Alright. This thread tells you how to start the sro_client straight off the bat without the need for that silly launcher program. First off, we need to create 2 mutexes. Mutex 1 should be called "Silkroad Online Launcher" and Mutex 2 should be called "Ready"
Remember to Import System.Threading in your program.
Code:
Dim SilkMutex1 As Mutex 'Declare the first mutex
Dim SilkMutex2 As Mutex 'And the second one
SilkMutex1 = New Mutex(False, "Silkroad Online Launcher", False)
SilkMutex2 = New Mutex(False, "Ready", False)
Now we have our two mutexes. As long as they are declared, they are active. Now that we have our two mutexes running, it's time to launch the client. You can do this any way you like, as long as you can include command line arguments in your function. I'm going to use the process method.
We are going to do a few things here, first, use the .StartInfo.Filename Function to select our processes filename, then the .StartInfo.Arguments Function to add our arguments that allow Silkroad to connect to servers. If we omit these arguments, Silkroad won't connect to any servers, and will give us a C8 error (Thanks Drew). Our arguments are '0 /18 0 0' OR '0 /18 0 1 (See below)
Side note from Drew:
Use the arguments '0 /18 0 0' to connect to gwgt1.joymax.com
And the arguments '0 /18 0 1' to connect to gwgt2.joymax.com
Code:
Dim SilkProc As New Process 'Declare the process
SilkProc.StartInfo.FileName = "C:\Program Files\Silkroad\sro_client.exe"
SilkProc.StartInfo.Arguments = "0 /18 0 1" 'Connecting to gwgt2.joymax.com
Now we can run our process, but we need to dispose of our Mutexes otherwise we could run into errors later on.
Code:
SilkProc.Start()
'You may want to wait a few seconds after we launch our program.
'You could use the API method, Sleep (remember to declare before)
Sleep(2000) 'Waits for 2 seconds
SilkMutex1.Close()
SilkMutex2.Close()
Tip by Seeker: Use WaitForSingleObject() Instead of Sleep. It is more practical and closes the mutexes at the exact time of silkroad opening.
EDIT: A more useful sleep mthod (which I completely overlooked is to use the Thread.Sleep function, thanks Korhan.
If all went well, your client should run perfectly and connect to servers successfully. Remember to Use at your own risk!
Special thanks to betaboon and Rumata for helping me find out how in the first place.
Skits