diff --git a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs index ee3c230..8a7b0fd 100644 --- a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs +++ b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs @@ -477,7 +477,6 @@ public class LauncherFuncs case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(Decryptline3) == 1: GlobalVars.ReShadeFPSDisplay = true; break; - case int showFPSLine when showFPSLine == 0 && Convert.ToInt32(Decryptline3) == 0: default: GlobalVars.ReShadeFPSDisplay = false; break; diff --git a/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs b/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs index 17aaee4..ba6e9ba 100644 --- a/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs +++ b/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs @@ -9,22 +9,22 @@ using System.Windows.Forms; using System.Xml; using System.Xml.Linq; +public enum DLType +{ + //RBXL and RBXM + RBXL, + RBXM, + //Items + Hat, + Head, + Face, + TShirt, + Shirt, + Pants +} + public static class RobloxXMLLocalizer { - public enum DLType - { - //RBXL and RBXM - RBXL, - RBXM, - //Items - Hat, - Head, - Face, - TShirt, - Shirt, - Pants - } - public static void DownloadFromNodes(string filepath, AssetCacheDef assetdef, string name = "", string meshname = "") { DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname); diff --git a/NovetusLauncher/NovetusLauncher/LocalVars.cs b/NovetusLauncher/NovetusLauncher/LocalVars.cs index e0c4977..7092c0c 100644 --- a/NovetusLauncher/NovetusLauncher/LocalVars.cs +++ b/NovetusLauncher/NovetusLauncher/LocalVars.cs @@ -1,4 +1,6 @@ -namespace NovetusLauncher +using System.Collections.Generic; + +namespace NovetusLauncher { class LocalVars { diff --git a/NovetusLauncher/NovetusLauncher/MainForm/MainForm.cs b/NovetusLauncher/NovetusLauncher/MainForm/MainForm.cs index 661b4d4..49ad9d2 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm/MainForm.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm/MainForm.cs @@ -1156,258 +1156,85 @@ namespace NovetusLauncher } } - void ConsoleProcessCommands(string command) + void ConsoleProcessCommands(string cmd) { - if (string.Compare(command,"server",true, CultureInfo.InvariantCulture) == 0) - { - StartServer(false); - } - else if (string.Compare(command,"server no3d",true, CultureInfo.InvariantCulture) == 0) - { - StartServer(true); - } - else if (string.Compare(command,"no3d",true, CultureInfo.InvariantCulture) == 0) - { - StartServer(true); - } - else if (string.Compare(command,"client",true, CultureInfo.InvariantCulture) == 0) - { - StartClient(); - } - else if (string.Compare(command,"client solo",true, CultureInfo.InvariantCulture) == 0) - { - StartSolo(); - } - else if (string.Compare(command,"solo",true, CultureInfo.InvariantCulture) == 0) - { - StartSolo(); - } - else if (string.Compare(command,"studio",true, CultureInfo.InvariantCulture) == 0) + switch(cmd) { - StartStudio(false); - } - else if (string.Compare(command, "studio map", true, CultureInfo.InvariantCulture) == 0) - { - StartStudio(false); + case string server3d when string.Compare(server3d, "server 3d", true, CultureInfo.InvariantCulture) == 0: + StartServer(false); + break; + case string serverno3d when string.Compare(serverno3d, "server no3d", true, CultureInfo.InvariantCulture) == 0: + StartServer(false); + break; + case string client when string.Compare(client, "client", true, CultureInfo.InvariantCulture) == 0: + StartClient(); + break; + case string solo when string.Compare(solo, "solo", true, CultureInfo.InvariantCulture) == 0: + StartSolo(); + break; + case string studiomap when string.Compare(studiomap, "studio map", true, CultureInfo.InvariantCulture) == 0: + StartStudio(false); + break; + case string studionomap when string.Compare(studionomap, "studio nomap", true, CultureInfo.InvariantCulture) == 0: + StartStudio(true); + break; + case string configsave when string.Compare(configsave, "config save", true, CultureInfo.InvariantCulture) == 0: + WriteConfigValues(); + break; + case string configload when string.Compare(configload, "config load", true, CultureInfo.InvariantCulture) == 0: + ReadConfigValues(); + break; + case string configreset when string.Compare(configreset, "config reset", true, CultureInfo.InvariantCulture) == 0: + ResetConfigValues(); + 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 webserverstart when string.Compare(webserverstart, "webserver start", true, CultureInfo.InvariantCulture) == 0: + if (GlobalVars.IsWebServerOn == false) + { + StartWebServer(); + } + else + { + ConsolePrint("WebServer: There is already a web server on.", 2); + } + break; + case string webserverstop when string.Compare(webserverstop, "webserver stop", true, CultureInfo.InvariantCulture) == 0: + if (GlobalVars.IsWebServerOn == true) + { + StopWebServer(); + } + else + { + ConsolePrint("WebServer: There is no web server on.", 2); + } + break; + case string webserverrestart when string.Compare(webserverrestart, "webserver restart", true, CultureInfo.InvariantCulture) == 0: + try + { + ConsolePrint("WebServer: Restarting...", 4); + StopWebServer(); + StartWebServer(); + } + catch (Exception ex) when (!Env.Debugging) + { + ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); + } + break; + case string important when string.Compare(important, GlobalVars.important, true, CultureInfo.InvariantCulture) == 0: + GlobalVars.AdminMode = true; + ConsolePrint("ADMIN MODE ENABLED.", 4); + ConsolePrint("YOU ARE GOD.", 2); + break; + default: + ConsolePrint("ERROR 3 - Command is either not registered or valid", 2); + break; } - else if (string.Compare(command, "studio nomap", true, CultureInfo.InvariantCulture) == 0) - { - StartStudio(true); - } - else if (string.Compare(command,"config save",true, CultureInfo.InvariantCulture) == 0) - { - WriteConfigValues(); - } - else if (string.Compare(command,"config load",true, CultureInfo.InvariantCulture) == 0) - { - ReadConfigValues(); - } - else if (string.Compare(command,"config reset",true, CultureInfo.InvariantCulture) == 0) - { - ResetConfigValues(); - } - else if (string.Compare(command,"help",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(0); - } - else if (string.Compare(command,"help config",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(1); - } - else if (string.Compare(command,"config",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(1); - } - else if (string.Compare(command,"help sdk",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(2); - } - else if (string.Compare(command,"sdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadLauncher(); - } - else if (string.Compare(command,"sdk clientinfo",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"sdk itemmaker",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command,"clientinfo",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"itemmaker",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command,"sdk clientsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"sdk itemsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command,"clientsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"itemsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command, "assetlocalizer", true, CultureInfo.InvariantCulture) == 0) - { - LoadAssetLocalizer(); - } - else if (string.Compare(command, "sdk assetlocalizer", true, CultureInfo.InvariantCulture) == 0) - { - LoadAssetLocalizer(); - } - else if (string.Compare(command, "splashtester", true, CultureInfo.InvariantCulture) == 0) - { - LoadSplashTester(); - } - else if (string.Compare(command, "sdk splashtester", true, CultureInfo.InvariantCulture) == 0) - { - LoadSplashTester(); - } - else if (string.Compare(command, "obj2meshv1gui", true, CultureInfo.InvariantCulture) == 0) - { - LoadOBJ2MeshV1GUI(); - } - else if (string.Compare(command, "sdk obj2meshv1gui", true, CultureInfo.InvariantCulture) == 0) - { - LoadOBJ2MeshV1GUI(); - } - else if (string.Compare(command,"charcustom",true, CultureInfo.InvariantCulture) == 0) - { - CharacterCustomization cc = new CharacterCustomization(); - cc.Show(); - ConsolePrint("Avatar Customization Loaded.", 4); - } - else if (string.Compare(command,"webserver",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(3); - } - else if (string.Compare(command,"webserver start",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == false) - { - StartWebServer(); - } - else - { - ConsolePrint("WebServer: There is already a web server open.", 2); - } - } - else if (string.Compare(command,"webserver stop",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == true) - { - StopWebServer(); - } - else - { - ConsolePrint("WebServer: There is no web server open.", 2); - } - } - else if (string.Compare(command,"webserver restart",true, CultureInfo.InvariantCulture) == 0) - { - try - { - ConsolePrint("WebServer: Restarting...", 4); - StopWebServer(); - StartWebServer(); - } - catch(Exception ex) when (!Env.Debugging) - { - ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); - } - } - else if (string.Compare(command,"start",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == false) - { - StartWebServer(); - } - else - { - ConsolePrint("WebServer: There is already a web server open.", 2); - } - } - else if (string.Compare(command,"stop",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == true) - { - StopWebServer(); - } - else - { - ConsolePrint("WebServer: There is no web server open.", 2); - } - } - else if (string.Compare(command,"restart",true, CultureInfo.InvariantCulture) == 0) - { - try - { - ConsolePrint("WebServer: Restarting...", 4); - StopWebServer(); - StartWebServer(); - } - catch(Exception ex) when (!Env.Debugging) - { - ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); - } - } - else if (string.Compare(command,GlobalVars.important,true, CultureInfo.InvariantCulture) == 0) - { - GlobalVars.AdminMode = true; - ConsolePrint("ADMIN MODE ENABLED.", 4); - ConsolePrint("YOU ARE GOD.", 2); - } - else - { - ConsolePrint("ERROR 3 - Command is either not registered or valid", 2); - } } - - void LoadItemSDK() - { - ItemMaker im = new ItemMaker(); - im.Show(); - ConsolePrint("Novetus Item SDK Loaded.", 4); - } - - void LoadClientSDK() - { - ClientinfoEditor cie = new ClientinfoEditor(); - cie.Show(); - ConsolePrint("Novetus Client SDK Loaded.", 4); - } - - void LoadAssetLocalizer() - { - AssetLocalizer al = new AssetLocalizer(); - al.Show(); - ConsolePrint("Novetus Asset Localizer Loaded.", 4); - } - - void LoadSplashTester() - { - SplashTester st = new SplashTester(); - st.Show(); - ConsolePrint("Splash Tester Loaded.", 4); - } - - void LoadOBJ2MeshV1GUI() - { - Obj2MeshV1GUI obj = new Obj2MeshV1GUI(); - obj.Show(); - ConsolePrint("OBJ2MeshV1 GUI Loaded.", 4); - } void LoadLauncher() { @@ -1416,62 +1243,26 @@ namespace NovetusLauncher ConsolePrint("Novetus SDK Launcher Loaded.", 4); } - void ConsoleHelp(int page) + void ConsoleHelp() { - if (page == 1) - { - ConsolePrint("Help: config", 3); - ConsolePrint("-------------------------", 1); - ConsolePrint("= save | Saves the config file", 4); - ConsolePrint("= load | Reloads the config file", 4); - ConsolePrint("= reset | Resets the config file", 4); - } - else if (page == 2) - { - ConsolePrint("Help: sdk", 3); - ConsolePrint("-------------------------", 1); - ConsolePrint("-- sdk | Launches the Novetus SDK Launcher", 4); - ConsolePrint("= clientinfo | Launches the Novetus Client SDK", 4); - ConsolePrint("= itemmaker | Launches the Novetus Item SDK", 4); - ConsolePrint("= assetlocalizer | Launches the Novetus Asset Localizer", 4); - ConsolePrint("= splashtester | Launches the Splash Tester", 4); - ConsolePrint("= obj2meshv1gui | Launches the OBJ2MeshV1 GUI", 4); - } - else if (page == 3) - { - ConsolePrint("Help: webserver", 3); - ConsolePrint("-------------------------", 1); - ConsolePrint("= restart | Restarts the web server", 4); - ConsolePrint("= stop | Stops a web server if there is one on.", 4); - ConsolePrint("= start | Starts a web server if there isn't one on yet.", 4); - } - else - { - ConsolePrint("Help: all", 3); - ConsolePrint("---------", 1); - ConsolePrint("= client | Launches client with launcher settings", 3); - ConsolePrint("-- solo | Launches client in Play Solo mode with launcher settings", 4); - ConsolePrint("= server |Launches server with launcher settings", 3); - ConsolePrint("-- no3d | Launches server in NoGraphics mode with launcher settings", 4); - ConsolePrint("= studio | Launches Roblox Studio with launcher settings", 3); - ConsolePrint("---------", 1); - ConsolePrint("= sdk", 3); - ConsolePrint("-- sdk | Launches the Novetus SDK Launcher", 4); - ConsolePrint("-- clientinfo | Launches the Novetus Client SDK", 4); - ConsolePrint("-- itemmaker | Launches the Novetus Item SDK", 4); - ConsolePrint("-- assetlocalizer | Launches the Novetus Asset Localizer", 4); - ConsolePrint("---------", 1); - ConsolePrint("= config", 3); - ConsolePrint("-- save | Saves the config file", 4); - ConsolePrint("-- load | Reloads the config file", 4); - ConsolePrint("-- reset | Resets the config file", 4); - ConsolePrint("---------", 1); - ConsolePrint("= webserver", 3); - ConsolePrint("-- restart | Restarts the web server", 4); - ConsolePrint("-- stop | Stops a web server if there is one on.", 4); - ConsolePrint("-- start | Starts a web server if there isn't one on yet.", 4); - ConsolePrint("---------", 1); - } + ConsolePrint("Help:", 3); + ConsolePrint("---------", 1); + ConsolePrint("= client | Launches client with launcher settings", 3); + ConsolePrint("= solo | Launches client in Play Solo mode with launcher settings", 3); + ConsolePrint("= server 3d | Launches server with launcher settings", 3); + ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 3); + ConsolePrint("= studio map | Launches Roblox Studio with the selected map",34); + ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 3); + ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 3); + ConsolePrint("---------", 1); + ConsolePrint("= config save | Saves the config file", 3); + ConsolePrint("= config load | Reloads the config file", 3); + ConsolePrint("= config reset | Resets the config file", 3); + ConsolePrint("---------", 1); + ConsolePrint("= webserver restart | Restarts the web server", 3); + ConsolePrint("= webserver stop | Stops a web server if there is one on.", 3); + ConsolePrint("= webserver start | Starts a web server if there isn't one on yet.", 3); + ConsolePrint("---------", 1); } void Button21Click(object sender, EventArgs e) diff --git a/NovetusLauncher/NovetusLauncher/MainForm/MainForm_legacy.cs b/NovetusLauncher/NovetusLauncher/MainForm/MainForm_legacy.cs index 1303212..1333364 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm/MainForm_legacy.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm/MainForm_legacy.cs @@ -1121,324 +1121,115 @@ namespace NovetusLauncher } } - void ConsoleProcessCommands(string command) + void ConsoleProcessCommands(string cmd) { - if (string.Compare(command,"server",true, CultureInfo.InvariantCulture) == 0) + switch (cmd) { - StartServer(false); + case string server3d when string.Compare(server3d, "server 3d", true, CultureInfo.InvariantCulture) == 0: + StartServer(false); + break; + case string serverno3d when string.Compare(serverno3d, "server no3d", true, CultureInfo.InvariantCulture) == 0: + StartServer(false); + break; + case string client when string.Compare(client, "client", true, CultureInfo.InvariantCulture) == 0: + StartClient(); + break; + case string solo when string.Compare(solo, "solo", true, CultureInfo.InvariantCulture) == 0: + StartSolo(); + break; + case string studiomap when string.Compare(studiomap, "studio map", true, CultureInfo.InvariantCulture) == 0: + StartStudio(false); + break; + case string studionomap when string.Compare(studionomap, "studio nomap", true, CultureInfo.InvariantCulture) == 0: + StartStudio(true); + break; + case string configsave when string.Compare(configsave, "config save", true, CultureInfo.InvariantCulture) == 0: + WriteConfigValues(); + break; + case string configload when string.Compare(configload, "config load", true, CultureInfo.InvariantCulture) == 0: + ReadConfigValues(); + break; + case string configreset when string.Compare(configreset, "config reset", true, CultureInfo.InvariantCulture) == 0: + ResetConfigValues(); + 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 webserverstart when string.Compare(webserverstart, "webserver start", true, CultureInfo.InvariantCulture) == 0: + if (GlobalVars.IsWebServerOn == false) + { + StartWebServer(); + } + else + { + ConsolePrint("WebServer: There is already a web server on.", 2); + } + break; + case string webserverstop when string.Compare(webserverstop, "webserver stop", true, CultureInfo.InvariantCulture) == 0: + if (GlobalVars.IsWebServerOn == true) + { + StopWebServer(); + } + else + { + ConsolePrint("WebServer: There is no web server on.", 2); + } + break; + case string webserverrestart when string.Compare(webserverrestart, "webserver restart", true, CultureInfo.InvariantCulture) == 0: + try + { + ConsolePrint("WebServer: Restarting...", 4); + StopWebServer(); + StartWebServer(); + } + catch (Exception ex) when (!Env.Debugging) + { + ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); + } + break; + case string important when string.Compare(important, GlobalVars.important, true, CultureInfo.InvariantCulture) == 0: + GlobalVars.AdminMode = true; + ConsolePrint("ADMIN MODE ENABLED.", 4); + ConsolePrint("YOU ARE GOD.", 2); + break; + default: + ConsolePrint("ERROR 3 - Command is either not registered or valid", 2); + break; } - else if (string.Compare(command,"server no3d",true, CultureInfo.InvariantCulture) == 0) - { - StartServer(true); - } - else if (string.Compare(command,"no3d",true, CultureInfo.InvariantCulture) == 0) - { - StartServer(true); - } - else if (string.Compare(command,"client",true, CultureInfo.InvariantCulture) == 0) - { - StartClient(); - } - else if (string.Compare(command,"client solo",true, CultureInfo.InvariantCulture) == 0) - { - StartSolo(); - } - else if (string.Compare(command,"solo",true, CultureInfo.InvariantCulture) == 0) - { - StartSolo(); - } - else if (string.Compare(command,"studio",true, CultureInfo.InvariantCulture) == 0) - { - StartStudio(false); - } - else if (string.Compare(command, "studio map", true, CultureInfo.InvariantCulture) == 0) - { - StartStudio(false); - } - else if (string.Compare(command, "studio nomap", true, CultureInfo.InvariantCulture) == 0) - { - StartStudio(true); - } - else if (string.Compare(command,"config save",true, CultureInfo.InvariantCulture) == 0) - { - WriteConfigValues(); - } - else if (string.Compare(command,"config load",true, CultureInfo.InvariantCulture) == 0) - { - ReadConfigValues(); - } - else if (string.Compare(command,"config reset",true, CultureInfo.InvariantCulture) == 0) - { - ResetConfigValues(); - } - else if (string.Compare(command,"help",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(0); - } - else if (string.Compare(command,"help config",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(1); - } - else if (string.Compare(command,"config",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(1); - } - else if (string.Compare(command,"help sdk",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(2); - } - else if (string.Compare(command,"sdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadLauncher(); - } - else if (string.Compare(command,"sdk clientinfo",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"sdk itemmaker",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command,"clientinfo",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"itemmaker",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command,"sdk clientsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"sdk itemsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command,"clientsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadClientSDK(); - } - else if (string.Compare(command,"itemsdk",true, CultureInfo.InvariantCulture) == 0) - { - LoadItemSDK(); - } - else if (string.Compare(command, "assetlocalizer", true, CultureInfo.InvariantCulture) == 0) - { - LoadAssetLocalizer(); - } - else if (string.Compare(command, "sdk assetlocalizer", true, CultureInfo.InvariantCulture) == 0) - { - LoadAssetLocalizer(); - } - else if (string.Compare(command, "splashtester", true, CultureInfo.InvariantCulture) == 0) - { - LoadSplashTester(); - } - else if (string.Compare(command, "sdk splashtester", true, CultureInfo.InvariantCulture) == 0) - { - LoadSplashTester(); - } - else if (string.Compare(command, "obj2meshv1gui", true, CultureInfo.InvariantCulture) == 0) - { - LoadOBJ2MeshV1GUI(); - } - else if (string.Compare(command, "sdk obj2meshv1gui", true, CultureInfo.InvariantCulture) == 0) - { - LoadOBJ2MeshV1GUI(); - } - else if (string.Compare(command,"charcustom",true, CultureInfo.InvariantCulture) == 0) - { - CharacterCustomization_legacy cc = new CharacterCustomization_legacy(); - cc.Show(); - ConsolePrint("Avatar Customization Loaded.", 4); - } - else if (string.Compare(command,"webserver",true, CultureInfo.InvariantCulture) == 0) - { - ConsoleHelp(3); - } - else if (string.Compare(command,"webserver start",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == false) - { - StartWebServer(); - } - else - { - ConsolePrint("WebServer: There is already a web server open.", 2); - } - } - else if (string.Compare(command,"webserver stop",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == true) - { - StopWebServer(); - } - else - { - ConsolePrint("WebServer: There is no web server open.", 2); - } - } - else if (string.Compare(command,"webserver restart",true, CultureInfo.InvariantCulture) == 0) - { - try - { - ConsolePrint("WebServer: Restarting...", 4); - StopWebServer(); - StartWebServer(); - } - catch(Exception ex) when (!Env.Debugging) - { - ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); - } - } - else if (string.Compare(command,"start",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == false) - { - StartWebServer(); - } - else - { - ConsolePrint("WebServer: There is already a web server open.", 2); - } - } - else if (string.Compare(command,"stop",true, CultureInfo.InvariantCulture) == 0) - { - if (GlobalVars.IsWebServerOn == true) - { - StopWebServer(); - } - else - { - ConsolePrint("WebServer: There is no web server open.", 2); - } - } - else if (string.Compare(command,"restart",true, CultureInfo.InvariantCulture) == 0) - { - try - { - ConsolePrint("WebServer: Restarting...", 4); - StopWebServer(); - StartWebServer(); - } - catch(Exception ex) when (!Env.Debugging) - { - ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); - } - } - else if (string.Compare(command,GlobalVars.important,true, CultureInfo.InvariantCulture) == 0) - { - GlobalVars.AdminMode = true; - ConsolePrint("ADMIN MODE ENABLED.", 4); - ConsolePrint("YOU ARE GOD.", 2); - } - else - { - ConsolePrint("ERROR 3 - Command is either not registered or valid", 2); - } } - - void LoadItemSDK() + + void LoadLauncher() { - ItemMaker im = new ItemMaker(); + NovetusSDK im = new NovetusSDK(); im.Show(); - ConsolePrint("Novetus Item SDK Loaded.", 4); + ConsolePrint("Novetus SDK Launcher Loaded.", 4); } - - void LoadClientSDK() + + void ConsoleHelp() { - ClientinfoEditor cie = new ClientinfoEditor(); - cie.Show(); - ConsolePrint("Novetus Client SDK Loaded.", 4); + ConsolePrint("Help:", 3); + ConsolePrint("---------", 1); + ConsolePrint("= client | Launches client with launcher settings", 4); + ConsolePrint("= solo | Launches client in Play Solo mode with launcher settings", 4); + ConsolePrint("= server 3d | Launches server with launcher settings", 4); + ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 4); + ConsolePrint("= studio map | Launches Roblox Studio with the selected map", 4); + ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 4); + ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 4); + ConsolePrint("---------", 1); + ConsolePrint("= config save | Saves the config file", 4); + ConsolePrint("= config load | Reloads the config file", 4); + ConsolePrint("= config reset | Resets the config file", 4); + ConsolePrint("---------", 1); + ConsolePrint("= webserver restart | Restarts the web server", 4); + ConsolePrint("= webserver stop | Stops a web server if there is one on.", 4); + ConsolePrint("= webserver start | Starts a web server if there isn't one on yet.", 4); + ConsolePrint("---------", 1); } - void LoadAssetLocalizer() - { - AssetLocalizer al = new AssetLocalizer(); - al.Show(); - ConsolePrint("Novetus Asset Localizer Loaded.", 4); - } - - void LoadSplashTester() - { - SplashTester st = new SplashTester(); - st.Show(); - ConsolePrint("Splash Tester Loaded.", 4); - } - - void LoadOBJ2MeshV1GUI() - { - Obj2MeshV1GUI obj = new Obj2MeshV1GUI(); - obj.Show(); - ConsolePrint("OBJ2MeshV1 GUI Loaded.", 4); - } - - void LoadLauncher() - { - NovetusSDK im = new NovetusSDK(); - im.Show(); - ConsolePrint("Novetus SDK Launcher Loaded.", 4); - } - - void ConsoleHelp(int page) - { - if (page == 1) - { - ConsolePrint("Help: config", 3); - ConsolePrint("-------------------------", 1); - ConsolePrint("= save | Saves the config file", 4); - ConsolePrint("= load | Reloads the config file", 4); - ConsolePrint("= reset | Resets the config file", 4); - } - else if (page == 2) - { - ConsolePrint("Help: sdk", 3); - ConsolePrint("-------------------------", 1); - ConsolePrint("-- sdk | Launches the Novetus SDK Launcher", 4); - ConsolePrint("= clientinfo | Launches the Novetus Client SDK", 4); - ConsolePrint("= itemmaker | Launches the Novetus Item SDK", 4); - ConsolePrint("= assetlocalizer | Launches the Novetus Asset Localizer", 4); - ConsolePrint("= splashtester | Launches the Splash Tester", 4); - ConsolePrint("= obj2meshv1gui | Launches the OBJ2MeshV1 GUI", 4); - } - else if (page == 3) - { - ConsolePrint("Help: webserver", 3); - ConsolePrint("-------------------------", 1); - ConsolePrint("= restart | Restarts the web server", 4); - ConsolePrint("= stop | Stops a web server if there is one on.", 4); - ConsolePrint("= start | Starts a web server if there isn't one on yet.", 4); - } - else - { - ConsolePrint("Help: all", 3); - ConsolePrint("---------", 1); - ConsolePrint("= client | Launches client with launcher settings", 3); - ConsolePrint("-- solo | Launches client in Play Solo mode with launcher settings", 4); - ConsolePrint("= server |Launches server with launcher settings", 3); - ConsolePrint("-- no3d | Launches server in NoGraphics mode with launcher settings", 4); - ConsolePrint("= studio | Launches Roblox Studio with launcher settings", 3); - ConsolePrint("---------", 1); - ConsolePrint("= sdk", 3); - ConsolePrint("-- sdk | Launches the Novetus SDK Launcher", 4); - ConsolePrint("-- clientinfo | Launches the Novetus Client SDK", 4); - ConsolePrint("-- itemmaker | Launches the Novetus Item SDK", 4); - ConsolePrint("-- assetlocalizer | Launches the Novetus Asset Localizer", 4); - ConsolePrint("---------", 1); - ConsolePrint("= config", 3); - ConsolePrint("-- save | Saves the config file", 4); - ConsolePrint("-- load | Reloads the config file", 4); - ConsolePrint("-- reset | Resets the config file", 4); - ConsolePrint("---------", 1); - ConsolePrint("= webserver", 3); - ConsolePrint("-- restart | Restarts the web server", 4); - ConsolePrint("-- stop | Stops a web server if there is one on.", 4); - ConsolePrint("-- start | Starts a web server if there isn't one on yet.", 4); - ConsolePrint("---------", 1); - } - } - void Button21Click(object sender, EventArgs e) { if (SecurityFuncs.IsElevated) @@ -1705,14 +1496,15 @@ namespace NovetusLauncher { DialogResult result = MessageBox.Show("If you want to test out your place, you will have to save your place in Novetus's map folder, then launch your place in Play Solo." + Environment.NewLine + Environment.NewLine + "Press Yes to launch Studio with a map, or No to launch Studio without a map.", "Novetus - Launch ROBLOX Studio", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); bool nomap = false; - if (result == DialogResult.Cancel) - { - return; - } - else if (result == DialogResult.No) - { - nomap = true; - } + + switch(result) + { + case DialogResult.No: + nomap = true; + break; + default: + break; + } WriteConfigValues(); StartStudio(nomap); diff --git a/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs b/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs index 993aa44..64661d1 100644 --- a/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs +++ b/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs @@ -7,7 +7,7 @@ namespace NovetusLauncher { public partial class AssetLocalizer : Form { - private RobloxXMLLocalizer.DLType currentType; + private DLType currentType; private string path; private string name; private string meshname; @@ -21,7 +21,7 @@ namespace NovetusLauncher { OpenFileDialog openFileDialog1 = new OpenFileDialog { - Filter = (currentType == RobloxXMLLocalizer.DLType.RBXL) ? "ROBLOX Level (*.rbxl)|*.rbxl" : "ROBLOX Model (*.rbxm)|*.rbxm", + Filter = (currentType == DLType.RBXL) ? "ROBLOX Level (*.rbxl)|*.rbxl" : "ROBLOX Model (*.rbxm)|*.rbxm", Title = "Open ROBLOX level or model" }; @@ -35,37 +35,32 @@ namespace NovetusLauncher private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { - if (comboBox1.SelectedIndex == 0) + switch (comboBox1.SelectedIndex) { - currentType = RobloxXMLLocalizer.DLType.RBXL; - } - else if (comboBox1.SelectedIndex == 1) - { - currentType = RobloxXMLLocalizer.DLType.RBXM; - } - else if (comboBox1.SelectedIndex == 2) - { - currentType = RobloxXMLLocalizer.DLType.Hat; - } - else if (comboBox1.SelectedIndex == 3) - { - currentType = RobloxXMLLocalizer.DLType.Head; - } - else if (comboBox1.SelectedIndex == 4) - { - currentType = RobloxXMLLocalizer.DLType.Face; - } - else if (comboBox1.SelectedIndex == 5) - { - currentType = RobloxXMLLocalizer.DLType.Shirt; - } - else if (comboBox1.SelectedIndex == 6) - { - currentType = RobloxXMLLocalizer.DLType.TShirt; - } - else if (comboBox1.SelectedIndex == 7) - { - currentType = RobloxXMLLocalizer.DLType.Pants; + case 1: + currentType = DLType.RBXM; + break; + case 2: + currentType = DLType.Hat; + break; + case 3: + currentType = DLType.Head; + break; + case 4: + currentType = DLType.Face; + break; + case 5: + currentType = DLType.Shirt; + break; + case 6: + currentType = DLType.TShirt; + break; + case 7: + currentType = DLType.Pants; + break; + default: + currentType = DLType.RBXL; + break; } } @@ -121,7 +116,7 @@ namespace NovetusLauncher switch (currentType) { - case RobloxXMLLocalizer.DLType.RBXL: + case DLType.RBXL: switch (percent) { case 0: @@ -168,7 +163,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.RBXM: + case DLType.RBXM: switch (percent) { case 0: @@ -212,7 +207,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.Hat: + case DLType.Hat: switch (percent) { case 0: @@ -229,7 +224,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.Head: + case DLType.Head: //meshes switch (percent) { @@ -238,7 +233,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.Face: + case DLType.Face: //decal switch (percent) { @@ -247,7 +242,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.TShirt: + case DLType.TShirt: //texture switch (percent) { @@ -256,7 +251,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.Shirt: + case DLType.Shirt: //texture switch (percent) { @@ -265,7 +260,7 @@ namespace NovetusLauncher break; } break; - case RobloxXMLLocalizer.DLType.Pants: + case DLType.Pants: //texture switch (percent) { @@ -291,7 +286,7 @@ namespace NovetusLauncher { switch (currentType) { - case RobloxXMLLocalizer.DLType.RBXL: + case DLType.RBXL: //backup the original copy try { @@ -344,7 +339,7 @@ namespace NovetusLauncher RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.RBXM: + case DLType.RBXM: //meshes worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.Fonts); @@ -387,7 +382,7 @@ namespace NovetusLauncher RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.Hat: + case DLType.Hat: //meshes worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHatFonts, name, meshname); @@ -401,32 +396,32 @@ namespace NovetusLauncher RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.Head: + case DLType.Head: //meshes worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHeadFonts, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHeadFonts, 1, 1, 1, 1, name); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.Face: + case DLType.Face: //decal worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemFaceTexture, name); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.TShirt: + case DLType.TShirt: //texture worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemTShirtTexture, name); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.Shirt: + case DLType.Shirt: //texture worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemShirtTexture, name); worker.ReportProgress(100); break; - case RobloxXMLLocalizer.DLType.Pants: + case DLType.Pants: //texture worker.ReportProgress(0); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemPantsTexture, name); @@ -452,17 +447,17 @@ namespace NovetusLauncher // This event handler deals with the results of the background operation. private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { - if (e.Cancelled == true) + switch (e) { - label2.Text = "Canceled!"; - } - else if (e.Error != null) - { - label2.Text = "Error: " + e.Error.Message; - } - else - { - label2.Text = "Done!"; + case RunWorkerCompletedEventArgs can when can.Cancelled == true: + label2.Text = "Canceled!"; + break; + case RunWorkerCompletedEventArgs err when err.Error != null: + label2.Text = "Error: " + e.Error.Message; + break; + default: + label2.Text = "Done!"; + break; } } diff --git a/NovetusLauncher/NovetusLauncher/SDK/ClientinfoCreator.cs b/NovetusLauncher/NovetusLauncher/SDK/ClientinfoCreator.cs index f3d74f4..99c325c 100644 --- a/NovetusLauncher/NovetusLauncher/SDK/ClientinfoCreator.cs +++ b/NovetusLauncher/NovetusLauncher/SDK/ClientinfoCreator.cs @@ -18,21 +18,10 @@ namespace NovetusLauncher /// public partial class ClientinfoEditor : Form { - //clientinfocreator - private bool UsesPlayerName = false; - private bool UsesID = false; - private string Warning = ""; - private string SelectedClientDesc = ""; - private bool LegacyMode = false; - private string SelectedClientMD5 = ""; - private string SelectedClientScriptMD5 = ""; + private ClientInfo loadedClientInfo = new ClientInfo(); private string SelectedClientInfoPath = ""; private bool Locked = false; - private bool FixScriptMapMode = false; - private bool AlreadyHasSecurity = false; - private bool NoGraphicsModeOptions = false; private bool IsVersion2 = false; - private string CustomArgs = ""; public ClientinfoEditor() { @@ -48,31 +37,17 @@ namespace NovetusLauncher void CheckBox1CheckedChanged(object sender, EventArgs e) { - if (checkBox1.Checked == true) - { - UsesPlayerName = true; - } - else if (checkBox1.Checked == false) - { - UsesPlayerName = false; - } + checkBox1.Checked = loadedClientInfo.UsesPlayerName; } void CheckBox2CheckedChanged(object sender, EventArgs e) { - if (checkBox2.Checked == true) - { - UsesID = true; - } - else if (checkBox2.Checked == false) - { - UsesID = false; - } + checkBox2.Checked = loadedClientInfo.UsesID; } void TextBox1TextChanged(object sender, EventArgs e) { - SelectedClientDesc = textBox1.Text; + loadedClientInfo.Description = textBox1.Text; } void ClientinfoCreatorLoad(object sender, EventArgs e) @@ -87,38 +62,24 @@ namespace NovetusLauncher LauncherFuncs.Config(cfgpath, false); } - if (GlobalVars.AdminMode == true) - { - checkBox4.Visible = true; - } - else - { - checkBox4.Visible = false; - } + checkBox4.Visible = GlobalVars.AdminMode; } void CheckBox3CheckedChanged(object sender, EventArgs e) { - if (checkBox3.Checked == true) - { - LegacyMode = true; - } - else if (checkBox3.Checked == false) - { - LegacyMode = false; - } + checkBox3.Checked = loadedClientInfo.LegacyMode; } void TextBox2TextChanged(object sender, EventArgs e) { textBox2.Text = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); - SelectedClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); + loadedClientInfo.ClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); } void TextBox3TextChanged(object sender, EventArgs e) { textBox3.Text = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); - SelectedClientScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); + loadedClientInfo.ScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); } void Button4Click(object sender, EventArgs e) @@ -134,7 +95,7 @@ namespace NovetusLauncher string ClientName = ""; - if (!LegacyMode) + if (!loadedClientInfo.LegacyMode) { ClientName = "\\RobloxApp_Client.exe"; } @@ -149,7 +110,7 @@ namespace NovetusLauncher { textBox2.Text = ClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox2.BackColor = System.Drawing.Color.Lime; - SelectedClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); + loadedClientInfo.ClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); } else { @@ -162,7 +123,7 @@ namespace NovetusLauncher { textBox3.Text = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); textBox3.BackColor = System.Drawing.Color.Lime; - SelectedClientScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); + loadedClientInfo.ScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); } else { @@ -174,79 +135,51 @@ namespace NovetusLauncher void CheckBox4CheckedChanged(object sender, EventArgs e) { - if (checkBox4.Checked == true) - { - Locked = true; - } - else if (checkBox4.Checked == false && Locked == true) - { - Locked = true; - } + Locked = true; } void CheckBox6CheckedChanged(object sender, EventArgs e) { - if (checkBox6.Checked == true) - { - FixScriptMapMode = true; - } - else if (checkBox6.Checked == false) - { - FixScriptMapMode = false; - } + checkBox6.Checked = loadedClientInfo.Fix2007; } void CheckBox7CheckedChanged(object sender, EventArgs e) { - if (checkBox7.Checked == true) - { - AlreadyHasSecurity = true; - } - else if (checkBox7.Checked == false) - { - AlreadyHasSecurity = false; - } + checkBox7.Checked = loadedClientInfo.AlreadyHasSecurity; } void checkBox5_CheckedChanged(object sender, EventArgs e) { - if (checkBox5.Checked == true) - { - NoGraphicsModeOptions = true; - } - else if (checkBox5.Checked == false) - { - NoGraphicsModeOptions = false; - } + checkBox5.Checked = loadedClientInfo.NoGraphicsOptions; } void NewToolStripMenuItemClick(object sender, EventArgs e) { label9.Text = "Not Loaded"; - UsesPlayerName = false; - UsesID = false; - Warning = ""; - LegacyMode = false; - FixScriptMapMode = false; - AlreadyHasSecurity = false; - SelectedClientDesc = ""; - SelectedClientMD5 = ""; - SelectedClientScriptMD5 = ""; + loadedClientInfo.UsesPlayerName = false; + loadedClientInfo.UsesID = false; + loadedClientInfo.Warning = ""; + loadedClientInfo.LegacyMode = false; + loadedClientInfo.Fix2007 = false; + loadedClientInfo.AlreadyHasSecurity = false; + loadedClientInfo.Description = ""; + loadedClientInfo.ClientMD5 = ""; + loadedClientInfo.ScriptMD5 = ""; SelectedClientInfoPath = ""; - CustomArgs = ""; + loadedClientInfo.CommandLineArgs = ""; Locked = false; - checkBox1.Checked = UsesPlayerName; - checkBox2.Checked = UsesID; - checkBox3.Checked = LegacyMode; + checkBox1.Checked = loadedClientInfo.UsesPlayerName; + checkBox2.Checked = loadedClientInfo.UsesID; + checkBox3.Checked = loadedClientInfo.LegacyMode; checkBox4.Checked = Locked; - checkBox6.Checked = FixScriptMapMode; - checkBox7.Checked = AlreadyHasSecurity; - checkBox5.Checked = NoGraphicsModeOptions; - textBox3.Text = SelectedClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); - textBox2.Text = SelectedClientMD5.ToUpper(CultureInfo.InvariantCulture); - textBox1.Text = SelectedClientDesc; - textBox4.Text = CustomArgs; - textBox5.Text = Warning; + checkBox6.Checked = loadedClientInfo.Fix2007; + checkBox7.Checked = loadedClientInfo.AlreadyHasSecurity; + checkBox5.Checked = loadedClientInfo.NoGraphicsOptions; + textBox3.Text = loadedClientInfo.ScriptMD5.ToUpper(CultureInfo.InvariantCulture); + textBox2.Text = loadedClientInfo.ClientMD5.ToUpper(CultureInfo.InvariantCulture); + textBox1.Text = loadedClientInfo.Description; + textBox4.Text = loadedClientInfo.CommandLineArgs; + textBox5.Text = loadedClientInfo.Warning; textBox2.BackColor = System.Drawing.SystemColors.Control; textBox3.BackColor = System.Drawing.SystemColors.Control; } @@ -326,58 +259,58 @@ namespace NovetusLauncher } else { - Boolean bline8 = Convert.ToBoolean(Decryptline8); + bool bline8 = Convert.ToBoolean(Decryptline8); Locked = bline8; checkBox4.Checked = Locked; } + + bool bline1 = Convert.ToBoolean(Decryptline1); + loadedClientInfo.UsesPlayerName = bline1; + + bool bline2 = Convert.ToBoolean(Decryptline2); + loadedClientInfo.UsesID = bline2; + + loadedClientInfo.Warning = Decryptline3; - Boolean bline1 = Convert.ToBoolean(Decryptline1); - UsesPlayerName = bline1; - - Boolean bline2 = Convert.ToBoolean(Decryptline2); - UsesID = bline2; - - Warning = Decryptline3; - - Boolean bline4 = Convert.ToBoolean(Decryptline4); - LegacyMode = bline4; - - SelectedClientMD5 = Decryptline5; - - SelectedClientScriptMD5 = Decryptline6; - - SelectedClientDesc = Decryptline7; + bool bline4 = Convert.ToBoolean(Decryptline4); + loadedClientInfo.LegacyMode = bline4; + + loadedClientInfo.ClientMD5 = Decryptline5; + + loadedClientInfo.ScriptMD5 = Decryptline6; + + loadedClientInfo.Description = Decryptline7; bool bline9 = Convert.ToBoolean(Decryptline9); - FixScriptMapMode = bline9; + loadedClientInfo.Fix2007 = bline9; bool bline10 = Convert.ToBoolean(Decryptline10); - AlreadyHasSecurity = bline10; + loadedClientInfo.AlreadyHasSecurity = bline10; if (IsVersion2) { bool bline11 = Convert.ToBoolean(Decryptline11); - NoGraphicsModeOptions = bline11; - CustomArgs = Decryptline12; + loadedClientInfo.NoGraphicsOptions = bline11; + loadedClientInfo.CommandLineArgs = Decryptline12; } else { //Agin, fake it. - NoGraphicsModeOptions = false; - CustomArgs = Decryptline11; + loadedClientInfo.NoGraphicsOptions = false; + loadedClientInfo.CommandLineArgs = Decryptline11; } - checkBox1.Checked = UsesPlayerName; - checkBox2.Checked = UsesID; - checkBox3.Checked = LegacyMode; - checkBox6.Checked = FixScriptMapMode; - checkBox7.Checked = AlreadyHasSecurity; - checkBox5.Checked = NoGraphicsModeOptions; - textBox3.Text = SelectedClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); - textBox2.Text = SelectedClientMD5.ToUpper(CultureInfo.InvariantCulture); - textBox1.Text = SelectedClientDesc; - textBox4.Text = CustomArgs; - textBox5.Text = Warning; + checkBox1.Checked = loadedClientInfo.UsesPlayerName; + checkBox2.Checked = loadedClientInfo.UsesID; + checkBox3.Checked = loadedClientInfo.LegacyMode; + checkBox6.Checked = loadedClientInfo.Fix2007; + checkBox7.Checked = loadedClientInfo.AlreadyHasSecurity; + checkBox5.Checked = loadedClientInfo.NoGraphicsOptions; + textBox3.Text = loadedClientInfo.ScriptMD5.ToUpper(CultureInfo.InvariantCulture); + textBox2.Text = loadedClientInfo.ClientMD5.ToUpper(CultureInfo.InvariantCulture); + textBox1.Text = loadedClientInfo.Description; + textBox4.Text = loadedClientInfo.CommandLineArgs; + textBox5.Text = loadedClientInfo.Warning; } } textBox2.BackColor = System.Drawing.SystemColors.Control; @@ -396,18 +329,18 @@ namespace NovetusLauncher if (sfd.ShowDialog() == DialogResult.OK) { string[] lines = { - SecurityFuncs.Base64Encode(UsesPlayerName.ToString()), - SecurityFuncs.Base64Encode(UsesID.ToString()), - SecurityFuncs.Base64Encode(Warning.ToString()), - SecurityFuncs.Base64Encode(LegacyMode.ToString()), - SecurityFuncs.Base64Encode(SelectedClientMD5.ToString()), - SecurityFuncs.Base64Encode(SelectedClientScriptMD5.ToString()), - SecurityFuncs.Base64Encode(SelectedClientDesc.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.UsesPlayerName.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.UsesID.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.Warning.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.LegacyMode.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.ClientMD5.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.ScriptMD5.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.Description.ToString()), SecurityFuncs.Base64Encode(Locked.ToString()), - SecurityFuncs.Base64Encode(FixScriptMapMode.ToString()), - SecurityFuncs.Base64Encode(AlreadyHasSecurity.ToString()), - SecurityFuncs.Base64Encode(NoGraphicsModeOptions.ToString()), - SecurityFuncs.Base64Encode(CustomArgs.ToString()) + SecurityFuncs.Base64Encode(loadedClientInfo.Fix2007.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.AlreadyHasSecurity.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.NoGraphicsOptions.ToString()), + SecurityFuncs.Base64Encode(loadedClientInfo.CommandLineArgs.ToString()) }; File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|",lines))); SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName); @@ -421,12 +354,12 @@ namespace NovetusLauncher void TextBox4TextChanged(object sender, EventArgs e) { - CustomArgs = textBox4.Text; + loadedClientInfo.CommandLineArgs = textBox4.Text; } void TextBox5TextChanged(object sender, EventArgs e) { - Warning = textBox5.Text; + loadedClientInfo.Warning = textBox5.Text; } private void documentationToolStripMenuItem_Click(object sender, EventArgs e) @@ -486,15 +419,15 @@ namespace NovetusLauncher if (sfd.ShowDialog() == DialogResult.OK) { string[] lines = { - UsesPlayerName.ToString(), - UsesID.ToString(), - Warning.ToString(), - LegacyMode.ToString(), - SelectedClientDesc.ToString(), - FixScriptMapMode.ToString(), - AlreadyHasSecurity.ToString(), - NoGraphicsModeOptions.ToString(), - CustomArgs.ToString() + loadedClientInfo.UsesPlayerName.ToString(), + loadedClientInfo.UsesID.ToString(), + loadedClientInfo.Warning.ToString(), + loadedClientInfo.LegacyMode.ToString(), + loadedClientInfo.Description.ToString(), + loadedClientInfo.Fix2007.ToString(), + loadedClientInfo.AlreadyHasSecurity.ToString(), + loadedClientInfo.NoGraphicsOptions.ToString(), + loadedClientInfo.CommandLineArgs.ToString() }; File.WriteAllLines(sfd.FileName, lines); }