From 79adfb2883e0d0677b4923d5747aaa5672d679d9 Mon Sep 17 00:00:00 2001 From: Bitl Date: Mon, 22 Aug 2022 14:59:22 -0700 Subject: [PATCH] backcompat stuff --- .../NovetusLaunchForm.Designer.cs | 31 +++++-- .../Novetus.Bootstrapper/NovetusLaunchForm.cs | 6 ++ Novetus/NovetusCMD/Classes/LocalFuncs.cs | 1 + Novetus/NovetusCMD/NovetusCMD.cs | 11 +++ .../StorageAndFunctions/GlobalFuncs.cs | 88 ++++++++++++++----- .../StorageAndFunctions/GlobalVars.cs | 1 + .../Forms/LauncherForm/LauncherFormShared.cs | 9 ++ .../Forms/SDK/ClientinfoCreator.Designer.cs | 51 +++++++---- .../Forms/SDK/ClientinfoCreator.cs | 10 ++- .../NovetusLauncher/Forms/ServerBrowser.cs | 25 ++++-- .../NovetusLauncherEntryPoint.cs | 10 +++ changelog.txt | 15 ++++ scripts/batch/Novetus_launcher_legacy.bat | 31 ++++--- 13 files changed, 222 insertions(+), 67 deletions(-) diff --git a/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.Designer.cs b/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.Designer.cs index a211bb7..a90c255 100644 --- a/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.Designer.cs +++ b/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.Designer.cs @@ -42,6 +42,7 @@ namespace Novetus.Bootstrapper this.URIButton = new System.Windows.Forms.Button(); this.VersionLabel = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.LaunchNovetusBackCompatButton = new System.Windows.Forms.Button(); this.CMDGroup.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); @@ -50,9 +51,9 @@ namespace Novetus.Bootstrapper // LaunchNovetusButton // this.LaunchNovetusButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.LaunchNovetusButton.Location = new System.Drawing.Point(12, 132); + this.LaunchNovetusButton.Location = new System.Drawing.Point(12, 135); this.LaunchNovetusButton.Name = "LaunchNovetusButton"; - this.LaunchNovetusButton.Size = new System.Drawing.Size(485, 52); + this.LaunchNovetusButton.Size = new System.Drawing.Size(485, 56); this.LaunchNovetusButton.TabIndex = 0; this.LaunchNovetusButton.Text = "PLAY NOVETUS"; this.LaunchNovetusButton.UseVisualStyleBackColor = true; @@ -104,7 +105,7 @@ namespace Novetus.Bootstrapper this.CMDGroup.Controls.Add(this.ArgBox); this.CMDGroup.Controls.Add(this.CMDHelpButton); this.CMDGroup.Controls.Add(this.CMDButton); - this.CMDGroup.Location = new System.Drawing.Point(12, 190); + this.CMDGroup.Location = new System.Drawing.Point(12, 221); this.CMDGroup.Name = "CMDGroup"; this.CMDGroup.Size = new System.Drawing.Size(263, 92); this.CMDGroup.TabIndex = 6; @@ -132,7 +133,7 @@ namespace Novetus.Bootstrapper this.groupBox1.Controls.Add(this.URIButton); this.groupBox1.Controls.Add(this.LaunchSDKButton); this.groupBox1.Controls.Add(this.DependencyInstallerButton); - this.groupBox1.Location = new System.Drawing.Point(281, 195); + this.groupBox1.Location = new System.Drawing.Point(281, 226); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(216, 80); this.groupBox1.TabIndex = 7; @@ -153,9 +154,9 @@ namespace Novetus.Bootstrapper // this.VersionLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.VersionLabel.ForeColor = System.Drawing.Color.IndianRed; - this.VersionLabel.Location = new System.Drawing.Point(20, 95); + this.VersionLabel.Location = new System.Drawing.Point(12, 98); this.VersionLabel.Name = "VersionLabel"; - this.VersionLabel.Size = new System.Drawing.Size(470, 34); + this.VersionLabel.Size = new System.Drawing.Size(484, 34); this.VersionLabel.TabIndex = 8; this.VersionLabel.Text = "v1.0"; this.VersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -165,19 +166,30 @@ namespace Novetus.Bootstrapper this.pictureBox1.BackgroundImage = global::Novetus.Bootstrapper.Properties.Resources.NOVETUS_new_final_smol; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.pictureBox1.InitialImage = null; - this.pictureBox1.Location = new System.Drawing.Point(21, 12); + this.pictureBox1.Location = new System.Drawing.Point(12, 3); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(469, 91); + this.pictureBox1.Size = new System.Drawing.Size(484, 92); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; // + // LaunchNovetusBackCompatButton + // + this.LaunchNovetusBackCompatButton.Location = new System.Drawing.Point(12, 197); + this.LaunchNovetusBackCompatButton.Name = "LaunchNovetusBackCompatButton"; + this.LaunchNovetusBackCompatButton.Size = new System.Drawing.Size(485, 23); + this.LaunchNovetusBackCompatButton.TabIndex = 9; + this.LaunchNovetusBackCompatButton.Text = "PLAY NOVETUS WITH BACKWARDS COMPATIBILITY"; + this.LaunchNovetusBackCompatButton.UseVisualStyleBackColor = true; + this.LaunchNovetusBackCompatButton.Click += new System.EventHandler(this.LaunchNovetusBackCompatButton_Click); + // // NovetusLaunchForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(508, 294); + this.ClientSize = new System.Drawing.Size(508, 318); + this.Controls.Add(this.LaunchNovetusBackCompatButton); this.Controls.Add(this.VersionLabel); this.Controls.Add(this.groupBox1); this.Controls.Add(this.CMDGroup); @@ -211,6 +223,7 @@ namespace Novetus.Bootstrapper private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button URIButton; private System.Windows.Forms.Label VersionLabel; + private System.Windows.Forms.Button LaunchNovetusBackCompatButton; } } diff --git a/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs b/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs index c8b97e5..307536e 100644 --- a/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs +++ b/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs @@ -49,6 +49,12 @@ namespace Novetus.Bootstrapper Close(); } + private void LaunchNovetusBackCompatButton_Click(object sender, EventArgs e) + { + LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-backcompat"); + Close(); + } + private void LaunchSDKButton_Click(object sender, EventArgs e) { LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-sdk"); diff --git a/Novetus/NovetusCMD/Classes/LocalFuncs.cs b/Novetus/NovetusCMD/Classes/LocalFuncs.cs index e6fa483..88e23b4 100644 --- a/Novetus/NovetusCMD/Classes/LocalFuncs.cs +++ b/Novetus/NovetusCMD/Classes/LocalFuncs.cs @@ -24,6 +24,7 @@ namespace NovetusCMD GlobalFuncs.ConsolePrint("-no3d | Launches server in NoGraphics mode", 4, true, true); GlobalFuncs.ConsolePrint("-outputinfo | Outputs all information about the running server to a text file.", 4, true, true); GlobalFuncs.ConsolePrint("-debug | Disables launching of the server for debugging purposes.", 4, true, true); + GlobalFuncs.ConsolePrint("-debug | Disables launching of the server for debugging purposes.", 4, true, true); GlobalFuncs.ConsolePrint("---------", 1, true, true); GlobalFuncs.ConsolePrint("Custom server options", 3, true, true); GlobalFuncs.ConsolePrint("---------", 1, true, true); diff --git a/Novetus/NovetusCMD/NovetusCMD.cs b/Novetus/NovetusCMD/NovetusCMD.cs index 3d18df2..cece1c3 100644 --- a/Novetus/NovetusCMD/NovetusCMD.cs +++ b/Novetus/NovetusCMD/NovetusCMD.cs @@ -182,10 +182,16 @@ namespace NovetusCMD switch (LocalVars.DebugMode) { case true: + GlobalVars.RequestToOutputInfo = true; GlobalFuncs.CreateTXT(); break; case false: default: + if (GlobalVars.RequestToOutputInfo) + { + GlobalFuncs.CreateTXT(); + } + StartServer(LocalVars.StartInNo3D); break; } @@ -260,6 +266,11 @@ namespace NovetusCMD { LocalVars.DebugMode = true; } + + if ((CommandLine["backcompat"] != null) || (CommandLine["bc"] != null)) + { + GlobalVars.BackwardsCompatEnabled = true; + } } } diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index 129d4a3..1af22a3 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -143,6 +143,12 @@ public class GlobalFuncs { if (write) { + if (!GlobalVars.BackwardsCompatEnabled) + { + ini.IniWriteValue(section, newKey, val); + return ""; + } + if (!ini.IniValueExists(newKey)) { if (GlobalVars.ProgramInformation.InitialBootup) @@ -170,6 +176,11 @@ public class GlobalFuncs } else { + if (!GlobalVars.BackwardsCompatEnabled) + { + return ini.IniReadValue(section, newKey, val); + } + if (ini.IniValueExists(newKey)) { return ini.IniReadValue(section, newKey, val); @@ -1159,29 +1170,56 @@ public class GlobalFuncs folders = "False"; usescustomname = "False"; customname = ""; - try - { - commandlineargs = SecurityFuncs.Base64Decode(result[11]); - bool parsedValue; - if (bool.TryParse(commandlineargs, out parsedValue)) + if (GlobalVars.BackwardsCompatEnabled) + { + try { - folders = SecurityFuncs.Base64Decode(result[11]); - commandlineargs = SecurityFuncs.Base64Decode(result[12]); - bool parsedValue2; - if (bool.TryParse(commandlineargs, out parsedValue2)) + commandlineargs = SecurityFuncs.Base64Decode(result[11]); + + bool parsedValue; + if (bool.TryParse(commandlineargs, out parsedValue)) { - usescustomname = SecurityFuncs.Base64Decode(result[12]); - customname = SecurityFuncs.Base64Decode(result[13]); - commandlineargs = SecurityFuncs.Base64Decode(result[14]); + folders = SecurityFuncs.Base64Decode(result[11]); + commandlineargs = SecurityFuncs.Base64Decode(result[12]); + bool parsedValue2; + if (bool.TryParse(commandlineargs, out parsedValue2)) + { + usescustomname = SecurityFuncs.Base64Decode(result[12]); + customname = SecurityFuncs.Base64Decode(result[13]); + commandlineargs = SecurityFuncs.Base64Decode(result[14]); + } } } + catch (Exception) + { + //fake this option until we properly apply it. + clientloadoptions = "2"; + commandlineargs = SecurityFuncs.Base64Decode(result[10]); + } } - catch (Exception) + else { - //fake this option until we properly apply it. - clientloadoptions = "2"; - commandlineargs = SecurityFuncs.Base64Decode(result[10]); + try + { + folders = SecurityFuncs.Base64Decode(result[11]); + usescustomname = SecurityFuncs.Base64Decode(result[12]); + customname = SecurityFuncs.Base64Decode(result[13]); + commandlineargs = SecurityFuncs.Base64Decode(result[14]); + } + catch (Exception) + { +#if LAUNCHER + MessageBox.Show("Failed to load outdated client. Please update your client to the latest Novetus version or use the -backcompat/-bc command line argument.", "Novetus - Outdated Client", MessageBoxButtons.OK, MessageBoxIcon.Error); +#elif CMD + ConsolePrint("Failed to load outdated client. Please update your client to the latest Novetus version or use the -backcompat/-bc command line argument.", 2); + ConsolePrint("Loading default client '" + GlobalVars.ProgramInformation.DefaultClient + "'", 4); +#endif + + string path = GlobalPaths.ClientDir + @"\\" + GlobalVars.ProgramInformation.DefaultClient + @"\\clientinfo.nov"; + LoadClientValues(path); + return; + } } info.UsesPlayerName = Convert.ToBoolean(usesplayername); @@ -1193,7 +1231,7 @@ public class GlobalFuncs info.Description = desc; info.Fix2007 = Convert.ToBoolean(fix2007); info.AlreadyHasSecurity = Convert.ToBoolean(alreadyhassecurity); - if (clientloadoptions.Equals("True") || clientloadoptions.Equals("False")) + if ((clientloadoptions.Equals("True") || clientloadoptions.Equals("False")) && GlobalVars.BackwardsCompatEnabled) { info.ClientLoadOptions = Settings.GetClientLoadOptionsForBool(Convert.ToBoolean(clientloadoptions)); } @@ -2507,9 +2545,9 @@ public class GlobalFuncs box.AppendText(Environment.NewLine, Color.White); } #elif CMD - public static void ConsolePrint(string text, int type, bool notime = false, bool noLog = false) + public static void ConsolePrint(string text, int type, bool noLog = false, bool noTime = false) { - if (!notime) + if (!noTime) { ConsoleText("[" + DateTime.Now.ToShortTimeString() + "] - ", ConsoleColor.White); } @@ -2552,8 +2590,13 @@ public class GlobalFuncs Console.ForegroundColor = color; Console.Write(text); } +#endif +#if LAUNCHER + public static void CreateTXT(RichTextBox box) +#else public static void CreateTXT() +#endif { if (GlobalVars.RequestToOutputInfo) { @@ -2571,9 +2614,11 @@ public class GlobalFuncs string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); string[] text = { +#if CMD "Process ID: " + (GlobalVars.ProcessID == 0 ? "N/A" : GlobalVars.ProcessID.ToString()), "Don't copy the Process ID when sharing the server.", "--------------------", +#endif "Server Info:", "Client: " + GlobalVars.UserConfiguration.SelectedClient, "IP: " + (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP), @@ -2589,10 +2634,13 @@ public class GlobalFuncs string txt = GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName; File.WriteAllLines(txt, text); +#if LAUNCHER + ConsolePrint("Server Information sent to file " + txt, 4, box); +#elif CMD ConsolePrint("Server Information sent to file " + txt, 4); +#endif } } -#endif public static void LogPrint(string text, int type = 1) { diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs index b0aa279..0902bc3 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs @@ -98,6 +98,7 @@ public static class GlobalVars public static bool NoFileList = false; public static string ServerID = "N/A"; public static string PingURL = ""; + public static bool BackwardsCompatEnabled = false; #endregion } #endregion diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index e67d276..b2035aa 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -293,6 +293,11 @@ namespace NovetusLauncher { LocalVars.launcherInitState = false; } + + if (GlobalVars.RequestToOutputInfo) + { + GlobalFuncs.CreateTXT(ConsoleBox); + } } public void CloseEvent(CancelEventArgs e) @@ -349,6 +354,10 @@ namespace NovetusLauncher { DiscordRPC.Shutdown(); } + if (GlobalVars.RequestToOutputInfo) + { + GlobalFuncs.FixedFileDelete(GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName); + } Application.Exit(); } diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs index 79afdee..3dff569 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs @@ -165,6 +165,7 @@ partial class ClientinfoEditor this.checkBox8 = new System.Windows.Forms.CheckBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -360,7 +361,7 @@ partial class ClientinfoEditor this.sharedToolStripMenuItem, this.validateToolStripMenuItem}); this.tagsToolStripMenuItem.Name = "tagsToolStripMenuItem"; - this.tagsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.tagsToolStripMenuItem.Size = new System.Drawing.Size(157, 22); this.tagsToolStripMenuItem.Text = "Add Tags"; // // clientToolStripMenuItem @@ -431,7 +432,7 @@ partial class ClientinfoEditor this.debuggingToolStripMenuItem, this.argsToolStripMenuItem}); this.variablesToolStripMenuItem.Name = "variablesToolStripMenuItem"; - this.variablesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.variablesToolStripMenuItem.Size = new System.Drawing.Size(157, 22); this.variablesToolStripMenuItem.Text = "Add Variables"; // // generalToolStripMenuItem @@ -454,7 +455,7 @@ partial class ClientinfoEditor this.useloadfileToolStripMenuItem, this.userbxassetforgenerationToolStripMenuItem}); this.generalToolStripMenuItem.Name = "generalToolStripMenuItem"; - this.generalToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.generalToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.generalToolStripMenuItem.Text = "General"; // // mapfileToolStripMenuItem @@ -576,7 +577,7 @@ partial class ClientinfoEditor this.notificationsToolStripMenuItem, this.portToolStripMenuItem}); this.serverToolStripMenuItem1.Name = "serverToolStripMenuItem1"; - this.serverToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.serverToolStripMenuItem1.Size = new System.Drawing.Size(163, 22); this.serverToolStripMenuItem1.Text = "Server"; // // limitToolStripMenuItem @@ -611,55 +612,55 @@ partial class ClientinfoEditor this.md5sToolStripMenuItem, this.md5sdToolStripMenuItem}); this.securityToolStripMenuItem.Name = "securityToolStripMenuItem"; - this.securityToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.securityToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.securityToolStripMenuItem.Text = "Security"; // // md5launcherToolStripMenuItem // this.md5launcherToolStripMenuItem.Name = "md5launcherToolStripMenuItem"; - this.md5launcherToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5launcherToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5launcherToolStripMenuItem.Text = "%md5launcher%"; this.md5launcherToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // md5scriptToolStripMenuItem // this.md5scriptToolStripMenuItem.Name = "md5scriptToolStripMenuItem"; - this.md5scriptToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5scriptToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5scriptToolStripMenuItem.Text = "%md5script%"; this.md5scriptToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // md5exeToolStripMenuItem // this.md5exeToolStripMenuItem.Name = "md5exeToolStripMenuItem"; - this.md5exeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5exeToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5exeToolStripMenuItem.Text = "%md5exe%"; this.md5exeToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // md5scriptdToolStripMenuItem // this.md5scriptdToolStripMenuItem.Name = "md5scriptdToolStripMenuItem"; - this.md5scriptdToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5scriptdToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5scriptdToolStripMenuItem.Text = "%md5scriptd%"; this.md5scriptdToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // md5exedToolStripMenuItem // this.md5exedToolStripMenuItem.Name = "md5exedToolStripMenuItem"; - this.md5exedToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5exedToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5exedToolStripMenuItem.Text = "%md5exed%"; this.md5exedToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // md5sToolStripMenuItem // this.md5sToolStripMenuItem.Name = "md5sToolStripMenuItem"; - this.md5sToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5sToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5sToolStripMenuItem.Text = "%md5s%"; this.md5sToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // md5sdToolStripMenuItem // this.md5sdToolStripMenuItem.Name = "md5sdToolStripMenuItem"; - this.md5sdToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.md5sdToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.md5sdToolStripMenuItem.Text = "%md5sd%"; this.md5sdToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // @@ -671,7 +672,7 @@ partial class ClientinfoEditor this.idToolStripMenuItem, this.tripcodeToolStripMenuItem}); this.playerToolStripMenuItem.Name = "playerToolStripMenuItem"; - this.playerToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.playerToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.playerToolStripMenuItem.Text = "Player"; // // customizationToolStripMenuItem @@ -1084,34 +1085,34 @@ partial class ClientinfoEditor this.donothingToolStripMenuItem, this.disabledToolStripMenuItem}); this.debuggingToolStripMenuItem.Name = "debuggingToolStripMenuItem"; - this.debuggingToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.debuggingToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.debuggingToolStripMenuItem.Text = "Debugging/Misc"; // // donothingToolStripMenuItem // this.donothingToolStripMenuItem.Name = "donothingToolStripMenuItem"; - this.donothingToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.donothingToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.donothingToolStripMenuItem.Text = "%donothing%"; this.donothingToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // disabledToolStripMenuItem // this.disabledToolStripMenuItem.Name = "disabledToolStripMenuItem"; - this.disabledToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.disabledToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.disabledToolStripMenuItem.Text = "%disabled%"; this.disabledToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // argsToolStripMenuItem // this.argsToolStripMenuItem.Name = "argsToolStripMenuItem"; - this.argsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.argsToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.argsToolStripMenuItem.Text = "%args%"; this.argsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // documentationToolStripMenuItem1 // this.documentationToolStripMenuItem1.Name = "documentationToolStripMenuItem1"; - this.documentationToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.documentationToolStripMenuItem1.Size = new System.Drawing.Size(157, 22); this.documentationToolStripMenuItem1.Text = "Documentation"; this.documentationToolStripMenuItem1.Click += new System.EventHandler(this.documentationToolStripMenuItem_Click); // @@ -1268,12 +1269,25 @@ partial class ClientinfoEditor this.label3.TabIndex = 37; this.label3.Text = "EXE Name:"; // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.Color.Red; + this.label4.Location = new System.Drawing.Point(161, 6); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(471, 13); + this.label4.TabIndex = 38; + this.label4.Text = "THIS CLIENT INFO REQUIRES BACKWARDS COMPATIBILITY TO BE ENABLED."; + this.label4.Visible = false; + // // ClientinfoEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.ClientSize = new System.Drawing.Size(632, 425); + this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.textBox2); this.Controls.Add(this.checkBox8); @@ -1438,4 +1452,5 @@ partial class ClientinfoEditor private System.Windows.Forms.ToolStripMenuItem usenewsignformatToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem useloadfileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem userbxassetforgenerationToolStripMenuItem; + private System.Windows.Forms.Label label4; } diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs index 10fd243..3b50a98 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs @@ -75,7 +75,6 @@ public partial class ClientinfoEditor : Form void NewToolStripMenuItemClick(object sender, EventArgs e) { - label9.Text = "Not Loaded"; NewClientInfo(); } @@ -112,7 +111,8 @@ public partial class ClientinfoEditor : Form catch (Exception ex) { GlobalFuncs.LogExceptions(ex); - label9.Text = "v1 (v1.1)"; + label9.Text = "v1 (Last used in v1.1)"; + label4.Visible = true; ConvertedLine = SecurityFuncs.Base64DecodeOld(file); } @@ -156,6 +156,7 @@ public partial class ClientinfoEditor : Form if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2.2 (Last used in v1.3 v11.2021.1)"; + label4.Visible = true; } } } @@ -164,6 +165,7 @@ public partial class ClientinfoEditor : Form if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2.1 (Last used in v1.3 Pre-Release 5)"; + label4.Visible = true; } } } @@ -174,6 +176,7 @@ public partial class ClientinfoEditor : Form if (!label9.Text.Equals("v1 (v1.1)")) { label9.Text = "v2 Alpha (Last used in v1.2 Snapshot 7440)"; + label4.Visible = true; IsVersion2 = false; } } @@ -219,6 +222,7 @@ public partial class ClientinfoEditor : Form if (cmdargsorclientoptions.Equals("True") || cmdargsorclientoptions.Equals("False")) { label9.Text = "v2 (Last used in v1.2.3)"; + label4.Visible = true; SelectedClientInfo.ClientLoadOptions = Settings.GetClientLoadOptionsForBool(Convert.ToBoolean(cmdargsorclientoptions)); } else @@ -269,6 +273,7 @@ public partial class ClientinfoEditor : Form File.WriteAllText(SelectedClientInfoPath + "\\clientinfo.nov", SecurityFuncs.Base64Encode(string.Join("|", lines))); label9.Text = curversion + " (v" + GlobalVars.ProgramInformation.Version + ")"; + label4.Visible = false; MessageBox.Show(SelectedClientInfoPath + "\\clientinfo.nov saved!", "Novetus Client SDK - Clientinfo Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -555,6 +560,7 @@ public partial class ClientinfoEditor : Form void NewClientInfo() { label9.Text = "Not Loaded"; + label4.Visible = false; SelectedClientInfo = new FileFormat.ClientInfo(); Locked = false; SelectedClientInfoPath = ""; diff --git a/Novetus/NovetusLauncher/Forms/ServerBrowser.cs b/Novetus/NovetusLauncher/Forms/ServerBrowser.cs index ac3baac..017131a 100644 --- a/Novetus/NovetusLauncher/Forms/ServerBrowser.cs +++ b/Novetus/NovetusLauncher/Forms/ServerBrowser.cs @@ -142,14 +142,29 @@ namespace NovetusLauncher { string DecodedLine = ""; - try + if (GlobalVars.BackwardsCompatEnabled) { - string[] initialLine = line.Split('|'); - DecodedLine = SecurityFuncs.Base64DecodeOld(initialLine[1]); + try + { + string[] initialLine = line.Split('|'); + DecodedLine = SecurityFuncs.Base64DecodeOld(initialLine[1]); + } + catch (Exception) + { + DecodedLine = SecurityFuncs.Base64DecodeOld(line); + } } - catch (Exception) + else { - DecodedLine = SecurityFuncs.Base64DecodeOld(line); + try + { + string[] initialLine = line.Split('|'); + DecodedLine = SecurityFuncs.Base64DecodeOld(initialLine[1]); + } + catch (Exception) + { + continue; + } } string[] serverInfo = DecodedLine.Split('|'); diff --git a/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs b/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs index 5660af4..40e8e97 100644 --- a/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs +++ b/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs @@ -48,6 +48,16 @@ namespace NovetusLauncher { GlobalVars.NoFileList = true; } + + if (CommandLine["outputinfo"] != null) + { + GlobalVars.RequestToOutputInfo = true; + } + + if ((CommandLine["backcompat"] != null) || (CommandLine["bc"] != null)) + { + GlobalVars.BackwardsCompatEnabled = true; + } } } diff --git a/changelog.txt b/changelog.txt index 2b9e18d..6ee3a1d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,18 @@ +1.3 Snapshot v22.8269.25769.1 +Notes: +- Backwards compatibility for the following is now disabled by default to increase launcher/CMD performance. + - Master Servers that still use query.php. + - Clients that were built on old Novetus versions. + - Configs from old Novetus versions. +- In order to re-enable backwards compatibility, use the -backcompat or -bc command line arguments. +- The Novetus Bootstrapper and legacy launcher are updated to support this. + +Enhancements: +- Added the -outputinfo command line argument from NovetusCMD to the main launcher. + +Fixes: +- Fixed -outputinfo not functioning without -debug being enabled. +---------------------------------------------------------------------------- 1.3 Snapshot v22.8268.17854.1 Enhancements: - Made the Novetus URI Player Configuration UI more user friendly. diff --git a/scripts/batch/Novetus_launcher_legacy.bat b/scripts/batch/Novetus_launcher_legacy.bat index d166a03..4d7982f 100644 --- a/scripts/batch/Novetus_launcher_legacy.bat +++ b/scripts/batch/Novetus_launcher_legacy.bat @@ -37,12 +37,13 @@ ECHO. ECHO NOVETUS LEGACY LAUNCHER ECHO. ECHO 1 - Play -ECHO 2 = Install Required Dependencies -ECHO 3 - Novetus SDK -ECHO 4 - Novetus CMD -ECHO 5 - Novetus CMD Help -ECHO 6 - Install URI -ECHO 7 - Exit +ECHO 2 - Play with Backwards Compatibility +ECHO 3 = Install Required Dependencies +ECHO 4 - Novetus SDK +ECHO 5 - Novetus CMD +ECHO 6 - Novetus CMD Help +ECHO 7 - Install URI +ECHO 8 - Exit ECHO. SET /P M=Choose an option by typing the number corresponding to which utility you want to launch: IF %M%==1 CLS @@ -50,21 +51,25 @@ IF %M%==1 start "" "%CD%/bin/Novetus.exe" IF %M%==1 EXIT IF %M%==2 CLS -IF %M%==2 call "%CD%/Novetus_dependency_installer.bat" +IF %M%==2 start "" "%CD%/bin/Novetus.exe" -backcompat +IF %M%==2 EXIT IF %M%==3 CLS -IF %M%==3 start "" "%CD%/bin/Novetus.exe" -sdk -IF %M%==3 EXIT +IF %M%==3 call "%CD%/Novetus_dependency_installer.bat" IF %M%==4 CLS -IF %M%==4 "bin/NovetusCMD.exe" +IF %M%==4 start "" "%CD%/bin/Novetus.exe" -sdk +IF %M%==4 EXIT IF %M%==5 CLS -IF %M%==5 "bin/NovetusCMD.exe" -help +IF %M%==5 "bin/NovetusCMD.exe" IF %M%==6 CLS -IF %M%==6 start "" "%CD%/bin/NovetusURI.exe" -IF %M%==6 EXIT +IF %M%==6 "bin/NovetusCMD.exe" -help +IF %M%==7 CLS +IF %M%==7 start "" "%CD%/bin/NovetusURI.exe" IF %M%==7 EXIT + +IF %M%==8 EXIT EXIT