Register for your free account! | Forgot your password?

You last visited: Today at 18:44

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]Source Code for Play.exe

Discussion on [Release]Source Code for Play.exe within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
xI NiNJA DuCKey's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 51
Received Thanks: 17
[Release]Source Code for Play.exe

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.
xI NiNJA DuCKey is offline  
Thanks
8 Users
Old 03/13/2010, 13:19   #2
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Thank you!
Paralyzer[GM] is offline  
Thanks
1 User
Old 03/13/2010, 13:30   #3
 
xI NiNJA DuCKey's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 51
Received Thanks: 17
Np, Hope its useful for you
xI NiNJA DuCKey is offline  
Old 03/13/2010, 14:00   #4
 
elite*gold: 0
Join Date: Sep 2009
Posts: 321
Received Thanks: 60
has potential +1
LegalConquer is offline  
Old 03/13/2010, 14:10   #5
 
xI NiNJA DuCKey's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 51
Received Thanks: 17
Thanks
xI NiNJA DuCKey is offline  
Old 03/13/2010, 16:37   #6
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
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,
Paralyzer[GM] is offline  
Old 03/13/2010, 16:45   #7
 
CurseOfExcalibur's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 151
Received Thanks: 28
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;
CurseOfExcalibur is offline  
Old 03/13/2010, 16:52   #8
 
xI NiNJA DuCKey's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 51
Received Thanks: 17
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.
xI NiNJA DuCKey is offline  
Old 03/13/2010, 17:25   #9
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
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");
Paralyzer[GM] is offline  
Old 03/13/2010, 17:58   #10
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Exclamation

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.
Paralyzer[GM] is offline  
Old 03/13/2010, 18:19   #11
 
CurseOfExcalibur's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 151
Received Thanks: 28
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");
.
CurseOfExcalibur is offline  
Old 03/13/2010, 19:28   #12
 
xI NiNJA DuCKey's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 51
Received Thanks: 17
3 Thanks, :'(
xI NiNJA DuCKey is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[RELEASE] [OPEN SOURCE] CE 5.5 Pointer to AutoIt Source-Code
02/13/2011 - AutoIt - 6 Replies
Habe heute erst gemerkt, dass es hier eine AutoIt Sektion gibt xD also poste ich mal mein Programm mit rein. Funktionsweise: 1. in CE Rechtsklick auf den Pointer und auf "Copy" klicken 2. in meinem Programm auf "Code generieren" klicken 3. In euer Scite gehen und einfügen Hier ist der Source Code vom Programm:
[Release] Silkmod Source Code
08/06/2010 - SRO Coding Corner - 10 Replies
Since I've found out that people still use this old project, I'll release the source code since I don't think I did in the past (If I have, well here it is again). The code is really old and was written at a time I was still pretty new to all this stuff. There are probably going to be a few things that have bugs or don't make sense due to a lack of comments. A lot of the patches use static constants that refer to memory structures and refinding some of them might be hard. This is being...



All times are GMT +2. The time now is 18:44.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.