From 8edde1a7b809f760de3e9011d940a3782fa90601 Mon Sep 17 00:00:00 2001 From: Bitl Date: Wed, 14 Sep 2022 14:47:08 -0700 Subject: [PATCH] console rewrite --- .../StorageAndFunctions/ClientManagement.cs | 37 - .../StorageAndFunctions/FileManagement.cs | 8 + .../StorageAndFunctions/GlobalVars.cs | 14 +- .../StorageAndFunctions/NovetusFuncs.cs | 13 +- .../StorageAndFunctions/SecurityFuncs.cs | 2 - .../NovetusCore/StorageAndFunctions/Util.cs | 209 +- .../Classes/Launcher/ModManager.cs | 7 - Novetus/NovetusLauncher/Classes/LocalVars.cs | 4 - .../Forms/CustomGraphicsOptions.cs | 4 +- .../Compact/LauncherFormCompact.Designer.cs | 39 +- .../Compact/LauncherFormCompact.cs | 10 - .../Compact/LauncherFormCompact.resx | 2 +- .../Extended/LauncherFormExtended.Designer.cs | 98 +- .../Extended/LauncherFormExtended.cs | 15 - .../Extended/LauncherFormExtended.resx | 2 +- .../Forms/LauncherForm/LauncherFormShared.cs | 409 +-- .../Stylish/LauncherFormStylish.cs | 2 +- .../Stylish/LauncherFormStylishInterface.xaml | 2 +- .../LauncherFormStylishInterface.xaml.cs | 2 - .../Forms/NovetusConsole.Designer.cs | 71 + .../NovetusLauncher/Forms/NovetusConsole.cs | 265 ++ .../NovetusLauncher/Forms/NovetusConsole.resx | 2384 +++++++++++++++++ .../NovetusLauncher/Forms/SDK/ModCreator.cs | 1 + .../NovetusLauncher/Forms/SDK/NovetusSDK.cs | 17 +- .../NovetusLauncher/Forms/ServerBrowser.cs | 2 +- .../NovetusLauncher/Novetus.Launcher.csproj | 14 +- .../NovetusLauncherEntryPoint.cs | 166 +- 27 files changed, 3122 insertions(+), 677 deletions(-) create mode 100644 Novetus/NovetusLauncher/Forms/NovetusConsole.Designer.cs create mode 100644 Novetus/NovetusLauncher/Forms/NovetusConsole.cs create mode 100644 Novetus/NovetusLauncher/Forms/NovetusConsole.resx diff --git a/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs b/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs index b0a24ba..431f871 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs @@ -15,24 +15,12 @@ using System.Reflection; #region Client Management public class ClientManagement { -#if LAUNCHER - public static void ReadClientValues(RichTextBox box, bool initial = false) -#else public static void ReadClientValues(bool initial = false) -#endif { -#if LAUNCHER - ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, box, initial); -#else ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, initial); -#endif } -#if LAUNCHER - public static void ReadClientValues(string ClientName, RichTextBox box, bool initial = false) -#else public static void ReadClientValues(string ClientName, bool initial = false) -#endif { string name = ClientName; if (string.IsNullOrWhiteSpace(name)) @@ -55,12 +43,7 @@ public class ClientManagement { Util.ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available. Novetus will attempt to generate one.", 2); GenerateDefaultClientInfo(Path.GetDirectoryName(clientpath)); - -#if LAUNCHER - ReadClientValues(name, box, initial); -#else ReadClientValues(name, initial); -#endif } #if URI || LAUNCHER || CMD || BASICLAUNCHER catch (Exception ex) @@ -70,15 +53,10 @@ public class ClientManagement catch (Exception) { #endif - Util.ConsolePrint("ERROR - Failed to generate default clientinfo.nov. Info: " + ex.Message, 2); Util.ConsolePrint("Loading default client '" + GlobalVars.ProgramInformation.DefaultClient + "'", 4); name = GlobalVars.ProgramInformation.DefaultClient; -#if LAUNCHER - ReadClientValues(name, box, initial); -#else ReadClientValues(name, initial); -#endif } } else @@ -1005,16 +983,12 @@ public class ClientManagement #if URI public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e, Label label) -#elif LAUNCHER - public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e, RichTextBox box) #else public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e) #endif { #if URI LaunchRBXClient(GlobalVars.UserConfiguration.SelectedClient, type, no3d, nomap, e, label); -#elif LAUNCHER - LaunchRBXClient(GlobalVars.UserConfiguration.SelectedClient, type, no3d, nomap, e, box); #else LaunchRBXClient(GlobalVars.UserConfiguration.SelectedClient, type, no3d, nomap, e); #endif @@ -1022,8 +996,6 @@ public class ClientManagement #if URI public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e, Label label) -#elif LAUNCHER - public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e, RichTextBox box) #else public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e) #endif @@ -1083,12 +1055,7 @@ public class ClientManagement break; } -#if LAUNCHER - ReadClientValues(ClientName, box); -#else ReadClientValues(ClientName); -#endif - string luafile = GetLuaFileName(ClientName, type); string rbxexe = GetClientEXEDir(ClientName, type); string mapfile = type.Equals(ScriptType.EasterEgg) ? @@ -1254,11 +1221,7 @@ public class ClientManagement case ScriptType.Studio: break; case ScriptType.Server: -#if LAUNCHER - NovetusFuncs.PingMasterServer(true, "Server will now display on the defined master server.", box); -#elif CMD NovetusFuncs.PingMasterServer(true, "Server will now display on the defined master server."); -#endif goto default; default: GlobalVars.GameOpened = type; diff --git a/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs b/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs index 2400a97..2fbd16d 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs @@ -1443,7 +1443,9 @@ public class FileManagement if (!File.Exists(filePath)) { + Util.ConsolePrint("WARNING - No file list detected. Generating Initial File List.", 5); Thread t = new Thread(CreateInitialFileList); + t.IsBackground = true; t.Start(); } else @@ -1474,7 +1476,9 @@ public class FileManagement if (lineCount != fileCount) { + Util.ConsolePrint("WARNING - Initial File List is not relevant to file path. Regenerating.", 5); Thread t = new Thread(CreateInitialFileList); + t.IsBackground = true; t.Start(); } } @@ -1486,6 +1490,8 @@ public class FileManagement string[] fileListToIgnore = File.ReadAllLines(filterPath); string FileName = GlobalPaths.ConfigDir + "\\InitialFileList.txt"; + File.Create(FileName).Close(); + using (var txt = File.CreateText(FileName)) { DirectoryInfo dinfo = new DirectoryInfo(GlobalPaths.RootPath); @@ -1504,6 +1510,8 @@ public class FileManagement } } } + + Util.ConsolePrint("File list generation finished.", 4); } } #endregion \ No newline at end of file diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs index c625c18..bb080d2 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs @@ -27,7 +27,7 @@ public enum ScriptType #region Global Variables public static class GlobalVars { - #region Launcher State for Discord + #region Discord public enum LauncherState { InLauncher = 0, @@ -38,6 +38,8 @@ public static class GlobalVars InEasterEggGame = 5, LoadingURI = 6 } + + public static DiscordRPC.EventHandlers handlers; #endregion #region Class definitions @@ -64,6 +66,12 @@ public static class GlobalVars public static bool RequestToOutputInfo = false; #endregion +#if LAUNCHER + #region Novetus Launcher + public static NovetusLauncher.NovetusConsole consoleForm = null; + #endregion +#endif + #region Customization public static string Loadout = ""; public static string soloLoadout = ""; @@ -97,6 +105,10 @@ public static class GlobalVars public static bool NoFileList = false; public static string ServerID = "N/A"; public static string PingURL = ""; + public static string Important = ""; + public static string Important2 = ""; + public static string NextCommand = ""; + public static bool AppClosed = false; #endregion } #endregion diff --git a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs index 310fe7a..83405c9 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs @@ -129,11 +129,7 @@ public class NovetusFuncs return UHWID.UHWIDEngine.AdvancedUid; } -#if LAUNCHER - public static void PingMasterServer(bool online, string reason, RichTextBox box) -#else public static void PingMasterServer(bool online, string reason) -#endif { if (online) { @@ -294,6 +290,15 @@ public class NovetusFuncs return finalUrl; } + + public static void SetupAdminPassword() + { + CryptoRandom random = new CryptoRandom(); + string Name1 = SecurityFuncs.GenerateName(random.Next(4, 12)); + string Name2 = SecurityFuncs.GenerateName(random.Next(4, 12)); + GlobalVars.Important = Name1 + Name2; + GlobalVars.Important2 = SecurityFuncs.Encipher(GlobalVars.Important, random.Next(2, 13)); + } } #endregion diff --git a/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs index 001333c..7d8af62 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs @@ -331,7 +331,6 @@ public class SecurityFuncs return ipAddress; } -#if LAUNCHER //modified from https://stackoverflow.com/questions/14687658/random-name-generator-in-c-sharp public static string GenerateName(int len) { @@ -379,6 +378,5 @@ public class SecurityFuncs { return Encipher(input, 26 - key); } -#endif } #endregion \ No newline at end of file diff --git a/Novetus/NovetusCore/StorageAndFunctions/Util.cs b/Novetus/NovetusCore/StorageAndFunctions/Util.cs index 5787261..2f1f6fc 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/Util.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/Util.cs @@ -14,6 +14,9 @@ using NLog; using System.Text.RegularExpressions; using System.Drawing.Imaging; using System.Runtime.InteropServices; +#if !BASICLAUNCHER +using Mono.Nat; +#endif #endregion #region Utils @@ -600,7 +603,43 @@ public static class Util return (p <= 0); } - public static void ConsolePrint(string text, int type, bool notime = false, bool noLog = false) + private static void FormPrint(string text, int type, RichTextBox box, bool noTime = false) + { + if (box == null) + return; + + if (!noTime) + { + box.AppendText("[" + DateTime.Now.ToShortTimeString() + "] - ", Color.White); + } + + switch (type) + { + case 1: + box.AppendText(text, Color.White); + break; + case 2: + box.AppendText(text, Color.Red); + break; + case 3: + box.AppendText(text, Color.Lime); + break; + case 4: + box.AppendText(text, Color.Aqua); + break; + case 5: + box.AppendText(text, Color.Yellow); + break; + case 0: + default: + box.AppendText(text, Color.Black); + break; + } + + box.AppendText(Environment.NewLine, Color.White); + } + + public static void ConsolePrint(string text, int type = 1, bool notime = false, bool noLog = false) { if (!notime) { @@ -609,43 +648,195 @@ public static class Util switch (type) { + case 0: + ConsoleText(text, ConsoleColor.Black, true); + break; case 2: - ConsoleText(text, ConsoleColor.Red); + ConsoleText(text, ConsoleColor.Red, true); if (!noLog) LogPrint(text, 2); break; case 3: - ConsoleText(text, ConsoleColor.Green); + ConsoleText(text, ConsoleColor.Green, true); if (!noLog) LogPrint(text); break; case 4: - ConsoleText(text, ConsoleColor.Cyan); + ConsoleText(text, ConsoleColor.Cyan, true); if (!noLog) LogPrint(text); break; case 5: - ConsoleText(text, ConsoleColor.Yellow); + ConsoleText(text, ConsoleColor.Yellow, true); if (!noLog) LogPrint(text, 3); break; case 1: default: - ConsoleText(text, ConsoleColor.White); + ConsoleText(text, ConsoleColor.White, true); if (!noLog) LogPrint(text); break; } - ConsoleText(Environment.NewLine, ConsoleColor.White); +#if LAUNCHER + if (GlobalVars.consoleForm != null) + { + FormPrint(text, type, GlobalVars.consoleForm.ConsoleBox, notime); + } +#endif } - public static void ConsoleText(string text, ConsoleColor color) + private static void ConsoleText(string text, ConsoleColor color, bool newLine = false) { Console.ForegroundColor = color; - Console.Write(text); + if (newLine) + { + Console.WriteLine(text); + } + else + { + Console.Write(text); + } } #endregion + +#if !BASICLAUNCHER + #region UPnP + public static void InitUPnP() + { + if (GlobalVars.UserConfiguration.UPnP) + { + try + { + NetFuncs.InitUPnP(DeviceFound, DeviceLost); + Util.ConsolePrint("UPnP: Service initialized", 3); + } + catch (Exception ex) + { + Util.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to initialize UPnP. Reason - " + ex.Message, 2); + } + } + } + + public static void StartUPnP(INatDevice device, Protocol protocol, int port) + { + if (GlobalVars.UserConfiguration.UPnP) + { + try + { + NetFuncs.StartUPnP(device, protocol, port); + string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); + Util.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3); + } + catch (Exception ex) + { + Util.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2); + } + } + } + + public static void StopUPnP(INatDevice device, Protocol protocol, int port) + { + if (GlobalVars.UserConfiguration.UPnP) + { + try + { + NetFuncs.StopUPnP(device, protocol, port); + string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); + Util.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3); + } + catch (Exception ex) + { + Util.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2); + } + } + } + + public static void DeviceFound(object sender, DeviceEventArgs args) + { + try + { + INatDevice device = args.Device; + string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); + Util.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3); + StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); + StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); + } + catch (Exception ex) + { + Util.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2); + } + } + + public static void DeviceLost(object sender, DeviceEventArgs args) + { + try + { + INatDevice device = args.Device; + string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); + Util.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3); + StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); + StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); + } + catch (Exception ex) + { + Util.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2); + } + } + #endregion + + #region Discord + public static void ReadyCallback() + { + Util.ConsolePrint("Discord RPC: Ready", 3); + } + + public static void DisconnectedCallback(int errorCode, string message) + { + Util.ConsolePrint("Discord RPC: Disconnected. Reason - " + errorCode + ": " + message, 2); + } + + public static void ErrorCallback(int errorCode, string message) + { + Util.ConsolePrint("Discord RPC: Error. Reason - " + errorCode + ": " + message, 2); + } + + public static void JoinCallback(string secret) + { + } + + public static void SpectateCallback(string secret) + { + } + + public static void RequestCallback(DiscordRPC.JoinRequest request) + { + } + + public static void StartDiscord() + { + if (GlobalVars.UserConfiguration.DiscordPresence) + { + GlobalVars.handlers = new DiscordRPC.EventHandlers(); + GlobalVars.handlers.readyCallback = ReadyCallback; + GlobalVars.handlers.disconnectedCallback += DisconnectedCallback; + GlobalVars.handlers.errorCallback += ErrorCallback; + GlobalVars.handlers.joinCallback += JoinCallback; + GlobalVars.handlers.spectateCallback += SpectateCallback; + GlobalVars.handlers.requestCallback += RequestCallback; + DiscordRPC.Initialize(GlobalVars.appid, ref GlobalVars.handlers, true, ""); + + ClientManagement.UpdateRichPresence(ClientManagement.GetStateForType(GlobalVars.GameOpened), true); + } + } + #endregion +#endif } #endregion diff --git a/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs b/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs index 7296276..dcae6a6 100644 --- a/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs +++ b/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs @@ -22,7 +22,6 @@ public class ModManager private SaveFileDialog saveFileDialog1; private string installOutcome = ""; private int fileListDisplay = 0; - private RichTextBox consoleBox; private CancellationTokenSource tokenSource; private int pastPercentage = 0; @@ -31,12 +30,6 @@ public class ModManager Init(mode); } - public ModManager(ModMode mode, RichTextBox box) - { - consoleBox = box; - Init(mode); - } - public void Init(ModMode mode) { Application.ApplicationExit += new EventHandler(OnApplicationExit); diff --git a/Novetus/NovetusLauncher/Classes/LocalVars.cs b/Novetus/NovetusLauncher/Classes/LocalVars.cs index 8f137b5..0f4c153 100644 --- a/Novetus/NovetusLauncher/Classes/LocalVars.cs +++ b/Novetus/NovetusLauncher/Classes/LocalVars.cs @@ -9,10 +9,6 @@ namespace NovetusLauncher public static string prevsplash = ""; public static bool launcherInitState = true; #endregion - #region Commands - public static string important = ""; - public static string important2 = ""; - #endregion } #endregion } diff --git a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs index 7593f81..78b1513 100644 --- a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs +++ b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs @@ -40,7 +40,7 @@ namespace NovetusLauncher #region Form Events private void CustomGraphicsOptions_Load(object sender, EventArgs e) { - ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null); + ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); info = ClientManagement.GetClientInfoValues(GlobalVars.UserConfiguration.SelectedClient); string terms = "_" + GlobalVars.UserConfiguration.SelectedClient; @@ -441,7 +441,7 @@ namespace NovetusLauncher private void CustomGraphicsOptions_Close(object sender, FormClosingEventArgs e) { - ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null); + ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); ClientManagement.ApplyClientSettings_custom(info, GlobalVars.UserConfiguration.SelectedClient, MeshDetail, ShadingQuality, MaterialQuality, AA, AASamples, Bevels, Shadows_2008, Shadows_2007, Style_2007, QualityLevel, WindowResolution, FullscreenResolution, ModernResolution); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs index 07f53c4..a4ab644 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs @@ -103,8 +103,6 @@ namespace NovetusLauncher this.listBox3 = new System.Windows.Forms.ListBox(); this.label21 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); - this.tabPage7 = new System.Windows.Forms.TabPage(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.tabPage8 = new System.Windows.Forms.TabPage(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.tabPage5 = new System.Windows.Forms.TabPage(); @@ -171,7 +169,6 @@ namespace NovetusLauncher this.tabPage3.SuspendLayout(); this.tabPage4.SuspendLayout(); this.tabPage6.SuspendLayout(); - this.tabPage7.SuspendLayout(); this.tabPage8.SuspendLayout(); this.tabPage5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); @@ -184,7 +181,6 @@ namespace NovetusLauncher this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Controls.Add(this.tabPage6); - this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage8); this.tabControl1.Controls.Add(this.tabPage5); this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -196,7 +192,6 @@ namespace NovetusLauncher this.tabControl1.Size = new System.Drawing.Size(413, 284); this.tabControl1.TabIndex = 1; this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); - this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.launcherForm_KeyDown); // // tabPage1 // @@ -865,33 +860,6 @@ namespace NovetusLauncher this.label14.TabIndex = 0; this.label14.Text = "SERVERS"; // - // tabPage7 - // - this.tabPage7.BackColor = System.Drawing.SystemColors.ControlText; - this.tabPage7.Controls.Add(this.richTextBox1); - this.tabPage7.Location = new System.Drawing.Point(4, 22); - this.tabPage7.Name = "tabPage7"; - this.tabPage7.Padding = new System.Windows.Forms.Padding(3); - this.tabPage7.Size = new System.Drawing.Size(405, 258); - this.tabPage7.TabIndex = 7; - this.tabPage7.Text = "CMD"; - // - // richTextBox1 - // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.richTextBox1.BackColor = System.Drawing.SystemColors.ControlText; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.richTextBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.richTextBox1.ForeColor = System.Drawing.Color.White; - this.richTextBox1.Location = new System.Drawing.Point(3, 3); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(399, 255); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = ""; - this.richTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown); - // // tabPage8 // this.tabPage8.Controls.Add(this.richTextBox2); @@ -1098,7 +1066,7 @@ namespace NovetusLauncher this.SettingsButton.Name = "SettingsButton"; this.SettingsButton.Size = new System.Drawing.Size(61, 34); this.SettingsButton.TabIndex = 10; - this.SettingsButton.Text = "Settings"; + this.SettingsButton.Text = "Graphics Settings"; this.SettingsButton.UseVisualStyleBackColor = true; this.SettingsButton.Click += new System.EventHandler(this.SettingsButtonClick); // @@ -1462,7 +1430,6 @@ namespace NovetusLauncher this.tabPage4.ResumeLayout(false); this.tabPage4.PerformLayout(); this.tabPage6.ResumeLayout(false); - this.tabPage7.ResumeLayout(false); this.tabPage8.ResumeLayout(false); this.tabPage5.ResumeLayout(false); this.tabPage5.PerformLayout(); @@ -1478,7 +1445,6 @@ namespace NovetusLauncher launcherForm = new LauncherFormShared(); launcherForm.Parent = this; launcherForm.FormStyle = Settings.Style.Compact; - launcherForm.ConsoleBox = richTextBox1; launcherForm.Tabs = tabControl1; launcherForm.MapDescBox = textBox4; launcherForm.ServerInfo = textBox3; @@ -1519,7 +1485,6 @@ namespace NovetusLauncher launcherForm.IPBox = textBox1; launcherForm.ServerBrowserNameBox = textBox7; launcherForm.ServerBrowserAddressBox = textBox8; - launcherForm.ConsolePage = tabPage7; } private System.Windows.Forms.CheckBox checkBox4; @@ -1540,8 +1505,6 @@ namespace NovetusLauncher private System.Windows.Forms.Label label29; private System.Windows.Forms.RichTextBox richTextBox2; private System.Windows.Forms.TabPage tabPage8; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.Windows.Forms.TabPage tabPage7; private System.Windows.Forms.Button button19; private System.Windows.Forms.Button button18; private System.Windows.Forms.Button button16; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index a226042..95bf7a1 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -180,16 +180,6 @@ namespace NovetusLauncher launcherForm.AddIPPortListing(listBox4, GlobalPaths.ConfigDir + "\\ports.txt", GlobalVars.JoinPort); } - void richTextBox1_KeyDown(object sender, KeyEventArgs e) - { - launcherForm.ProcessConsole(e); - } - - void launcherForm_KeyDown(object sender, KeyEventArgs e) - { - launcherForm.SwapToConsole(e); - } - void NumericUpDown1ValueChanged(object sender, EventArgs e) { launcherForm.ChangeJoinPort(); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx index 0aab3fc..301266d 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx @@ -136,7 +136,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0 - CQAAAk1TRnQBSQFMAgEBAgEAAXgBAAF4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAAYABAAGAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs index 68384d4..aacfc7c 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs @@ -63,7 +63,6 @@ namespace NovetusLauncher this.panel1 = new System.Windows.Forms.Panel(); this.button33 = new System.Windows.Forms.Button(); this.button32 = new System.Windows.Forms.Button(); - this.button31 = new System.Windows.Forms.Button(); this.button30 = new System.Windows.Forms.Button(); this.button29 = new System.Windows.Forms.Button(); this.button28 = new System.Windows.Forms.Button(); @@ -129,8 +128,6 @@ namespace NovetusLauncher this.listBox3 = new System.Windows.Forms.ListBox(); this.label21 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); - this.tabPage7 = new System.Windows.Forms.TabPage(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.tabPage8 = new System.Windows.Forms.TabPage(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.tabPage5 = new System.Windows.Forms.TabPage(); @@ -164,7 +161,6 @@ namespace NovetusLauncher this.tabPage3.SuspendLayout(); this.tabPage4.SuspendLayout(); this.tabPage6.SuspendLayout(); - this.tabPage7.SuspendLayout(); this.tabPage8.SuspendLayout(); this.tabPage5.SuspendLayout(); this.panel5.SuspendLayout(); @@ -176,9 +172,9 @@ namespace NovetusLauncher // button25 // this.button25.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button25.Location = new System.Drawing.Point(306, 3); + this.button25.Location = new System.Drawing.Point(369, 3); this.button25.Name = "button25"; - this.button25.Size = new System.Drawing.Size(104, 20); + this.button25.Size = new System.Drawing.Size(113, 20); this.button25.TabIndex = 56; this.button25.Text = "Install Mod Package"; this.button25.UseVisualStyleBackColor = true; @@ -235,9 +231,9 @@ namespace NovetusLauncher // button8 // this.button8.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button8.Location = new System.Drawing.Point(78, 3); + this.button8.Location = new System.Drawing.Point(12, 3); this.button8.Name = "button8"; - this.button8.Size = new System.Drawing.Size(104, 20); + this.button8.Size = new System.Drawing.Size(113, 20); this.button8.TabIndex = 35; this.button8.Text = "Customize Character"; this.button8.UseVisualStyleBackColor = true; @@ -246,9 +242,9 @@ namespace NovetusLauncher // button3 // this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button3.Location = new System.Drawing.Point(188, 3); + this.button3.Location = new System.Drawing.Point(131, 3); this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(72, 20); + this.button3.Size = new System.Drawing.Size(113, 20); this.button3.TabIndex = 6; this.button3.Text = "Launch Studio"; this.button3.UseVisualStyleBackColor = true; @@ -290,11 +286,11 @@ namespace NovetusLauncher // label11 // this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label11.Location = new System.Drawing.Point(3, 212); + this.label11.Location = new System.Drawing.Point(3, 180); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(75, 48); + this.label11.Size = new System.Drawing.Size(75, 88); this.label11.TabIndex = 50; - this.label11.Text = "v1.0"; + this.label11.Text = "v1.4\r\nwill never\r\nbe a\r\nthing"; this.label11.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // label12 @@ -318,7 +314,7 @@ namespace NovetusLauncher // // button20 // - this.button20.Location = new System.Drawing.Point(3, 30); + this.button20.Location = new System.Drawing.Point(3, 29); this.button20.Name = "button20"; this.button20.Size = new System.Drawing.Size(75, 23); this.button20.TabIndex = 57; @@ -343,7 +339,6 @@ namespace NovetusLauncher this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panel1.Controls.Add(this.button33); this.panel1.Controls.Add(this.button32); - this.panel1.Controls.Add(this.button31); this.panel1.Controls.Add(this.button30); this.panel1.Controls.Add(this.button29); this.panel1.Controls.Add(this.label11); @@ -357,7 +352,7 @@ namespace NovetusLauncher // // button33 // - this.button33.Location = new System.Drawing.Point(3, 186); + this.button33.Location = new System.Drawing.Point(3, 154); this.button33.Name = "button33"; this.button33.Size = new System.Drawing.Size(75, 23); this.button33.TabIndex = 64; @@ -368,7 +363,7 @@ namespace NovetusLauncher // // button32 // - this.button32.Location = new System.Drawing.Point(3, 160); + this.button32.Location = new System.Drawing.Point(3, 129); this.button32.Name = "button32"; this.button32.Size = new System.Drawing.Size(75, 23); this.button32.TabIndex = 63; @@ -377,20 +372,9 @@ namespace NovetusLauncher this.button32.UseVisualStyleBackColor = true; this.button32.Click += new System.EventHandler(this.button32_Click); // - // button31 - // - this.button31.Location = new System.Drawing.Point(3, 134); - this.button31.Name = "button31"; - this.button31.Size = new System.Drawing.Size(75, 23); - this.button31.TabIndex = 62; - this.button31.TabStop = false; - this.button31.Text = "CONSOLE"; - this.button31.UseVisualStyleBackColor = true; - this.button31.Click += new System.EventHandler(this.button31_Click); - // // button30 // - this.button30.Location = new System.Drawing.Point(3, 108); + this.button30.Location = new System.Drawing.Point(3, 104); this.button30.Name = "button30"; this.button30.Size = new System.Drawing.Size(75, 23); this.button30.TabIndex = 61; @@ -401,7 +385,7 @@ namespace NovetusLauncher // // button29 // - this.button29.Location = new System.Drawing.Point(3, 82); + this.button29.Location = new System.Drawing.Point(3, 79); this.button29.Name = "button29"; this.button29.Size = new System.Drawing.Size(75, 23); this.button29.TabIndex = 60; @@ -412,7 +396,7 @@ namespace NovetusLauncher // // button28 // - this.button28.Location = new System.Drawing.Point(3, 56); + this.button28.Location = new System.Drawing.Point(3, 54); this.button28.Name = "button28"; this.button28.Size = new System.Drawing.Size(75, 23); this.button28.TabIndex = 59; @@ -424,11 +408,11 @@ namespace NovetusLauncher // button34 // this.button34.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button34.Location = new System.Drawing.Point(266, 3); + this.button34.Location = new System.Drawing.Point(250, 3); this.button34.Name = "button34"; - this.button34.Size = new System.Drawing.Size(34, 20); + this.button34.Size = new System.Drawing.Size(113, 20); this.button34.TabIndex = 60; - this.button34.Text = "SDK"; + this.button34.Text = "Novetus SDK"; this.button34.UseVisualStyleBackColor = true; this.button34.Click += new System.EventHandler(this.button34_Click); // @@ -449,7 +433,6 @@ namespace NovetusLauncher this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Controls.Add(this.tabPage6); - this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage8); this.tabControl1.Controls.Add(this.tabPage5); this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -461,7 +444,6 @@ namespace NovetusLauncher this.tabControl1.TabIndex = 1; this.tabControl1.TabStop = false; this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); - this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.launcherForm_KeyDown); // // tabPage1 // @@ -1123,32 +1105,6 @@ namespace NovetusLauncher this.label14.Text = "SERVERS"; this.label14.TextAlign = System.Drawing.ContentAlignment.TopCenter; // - // tabPage7 - // - this.tabPage7.BackColor = System.Drawing.SystemColors.ControlText; - this.tabPage7.Controls.Add(this.richTextBox1); - this.tabPage7.Location = new System.Drawing.Point(4, 4); - this.tabPage7.Name = "tabPage7"; - this.tabPage7.Padding = new System.Windows.Forms.Padding(3); - this.tabPage7.Size = new System.Drawing.Size(625, 265); - this.tabPage7.TabIndex = 7; - this.tabPage7.Text = "CONSOLE"; - // - // richTextBox1 - // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.richTextBox1.BackColor = System.Drawing.SystemColors.ControlText; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.richTextBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.richTextBox1.ForeColor = System.Drawing.Color.White; - this.richTextBox1.Location = new System.Drawing.Point(3, 3); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(616, 256); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = ""; - this.richTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown); - // // tabPage8 // this.tabPage8.Controls.Add(this.richTextBox2); @@ -1205,11 +1161,11 @@ namespace NovetusLauncher // // button36 // - this.button36.Location = new System.Drawing.Point(401, 27); + this.button36.Location = new System.Drawing.Point(396, 27); this.button36.Name = "button36"; - this.button36.Size = new System.Drawing.Size(60, 26); + this.button36.Size = new System.Drawing.Size(100, 26); this.button36.TabIndex = 77; - this.button36.Text = "Settings"; + this.button36.Text = "Graphics Settings"; this.button36.UseVisualStyleBackColor = true; this.button36.Click += new System.EventHandler(this.button36_Click); // @@ -1276,7 +1232,7 @@ namespace NovetusLauncher // button9 // this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button9.Location = new System.Drawing.Point(198, 27); + this.button9.Location = new System.Drawing.Point(193, 27); this.button9.Name = "button9"; this.button9.Size = new System.Drawing.Size(83, 26); this.button9.TabIndex = 37; @@ -1287,7 +1243,7 @@ namespace NovetusLauncher // button26 // this.button26.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button26.Location = new System.Drawing.Point(287, 27); + this.button26.Location = new System.Drawing.Point(282, 27); this.button26.Name = "button26"; this.button26.Size = new System.Drawing.Size(108, 26); this.button26.TabIndex = 57; @@ -1298,7 +1254,7 @@ namespace NovetusLauncher // button5 // this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button5.Location = new System.Drawing.Point(109, 27); + this.button5.Location = new System.Drawing.Point(104, 27); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(83, 26); this.button5.TabIndex = 10; @@ -1434,7 +1390,6 @@ namespace NovetusLauncher this.tabPage4.ResumeLayout(false); this.tabPage4.PerformLayout(); this.tabPage6.ResumeLayout(false); - this.tabPage7.ResumeLayout(false); this.tabPage8.ResumeLayout(false); this.tabPage5.ResumeLayout(false); this.panel5.ResumeLayout(false); @@ -1453,7 +1408,6 @@ namespace NovetusLauncher launcherForm = new LauncherFormShared(); launcherForm.Parent = this; launcherForm.FormStyle = Settings.Style.Extended; - launcherForm.ConsoleBox = richTextBox1; launcherForm.Tabs = tabControl1; launcherForm.MapDescBox = textBox4; launcherForm.ServerInfo = textBox3; @@ -1494,7 +1448,6 @@ namespace NovetusLauncher launcherForm.IPBox = textBox1; launcherForm.ServerBrowserNameBox = textBox7; launcherForm.ServerBrowserAddressBox = textBox8; - launcherForm.ConsolePage = tabPage7; } private System.Windows.Forms.CheckBox checkBox4; @@ -1513,8 +1466,6 @@ namespace NovetusLauncher private System.Windows.Forms.Label label29; private System.Windows.Forms.RichTextBox richTextBox2; private System.Windows.Forms.TabPage tabPage8; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.Windows.Forms.TabPage tabPage7; private System.Windows.Forms.Button button19; private System.Windows.Forms.Button button18; private System.Windows.Forms.Button button16; @@ -1581,7 +1532,6 @@ namespace NovetusLauncher private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button button33; private System.Windows.Forms.Button button32; - private System.Windows.Forms.Button button31; private System.Windows.Forms.Button button30; private System.Windows.Forms.Button button29; private System.Windows.Forms.Button button28; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index fcf1b64..7d9ec54 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -184,16 +184,6 @@ namespace NovetusLauncher { launcherForm.AddIPPortListing(listBox4, GlobalPaths.ConfigDir + "\\ports.txt", GlobalVars.JoinPort); } - - void richTextBox1_KeyDown(object sender, KeyEventArgs e) - { - launcherForm.ProcessConsole(e); - } - - void launcherForm_KeyDown(object sender, KeyEventArgs e) - { - launcherForm.SwapToConsole(e); - } void NumericUpDown1ValueChanged(object sender, EventArgs e) { @@ -291,11 +281,6 @@ namespace NovetusLauncher tabControl1.SelectedTab = tabPage6; } - private void button31_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage7; - } - private void button32_Click(object sender, EventArgs e) { tabControl1.SelectedTab = tabPage8; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx index f6a5bd4..f8e32a7 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx @@ -136,7 +136,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0 - CQAAAk1TRnQBSQFMAgEBAgEAAdABAAHQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAAdgBAAHYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index 657d825..9d009ad 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -38,7 +38,6 @@ namespace NovetusLauncher public class LauncherFormShared { #region Variables - public DiscordRPC.EventHandlers handlers; public List CurrentNodeMatches = new List(); public int LastNodeIndex = 0; public string LastSearchText; @@ -47,9 +46,8 @@ namespace NovetusLauncher //CONTROLS public Form Parent = null; public Settings.Style FormStyle = Settings.Style.None; - public RichTextBox ConsoleBox, ChangelogBox, ReadmeBox = null; + public RichTextBox ChangelogBox, ReadmeBox = null; public TabControl Tabs = null; - public TabPage ConsolePage = null; public TextBox MapDescBox, ServerInfo, SearchBar, PlayerIDTextBox, PlayerNameTextBox, ClientDescriptionBox, IPBox, ServerBrowserNameBox, ServerBrowserAddressBox = null; public TreeView Tree, _TreeCache = null; @@ -64,154 +62,17 @@ namespace NovetusLauncher private ToolTip contextToolTip; #endregion - #region UPnP - public void InitUPnP() - { - if (GlobalVars.UserConfiguration.UPnP) - { - try - { - NetFuncs.InitUPnP(DeviceFound, DeviceLost); - Util.ConsolePrint("UPnP: Service initialized", 3); - } - catch (Exception ex) - { - Util.LogExceptions(ex); - Util.ConsolePrint("UPnP: Unable to initialize UPnP. Reason - " + ex.Message, 2); - } - } - } - - public void StartUPnP(INatDevice device, Protocol protocol, int port) - { - if (GlobalVars.UserConfiguration.UPnP) - { - try - { - NetFuncs.StartUPnP(device, protocol, port); - string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - Util.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3); - } - catch (Exception ex) - { - Util.LogExceptions(ex); - Util.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2); - } - } - } - - public void StopUPnP(INatDevice device, Protocol protocol, int port) - { - if (GlobalVars.UserConfiguration.UPnP) - { - try - { - NetFuncs.StopUPnP(device, protocol, port); - string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - Util.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3); - } - catch (Exception ex) - { - Util.LogExceptions(ex); - Util.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2); - } - } - } - - public void DeviceFound(object sender, DeviceEventArgs args) - { - try - { - INatDevice device = args.Device; - string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - Util.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3); - StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); - StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); - } - catch (Exception ex) - { - Util.LogExceptions(ex); - Util.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2); - } - } - - public void DeviceLost(object sender, DeviceEventArgs args) - { - try - { - INatDevice device = args.Device; - string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - Util.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3); - StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); - StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); - } - catch (Exception ex) - { - Util.LogExceptions(ex); - Util.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2); - } - } - #endregion - - #region Discord - public void ReadyCallback() - { - Util.ConsolePrint("Discord RPC: Ready", 3); - } - - public void DisconnectedCallback(int errorCode, string message) - { - Util.ConsolePrint("Discord RPC: Disconnected. Reason - " + errorCode + ": " + message, 2); - } - - public void ErrorCallback(int errorCode, string message) - { - Util.ConsolePrint("Discord RPC: Error. Reason - " + errorCode + ": " + message, 2); - } - - public void JoinCallback(string secret) - { - } - - public void SpectateCallback(string secret) - { - } - - public void RequestCallback(DiscordRPC.JoinRequest request) - { - } - - public void StartDiscord() - { - if (GlobalVars.UserConfiguration.DiscordPresence) - { - handlers = new DiscordRPC.EventHandlers(); - handlers.readyCallback = ReadyCallback; - handlers.disconnectedCallback += DisconnectedCallback; - handlers.errorCallback += ErrorCallback; - handlers.joinCallback += JoinCallback; - handlers.spectateCallback += SpectateCallback; - handlers.requestCallback += RequestCallback; - DiscordRPC.Initialize(GlobalVars.appid, ref handlers, true, ""); - - ClientManagement.UpdateRichPresence(ClientManagement.GetStateForType(GlobalVars.GameOpened), true); - } - } - #endregion + #region Form Event Functions public void InitForm() { - FileManagement.CreateInitialFileListIfNeededMulti(); - HideMasterAddressWarning = false; if (FormStyle != Settings.Style.Stylish) { Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version; } - Util.ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4); - Util.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 4); if (FormStyle != Settings.Style.Stylish) { @@ -234,27 +95,6 @@ namespace NovetusLauncher } } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) - { - Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5); - WriteConfigValues(); - } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) - { - Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization + " not found. Creating one with default values.", 5); - WriteCustomizationValues(); - } - if (!File.Exists(GlobalPaths.ConfigDir + "\\servers.txt")) - { - Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\servers.txt not found. Creating empty file.", 5); - File.Create(GlobalPaths.ConfigDir + "\\servers.txt").Dispose(); - } - if (!File.Exists(GlobalPaths.ConfigDir + "\\ports.txt")) - { - Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\ports.txt not found. Creating empty file.", 5); - File.Create(GlobalPaths.ConfigDir + "\\ports.txt").Dispose(); - } - if (FormStyle == Settings.Style.Stylish) { Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version + " [CLIENT: " + @@ -262,10 +102,6 @@ namespace NovetusLauncher GlobalVars.UserConfiguration.Map + "]"; } - FileManagement.CreateAssetCacheDirectories(); - - SetupImportantData(); - Splash splash = SplashReader.GetSplash(); SplashLabel.Text = splash.SplashText; @@ -286,9 +122,6 @@ namespace NovetusLauncher ReadConfigValues(true); } - InitUPnP(); - StartDiscord(); - if (FormStyle != Settings.Style.Stylish) { LocalVars.launcherInitState = false; @@ -349,11 +182,13 @@ namespace NovetusLauncher { DiscordRPC.Shutdown(); } - Application.Exit(); + + if (!GlobalVars.AppClosed) + { + GlobalVars.AppClosed = true; + } } - - public void ChangeTabs() { switch (Tabs.SelectedTab) @@ -497,19 +332,19 @@ namespace NovetusLauncher switch (gameType) { case ScriptType.Client: - ClientManagement.LaunchRBXClient(ScriptType.Client, false, true, new EventHandler(ClientExited), ConsoleBox); + ClientManagement.LaunchRBXClient(ScriptType.Client, false, true, new EventHandler(ClientExited)); break; case ScriptType.Server: - ClientManagement.LaunchRBXClient(ScriptType.Server, no3d, false, new EventHandler(ServerExited), ConsoleBox); + ClientManagement.LaunchRBXClient(ScriptType.Server, no3d, false, new EventHandler(ServerExited)); break; case ScriptType.Solo: - ClientManagement.LaunchRBXClient(ScriptType.Solo, false, false, new EventHandler(SoloExited), ConsoleBox); + ClientManagement.LaunchRBXClient(ScriptType.Solo, false, false, new EventHandler(SoloExited)); break; case ScriptType.Studio: - ClientManagement.LaunchRBXClient(ScriptType.Studio, false, nomap, new EventHandler(ClientExitedBase), ConsoleBox); + ClientManagement.LaunchRBXClient(ScriptType.Studio, false, nomap, new EventHandler(ClientExitedBase)); break; case ScriptType.EasterEgg: - ClientManagement.LaunchRBXClient(ScriptType.EasterEgg, false, false, new EventHandler(EasterEggExited), ConsoleBox); + ClientManagement.LaunchRBXClient(ScriptType.EasterEgg, false, false, new EventHandler(EasterEggExited)); break; case ScriptType.None: default: @@ -573,7 +408,7 @@ namespace NovetusLauncher void ServerExited(object sender, EventArgs e) { GlobalVars.GameOpened = ScriptType.None; - NovetusFuncs.PingMasterServer(false, "The server has removed itself from the master server list.", ConsoleBox); + NovetusFuncs.PingMasterServer(false, "The server has removed itself from the master server list."); ClientExitedBase(sender, e); } @@ -655,193 +490,6 @@ namespace NovetusLauncher } } - public void ProcessConsole(KeyEventArgs e) - { - //Command proxy - - int totalLines = ConsoleBox.Lines.Length; - if (totalLines > 0) - { - string lastLine = ConsoleBox.Lines[totalLines - 1]; - - if (e.KeyCode == Keys.Enter) - { - ConsoleBox.AppendText(Environment.NewLine, System.Drawing.Color.White); - ConsoleProcessCommands(lastLine); - e.Handled = true; - } - } - - if (e.Modifiers == Keys.Control) - { - switch (e.KeyCode) - { - case Keys.X: - case Keys.Z: - e.Handled = true; - break; - default: - break; - } - } - } - - public void SwapToConsole(KeyEventArgs e) - { - if (e.KeyCode == Keys.Oemtilde) - { - Tabs.SelectedTab = ConsolePage; - e.Handled = true; - } - } - - public void SetupImportantData() - { - CryptoRandom random = new CryptoRandom(); - string Name1 = SecurityFuncs.GenerateName(random.Next(4, 12)); - string Name2 = SecurityFuncs.GenerateName(random.Next(4, 12)); - LocalVars.important = Name1 + Name2; - LocalVars.important2 = SecurityFuncs.Encipher(LocalVars.important, random.Next(2, 9)); - } - - public void ConsoleProcessCommands(string cmd) - { - switch (cmd) - { - case string server when server.Contains("server", StringComparison.InvariantCultureIgnoreCase) == true: - try - { - string[] vals = server.Split(' '); - - if (vals[1].Equals("3d", StringComparison.InvariantCultureIgnoreCase)) - { - StartGame(ScriptType.Server, false, false, true); - } - else if (vals[1].Equals("no3d", StringComparison.InvariantCultureIgnoreCase)) - { - StartGame(ScriptType.Server, true, false, true); - } - else - { - StartGame(ScriptType.Server, false, false, true); - } - } - catch (Exception) - { - StartGame(ScriptType.Server, false, false, true); - } - break; - case string client when string.Compare(client, "client", true, CultureInfo.InvariantCulture) == 0: - StartGame(ScriptType.Client); - break; - case string solo when string.Compare(solo, "solo", true, CultureInfo.InvariantCulture) == 0: - StartGame(ScriptType.Solo); - break; - case string studio when studio.Contains("studio", StringComparison.InvariantCultureIgnoreCase) == true: - try - { - string[] vals = studio.Split(' '); - - if (vals[1].Equals("map", StringComparison.InvariantCultureIgnoreCase)) - { - StartGame(ScriptType.Studio, false, false, true); - } - else if (vals[1].Equals("nomap", StringComparison.InvariantCultureIgnoreCase)) - { - StartGame(ScriptType.Studio, false, true, true); - } - else - { - StartGame(ScriptType.Studio, false, false, true); - } - } - catch (Exception) - { - StartGame(ScriptType.Studio, false, false, true); - } - break; - case string config when config.Contains("config", StringComparison.InvariantCultureIgnoreCase) == true: - try - { - string[] vals = config.Split(' '); - - if (vals[1].Equals("save", StringComparison.InvariantCultureIgnoreCase)) - { - WriteConfigValues(); - } - else if (vals[1].Equals("load", StringComparison.InvariantCultureIgnoreCase)) - { - ReadConfigValues(); - } - else if (vals[1].Equals("reset", StringComparison.InvariantCultureIgnoreCase)) - { - ResetConfigValues(); - } - else - { - Util.ConsolePrint("Please specify 'save', 'load', or 'reset'.", 4); - } - } - catch (Exception) - { - Util.ConsolePrint("Please specify 'save', 'load', or 'reset'.", 4); - } - break; - case string help when string.Compare(help, "help", true, CultureInfo.InvariantCulture) == 0: - ConsoleHelp(); - break; - case string sdk when string.Compare(sdk, "sdk", true, CultureInfo.InvariantCulture) == 0: - LoadLauncher(); - break; - case string dlldelete when string.Compare(dlldelete, "dlldelete", true, CultureInfo.InvariantCulture) == 0: - if (GlobalVars.UserConfiguration.DisableReshadeDelete == true) - { - GlobalVars.UserConfiguration.DisableReshadeDelete = false; - Util.ConsolePrint("ReShade DLL deletion enabled.", 4); - } - else - { - GlobalVars.UserConfiguration.DisableReshadeDelete = true; - Util.ConsolePrint("ReShade DLL deletion disabled.", 4); - } - break; - case string altserverip when altserverip.Contains("altserverip", StringComparison.InvariantCultureIgnoreCase) == true: - try - { - string[] vals = altserverip.Split(' '); - - if (vals[1].Equals("none", StringComparison.InvariantCultureIgnoreCase)) - { - GlobalVars.UserConfiguration.AlternateServerIP = ""; - Util.ConsolePrint("Alternate Server IP removed.", 4); - } - else - { - GlobalVars.UserConfiguration.AlternateServerIP = vals[1]; - Util.ConsolePrint("Alternate Server IP set to " + vals[1], 4); - } - } - catch (Exception) - { - Util.ConsolePrint("Please specify the IP address you would like to set Novetus to.", 4); - } - break; - case string important when string.Compare(important, LocalVars.important, true, CultureInfo.InvariantCulture) == 0: - GlobalVars.AdminMode = true; - Util.ConsolePrint("ADMIN MODE ENABLED.", 4); - Util.ConsolePrint("YOU ARE GOD.", 2); - break; - case string decode when (string.Compare(decode, "decode", true, CultureInfo.InvariantCulture) == 0 || string.Compare(decode, "decrypt", true, CultureInfo.InvariantCulture) == 0): - Decoder de = new Decoder(); - de.Show(); - Util.ConsolePrint("???", 2); - break; - default: - Util.ConsolePrint("Command is either not registered or valid", 2); - break; - } - } - public void LoadLauncher() { NovetusSDK im = new NovetusSDK(); @@ -849,26 +497,6 @@ namespace NovetusLauncher Util.ConsolePrint("Novetus SDK Launcher Loaded.", 4); } - public void ConsoleHelp() - { - Util.ConsolePrint("Help:", 3, true); - Util.ConsolePrint("---------", 1, true); - Util.ConsolePrint("= client | Launches client with launcher settings", 4, true); - Util.ConsolePrint("= solo | Launches client in Play Solo mode with launcher settings", 4, true); - Util.ConsolePrint("= server 3d | Launches server with launcher settings", 4, true); - Util.ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 4, true); - Util.ConsolePrint("= studio map | Launches Roblox Studio with the selected map", 4, true); - Util.ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 4, true); - Util.ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 4, true); - Util.ConsolePrint("= dlldelete | Toggle the deletion of opengl32.dll when ReShade is off.", 4, true); - Util.ConsolePrint("= altserverip | Sets the alternate server IP for server info. Replace with your specified IP or specify 'none' to remove the current alternate server IP", 4, true); - Util.ConsolePrint("---------", 1, true); - Util.ConsolePrint("= config save | Saves the config file", 4, true); - Util.ConsolePrint("= config load | Reloads the config file", 4, true); - Util.ConsolePrint("= config reset | Resets the config file", 4, true); - Util.ConsolePrint(LocalVars.important2, 0, true, true); - } - public void SwitchStyles() { if (LocalVars.launcherInitState) @@ -897,7 +525,6 @@ namespace NovetusLauncher GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Extended; CloseEventInternal(); System.Diagnostics.Process.Start(Application.ExecutablePath); - Application.Exit(); } break; case 1: @@ -906,7 +533,6 @@ namespace NovetusLauncher GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Compact; CloseEventInternal(); System.Diagnostics.Process.Start(Application.ExecutablePath); - Application.Exit(); } break; case 2: @@ -915,7 +541,6 @@ namespace NovetusLauncher GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Stylish; CloseEventInternal(); System.Diagnostics.Process.Start(Application.ExecutablePath); - Application.Exit(); } break; default: @@ -967,7 +592,7 @@ namespace NovetusLauncher public void WriteConfigValues(bool ShowBox = false) { FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); - ClientManagement.ReadClientValues(ConsoleBox); + ClientManagement.ReadClientValues(); Util.ConsolePrint("Config Saved.", 3); if (ShowBox) { @@ -1038,7 +663,7 @@ namespace NovetusLauncher } } - ClientManagement.ReadClientValues(ConsoleBox, initial); + ClientManagement.ReadClientValues(initial); PlayerNameTextBox.Enabled = GlobalVars.SelectedClientInfo.UsesPlayerName; @@ -1080,7 +705,7 @@ namespace NovetusLauncher public async void InstallAddon() { - ModManager addon = new ModManager(ModManager.ModMode.ModInstallation, ConsoleBox); + ModManager addon = new ModManager(ModManager.ModMode.ModInstallation); addon.setFileListDisplay(10); try { @@ -1484,7 +1109,7 @@ namespace NovetusLauncher void SettingsExited(object sender, FormClosingEventArgs e) { - ClientManagement.ReadClientValues(ConsoleBox); + ClientManagement.ReadClientValues(); } #endregion diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs index 06a81ee..be86f82 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs @@ -191,7 +191,7 @@ namespace NovetusLauncher } } - ClientManagement.ReadClientValues(null, initial); + ClientManagement.ReadClientValues(initial); launcherFormStylishInterface1.userNameBox.IsEnabled = GlobalVars.SelectedClientInfo.UsesPlayerName; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml index c6d0a94..8a00fe9 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml @@ -867,7 +867,7 @@