void SaveToClientToolStripMenuItemClick(object sender, EventArgs e) { GenerateMD5s(); if (!string.IsNullOrWhiteSpace(SelectedClientInfoPath)) { string[] lines = { SecurityFuncs.Base64Encode(SelectedClientInfo.UsesPlayerName.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.UsesID.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Warning.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.LegacyMode.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.ClientMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.ScriptMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Description.ToString()), SecurityFuncs.Base64Encode(Locked.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Fix2007.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.AlreadyHasSecurity.ToString()), SecurityFuncs.Base64Encode(Settings.GraphicsOptions.GetIntForClientLoadOptions(SelectedClientInfo.ClientLoadOptions).ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.CommandLineArgs.ToString()) }; File.WriteAllText(SelectedClientInfoPath + "\\clientinfo.nov", SecurityFuncs.Base64Encode(string.Join("|", lines))); label9.Text = "v2 (v" + GlobalVars.ProgramInformation.Version + ")"; MessageBox.Show(SelectedClientInfoPath + "\\clientinfo.nov saved!", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("You must save the into a seperate directory with a client in it, generate the IDs, then use this option.", "Novetus Launcher - Error when saving to client.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void SaveToClientToolStripMenuItemClick(object sender, EventArgs e) { GenerateMD5s(); if (!string.IsNullOrWhiteSpace(SelectedClientInfoPath)) { string[] lines = { SecurityFuncs.Base64Encode(SelectedClientInfo.UsesPlayerName.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.UsesID.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Warning.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.LegacyMode.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.ClientMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.ScriptMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Description.ToString()), SecurityFuncs.Base64Encode(Locked.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Fix2007.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.AlreadyHasSecurity.ToString()), SecurityFuncs.Base64Encode(((int)SelectedClientInfo.ClientLoadOptions).ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.SeperateFolders.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.UsesCustomClientEXEName.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.CustomClientEXEName.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.CommandLineArgs.ToString()) }; File.WriteAllText(SelectedClientInfoPath + "\\clientinfo.nov", SecurityFuncs.Base64Encode(string.Join("|", lines))); label9.Text = curversion + " (v" + GlobalVars.ProgramInformation.Version + ")"; MessageBox.Show(SelectedClientInfoPath + "\\clientinfo.nov saved!", "Novetus Client SDK - Clientinfo Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("This client info file is not saved in your client's directory. Please save it in your client's directory before using.", "Novetus Client SDK - Error when saving to client.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void SaveToolStripMenuItemClick(object sender, EventArgs e) { using (var sfd = new SaveFileDialog()) { sfd.Filter = "Novetus Clientinfo files (*.nov)|*.nov"; sfd.FilterIndex = 1; string filename = "clientinfo.nov"; sfd.FileName = filename; sfd.Title = "Save " + filename; if (sfd.ShowDialog() == DialogResult.OK) { string[] lines = { SecurityFuncs.Base64Encode(SelectedClientInfo.UsesPlayerName.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.UsesID.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Warning.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.LegacyMode.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.ClientMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.ScriptMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Description.ToString()), SecurityFuncs.Base64Encode(Locked.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.Fix2007.ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.AlreadyHasSecurity.ToString()), SecurityFuncs.Base64Encode(Settings.GraphicsOptions.GetIntForClientLoadOptions(SelectedClientInfo.ClientLoadOptions).ToString()), SecurityFuncs.Base64Encode(SelectedClientInfo.CommandLineArgs.ToString()) }; File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|", lines))); SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName); MessageBox.Show(sfd.FileName + " saved!", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); } } label9.Text = "v2 (v" + GlobalVars.ProgramInformation.Version + ")"; textBox2.BackColor = System.Drawing.SystemColors.Control; textBox3.BackColor = System.Drawing.SystemColors.Control; }
public async Task ChangeTabs() { switch (Tabs.SelectedTab) { case TabPage pg2 when pg2 == Tabs.TabPages[TabPageHost]: Tree.Nodes.Clear(); _TreeCache.Nodes.Clear(); MapDescBox.Text = ""; ClientBox.Items.Clear(); ServerBox.Items.Clear(); PortBox.Items.Clear(); //since we are async, DO THESE first or we'll clear out random stuff. ServerInfo.Text = "Loading..."; string IP = await SecurityFuncs.GetExternalIPAddressAsync(); ServerInfo.Text = ""; string[] lines1 = { SecurityFuncs.Base64Encode((!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : IP)), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) }; string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true); string[] lines2 = { SecurityFuncs.Base64Encode("localhost"), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) }; string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); string[] text = { "Client: " + GlobalVars.UserConfiguration.SelectedClient, "IP: " + (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : IP), "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), "Map: " + GlobalVars.UserConfiguration.Map, "Players: " + GlobalVars.UserConfiguration.PlayerLimit, "Version: Novetus " + GlobalVars.ProgramInformation.Version, "Online URI Link:", URI, "Local URI Link:", URI2 }; foreach (string str in text) { if (!string.IsNullOrWhiteSpace(str)) { ServerInfo.AppendText(str + Environment.NewLine); } } ServerInfo.SelectionStart = 0; ServerInfo.ScrollToCaret(); break; case TabPage pg3 when pg3 == Tabs.TabPages[TabPageClients]: string clientdir = GlobalPaths.ClientDir; DirectoryInfo dinfo = new DirectoryInfo(clientdir); DirectoryInfo[] Dirs = dinfo.GetDirectories(); foreach (DirectoryInfo dir in Dirs) { ClientBox.Items.Add(dir.Name); } ClientBox.SelectedItem = GlobalVars.UserConfiguration.SelectedClient; Tree.Nodes.Clear(); _TreeCache.Nodes.Clear(); MapDescBox.Text = ""; ServerInfo.Text = ""; ServerBox.Items.Clear(); PortBox.Items.Clear(); break; case TabPage pg4 when pg4 == Tabs.TabPages[TabPageMaps]: string mapdir = GlobalPaths.MapsDir; string[] fileexts = new string[] { ".rbxl", ".rbxlx" }; TreeNodeHelper.ListDirectory(Tree, mapdir, fileexts); TreeNodeHelper.CopyNodes(Tree.Nodes, _TreeCache.Nodes); Tree.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.UserConfiguration.Map, Tree.Nodes); Tree.Focus(); ServerInfo.Text = ""; ClientBox.Items.Clear(); ServerBox.Items.Clear(); PortBox.Items.Clear(); break; case TabPage pg6 when pg6 == Tabs.TabPages[TabPageSaved]: string[] lines_server = File.ReadAllLines(GlobalPaths.ConfigDir + "\\servers.txt"); string[] lines_ports = File.ReadAllLines(GlobalPaths.ConfigDir + "\\ports.txt"); ServerBox.Items.AddRange(lines_server); PortBox.Items.AddRange(lines_ports); Tree.Nodes.Clear(); _TreeCache.Nodes.Clear(); MapDescBox.Text = ""; ServerInfo.Text = ""; ClientBox.Items.Clear(); break; default: Tree.Nodes.Clear(); _TreeCache.Nodes.Clear(); MapDescBox.Text = ""; ServerInfo.Text = ""; ClientBox.Items.Clear(); ServerBox.Items.Clear(); PortBox.Items.Clear(); break; } }