void Button1Click(object sender, EventArgs e)
        {
            SecurityFuncs.WriteConfigValues();
            ScriptType type = ScriptType.Solo;

            ScriptGenerator.GenerateScriptForClient(type);
            bool IsValid = SecurityFuncs.checkClientMD5();

            if (IsValid == true)
            {
                //temp domain
                string exefile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Origins07_Client.exe";
                string quote   = "\"";
                string args    = "-script " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + ScriptGenerator.GetScriptNameForType(type) + quote + " " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\maps\\" + listBox2.SelectedItem.ToString() + quote;
                Process.Start(exefile, args);
                this.Close();
            }
            else
            {
                MessageBox.Show("The client has been detected as modified.", "Cannot Launch Game.", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
0
        void Button1Click(object sender, EventArgs e)
        {
            string ExtractedArg = "";

            //File.WriteAllText(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\arglog.txt", GlobalVars.SharedArgs);
            ExtractedArg = GlobalVars.SharedArgs.Replace("origins07server://", "").Replace("origins07server", "").Replace("origins07", "").Replace("origins", "").Replace(":", "").Replace("/", "").Replace("?", "");
            //File.WriteAllText(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\arglog2.txt", ExtractedArg);
            string ConvertedArg = SecurityFuncs.Base64Decode(ExtractedArg);

            string[] SplitArg = ConvertedArg.Split('|');
            string   port     = SecurityFuncs.Base64Decode(SplitArg[0]);
            string   ping     = SecurityFuncs.Base64Decode(SplitArg[1]);
            string   limit    = SecurityFuncs.Base64Decode(SplitArg[2]);
            bool     upnp     = Convert.ToBoolean(SecurityFuncs.Base64Decode(SplitArg[3]));
            string   id       = SecurityFuncs.Base64Decode(SplitArg[4]);

            if (upnp == true)
            {
                StartUPNP();
            }
            ScriptType type = ScriptType.Server;

            ScriptGenerator.GenerateScriptForClient(type, ping, port, limit, id);
            //temp domain
            string  exefile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Origins07_Server.exe";
            string  quote   = "\"";
            string  args    = "-script " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + ScriptGenerator.GetScriptNameForType(type) + quote + " -no3d " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\maps\\" + listBox1.SelectedItem.ToString() + quote;
            Process server  = new Process();

            server.StartInfo.FileName  = exefile;
            server.StartInfo.Arguments = args;
            server.EnableRaisingEvents = true;
            server.Exited += new EventHandler(ServerExited);
            server.Start();
        }
Exemple #3
0
 void StartGame()
 {
     if (GlobalVars.SharedArgs.Contains("origins07local://"))
     {
         string ExtractedArg = "";
         //File.WriteAllText(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\arglog.txt", GlobalVars.SharedArgs);
         ExtractedArg = GlobalVars.SharedArgs.Replace("origins07local://", "").Replace("origins07local", "").Replace("origins07", "").Replace("origins", "").Replace(":", "").Replace("/", "").Replace("?", "");
         //File.WriteAllText(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\arglog2.txt", ExtractedArg);
         string     ConvertedArg = SecurityFuncs.Base64Decode(ExtractedArg);
         ScriptType type         = ScriptType.Solo;
         ScriptGenerator.GenerateScriptForClient(type);
         bool IsValid = SecurityFuncs.checkClientMD5();
         if (IsValid == true)
         {
             //temp domain
             string exefile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Origins07_Client.exe";
             string quote   = "\"";
             string args    = "-script " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + ScriptGenerator.GetScriptNameForType(type) + quote + " " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\maps\\" + ConvertedArg + quote;
             Process.Start(exefile, args);
             this.Close();
         }
         else
         {
             label1.Text = "Cannot Launch Game.";
             label2.Text = "The client has been detected as modified.";
         }
     }
     else
     {
         string ExtractedArg = "";
         ExtractedArg = GlobalVars.SharedArgs.Replace("origins07://", "").Replace("origins07", "").Replace("origins", "").Replace(":", "").Replace("/", "").Replace("?", "");
         //File.WriteAllText(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\arglog2.txt", ExtractedArg);
         string     ConvertedArg = SecurityFuncs.Base64Decode(ExtractedArg);
         string[]   SplitArg     = ConvertedArg.Split('|');
         string     ip           = SecurityFuncs.Base64Decode(SplitArg[0]);
         string     port         = SecurityFuncs.Base64Decode(SplitArg[1]);
         ScriptType type         = ScriptType.Join;
         ScriptGenerator.GenerateScriptForClient(type, ip, port);
         bool IsValid = SecurityFuncs.checkClientMD5();
         if (IsValid == true)
         {
             //temp domain
             string exefile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Origins07_Client.exe";
             string quote   = "\"";
             string args    = "-script " + quote + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + ScriptGenerator.GetScriptNameForType(type) + quote;
             Process.Start(exefile, args);
             this.Close();
         }
         else
         {
             label1.Text = "Cannot Launch Game.";
             label2.Text = "The client has been detected as modified.";
         }
     }
 }