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 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); } }
private static string RandomSplash() { string[] splashes = File.ReadAllLines(GlobalPaths.ConfigDir + "\\splashes.txt"); string splash = ""; try { splash = splashes[new CryptoRandom().Next(0, splashes.Length - 1)]; } catch (Exception) { try { splash = splashes[0]; } catch (Exception) { splash = "missingno"; return(splash); } } CryptoRandom random = new CryptoRandom(); string formattedsplash = splash .Replace("%name%", GlobalVars.UserConfiguration.PlayerName) .Replace("%randomtext%", SecurityFuncs.RandomString(random.Next(2, 32))); return(formattedsplash); }
public GameServer(string name, string ip, string port, string client) { ServerName = SecurityFuncs.Base64DecodeOld(name); ServerIP = SecurityFuncs.Base64DecodeOld(ip); ServerPort = Convert.ToInt32(SecurityFuncs.Base64DecodeOld(port)); ServerClient = SecurityFuncs.Base64DecodeOld(client); }
public void InitForm() { Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version; GlobalFuncs.ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4, ConsoleBox); GlobalFuncs.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 4, ConsoleBox); if (File.Exists(GlobalPaths.RootPath + "\\changelog.txt")) { ChangelogBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\changelog.txt"); } else { GlobalFuncs.ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\changelog.txt not found.", 2, ConsoleBox); } if (File.Exists(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT")) { ReadmeBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT"); } else { GlobalFuncs.ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT not found.", 2, ConsoleBox); } if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) { GlobalFuncs.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5, ConsoleBox); WriteConfigValues(); } if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) { GlobalFuncs.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization + " not found. Creating one with default values.", 5, ConsoleBox); WriteCustomizationValues(); } if (!File.Exists(GlobalPaths.ConfigDir + "\\servers.txt")) { GlobalFuncs.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\servers.txt not found. Creating empty file.", 5, ConsoleBox); File.Create(GlobalPaths.ConfigDir + "\\servers.txt").Dispose(); } if (!File.Exists(GlobalPaths.ConfigDir + "\\ports.txt")) { GlobalFuncs.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\ports.txt not found. Creating empty file.", 5, ConsoleBox); File.Create(GlobalPaths.ConfigDir + "\\ports.txt").Dispose(); } GlobalFuncs.CreateAssetCacheDirectories(); ProductVersionLabel.Text = Application.ProductVersion; LocalVars.important = SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location); NovetusVersionLabel.Text = GlobalVars.ProgramInformation.Version; SplashLabel.Text = SplashReader.GetSplash(); LocalVars.prevsplash = SplashLabel.Text; ReadConfigValues(true); InitUPnP(); StartDiscord(); }
public static string GetScriptFuncForType(string ClientName, ScriptType type) { FileFormat.ClientInfo info = GlobalFuncs.GetClientInfoValues(ClientName); string rbxexe = ""; if (info.LegacyMode) { rbxexe = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\RobloxApp.exe"; } else { rbxexe = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\RobloxApp_client.exe"; } #if LAUNCHER string md5dir = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location) : ""; #else string md5dir = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.RootPathLauncher + "\\Novetus.exe") : ""; #endif string md5script = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.ClientDir + @"\\" + ClientName + @"\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; string md5exe = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(rbxexe) : ""; string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'"; switch (type) { case ScriptType.Client: return("_G.CSConnect(" + (info.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + GlobalVars.IP + "'," + GlobalVars.UserConfiguration.RobloxPort + ",'" + (info.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," + GlobalVars.Loadout + "," + md5s + ",'" + GlobalVars.UserConfiguration.PlayerTripcode + "')"); case ScriptType.Server: return("_G.CSServer(" + GlobalVars.UserConfiguration.RobloxPort + "," + GlobalVars.UserConfiguration.PlayerLimit + "," + md5s + ")"); case ScriptType.Solo: case ScriptType.EasterEgg: return("_G.CSSolo(" + (info.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + (info.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," + GlobalVars.soloLoadout + ")"); case ScriptType.Studio: return("_G.CSStudio()"); default: return(""); } }
private void GenerateMD5s() { if (string.IsNullOrWhiteSpace(SelectedClientInfoPath)) { MessageBox.Show("Please choose the folder where you would like to save your clientinfo file.", "Novetus Client SDK - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog(); if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { SelectedClientInfoPath = folderBrowserDialog1.SelectedPath; } } string ClientName = ""; if (SelectedClientInfo.LegacyMode) { ClientName = "\\RobloxApp.exe"; } else if (SelectedClientInfo.SeperateFolders) { ClientName = "\\client\\RobloxApp_client.exe"; } else if (SelectedClientInfo.UsesCustomClientEXEName) { ClientName = @"\\" + SelectedClientInfo.CustomClientEXEName; } else { ClientName = "\\RobloxApp_client.exe"; } string ClientMD5 = File.Exists(SelectedClientInfoPath + ClientName) ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + ClientName) : ""; if (!string.IsNullOrWhiteSpace(ClientMD5)) { SelectedClientInfo.ClientMD5 = ClientMD5.ToUpper(CultureInfo.InvariantCulture); } else { MessageBox.Show("Cannot load '" + ClientName.Trim('/') + "'. Please make sure you saved the clientinfo.nov into the client directory and if the file exists.", "Novetus Client SDK - Error while generating MD5 for client", MessageBoxButtons.OK, MessageBoxIcon.Error); } string ClientScriptMD5 = File.Exists(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; if (!string.IsNullOrWhiteSpace(ClientScriptMD5)) { SelectedClientInfo.ScriptMD5 = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); } /*else * { * MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you saved the clientinfo.nov into the client directory and if the file exists.", "Novetus Client SDK - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); * }*/ }
void Button4Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(SelectedClientInfoPath)) { FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog(); if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { SelectedClientInfoPath = folderBrowserDialog1.SelectedPath; } } string ClientName = ""; if (!SelectedClientInfo.LegacyMode) { ClientName = "\\RobloxApp_client.exe"; } else { ClientName = "\\RobloxApp.exe"; } string ClientMD5 = File.Exists(SelectedClientInfoPath + ClientName) ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + ClientName) : ""; if (!string.IsNullOrWhiteSpace(ClientMD5)) { textBox2.Text = ClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox2.BackColor = System.Drawing.Color.Lime; SelectedClientInfo.ClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); } else { MessageBox.Show("Cannot load '" + ClientName.Trim('/') + "'. Please make sure you selected the directory", "Novetus Launcher - Error while generating MD5 for client", MessageBoxButtons.OK, MessageBoxIcon.Error); } string ClientScriptMD5 = File.Exists(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; if (!string.IsNullOrWhiteSpace(ClientScriptMD5)) { textBox3.Text = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); textBox3.BackColor = System.Drawing.Color.Lime; SelectedClientInfo.ScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); } else { MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you selected the directory", "Novetus Launcher - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (!string.IsNullOrWhiteSpace(ClientMD5) && !string.IsNullOrWhiteSpace(ClientScriptMD5)) { MessageBox.Show("MD5s generated.", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public static void SetupURIValues() { string ExtractedArg = LocalVars.SharedArgs.Replace("novetus://", "").Replace("novetus", "").Replace(":", "").Replace("/", "").Replace("?", ""); string ConvertedArg = SecurityFuncs.Base64DecodeOld(ExtractedArg); string[] SplitArg = ConvertedArg.Split('|'); string ip = SecurityFuncs.Base64Decode(SplitArg[0]); string port = SecurityFuncs.Base64Decode(SplitArg[1]); string client = SecurityFuncs.Base64Decode(SplitArg[2]); GlobalVars.UserConfiguration.SelectedClient = client; GlobalVars.IP = ip; GlobalVars.JoinPort = Convert.ToInt32(port); GlobalFuncs.ReadClientValues(); }
async Task LoadServerInfoFromFile(string url) { //https://stackoverflow.com/questions/2471209/how-to-read-a-file-from-internet#2471245 //https://stackoverflow.com/questions/10826260/is-there-a-way-to-read-from-a-website-one-line-at-a-time //https://stackoverflow.com/questions/856885/httpwebrequest-to-url-with-dot-at-the-end MethodInfo getSyntax = typeof(UriParser).GetMethod("GetSyntax", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); FieldInfo flagsField = typeof(UriParser).GetField("m_Flags", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); if (getSyntax != null && flagsField != null) { foreach (string scheme in new[] { "http", "https" }) { UriParser parser = (UriParser)getSyntax.Invoke(null, new object[] { scheme }); if (parser != null) { int flagsValue = (int)flagsField.GetValue(parser); // Clear the CanonicalizeAsFilePath attribute if ((flagsValue & 0x1000000) != 0) { flagsField.SetValue(parser, flagsValue & ~0x1000000); } } } } WebClient client = new WebClient(); Uri uri = new Uri(url); using (Stream stream = await client.OpenReadTaskAsync(uri)) { using (StreamReader reader = new StreamReader(stream)) { string line; while ((line = await reader.ReadLineAsync()) != null) { string DecodedLine = SecurityFuncs.Base64DecodeOld(line); string[] serverInfo = DecodedLine.Split('|'); GameServer gameServer = new GameServer(serverInfo[0], serverInfo[1], serverInfo[2], serverInfo[3], serverInfo[4]); if (gameServer.IsValid()) { serverList.Add(gameServer); } } } } }
public static string DecodeSplashString(string text) { CryptoRandom random = new CryptoRandom(); DateTime now = DateTime.Now; return(text.Replace("%name%", GlobalVars.UserConfiguration.PlayerName) .Replace("%randomtext%", SecurityFuncs.RandomString(random.Next(2, (GlobalVars.UserConfiguration.LauncherStyle == Settings.Style.Stylish ? 64 : 32)))) .Replace("%version%", GlobalVars.ProgramInformation.Version) .Replace("%year%", now.Year.ToString()) .Replace("%day%", now.Day.ToString()) .Replace("%month%", now.Month.ToString()) .Replace("%nextyear%", (now.Year + 1).ToString()) .Replace("%newline%", "\n") .Replace("%branch%", GlobalVars.ProgramInformation.Branch) .Replace("%nextbranch%", (Convert.ToDouble(GlobalVars.ProgramInformation.Branch) + 0.1).ToString()) .Replace("[normal]", "") .Replace("[stylish]", "")); }
public static string GetRawArgsForType(ScriptType type, string md5s, string luafile) { switch (type) { case ScriptType.Client: return("dofile('" + luafile + "'); _G.CSConnect(" + (GlobalVars.SelectedClientInfo.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + GlobalVars.IP + "'," + GlobalVars.JoinPort + ",'" + (GlobalVars.SelectedClientInfo.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," + GlobalVars.Loadout + "," + md5s + ",'" + GlobalVars.UserConfiguration.PlayerTripcode + "');"); case ScriptType.Server: string IP = SecurityFuncs.GetExternalIPAddress(); return("dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.UserConfiguration.RobloxPort + "," + GlobalVars.UserConfiguration.PlayerLimit + "," + md5s + "," + GlobalVars.UserConfiguration.ShowServerNotifications.ToString().ToLower() + ",'" + GlobalVars.UserConfiguration.ServerBrowserServerName + "','" + GlobalVars.UserConfiguration.ServerBrowserServerAddress + "','" + GlobalVars.UserConfiguration.SelectedClient + "'); " + (!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? " dofile('" + GlobalPaths.AddonScriptPath + "');" : "")); case ScriptType.Solo: case ScriptType.EasterEgg: return("dofile('" + luafile + "'); _G.CSSolo(" + (GlobalVars.SelectedClientInfo.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + (GlobalVars.SelectedClientInfo.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," + GlobalVars.soloLoadout + ");"); case ScriptType.Studio: return("dofile('" + luafile + "'); _G.CSStudio();"); default: return(""); } }
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; }
private void addValidateTagsForRelativePathToolStripMenuItem_click(object sender, EventArgs e) { ClientinfoCreatorValidatePathForm pathForm = new ClientinfoCreatorValidatePathForm(this); pathForm.ShowDialog(); if (!string.IsNullOrWhiteSpace(SelectedClientInfoPath)) { string fullpath = SelectedClientInfoPath + "\\" + RelativePath; if (Directory.Exists(fullpath)) { DirectoryInfo dir = new DirectoryInfo(fullpath); FileInfo[] Files = dir.GetFiles("*.*"); List <string> text = new List <string>(); foreach (FileInfo file in Files) { string fileMD5 = SecurityFuncs.GenerateMD5(file.FullName); string filePathStrip = file.FullName.Replace(SelectedClientInfoPath, ""); text.Add("<validate>" + filePathStrip.TrimStart('/', '\\') + "|" + fileMD5 + "</validate>"); } string joined = string.Join("\r\n", text); AddClientinfoText(joined.Replace(@"\", "/")); } else { MessageBox.Show("The directory does not exist. Please use an existing directory path in your client's folder.", "Novetus Client SDK - Error when adding Validate tags.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } 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 adding Validate tags.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static string CompileScript(string ClientName, string code, string tag, string endtag, string mapfile, string luafile, string rbxexe, bool usesharedtags = true) { string start = tag; string end = endtag; FileFormat.ClientInfo info = GlobalFuncs.GetClientInfoValues(ClientName); ScriptType type = GetTypeFromTag(start); //we must have the ending tag before we continue. if (string.IsNullOrWhiteSpace(end)) { return(""); } if (usesharedtags) { string sharedstart = "<shared>"; string sharedend = "</shared>"; if (code.Contains(sharedstart) && code.Contains(sharedend)) { start = sharedstart; end = sharedend; } } if (info.Fix2007) { Generator.GenerateScriptForClient(type); } string extractedCode = GetArgsFromTag(code, start, end); if (extractedCode.Contains("%donothing%")) { return(""); } string WebServer_CustomPlayerDir = "http://" + GlobalVars.IP + ":" + (GlobalVars.UserConfiguration.WebServerPort.ToString()).ToString() + "/charcustom/"; string WebServer_HatDir = WebServer_CustomPlayerDir + "hats/"; string WebServer_FaceDir = WebServer_CustomPlayerDir + "faces/"; string WebServer_HeadDir = WebServer_CustomPlayerDir + "heads/"; string WebServer_TShirtDir = WebServer_CustomPlayerDir + "tshirts/"; string WebServer_ShirtDir = WebServer_CustomPlayerDir + "shirts/"; string WebServer_PantsDir = WebServer_CustomPlayerDir + "pants/"; string WebServer_ExtraDir = WebServer_CustomPlayerDir + "custom/"; #if LAUNCHER string md5dir = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location) : ""; #else string md5dir = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.RootPathLauncher + "\\Novetus.exe") : ""; #endif string md5script = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; string md5exe = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(rbxexe) : ""; string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'"; string compiled = extractedCode.Replace("%version%", GlobalVars.ProgramInformation.Version) .Replace("%mapfile%", mapfile) .Replace("%luafile%", luafile) .Replace("%charapp%", GlobalVars.UserCustomization.CharacterID) .Replace("%ip%", GlobalVars.IP) .Replace("%port%", GlobalVars.UserConfiguration.RobloxPort.ToString()) .Replace("%name%", GlobalVars.UserConfiguration.PlayerName) .Replace("%icone%", ConvertIconStringToInt().ToString()) .Replace("%icon%", GlobalVars.UserCustomization.Icon) .Replace("%id%", GlobalVars.UserConfiguration.UserID.ToString()) .Replace("%face%", GlobalVars.UserCustomization.Face) .Replace("%head%", GlobalVars.UserCustomization.Head) .Replace("%tshirt%", GlobalVars.UserCustomization.TShirt) .Replace("%shirt%", GlobalVars.UserCustomization.Shirt) .Replace("%pants%", GlobalVars.UserCustomization.Pants) .Replace("%hat1%", GlobalVars.UserCustomization.Hat1) .Replace("%hat2%", GlobalVars.UserCustomization.Hat2) .Replace("%hat3%", GlobalVars.UserCustomization.Hat3) .Replace("%faced%", GlobalVars.UserCustomization.Face.Contains("http://") ? GlobalVars.UserCustomization.Face : GlobalPaths.faceGameDir + GlobalVars.UserCustomization.Face) .Replace("%headd%", GlobalPaths.headGameDir + GlobalVars.UserCustomization.Head) .Replace("%tshirtd%", GlobalVars.UserCustomization.TShirt.Contains("http://") ? GlobalVars.UserCustomization.TShirt : GlobalPaths.tshirtGameDir + GlobalVars.UserCustomization.TShirt) .Replace("%shirtd%", GlobalVars.UserCustomization.Shirt.Contains("http://") ? GlobalVars.UserCustomization.Shirt : GlobalPaths.shirtGameDir + GlobalVars.UserCustomization.Shirt) .Replace("%pantsd%", GlobalVars.UserCustomization.Pants.Contains("http://") ? GlobalVars.UserCustomization.Pants : GlobalPaths.pantsGameDir + GlobalVars.UserCustomization.Pants) .Replace("%hat1d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Hat1) .Replace("%hat2d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Hat2) .Replace("%hat3d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Hat3) .Replace("%headcolor%", GlobalVars.UserCustomization.HeadColorID.ToString()) .Replace("%torsocolor%", GlobalVars.UserCustomization.TorsoColorID.ToString()) .Replace("%larmcolor%", GlobalVars.UserCustomization.LeftArmColorID.ToString()) .Replace("%llegcolor%", GlobalVars.UserCustomization.LeftLegColorID.ToString()) .Replace("%rarmcolor%", GlobalVars.UserCustomization.RightArmColorID.ToString()) .Replace("%rlegcolor%", GlobalVars.UserCustomization.RightLegColorID.ToString()) .Replace("%md5launcher%", md5dir) .Replace("%md5script%", info.ScriptMD5) .Replace("%md5exe%", info.ClientMD5) .Replace("%md5scriptd%", md5script) .Replace("%md5exed%", md5exe) .Replace("%limit%", GlobalVars.UserConfiguration.PlayerLimit.ToString()) .Replace("%extra%", GlobalVars.UserCustomization.Extra) .Replace("%hat4%", GlobalVars.UserCustomization.Extra) .Replace("%extrad%", GlobalPaths.extraGameDir + GlobalVars.UserCustomization.Extra) .Replace("%hat4d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Extra) .Replace("%args%", GetRawArgsForType(type, md5s, luafile)) .Replace("%facews%", GlobalVars.UserCustomization.Face.Contains("http://") ? GlobalVars.UserCustomization.Face : WebServer_FaceDir + GlobalVars.UserCustomization.Face) .Replace("%headws%", WebServer_HeadDir + GlobalVars.UserCustomization.Head) .Replace("%tshirtws%", GlobalVars.UserCustomization.TShirt.Contains("http://") ? GlobalVars.UserCustomization.TShirt : WebServer_TShirtDir + GlobalVars.UserCustomization.TShirt) .Replace("%shirtws%", GlobalVars.UserCustomization.Shirt.Contains("http://") ? GlobalVars.UserCustomization.Shirt : WebServer_ShirtDir + GlobalVars.UserCustomization.Shirt) .Replace("%pantsws%", GlobalVars.UserCustomization.Pants.Contains("http://") ? GlobalVars.UserCustomization.Pants : WebServer_PantsDir + GlobalVars.UserCustomization.Pants) .Replace("%hat1ws%", WebServer_HatDir + GlobalVars.UserCustomization.Hat1) .Replace("%hat2ws%", WebServer_HatDir + GlobalVars.UserCustomization.Hat2) .Replace("%hat3ws%", WebServer_HatDir + GlobalVars.UserCustomization.Hat3) .Replace("%extraws%", WebServer_ExtraDir + GlobalVars.UserCustomization.Extra) .Replace("%hat4ws%", WebServer_HatDir + GlobalVars.UserCustomization.Extra) .Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\").Replace(@"/", @"\")) .Replace("%mapfilec%", GlobalFuncs.CopyMapToRBXAsset()) .Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode) .Replace("%scripttype%", Generator.GetNameForType(type)) .Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath); return(compiled); }
void LoadToolStripMenuItemClick(object sender, EventArgs e) { bool IsVersion2 = false; using (var ofd = new OpenFileDialog()) { ofd.Filter = "Novetus Clientinfo files (*.nov)|*.nov"; ofd.FilterIndex = 1; ofd.FileName = "clientinfo.nov"; ofd.Title = "Load clientinfo.nov"; if (ofd.ShowDialog() == DialogResult.OK) { string file, usesplayername, usesid, warning, legacymode, clientmd5, scriptmd5, desc, locked, fix2007, alreadyhassecurity, cmdargsorclientoptions, commandargsver2; using (StreamReader reader = new StreamReader(ofd.FileName)) { file = reader.ReadLine(); } string ConvertedLine = ""; try { IsVersion2 = true; label9.Text = "v2 (v" + GlobalVars.ProgramInformation.Version + ")"; ConvertedLine = SecurityFuncs.Base64DecodeNew(file); } catch (Exception) { label9.Text = "v1 (v1.1)"; ConvertedLine = SecurityFuncs.Base64DecodeOld(file); } string[] result = ConvertedLine.Split('|'); usesplayername = SecurityFuncs.Base64Decode(result[0]); usesid = SecurityFuncs.Base64Decode(result[1]); warning = SecurityFuncs.Base64Decode(result[2]); legacymode = SecurityFuncs.Base64Decode(result[3]); clientmd5 = SecurityFuncs.Base64Decode(result[4]); scriptmd5 = SecurityFuncs.Base64Decode(result[5]); desc = SecurityFuncs.Base64Decode(result[6]); locked = SecurityFuncs.Base64Decode(result[7]); fix2007 = SecurityFuncs.Base64Decode(result[8]); alreadyhassecurity = SecurityFuncs.Base64Decode(result[9]); cmdargsorclientoptions = SecurityFuncs.Base64Decode(result[10]); commandargsver2 = ""; try { if (IsVersion2) { commandargsver2 = SecurityFuncs.Base64Decode(result[11]); } } catch (Exception) { if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2 (v1.2 Snapshot 7440)"; IsVersion2 = false; } } if (!GlobalVars.AdminMode) { bool lockcheck = Convert.ToBoolean(locked); if (lockcheck) { NewClientInfo(); MessageBox.Show("This client is locked and therefore it cannot be loaded.", "Novetus Launcher - Error when loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { Locked = lockcheck; checkBox4.Checked = Locked; } } else { Locked = Convert.ToBoolean(locked); checkBox4.Checked = Locked; } SelectedClientInfo.UsesPlayerName = Convert.ToBoolean(usesplayername); SelectedClientInfo.UsesID = Convert.ToBoolean(usesid); SelectedClientInfo.Warning = warning; SelectedClientInfo.LegacyMode = Convert.ToBoolean(legacymode); SelectedClientInfo.ClientMD5 = clientmd5; SelectedClientInfo.ScriptMD5 = scriptmd5; SelectedClientInfo.Description = desc; SelectedClientInfo.Fix2007 = Convert.ToBoolean(fix2007); SelectedClientInfo.AlreadyHasSecurity = Convert.ToBoolean(alreadyhassecurity); try { if (IsVersion2) { if (cmdargsorclientoptions.Equals("True") || cmdargsorclientoptions.Equals("False")) { label9.Text = "v2 (v1.2.3)"; SelectedClientInfo.ClientLoadOptions = Settings.GraphicsOptions.GetClientLoadOptionsForBool(Convert.ToBoolean(cmdargsorclientoptions)); } else { SelectedClientInfo.ClientLoadOptions = Settings.GraphicsOptions.GetClientLoadOptionsForInt(Convert.ToInt32(cmdargsorclientoptions)); } SelectedClientInfo.CommandLineArgs = commandargsver2; } } catch (Exception) { //Again, fake it. SelectedClientInfo.ClientLoadOptions = Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp; SelectedClientInfo.CommandLineArgs = cmdargsorclientoptions; } SelectedClientInfoPath = Path.GetDirectoryName(ofd.FileName); } } checkBox1.Checked = SelectedClientInfo.UsesPlayerName; checkBox2.Checked = SelectedClientInfo.UsesID; checkBox3.Checked = SelectedClientInfo.LegacyMode; checkBox6.Checked = SelectedClientInfo.Fix2007; checkBox7.Checked = SelectedClientInfo.AlreadyHasSecurity; switch (SelectedClientInfo.ClientLoadOptions) { case Settings.GraphicsOptions.ClientLoadOptions.Client_2007: comboBox1.SelectedIndex = 1; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp: comboBox1.SelectedIndex = 2; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp_LegacyOpenGL: comboBox1.SelectedIndex = 3; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp_QualityLevel21: comboBox1.SelectedIndex = 4; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp_NoGraphicsOptions: comboBox1.SelectedIndex = 5; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp_ForceAutomatic: comboBox1.SelectedIndex = 6; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp_ForceAutomaticQL21: comboBox1.SelectedIndex = 7; break; case Settings.GraphicsOptions.ClientLoadOptions.Client_2008AndUp_HasCharacterOnlyShadowsLegacyOpenGL: comboBox1.SelectedIndex = 8; break; default: comboBox1.SelectedIndex = 0; break; } textBox1.Text = SelectedClientInfo.Description; textBox4.Text = SelectedClientInfo.CommandLineArgs; textBox5.Text = SelectedClientInfo.Warning; }
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; } }
public static string CompileScript(string ClientName, string code, string tag, string endtag, string mapfile, string luafile, string rbxexe, bool usesharedtags = true) { string start = tag; string end = endtag; FileFormat.ClientInfo info = GlobalFuncs.GetClientInfoValues(ClientName); ScriptType type = GetTypeFromTag(start); //we must have the ending tag before we continue. if (string.IsNullOrWhiteSpace(end)) { return(""); } if (usesharedtags) { string sharedstart = "<shared>"; string sharedend = "</shared>"; if (code.Contains(sharedstart) && code.Contains(sharedend)) { start = sharedstart; end = sharedend; } } if (info.Fix2007) { Generator.GenerateScriptForClient(type); } string extractedCode = GetArgsFromTag(code, start, end); if (extractedCode.Contains("%donothing%")) { return(""); } #if LAUNCHER string md5dir = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location) : ""; #else string md5dir = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.RootPathLauncher + "\\Novetus.exe") : ""; #endif string md5script = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; string md5exe = !info.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(rbxexe) : ""; string md5sd = "'" + md5exe + "','" + md5dir + "','" + md5script + "'"; string md5s = "'" + info.ClientMD5 + "','" + md5dir + "','" + info.ScriptMD5 + "'"; string compiled = extractedCode.Replace("%version%", GlobalVars.ProgramInformation.Version) .Replace("%mapfile%", mapfile) .Replace("%luafile%", luafile) .Replace("%charapp%", GlobalVars.UserCustomization.CharacterID) .Replace("%ip%", GlobalVars.IP) .Replace("%port%", GlobalVars.UserConfiguration.RobloxPort.ToString()) .Replace("%joinport%", GlobalVars.JoinPort.ToString()) .Replace("%name%", GlobalVars.UserConfiguration.PlayerName) .Replace("%icone%", ConvertIconStringToInt().ToString()) .Replace("%icon%", GlobalVars.UserCustomization.Icon) .Replace("%id%", GlobalVars.UserConfiguration.UserID.ToString()) .Replace("%face%", GlobalVars.UserCustomization.Face) .Replace("%head%", GlobalVars.UserCustomization.Head) .Replace("%tshirt%", GlobalVars.UserCustomization.TShirt) .Replace("%shirt%", GlobalVars.UserCustomization.Shirt) .Replace("%pants%", GlobalVars.UserCustomization.Pants) .Replace("%hat1%", GlobalVars.UserCustomization.Hat1) .Replace("%hat2%", GlobalVars.UserCustomization.Hat2) .Replace("%hat3%", GlobalVars.UserCustomization.Hat3) .Replace("%faced%", GlobalVars.UserCustomization.Face.Contains("http://") ? GlobalVars.UserCustomization.Face : GlobalPaths.faceGameDir + GlobalVars.UserCustomization.Face) .Replace("%headd%", GlobalPaths.headGameDir + GlobalVars.UserCustomization.Head) .Replace("%tshirtd%", GlobalVars.UserCustomization.TShirt.Contains("http://") ? GlobalVars.UserCustomization.TShirt : GlobalPaths.tshirtGameDir + GlobalVars.UserCustomization.TShirt) .Replace("%shirtd%", GlobalVars.UserCustomization.Shirt.Contains("http://") ? GlobalVars.UserCustomization.Shirt : GlobalPaths.shirtGameDir + GlobalVars.UserCustomization.Shirt) .Replace("%pantsd%", GlobalVars.UserCustomization.Pants.Contains("http://") ? GlobalVars.UserCustomization.Pants : GlobalPaths.pantsGameDir + GlobalVars.UserCustomization.Pants) .Replace("%hat1d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Hat1) .Replace("%hat2d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Hat2) .Replace("%hat3d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Hat3) .Replace("%headcolor%", GlobalVars.UserCustomization.HeadColorID.ToString()) .Replace("%torsocolor%", GlobalVars.UserCustomization.TorsoColorID.ToString()) .Replace("%larmcolor%", GlobalVars.UserCustomization.LeftArmColorID.ToString()) .Replace("%llegcolor%", GlobalVars.UserCustomization.LeftLegColorID.ToString()) .Replace("%rarmcolor%", GlobalVars.UserCustomization.RightArmColorID.ToString()) .Replace("%rlegcolor%", GlobalVars.UserCustomization.RightLegColorID.ToString()) .Replace("%md5launcher%", md5dir) .Replace("%md5script%", info.ScriptMD5) .Replace("%md5exe%", info.ClientMD5) .Replace("%md5scriptd%", md5script) .Replace("%md5exed%", md5exe) .Replace("%md5s%", md5s) .Replace("%md5sd%", md5sd) .Replace("%limit%", GlobalVars.UserConfiguration.PlayerLimit.ToString()) .Replace("%extra%", GlobalVars.UserCustomization.Extra) .Replace("%hat4%", GlobalVars.UserCustomization.Extra) .Replace("%extrad%", GlobalPaths.extraGameDir + GlobalVars.UserCustomization.Extra) .Replace("%hat4d%", GlobalPaths.hatGameDir + GlobalVars.UserCustomization.Extra) .Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\").Replace(@"/", @"\")) .Replace("%mapfilec%", extractedCode.Contains("%mapfilec%") ? GlobalFuncs.CopyMapToRBXAsset() : "") .Replace("%tripcode%", GlobalVars.PlayerTripcode) .Replace("%scripttype%", Generator.GetNameForType(type)) .Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath) .Replace("%notifications%", GlobalVars.UserConfiguration.ShowServerNotifications.ToString().ToLower()) .Replace("%loadout%", code.Contains("<solo>") ? GlobalVars.soloLoadout : GlobalVars.Loadout) .Replace("%doublequote%", "\"") .Replace("%validatedextrafiles%", GlobalVars.ValidatedExtraFiles.ToString()) .Replace("%argstring%", GetRawArgsForType(type, ClientName, luafile)) .Replace("%tshirttexid%", GlobalVars.TShirtTextureID) .Replace("%shirttexid%", GlobalVars.ShirtTextureID) .Replace("%pantstexid%", GlobalVars.PantsTextureID) .Replace("%facetexid%", GlobalVars.FaceTextureID) .Replace("%tshirttexidlocal%", GlobalVars.TShirtTextureLocal) .Replace("%shirttexidlocal%", GlobalVars.ShirtTextureLocal) .Replace("%pantstexidlocal%", GlobalVars.PantsTextureLocal) .Replace("%facetexlocal%", GlobalVars.FaceTextureLocal) .Replace("%newgui%", GlobalVars.UserConfiguration.NewGUI.ToString().ToLower()); if (compiled.Contains("%disabled%")) { MessageBox.Show("This option has been disabled for this client.", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(""); } return(compiled); }
void LoadToolStripMenuItemClick(object sender, EventArgs e) { bool IsVersion2 = false; using (var ofd = new OpenFileDialog()) { ofd.Filter = "Novetus Clientinfo files (*.nov)|*.nov"; ofd.FilterIndex = 1; ofd.FileName = "clientinfo.nov"; ofd.Title = "Load clientinfo.nov"; if (ofd.ShowDialog() == DialogResult.OK) { string file, usesplayername, usesid, warning, legacymode, clientmd5, scriptmd5, desc, locked, fix2007, alreadyhassecurity, cmdargsorclientoptions, commandargsver2, folders, usescustomname, customname; using (StreamReader reader = new StreamReader(ofd.FileName)) { file = reader.ReadLine(); } string ConvertedLine = ""; try { IsVersion2 = true; label9.Text = curversion + " (v" + GlobalVars.ProgramInformation.Version + ")"; ConvertedLine = SecurityFuncs.Base64DecodeNew(file); } catch (Exception ex) { GlobalFuncs.LogExceptions(ex); label9.Text = "v1 (v1.1)"; ConvertedLine = SecurityFuncs.Base64DecodeOld(file); } string[] result = ConvertedLine.Split('|'); usesplayername = SecurityFuncs.Base64Decode(result[0]); usesid = SecurityFuncs.Base64Decode(result[1]); warning = SecurityFuncs.Base64Decode(result[2]); legacymode = SecurityFuncs.Base64Decode(result[3]); clientmd5 = SecurityFuncs.Base64Decode(result[4]); scriptmd5 = SecurityFuncs.Base64Decode(result[5]); desc = SecurityFuncs.Base64Decode(result[6]); locked = SecurityFuncs.Base64Decode(result[7]); fix2007 = SecurityFuncs.Base64Decode(result[8]); alreadyhassecurity = SecurityFuncs.Base64Decode(result[9]); cmdargsorclientoptions = SecurityFuncs.Base64Decode(result[10]); folders = "False"; usescustomname = "False"; customname = ""; commandargsver2 = ""; try { if (IsVersion2) { commandargsver2 = SecurityFuncs.Base64Decode(result[11]); bool parsedValue; if (bool.TryParse(commandargsver2, out parsedValue)) { folders = SecurityFuncs.Base64Decode(result[11]); commandargsver2 = SecurityFuncs.Base64Decode(result[12]); bool parsedValue2; if (bool.TryParse(commandargsver2, out parsedValue2)) { usescustomname = SecurityFuncs.Base64Decode(result[12]); customname = SecurityFuncs.Base64Decode(result[13]); commandargsver2 = SecurityFuncs.Base64Decode(result[14]); } else { if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2.2 (Last used in v1.3 v11.2021.1)"; } } } else { if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2.1 (Last used in v1.3 Pre-Release 5)"; } } } } catch (Exception ex) { GlobalFuncs.LogExceptions(ex); if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2 Alpha (Last used in v1.2 Snapshot 7440)"; IsVersion2 = false; } } if (!GlobalVars.AdminMode) { bool lockcheck = Convert.ToBoolean(locked); if (lockcheck) { NewClientInfo(); MessageBox.Show("This client is locked and therefore it cannot be loaded.", "Novetus Launcher - Error when loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { Locked = lockcheck; checkBox4.Checked = Locked; } } else { Locked = Convert.ToBoolean(locked); checkBox4.Checked = Locked; } SelectedClientInfo.UsesPlayerName = Convert.ToBoolean(usesplayername); SelectedClientInfo.UsesID = Convert.ToBoolean(usesid); SelectedClientInfo.Warning = warning; SelectedClientInfo.LegacyMode = Convert.ToBoolean(legacymode); SelectedClientInfo.ClientMD5 = clientmd5; SelectedClientInfo.ScriptMD5 = scriptmd5; SelectedClientInfo.Description = desc; SelectedClientInfo.Fix2007 = Convert.ToBoolean(fix2007); SelectedClientInfo.AlreadyHasSecurity = Convert.ToBoolean(alreadyhassecurity); SelectedClientInfo.SeperateFolders = Convert.ToBoolean(folders); SelectedClientInfo.UsesCustomClientEXEName = Convert.ToBoolean(usescustomname); SelectedClientInfo.CustomClientEXEName = customname; try { if (IsVersion2) { if (cmdargsorclientoptions.Equals("True") || cmdargsorclientoptions.Equals("False")) { label9.Text = "v2 (Last used in v1.2.3)"; SelectedClientInfo.ClientLoadOptions = Settings.GetClientLoadOptionsForBool(Convert.ToBoolean(cmdargsorclientoptions)); } else { SelectedClientInfo.ClientLoadOptions = (Settings.ClientLoadOptions)Convert.ToInt32(cmdargsorclientoptions); } SelectedClientInfo.CommandLineArgs = commandargsver2; } } catch (Exception ex) { GlobalFuncs.LogExceptions(ex); //Again, fake it. SelectedClientInfo.ClientLoadOptions = Settings.ClientLoadOptions.Client_2008AndUp; SelectedClientInfo.CommandLineArgs = cmdargsorclientoptions; } SelectedClientInfoPath = Path.GetDirectoryName(ofd.FileName); } } LoadUIElements(); }
private void Shift_ValueChanged(object sender, System.EventArgs e) { ResultBox.Text = SecurityFuncs.Decipher(TextEntry.Text, (int)Shift.Value); }