Exemplo n.º 1
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.";
         }
     }
 }
        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);
            }
        }