private void CheckIfFinished(object state) { if (GlobalVars.ReadyToLaunch == false) { System.Threading.Timer timer = new System.Threading.Timer(new TimerCallback(CheckIfFinished), null, 1, 0); } else { string ExtractedArg = GlobalVars.SharedArgs.Replace("rbxlegacy://", "").Replace("rbxlegacy", "").Replace(":", "").Replace("/", "").Replace("?", ""); string ConvertedArg = SecurityFuncs.Base64Decode(ExtractedArg); string[] SplitArg = ConvertedArg.Split('|'); string ip = SecurityFuncs.Base64Decode(SplitArg[0]); string port = SecurityFuncs.Base64Decode(SplitArg[1]); string client = SecurityFuncs.Base64Decode(SplitArg[2]); label1.Text = "Launching " + client + " game..."; LauncherFuncs.ReadClientValues(client); if (GlobalVars.HasRocky == true) { Process sudp = new Process(); sudp.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\udppipe.exe"; sudp.StartInfo.Arguments = "-p " + ip + " " + port + " " + port; sudp.StartInfo.UseShellExecute = false; sudp.StartInfo.CreateNoWindow = true; sudp.Start(); } StartGame(); } }
protected override void OnFormClosing(FormClosingEventArgs e) { string cfgpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\rbxlegacy_config.txt"; base.OnFormClosing(e); LauncherFuncs.WriteConfigValues(cfgpath); GlobalVars.ReadyToLaunch = true; }
void ReadClientValues(string ClientName) { string clientpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\clients\\" + ClientName + "\\clientinfo.txt"; if (!File.Exists(clientpath)) { MessageBox.Show("No clientinfo.txt detected with the client you chose. The client either cannot be loaded, or it is not available.", "RBXLegacy Launcher - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); GlobalVars.SelectedClient = "2008"; } LauncherFuncs.ReadClientValues(clientpath); }
void QuickConfigureLoad(object sender, EventArgs e) { string cfgpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\rbxlegacy_config.txt"; if (!File.Exists(cfgpath)) { LauncherFuncs.WriteConfigValues(cfgpath); } else { ReadConfigValues(cfgpath); } }
void ReadConfigValues(string cfgpath) { LauncherFuncs.ReadConfigValues(cfgpath); if (GlobalVars.UserID == 0) { GeneratePlayerID(); LauncherFuncs.WriteConfigValues(cfgpath); } else { textBox2.Text = GlobalVars.UserID.ToString(); } textBox1.Text = GlobalVars.PlayerName; }
void ReadClientValues(string ClientName) { string clientpath = GlobalVars.ClientDir + @"\\" + ClientName + @"\\clientinfo.txt"; if (!File.Exists(clientpath)) { ConsolePrint("ERROR 1 - No clientinfo.txt detected with the client you chose. The client either cannot be loaded, or it is not available.", 2); MessageBox.Show("No clientinfo.txt detected with the client you chose. The client either cannot be loaded, or it is not available.","RBXLegacy Launcher - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); GlobalVars.SelectedClient = "2008"; } LauncherFuncs.ReadClientValues(clientpath); if (GlobalVars.UsesPlayerName == true) { textBox2.Enabled = true; } else if (GlobalVars.UsesPlayerName == false) { textBox2.Enabled = false; } if (GlobalVars.UsesID == true) { textBox5.Enabled = true; button4.Enabled = true; if (GlobalVars.IP.Equals("localhost")) { checkBox3.Enabled = true; } } else if (GlobalVars.UsesID == false) { textBox5.Enabled = false; button4.Enabled = false; checkBox3.Enabled = false; GlobalVars.LocalPlayMode = false; } // use clientinfo desc rather than labels textBox6.Text = GlobalVars.SelectedClientDesc; label26.Text = GlobalVars.SelectedClient; ConsolePrint("Client '" + GlobalVars.SelectedClient + "' successfully loaded.", 3); }
void ReadConfigValues() { LauncherFuncs.ReadConfigValues("rbxlegacy_config.txt"); if (GlobalVars.CloseOnLaunch == true) { checkBox1.Checked = true; } else if (GlobalVars.CloseOnLaunch == false) { checkBox1.Checked = false; } if (GlobalVars.UserID == 0) { GeneratePlayerID(); WriteConfigValues(); } else { textBox5.Text = GlobalVars.UserID.ToString(); } if (GlobalVars.PlayerLimit == 0) { //We need at least a limit of 12 players. GlobalVars.PlayerLimit = 12; } textBox2.Text = GlobalVars.PlayerName; label26.Text = GlobalVars.SelectedClient; label28.Text = GlobalVars.Map; listBox1.SelectedItem = GlobalVars.Map; numericUpDown1.Text = GlobalVars.RobloxPort.ToString(); label37.Text = GlobalVars.IP; label38.Text = GlobalVars.RobloxPort.ToString(); ConsolePrint("Configuration has been loaded.", 3); ReadServerPrefs(); ReadClientValues(GlobalVars.SelectedClient); }
void ResetConfigValues() { LauncherFuncs.ResetConfigValues(); WriteConfigValues(); ReadConfigValues(); }
void GeneratePlayerID() { LauncherFuncs.GeneratePlayerID(); textBox5.Text = Convert.ToString(GlobalVars.UserID); }
void ReadServerPrefs() { LauncherFuncs.ReadServerPrefs("serverhost_config.txt"); ConsolePrint("Server configuration has been loaded.", 3); }
void WriteConfigValues() { LauncherFuncs.WriteConfigValues("rbxlegacy_config.txt"); ConsolePrint("Configuration has been saved successfully.", 3); }
void MainFormLoad(object sender, EventArgs e) { string line1; string Decryptline1, Decryptline2, Decryptline3, Decryptline4; using(StreamReader reader = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\info.txt")) { line1 = reader.ReadLine(); } if (!SecurityFuncs.IsBase64String(line1)) return; string ConvertedLine = SecurityFuncs.Base64Decode(line1); string[] result = ConvertedLine.Split('|'); Decryptline1 = SecurityFuncs.Base64Decode(result[0]); Decryptline2 = SecurityFuncs.Base64Decode(result[1]); Decryptline3 = SecurityFuncs.Base64Decode(result[2]); Decryptline4 = SecurityFuncs.Base64Decode(result[3]); string version = Decryptline1; GlobalVars.SelectedClient = Decryptline2; GlobalVars.DefaultScript = Decryptline3; GlobalVars.DefaultScriptMD5 = Decryptline4; ConsolePrint("RBXLegacy Launcher version " + version + " loaded. Initializing config.", 4); if (File.Exists("changelog.txt")) { richTextBox2.Text = File.ReadAllText("changelog.txt"); } else { ConsolePrint("ERROR 4 - changelog.txt not found.", 2); } if (!File.Exists("rbxlegacy_config.txt")) { ConsolePrint("WARNING 1 - rbxlegacy_config.txt not found. Creating one with default values.", 5); WriteConfigValues(); } if (!File.Exists("serverhost_config.txt")) { ConsolePrint("WARNING 1 - serverhost_config.txt not found. Creating one with default values.", 5); LauncherFuncs.WriteServerPrefs("serverhost_config.txt"); } if (!File.Exists("servers.txt")) { ConsolePrint("WARNING 2 - servers.txt not found. Creating empty file.", 5); File.Create("servers.txt").Dispose(); } if (!File.Exists("ports.txt")) { ConsolePrint("WARNING 3 - ports.txt not found. Creating empty file.", 5); File.Create("ports.txt").Dispose(); } GlobalVars.ClientDir = Path.Combine(Environment.CurrentDirectory, @"clients"); GlobalVars.ClientDir = GlobalVars.ClientDir.Replace(@"\",@"\\"); GlobalVars.ScriptsDir = Path.Combine(Environment.CurrentDirectory, @"scripts"); GlobalVars.ScriptsDir = GlobalVars.ScriptsDir.Replace(@"\",@"\\"); GlobalVars.MapsDir = Path.Combine(Environment.CurrentDirectory, @"maps"); GlobalVars.MapsDir = GlobalVars.MapsDir.Replace(@"\",@"\\"); GlobalVars.CustomPlayerDir = Path.Combine(Environment.CurrentDirectory, @"avatar"); GlobalVars.CustomPlayerDir = GlobalVars.CustomPlayerDir.Replace(@"\",@"\\"); label5.Text = Environment.CurrentDirectory; label8.Text = Application.ProductVersion; GlobalVars.IP = "localhost"; GlobalVars.Map = "Baseplate.rbxl"; label11.Text = version; GlobalVars.Version = version; ReadConfigValues(); }
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); LauncherFuncs.WriteServerPrefs("serverhost_config.txt"); }
void Button1Click(object sender, EventArgs e) { LauncherFuncs.ResetServerPrefs(); LauncherFuncs.WriteServerPrefs("serverhost_config.txt"); DialogResult result = MessageBox.Show("Your server configuration has been reset to the default values.", "RBXLegacy Launcher - Server Preferences", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); }
void GeneratePlayerID() { LauncherFuncs.GeneratePlayerID(); textBox2.Text = GlobalVars.UserID.ToString(); }
void ReadConfigValues() { LauncherFuncs.ReadConfigValues(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\rbxlegacy_config.txt"); }