From 045a6725080a248bdf2e42d8942d15f9c785b349 Mon Sep 17 00:00:00 2001 From: Bitl Date: Wed, 14 Sep 2022 07:12:18 -0700 Subject: [PATCH] fixing shit part 4 - the final fix --- Novetus/NovetusCMD/Classes/LocalFuncs.cs | 74 ++++++++--------- Novetus/NovetusCMD/NovetusCMD.cs | 82 +++++++++---------- .../StorageAndFunctions/GlobalPaths.cs | 1 + .../StorageAndFunctions/GlobalVars.cs | 1 - .../StorageAndFunctions/NovetusFuncs.cs | 2 +- .../Classes/Launcher/ModManager.cs | 10 +-- .../Forms/CustomGraphicsOptions.cs | 42 +++++----- .../Compact/LauncherFormCompact.cs | 2 +- .../Extended/LauncherFormExtended.cs | 2 +- .../Stylish/LauncherFormStylish.cs | 12 +-- .../LauncherFormStylishInterface.xaml.cs | 8 +- .../Forms/LauncherFormSettings.cs | 8 +- .../Forms/SDK/AssetDownloader.cs | 12 +-- 13 files changed, 128 insertions(+), 128 deletions(-) diff --git a/Novetus/NovetusCMD/Classes/LocalFuncs.cs b/Novetus/NovetusCMD/Classes/LocalFuncs.cs index e6fa483..48e0de2 100644 --- a/Novetus/NovetusCMD/Classes/LocalFuncs.cs +++ b/Novetus/NovetusCMD/Classes/LocalFuncs.cs @@ -16,43 +16,43 @@ namespace NovetusCMD public static void CommandInfo() { - GlobalFuncs.ConsolePrint("Novetus CMD Command Line Arguments", 3, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("General", 3, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("-help | Displays the help.", 4, true, true); - 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("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Custom server options", 3, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("-upnp | Turns on UPnP.", 4, true, true); - GlobalFuncs.ConsolePrint("-map | Sets the map.", 4, true, true); - GlobalFuncs.ConsolePrint("-client | Sets the client.", 4, true, true); - GlobalFuncs.ConsolePrint("-port | Sets the server port.", 4, true, true); - GlobalFuncs.ConsolePrint("-maxplayers | Sets the number of players.", 4, true, true); - GlobalFuncs.ConsolePrint("-notifications | Toggles server join/leave notifications.", 4, true, true); - GlobalFuncs.ConsolePrint("-serverbrowsername | Changes the name the server uses upon connection to the master server.", 4, true, true); - GlobalFuncs.ConsolePrint("-serverbrowseraddress | Changes the master server address.", 4, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("How to launch:", 3, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Create a shortcut to NovetusCMD in the bin folder of Novetus' Directory or", 4, true, true); - GlobalFuncs.ConsolePrint("create a batch file that launches NovetusCMD.", 4, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Shortcuts", 3, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Right-click your shortcut and then go to Properties -> Shortcut.", 4, true, true); - GlobalFuncs.ConsolePrint("Go to 'Target' and then click the end of where it says 'NovetusCMD.exe'", 4, true, true); - GlobalFuncs.ConsolePrint("Press space and then type in whatever arguments you please.", 4, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Batch", 3, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Click the end of where it says 'NovetusCMD.exe'", 4, true, true); - GlobalFuncs.ConsolePrint("Press space and then type in whatever arguments you please.", 4, true, true); - GlobalFuncs.ConsolePrint("---------", 1, true, true); - GlobalFuncs.ConsolePrint("Press any key to close...", 2, true, true); + Util.ConsolePrint("Novetus CMD Command Line Arguments", 3, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("General", 3, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("-help | Displays the help.", 4, true, true); + Util.ConsolePrint("-no3d | Launches server in NoGraphics mode", 4, true, true); + Util.ConsolePrint("-outputinfo | Outputs all information about the running server to a text file.", 4, true, true); + Util.ConsolePrint("-debug | Disables launching of the server for debugging purposes.", 4, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Custom server options", 3, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("-upnp | Turns on UPnP.", 4, true, true); + Util.ConsolePrint("-map | Sets the map.", 4, true, true); + Util.ConsolePrint("-client | Sets the client.", 4, true, true); + Util.ConsolePrint("-port | Sets the server port.", 4, true, true); + Util.ConsolePrint("-maxplayers | Sets the number of players.", 4, true, true); + Util.ConsolePrint("-notifications | Toggles server join/leave notifications.", 4, true, true); + Util.ConsolePrint("-serverbrowsername | Changes the name the server uses upon connection to the master server.", 4, true, true); + Util.ConsolePrint("-serverbrowseraddress | Changes the master server address.", 4, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("How to launch:", 3, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Create a shortcut to NovetusCMD in the bin folder of Novetus' Directory or", 4, true, true); + Util.ConsolePrint("create a batch file that launches NovetusCMD.", 4, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Shortcuts", 3, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Right-click your shortcut and then go to Properties -> Shortcut.", 4, true, true); + Util.ConsolePrint("Go to 'Target' and then click the end of where it says 'NovetusCMD.exe'", 4, true, true); + Util.ConsolePrint("Press space and then type in whatever arguments you please.", 4, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Batch", 3, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Click the end of where it says 'NovetusCMD.exe'", 4, true, true); + Util.ConsolePrint("Press space and then type in whatever arguments you please.", 4, true, true); + Util.ConsolePrint("---------", 1, true, true); + Util.ConsolePrint("Press any key to close...", 2, true, true); } } #endregion diff --git a/Novetus/NovetusCMD/NovetusCMD.cs b/Novetus/NovetusCMD/NovetusCMD.cs index 080a085..64f1eb2 100644 --- a/Novetus/NovetusCMD/NovetusCMD.cs +++ b/Novetus/NovetusCMD/NovetusCMD.cs @@ -40,12 +40,12 @@ namespace NovetusCMD try { NetFuncs.InitUPnP(DeviceFound,DeviceLost); - GlobalFuncs.ConsolePrint("UPnP: Service initialized", 3); + Util.ConsolePrint("UPnP: Service initialized", 3); } catch (Exception ex) { - GlobalFuncs.ConsolePrint("UPnP: Unable to initialize UPnP. Reason - " + ex.Message, 2); - GlobalFuncs.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to initialize UPnP. Reason - " + ex.Message, 2); + Util.LogExceptions(ex); } } } @@ -58,12 +58,12 @@ namespace NovetusCMD { NetFuncs.StartUPnP(device,protocol,port); string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - GlobalFuncs.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3); + Util.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3); } catch (Exception ex) { - GlobalFuncs.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2); - GlobalFuncs.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2); + Util.LogExceptions(ex); } } } @@ -76,12 +76,12 @@ namespace NovetusCMD { NetFuncs.StopUPnP(device,protocol,port); string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - GlobalFuncs.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3); + Util.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3); } catch (Exception ex) { - GlobalFuncs.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2); - GlobalFuncs.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2); + Util.LogExceptions(ex); } } } @@ -92,14 +92,14 @@ namespace NovetusCMD { INatDevice device = args.Device; string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - GlobalFuncs.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3); + Util.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3); StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); } catch (Exception ex) { - GlobalFuncs.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2); - GlobalFuncs.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2); + Util.LogExceptions(ex); } } @@ -109,14 +109,14 @@ namespace NovetusCMD { INatDevice device = args.Device; string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString(); - GlobalFuncs.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3); + Util.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3); StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); } catch (Exception ex) { - GlobalFuncs.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2); - GlobalFuncs.LogExceptions(ex); + Util.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2); + Util.LogExceptions(ex); } } #endregion @@ -124,16 +124,16 @@ namespace NovetusCMD #region Loading/Saving files static void WriteConfigValues() { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); - GlobalFuncs.ReadClientValues(); - GlobalFuncs.ConsolePrint("Config Saved.", 3); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + ClientManagement.ReadClientValues(); + Util.ConsolePrint("Config Saved.", 3); } static void ReadConfigValues(bool initial = false) { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); - GlobalFuncs.ConsolePrint("Config loaded.", 3); - GlobalFuncs.ReadClientValues(initial); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); + Util.ConsolePrint("Config loaded.", 3); + ClientManagement.ReadClientValues(initial); } #endregion @@ -157,19 +157,19 @@ namespace NovetusCMD if (!LocalVars.PrintHelp) { - GlobalFuncs.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalPaths.InfoName, true, + FileManagement.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalPaths.InfoName, true, GlobalPaths.RootPathLauncher + "\\Novetus.exe"); - GlobalFuncs.TurnOffInitialSequence(); + FileManagement.TurnOffInitialSequence(); Console.Title = "Novetus " + GlobalVars.ProgramInformation.Version + " CMD"; - GlobalFuncs.ConsolePrint("NovetusCMD version " + GlobalVars.ProgramInformation.Version + " loaded.", 1); - GlobalFuncs.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 1); + Util.ConsolePrint("NovetusCMD version " + GlobalVars.ProgramInformation.Version + " loaded.", 1); + Util.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 1); - GlobalFuncs.ConsolePrint("NovetusCMD is now loading main server configurations from the INI file.", 5); + Util.ConsolePrint("NovetusCMD is now loading main server configurations from the INI file.", 5); if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) { - GlobalFuncs.ConsolePrint("WARNING 2 - " + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5); + Util.ConsolePrint("WARNING 2 - " + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5); WriteConfigValues(); } @@ -177,19 +177,19 @@ namespace NovetusCMD LoadOverrideINIArgs(args); InitUPnP(); - GlobalFuncs.ConsolePrint("Launching a " + GlobalVars.UserConfiguration.SelectedClient + " server on " + GlobalVars.UserConfiguration.Map + " with " + GlobalVars.UserConfiguration.PlayerLimit + " players.", 1); + Util.ConsolePrint("Launching a " + GlobalVars.UserConfiguration.SelectedClient + " server on " + GlobalVars.UserConfiguration.Map + " with " + GlobalVars.UserConfiguration.PlayerLimit + " players.", 1); switch (LocalVars.DebugMode) { case true: GlobalVars.RequestToOutputInfo = true; - GlobalFuncs.CreateTXT(); + NovetusFuncs.CreateTXT(); break; case false: default: if (GlobalVars.RequestToOutputInfo) { - GlobalFuncs.CreateTXT(); + NovetusFuncs.CreateTXT(); } StartServer(LocalVars.StartInNo3D); @@ -230,7 +230,7 @@ namespace NovetusCMD if (GlobalVars.RequestToOutputInfo) { - GlobalFuncs.FixedFileDelete(GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName); + Util.FixedFileDelete(GlobalPaths.BasePath + "\\" + GlobalPaths.ServerInfoFileName); } } @@ -251,8 +251,8 @@ namespace NovetusCMD if (CommandLine["no3d"] != null) { LocalVars.StartInNo3D = true; - GlobalFuncs.ConsolePrint("NovetusCMD will now launch the server in No3D mode.", 4); - GlobalFuncs.ConsolePrint("Launching the server without graphics enables better performance. " + + Util.ConsolePrint("NovetusCMD will now launch the server in No3D mode.", 4); + Util.ConsolePrint("Launching the server without graphics enables better performance. " + "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes." + "This feature may also make your server unstable.", 5); } @@ -279,7 +279,7 @@ namespace NovetusCMD { LocalVars.OverrideINI = true; GlobalVars.UserConfiguration.UPnP = true; - GlobalFuncs.ConsolePrint("NovetusCMD will now use UPnP for port forwarding.", 4); + Util.ConsolePrint("NovetusCMD will now use UPnP for port forwarding.", 4); } if (CommandLine["notifications"] != null) @@ -289,11 +289,11 @@ namespace NovetusCMD if (GlobalVars.UserConfiguration.ShowServerNotifications) { - GlobalFuncs.ConsolePrint("NovetusCMD will show notifications on player join/leave.", 4); + Util.ConsolePrint("NovetusCMD will show notifications on player join/leave.", 4); } else { - GlobalFuncs.ConsolePrint("NovetusCMD will no longer show notifications on player join/leave.", 4); + Util.ConsolePrint("NovetusCMD will no longer show notifications on player join/leave.", 4); } } @@ -302,11 +302,11 @@ namespace NovetusCMD LocalVars.OverrideINI = true; GlobalVars.UserConfiguration.Map = CommandLine["map"]; GlobalVars.UserConfiguration.MapPath = CommandLine["map"]; - GlobalFuncs.ConsolePrint("NovetusCMD will now launch the server with the map " + GlobalVars.UserConfiguration.MapPath, 4); + Util.ConsolePrint("NovetusCMD will now launch the server with the map " + GlobalVars.UserConfiguration.MapPath, 4); } else { - GlobalFuncs.ConsolePrint("NovetusCMD will launch the server with the map defined in the INI file.", 4); + Util.ConsolePrint("NovetusCMD will launch the server with the map defined in the INI file.", 4); } if (CommandLine["client"] != null) @@ -316,7 +316,7 @@ namespace NovetusCMD } else { - GlobalFuncs.ConsolePrint("NovetusCMD will launch the server with the client defined in the INI file.", 4); + Util.ConsolePrint("NovetusCMD will launch the server with the client defined in the INI file.", 4); } if (CommandLine["port"] != null) @@ -349,13 +349,13 @@ namespace NovetusCMD #region Client Loading static void StartServer(bool no3d) { - GlobalFuncs.LaunchRBXClient(ScriptType.Server, no3d, false, new System.EventHandler(ServerExited)); + ClientManagement.LaunchRBXClient(ScriptType.Server, no3d, false, new System.EventHandler(ServerExited)); } static void ServerExited(object sender, EventArgs e) { GlobalVars.GameOpened = ScriptType.None; - GlobalFuncs.PingMasterServer(false, "The server has removed itself from the master server list."); + NovetusFuncs.PingMasterServer(false, "The server has removed itself from the master server list."); CloseHandlerInternal(); } diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs index 1a71915..150eac4 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalPaths.cs @@ -118,6 +118,7 @@ public class GlobalPaths public static readonly string PartColorXMLName = "PartColors.xml"; public static readonly string FileDeleteFilterName = "FileDeleteFilter.txt"; public static readonly string InitialFileListIgnoreFilterName = "InitialFileListIgnoreFilter.txt"; + public static readonly string ServerInfoFileName = "serverinfo.txt"; #endregion } #endregion diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs index b0aa279..c625c18 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs @@ -62,7 +62,6 @@ public static class GlobalVars //only for novetuscmd. only here because of launchrbxclient >:( public static int ProcessID = 0; public static bool RequestToOutputInfo = false; - public static string ServerInfoFileName = "serverinfo.txt"; #endregion #region Customization diff --git a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs index 934cef6..d9c6fe3 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs @@ -234,7 +234,7 @@ public class NovetusFuncs URI2 }; - string txt = GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName; + string txt = GlobalPaths.BasePath + "\\" + GlobalPaths.ServerInfoFileName; File.WriteAllLines(txt, text); Util.ConsolePrint("Server Information sent to file " + txt, 4); } diff --git a/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs b/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs index ab143e9..aaa1af7 100644 --- a/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs +++ b/Novetus/NovetusLauncher/Classes/Launcher/ModManager.cs @@ -136,7 +136,7 @@ public class ModManager } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); installOutcome = "Error when installing mod: " + ex.Message; } } @@ -155,7 +155,7 @@ public class ModManager if (intPercent % 25 == 0 && pastPercentage != intPercent) { - GlobalFuncs.ConsolePrint("ModManager - Extracting: " + Util.ConsolePrint("ModManager - Extracting: " + e.CurrentEntry.FileName + ". Progress: " + e.BytesTransferred + "/" + e.TotalBytesToTransfer + " (" + intPercent + "%)", 3, consoleBox, true); @@ -165,7 +165,7 @@ public class ModManager } else if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { - GlobalFuncs.ConsolePrint("ModManager - Extracting: " + e.CurrentEntry.FileName, 3, consoleBox); + Util.ConsolePrint("ModManager - Extracting: " + e.CurrentEntry.FileName, 3, consoleBox); } } @@ -199,7 +199,7 @@ public class ModManager Directory.CreateDirectory(fileInfo.DirectoryName); } - GlobalFuncs.FixedFileMove(originalPath, destPath, true); + Util.FixedFileMove(originalPath, destPath, true); ++filecount; } @@ -232,7 +232,7 @@ public class ModManager } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); installOutcome = "Error when creating mod: " + ex.Message; } } diff --git a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs index 64bda6c..dbe1362 100644 --- a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs +++ b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs @@ -40,8 +40,8 @@ namespace NovetusLauncher #region Form Events private void CustomGraphicsOptions_Load(object sender, EventArgs e) { - GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null); - info = GlobalFuncs.GetClientInfoValues(GlobalVars.UserConfiguration.SelectedClient); + ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null); + info = ClientManagement.GetClientInfoValues(GlobalVars.UserConfiguration.SelectedClient); string terms = "_" + GlobalVars.UserConfiguration.SelectedClient; bool hasFoundDir = false; @@ -63,7 +63,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); return; } @@ -76,7 +76,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsMeshQuality.Enabled = false; } @@ -87,7 +87,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsShadingQuality.Enabled = false; } @@ -98,7 +98,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); try { MaterialQuality = Convert.ToInt32(RobloxXML.GetRenderSettings(doc, "TrussDetail", XMLTypes.Token)); @@ -106,7 +106,7 @@ namespace NovetusLauncher } catch (Exception ex2) { - GlobalFuncs.LogExceptions(ex2); + Util.LogExceptions(ex2); GraphicsMaterialQuality.Enabled = false; } } @@ -118,7 +118,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsAntiAliasing.Enabled = false; } @@ -141,7 +141,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsAASamples.Enabled = false; } @@ -152,7 +152,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsBevels.Enabled = false; } @@ -163,7 +163,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsShadows2008.Enabled = false; } @@ -173,7 +173,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); // try doing march 2007. try { @@ -181,7 +181,7 @@ namespace NovetusLauncher } catch (Exception ex2) { - GlobalFuncs.LogExceptions(ex2); + Util.LogExceptions(ex2); GraphicsShadows2007.Enabled = false; } } @@ -215,7 +215,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); Style2007.Enabled = false; Style2007FolderFinder.Enabled = false; } @@ -227,7 +227,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsLevel.Enabled = false; } @@ -254,7 +254,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsFullscreenResolution.Enabled = false; } @@ -281,7 +281,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsWindowResolution.Enabled = false; } @@ -292,7 +292,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); GraphicsModernResolution.Enabled = false; } @@ -455,8 +455,8 @@ namespace NovetusLauncher private void CustomGraphicsOptions_Close(object sender, FormClosingEventArgs e) { - GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null); - GlobalFuncs.ApplyClientSettings_custom(info, GlobalVars.UserConfiguration.SelectedClient, MeshDetail, ShadingQuality, MaterialQuality, + ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null); + ClientManagement.ApplyClientSettings_custom(info, GlobalVars.UserConfiguration.SelectedClient, MeshDetail, ShadingQuality, MaterialQuality, AA, AASamples, Bevels, Shadows_2008, Shadows_2007, Style_2007, QualityLevel, WindowResolution, FullscreenResolution, ModernResolution); } @@ -494,7 +494,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); return false; } } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index ba361d2..a226042 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -122,7 +122,7 @@ namespace NovetusLauncher void Button8Click(object sender, EventArgs e) { - GlobalFuncs.LaunchCharacterCustomization(); + NovetusFuncs.LaunchCharacterCustomization(); } void Button9Click(object sender, EventArgs e) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index f2c7f56..fcf1b64 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -127,7 +127,7 @@ namespace NovetusLauncher void Button8Click(object sender, EventArgs e) { - GlobalFuncs.LaunchCharacterCustomization(); + NovetusFuncs.LaunchCharacterCustomization(); } void Button9Click(object sender, EventArgs e) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs index 1df521b..3a6343b 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs @@ -83,7 +83,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); } } @@ -97,12 +97,12 @@ namespace NovetusLauncher void splashLabel_Paint(object sender, PaintEventArgs e) { - GlobalFuncs.DrawBorderSimple(e.Graphics, splashLabel.DisplayRectangle, Color.White, ButtonBorderStyle.Solid, 1); + Util.DrawBorderSimple(e.Graphics, splashLabel.DisplayRectangle, Color.White, ButtonBorderStyle.Solid, 1); } public void ReadConfigValues(bool initial = false) { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); launcherFormStylishInterface1.minimizeOnLaunchBox.IsChecked = GlobalVars.UserConfiguration.CloseOnLaunch; launcherFormStylishInterface1.userIDBox.Text = GlobalVars.UserConfiguration.UserID.ToString(); @@ -144,7 +144,7 @@ namespace NovetusLauncher public void WriteConfigValues(bool ShowBox = false) { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); ReadClientValues(); if (ShowBox) { @@ -166,7 +166,7 @@ namespace NovetusLauncher f.Close(); } - GlobalFuncs.ResetConfigValues(Settings.Style.Stylish); + FileManagement.ResetConfigValues(Settings.Style.Stylish); WriteConfigValues(); ReadConfigValues(); if (ShowBox) @@ -193,7 +193,7 @@ namespace NovetusLauncher } } - GlobalFuncs.ReadClientValues(null, initial); + ClientManagement.ReadClientValues(null, initial); launcherFormStylishInterface1.userNameBox.IsEnabled = GlobalVars.SelectedClientInfo.UsesPlayerName; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs index 33b6d21..67268ea 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs @@ -99,7 +99,7 @@ namespace NovetusLauncher } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); } e.Handled = true; @@ -190,7 +190,7 @@ namespace NovetusLauncher GlobalVars.UserConfiguration.SelectedClient + " | MAP: " + GlobalVars.UserConfiguration.Map + "]"; - GlobalFuncs.UpdateRichPresence(GlobalFuncs.GetStateForType(GlobalVars.GameOpened)); + ClientManagement.UpdateRichPresence(ClientManagement.GetStateForType(GlobalVars.GameOpened)); FormCollection fc = System.Windows.Forms.Application.OpenForms; @@ -210,7 +210,7 @@ namespace NovetusLauncher if (!IsLoaded) return; - GlobalFuncs.LaunchCharacterCustomization(); + NovetusFuncs.LaunchCharacterCustomization(); } private void joinButton_Click(object sender, RoutedEventArgs e) @@ -247,7 +247,7 @@ namespace NovetusLauncher private void regenerateIDButton_Click(object sender, RoutedEventArgs e) { - GlobalFuncs.GeneratePlayerID(); + NovetusFuncs.GeneratePlayerID(); userIDBox.Text = Convert.ToString(GlobalVars.UserConfiguration.UserID); } diff --git a/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs b/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs index 66843bb..5c28116 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs @@ -19,14 +19,14 @@ namespace NovetusLauncher #region Form Events private void NovetusSettings_Load(object sender, EventArgs e) { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); ReadConfigValues(); CenterToScreen(); } private void NovetusSettings_Close(object sender, FormClosingEventArgs e) { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); FormCollection fc = Application.OpenForms; @@ -117,7 +117,7 @@ namespace NovetusLauncher { if (GlobalVars.UserConfiguration.QualityLevel == Settings.Level.Custom) { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); CustomGraphicsOptions opt = new CustomGraphicsOptions(); opt.Show(); } @@ -139,7 +139,7 @@ namespace NovetusLauncher #region Functions void ReadConfigValues() { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); + FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay; checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode; diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs index a0d5858..bd9b69a 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs @@ -138,7 +138,7 @@ public partial class AssetDownloader : Form } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); MessageBox.Show("Error: Unable to download the file. " + ex.Message, "Asset Downloader - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -161,7 +161,7 @@ public partial class AssetDownloader : Form } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); MessageBox.Show("Error: Unable to download the file. Try using a different file name or ID.", "Asset Downloader - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -185,7 +185,7 @@ public partial class AssetDownloader : Form } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); noErrors = false; } @@ -201,7 +201,7 @@ public partial class AssetDownloader : Form } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); noErrors = false; } @@ -282,12 +282,12 @@ public partial class AssetDownloader : Form string extraText = (lines.Count() != lineCount) ? "\n" + (lines.Count() - lineCount) + " errors were detected during the download. Make sure your IDs and links are valid." : ""; - MessageBox.Show("Batch download complete! " + lineCount + " items downloaded! " + GlobalFuncs.SizeSuffix(Convert.ToInt64(batchDownloadSize), 2) + " written (" + batchDownloadSize + " bytes)!" + extraText, "Asset Downloader - Download Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("Batch download complete! " + lineCount + " items downloaded! " + Util.SizeSuffix(Convert.ToInt64(batchDownloadSize), 2) + " written (" + batchDownloadSize + " bytes)!" + extraText, "Asset Downloader - Download Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { - GlobalFuncs.LogExceptions(ex); + Util.LogExceptions(ex); MessageBox.Show("Unable to batch download files. Error:" + ex.Message + "\n Make sure your items are set up properly.", "Asset Downloader - Unable to batch download files.", MessageBoxButtons.OK, MessageBoxIcon.Error); }