DSP Server Control application

Applications/Tools written to make running DarkStar easier for the rest of us.
ex0r
Posts: 83
Joined: Wed Aug 29, 2012 10:08 pm

Re: DSP Server Control application

Post by ex0r » Wed Apr 22, 2015 2:59 pm

ISSUE: If you do not set your DSP path, you cannot close the application as it keeps giving you an error. This isn't a huge deal as usually you'll set your path but if you accidentally go into here or you just want to check the program out and dont have an actual server setup, you have to control + alt + delete to close out the application, as the error dialog box takes focus and you can't close it from the taskbar.

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: DSP Server Control application

Post by Delaide » Thu Apr 23, 2015 12:29 am

Edit: Yes, I remember now, that is intentional. If you try to adjust the settings without declaring your path, it will crash the program, so basically, this becomes a nag screen so you cannot try to update the .conf and settings.lua without at minimum declaring your dsp path.
The ashita should just throw a single nag if you don't declare that, same with the pol.exe. Because those are not critical. However, pretty much everything except those two work off the dsp installation directory. It used to search for the exe, but now I have it search for the \conf\map_darkstar.conf. Basically, I know it will break if you don't declare the path, because all settings in login_server.conf, map_darkstar.conf, search_server.conf, and settings.lua are written to when you close the Config form. So, no path, it breaks it. I figured it was the lesser of two evils, because if someone really doesn't want to have those mapped, then I am not sure why they would want to use this app.

This can be eliminated by going to the pathlocations code in the project (This one, but I recommend doing it in VS, not by hand, since VB has additional things written to it, and if you are unsure what you are doing, it will end up with missing things) https://github.com/helixhamin/DSP-Contr ... cations.vb

It is line 6-11:

Code: Select all

If File.Exists(DSPPathTextBox.Text + "\conf\map_darkstar.conf") Then
            My.Settings.Save()
        Else
            MsgBox("You need to declare your DSP path.")
            e.Cancel = True
        End If
Remove this and it will not flag for it. If someone really wants to go to the config menu without declaring their path, then it can be edited in the main DSP-control form: https://github.com/helixhamin/DSP-Contr ... rolForm.vb
You can see the code check here:

Code: Select all

Private Sub ServerSetupToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ServerSetupToolStripMenuItem.Click
        If My.Settings.DSPPath.Length < 2 Then
            MsgBox("Please set your DSP Path first.")
            PathLocationsListBox.Activate()
            PathLocationsListBox.Show()
        End If
    End Sub
Just remove that rule. But be aware, opening the config form with no path set will cause it to break. Honestly, I would rather leave it in so someone who is not familiar with what they are doing will follow the directions and find their dsp folder, rather than report back to me that it errored on them because they tried messing with things that the control app has no idea where to find.

DSP path is the only requirement though, unless you click something else that isn't pathed. Then it will just send you a message and do nothing else.

ex0r
Posts: 83
Joined: Wed Aug 29, 2012 10:08 pm

Re: DSP Server Control application

Post by ex0r » Thu Apr 23, 2015 6:17 am

Delaide wrote:Edit: Yes, I remember now, that is intentional. If you try to adjust the settings without declaring your path, it will crash the program, so basically, this becomes a nag screen so you cannot try to update the .conf and settings.lua without at minimum declaring your dsp path.
The ashita should just throw a single nag if you don't declare that, same with the pol.exe. Because those are not critical. However, pretty much everything except those two work off the dsp installation directory. It used to search for the exe, but now I have it search for the \conf\map_darkstar.conf. Basically, I know it will break if you don't declare the path, because all settings in login_server.conf, map_darkstar.conf, search_server.conf, and settings.lua are written to when you close the Config form. So, no path, it breaks it. I figured it was the lesser of two evils, because if someone really doesn't want to have those mapped, then I am not sure why they would want to use this app.

This can be eliminated by going to the pathlocations code in the project (This one, but I recommend doing it in VS, not by hand, since VB has additional things written to it, and if you are unsure what you are doing, it will end up with missing things) https://github.com/helixhamin/DSP-Contr ... cations.vb

It is line 6-11:

Code: Select all

