All pastes #983383 Raw Edit

lol

public html v1 · immutable
·published 2008-04-13 09:57 UTC
rendered paste body
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. <span class="highlight">Mutex</span> 1 should be called "Silkroad Online Launcher" and <span class="highlight">Mutex</span> 2 should be called "Ready"<br><br>Remember to Import <i>System.Threading</i> in your program.</font><br><br><div style="margin: 5px 20px 20px;">	<div class="smallfont" style="margin-bottom: 2px;">Code:</div>	<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 470px; height: 114px; text-align: left;">Dim SilkMutex1 As <span class="highlight">Mutex</span>     'Declare the first <span class="highlight">mutex</span>Dim SilkMutex2 As <span class="highlight">Mutex</span>     'And the second oneSilkMutex1 = New <span class="highlight">Mutex</span>(False, "Silkroad Online Launcher", False)SilkMutex2 = New <span class="highlight">Mutex</span>(False, "Ready", False)</pre></div><font color="Orange"><br>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, <b>as long as you can include command line arguments in your function.</b> I'm going to use the process method.<br><br>We are going to do a few things here, first, use the <font color="White"><i>.StartInfo.Filename</i> </font>Function to select our processes filename, then the <font color="White"><i>.StartInfo.Arguments</i> </font>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' <b><u>OR</u></b> '0 /18 0 1 (See below)</font><br><br>Side note from Drew:<br><br>        Use the arguments '0 /18 0 0' to connect to gwgt1.joymax.com<br>        And the arguments '0 /18 0 1' to connect to gwgt2.joymax.com<br><br><div style="margin: 5px 20px 20px;">	<div class="smallfont" style="margin-bottom: 2px;">Code:</div>	<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 470px; height: 82px; text-align: left;">Dim SilkProc As New Process   'Declare the processSilkProc.StartInfo.FileName = "C:\Program Files\Silkroad\sro_client.exe"SilkProc.StartInfo.Arguments = "0 /18 0 1" 'Connecting to gwgt2.joymax.com</pre></div><font color="Orange">Now we can run our process, but we need to dispose of our Mutexes otherwise we could run into errors later on. </font><br><br><div style="margin: 5px 20px 20px;">	<div class="smallfont" style="margin-bottom: 2px;">Code:</div>	<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 470px; height: 146px; text-align: left;">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 secondsSilkMutex1.Close()SilkMutex2.Close()</pre></div>Tip by Seeker: Use WaitForSingleObject() Instead of Sleep. It is more practical and closes the mutexes at the exact time of silkroad opening.<br><br><font color="Orange">EDIT: A more useful sleep mthod (which I completely overlooked is to use the Thread.Sleep function, thanks Korhan.</font><br><br><br><font color="Orange">If all went well, your client should run perfectly and connect to servers successfully. Remember to </font><b><font color="Red">Use at your own risk</font></b><font color="Orange">!</font><br><font color="Orange"><br>Special thanks to betaboon and Rumata for helping me find out how in the first place.</font><br><br>Skits