[Release]Source Code for Play.exe

03/13/2010 12:22 xI NiNJA DuCKey#1
This is a short/Noob Release.
If you want to make a new Launcher for your Private Server, Here's a few things you might want and a Semi-Guide.

Create a New Windows form application.
I would recommend 4 or 5 Buttons, A play button, Site button, Vote button, Exit button and If you like a Credits button.
For the Play Button
Code:
Process.Start(System.IO.Directory.GetCurrentDirectory() + "\\conquer.exe", "blacknull");
For a Vote Button And You can ulter the address for the site
Code:
System.Diagnostics.Process.Start("http://www.xtremetop100.com/in.php?site=YourXtremeTopID");
For a Credits button
Code:
MessageBox.Show("Credits to bla bla bla");
This is something Ultimation N CurseOfExcalibur helped me with, credits to him.
Create a label and this is the code. It will show the patch number, and you could probly make it into a auto-patcher xD

I used a switch statement, This went up above the Play.exe code.
Code:
switch (version)
            {
                case 1001: MessageBox.Show("Client is up to date. Have fun playing =)"); break;
                default: MessageBox.Show("Please Patch Client up"); break;
            }

And to read it, Put this under Form1_Load_1
Code:
if (System.IO.File.Exists("version.dat"))
            {
                label1.Text = string.Format("Client Version: {0}", System.IO.File.ReadAllLines("version.dat")[0]);
                version = Convert.ToInt32(System.IO.File.ReadAllLines("version.dat")[0]);
            }
            else
                label1.Text = "Error 101: Unable to find version.dat";

Press thanks if it helped at all.
03/13/2010 13:19 Paralyzer[GM]#2
Thank you!
03/13/2010 13:30 xI NiNJA DuCKey#3
Np, Hope its useful for you
03/13/2010 14:00 LegalConquer#4
has potential +1
03/13/2010 14:10 xI NiNJA DuCKey#5
Thanks
03/13/2010 16:37 Paralyzer[GM]#6
I got an error on the verion it sais

"Version does not exist in the current context.... Ive made my own play.exe and the only code i want to steal of you is the version thing but idk gives error,
03/13/2010 16:45 CurseOfExcalibur#7
Only Ultimation? :P
Quote:
Originally Posted by Paralyzer[GM] View Post
I got an error on the verion it sais

"Version does not exist in the current context.... Ive made my own play.exe and the only code i want to steal of you is the version thing but idk gives error,
Because you didn't define version? int version = 0;
03/13/2010 16:52 xI NiNJA DuCKey#8
Quote:
Originally Posted by CurseOfExcalibur View Post
Only Ultimation? :P

Because you didn't define version? int version = 0;
And you XD, Lemme add it.
03/13/2010 17:25 Paralyzer[GM]#9
so like
Code:
switch (int version = 0)
            {
                case 1001: MessageBox.Show("Client is up to date. Have fun playing =)"); break;
                default: MessageBox.Show("Please Patch Client up"); break;
            }
AND
Code:
if (System.IO.File.Exists("version.dat"))
            {
                label1.Text = string.Format("Client Version: {0}", System.IO.File.ReadAllLines("version.dat")[0]);
                version = 0; Convert.ToInt32(System.IO.File.ReadAllLines("version.dat")[0]);
            }
            else
                label1.Text = "Error 101: Unable to find version.dat";
im sure thats NOT right but i need help were to define it ?

Oh and

Code:
Process.Start(System.IO.Directory.GetCurrentDirectory() + "\\conquer.exe", "blacknull");
should be
Code:
System.Diagnostics.Process.Start(System.IO.Directory.GetCurrentDirectory() +  "\\conquer.exe", "blacknull");
03/13/2010 17:58 Paralyzer[GM]#10
Quote:
Originally Posted by herekorvac View Post
paralazyer ur retarded. quit cops please

o.O I simply asked something and I made an correction* u got a problem with me ?

oh and LOL u cant even spell my name right maybe you should quit cops!

#Reported.
03/13/2010 18:19 CurseOfExcalibur#11
Quote:
Originally Posted by Paralyzer[GM] View Post
so like
Code:
switch (int version = 0)[b]Hell no.[/b]
            {
                case 1001: MessageBox.Show("Client is up to date. Have fun playing =)"); break;
                default: MessageBox.Show("Please Patch Client up"); break;
            }
AND
Code:
if (System.IO.File.Exists("version.dat"))
            {
                label1.Text = string.Format("Client Version: {0}", System.IO.File.ReadAllLines("version.dat")[0]);
                version = 0; Convert.ToInt32(System.IO.File.ReadAllLines("version.dat")[0]);
            }
            else
                label1.Text = "Error 101: Unable to find version.dat";
im sure thats NOT right but i need help were to define it ?

Oh and

Code:
Process.Start(System.IO.Directory.GetCurrentDirectory()[b] What the hell? Windows.Forms.Application.StartupPath[/b] + "\\conquer.exe", "blacknull");
should be
Code:
System.Diagnostics.Process.Start(System.IO.Directory.GetCurrentDirectory()[b]Same as above.[/b] +  "\\conquer.exe", "blacknull");
. [Only registered and activated users can see links. Click Here To Register...]
03/13/2010 19:28 xI NiNJA DuCKey#12
3 Thanks, :'(