If File.Exists(DSPPathTextBox.Text + "\conf\map_darkstar.conf") Then
            My.Settings.Save()
        Else
            MsgBox("You need to declare your DSP path.")
            e.Cancel = True
        End If
Remove this and it will not flag for it. If someone really wants to go to the config menu without declaring their path, then it can be edited in the main DSP-control form: https://github.com/helixhamin/DSP-Contr ... rolForm.vb
You can see the code check here:

Code: Select all

Private Sub ServerSetupToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ServerSetupToolStripMenuItem.Click
        If My.Settings.DSPPath.Length < 2 Then
            MsgBox("Please set your DSP Path first.")
            PathLocationsListBox.Activate()
            PathLocationsListBox.Show()
        End If
    End Sub
Just remove that rule. But be aware, opening the config form with no path set will cause it to break. Honestly, I would rather leave it in so someone who is not familiar with what they are doing will follow the directions and find their dsp folder, rather than report back to me that it errored on them because they tried messing with things that the control app has no idea where to find.

DSP path is the only requirement though, unless you click something else that isn't pathed. Then it will just send you a message and do nothing else.
Delaide. I don't want to sound like an asshole, but this is exactly an example of poor coding. Your program should be designed so that if an 'if-case' does happen, it works around it, not forces the user to work around it. If no path is stored, the system should just simply not read/write anything. Personally this feature alone is enough to prevent me to never use this application, because if this is designed this way, without any standard and with poor design, there's no telling what lies under the hood that will pop up later or cause problems, and it's a headache I don't want to deal with.

As I said I opened the program to see what the interface looked like, and how easy it was to browse through things. I was immediately turned off when as soon as I 'accidentally' clicked the server setup menu at the top, I could not close the application without a control alt delete. At minimum that option should be buried deeper into a menu, not at top-level where accidental mouse clicks can easily happen.

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: DSP Server Control application

Post by Delaide » Fri Apr 24, 2015 1:16 am

Yes, actually, me and Teo was discussing this yesterday, and as he had mentioned, instead of forcing the user to input the path, I could just warn them and close the program if needed to prevent errors.

"Please select your path."
"Sorry, no path selected, this program will now self destruct" (program closes)

Eh, lol, no one claimed my app was that well programmed. It does what I want it to, and after messing up my config files more than once, I fixed problems so it does not do things like overwrite the wrong line, but yes, there is probably lots of code problems. The code works, but I probably made it harder, and with more code than needed, simply because I am not sure how to program in the best way. This was more of a project to get me to understanding a bit about how coding works so I could help on DSP (Remember, I have never before released any kind of program, and have not done any program since 1999, when I was first in college). Does it do what I want? Yes. Does it do what I want efficiently, effectively, and not have problems that will force me to re-release it every time something specific is changed in DSP? No.

But, I will take your suggestion and Teo's suggestion in mind and see if it would be better to approach a user trying to do things in a way that is not handled in a friendlier way, like stopping the forced loop. You are right, you shouldn't have to be forced to do that. You should have the option to just let it close. Maybe a "This area will not work without DSP path mapping. Do you want to map now? Yes No If yes, then pop up path form, if no, cancel selection and show main form only"

Maybe something like that.

Desufire
Posts: 162
Joined: Sun Feb 22, 2015 2:58 am

Re: DSP Server Control application

Post by Desufire » Sat Apr 25, 2015 11:40 pm

Delaide wrote: But, I will take your suggestion and Teo's suggestion in mind and see if it would be better to approach a user trying to do things in a way that is not handled in a friendlier way, like stopping the forced loop. You are right, you shouldn't have to be forced to do that. You should have the option to just let it close. Maybe a "This area will not work without DSP path mapping. Do you want to map now? Yes No If yes, then pop up path form, if no, cancel selection and show main form only"

Maybe something like that.
Got an idea for you. I do some modding for Skyrim and a major program for anyone who uses a fair number of mods is LOOT. When you set it up, it scans your PC for select games you have installed.

Could you figure a way to code that into your Control program maybe? When first ran, it scans for the DSP, shows the path to the user when found for verification, then sets the path when user confirms it to be correct.

Just spit ballin'.

Post Reply