Scorpion0x17
can detect anyone's visible post count...
+691|6983|Cambridge (UK)

jsnipy wrote:

Scorpion0x17 wrote:

CrazeD wrote:

Well for one, if you don't have COD4 installed it totally freaks out.

And if you do certain things, it totally freaks out.

Basically my lack of exception handling, really. It works fine if you don't try to break it.
Welcome to the Microsoft Software Development Team!
erm has nothing to do with M$
:face:, meet :palm:

:palm:, meet :face:

way to not get the joke, snipster.

jsnipy
...
+3,276|6740|...

Scorpion0x17 wrote:

jsnipy wrote:

Scorpion0x17 wrote:


Welcome to the Microsoft Software Development Team!
erm has nothing to do with M$
:face:, meet :palm:

:palm:, meet :face:

way to not get the joke, snipster.

you know me, im high strung
jsnipy
...
+3,276|6740|...

moar bulletproof

Code:

        private void launchCOD4(String serverip)
        {
            if (!string.IsNullOrEmpty(serverip) &&
                serverip.Contains(";"))
            {
                string[] temp = serverip.Split(new char[] { ';' });
                string serverpw = string.Empty;
                serverip = serverip.Trim();

                if (serverip.Length > 1)
                {
                    serverip = temp[0].Replace("/", "").Trim();
                    serverpw = temp[1].Trim();

                    ProcessStartInfo startInfo = new ProcessStartInfo();

                    startInfo.FileName = "iw3mp.exe";
                    startInfo.Arguments = string.Concat("+", serverip, " +", serverpw);
                    startInfo.WorkingDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
                    startInfo.WindowStyle = ProcessWindowStyle.Maximized;

                    Process.Start(startInfo);

                    // Application.Exit(); // for winforms
                }
            }
            else
            {
                // serverip was null and had no ";", do something meanigful, like fap
            }

        }
CrazeD
Member
+368|6890|Maine
Now make it work in Java.

jsnipy
...
+3,276|6740|...

CrazeD wrote:

Now make it work in Java.

meh ... too much hassle (for me), especially for something that's on going to run on windows.

but in java why not just write out a batch file at run and and use java to run it (ghetto solution)

Last edited by jsnipy (2009-01-18 18:00:37)

CrazeD
Member
+368|6890|Maine
Cause I don't want a ghetto solution.
CrazeD
Member
+368|6890|Maine
Got it!

For anyone interested:

Code:

String workingDir = "F:\\Games\\COD4\\";
String cmd = workingDir + "iw3mp.exe";            
            
Runtime.getRuntime().exec(cmd,null,new File(workingDir));
Got help from a forum. Woot.
Scorpion0x17
can detect anyone's visible post count...
+691|6983|Cambridge (UK)

CrazeD wrote:

Got it!

For anyone interested:

Code:

String workingDir = "F:\\Games\\COD4\\";
String cmd = workingDir + "iw3mp.exe";            
            
Runtime.getRuntime().exec(cmd,null,new File(workingDir));
Got help from a forum. Woot.
:face: :palm:

so you put the working directory into both the command and the working directory.

That makes sense...

jsnipy
...
+3,276|6740|...

Scorpion0x17 wrote:

CrazeD wrote:

Got it!

For anyone interested:

Code:

String workingDir = "F:\\Games\\COD4\\";
String cmd = workingDir + "iw3mp.exe";            
            
Runtime.getRuntime().exec(cmd,null,new File(workingDir));
Got help from a forum. Woot.
:face: :palm:

so you put the working directory into both the command and the working directory.

That makes sense...

Same thing as shortcut in Windows

Board footer

Privacy Policy - © 2024 Jeff Minard