rewrite part 2: end of the else ifs

This commit is contained in:
Bitl 2020-07-04 15:18:48 -07:00
parent aad4582f84
commit 04913d75ad
7 changed files with 364 additions and 852 deletions

View File

@ -477,7 +477,6 @@ public class LauncherFuncs
case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(Decryptline3) == 1: case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(Decryptline3) == 1:
GlobalVars.ReShadeFPSDisplay = true; GlobalVars.ReShadeFPSDisplay = true;
break; break;
case int showFPSLine when showFPSLine == 0 && Convert.ToInt32(Decryptline3) == 0:
default: default:
GlobalVars.ReShadeFPSDisplay = false; GlobalVars.ReShadeFPSDisplay = false;
break; break;

View File

@ -9,22 +9,22 @@ using System.Windows.Forms;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
public enum DLType
{
//RBXL and RBXM
RBXL,
RBXM,
//Items
Hat,
Head,
Face,
TShirt,
Shirt,
Pants
}
public static class RobloxXMLLocalizer 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 = "") 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); DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname);

View File

@ -1,4 +1,6 @@
namespace NovetusLauncher using System.Collections.Generic;
namespace NovetusLauncher
{ {
class LocalVars class LocalVars
{ {

View File

@ -1156,259 +1156,86 @@ namespace NovetusLauncher
} }
} }
void ConsoleProcessCommands(string command) void ConsoleProcessCommands(string cmd)
{ {
if (string.Compare(command,"server",true, CultureInfo.InvariantCulture) == 0) switch(cmd)
{
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)
{ {
StartStudio(false); case string server3d when string.Compare(server3d, "server 3d", true, CultureInfo.InvariantCulture) == 0:
} StartServer(false);
else if (string.Compare(command, "studio map", true, CultureInfo.InvariantCulture) == 0) break;
{ case string serverno3d when string.Compare(serverno3d, "server no3d", true, CultureInfo.InvariantCulture) == 0:
StartStudio(false); 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() void LoadLauncher()
{ {
NovetusSDK im = new NovetusSDK(); NovetusSDK im = new NovetusSDK();
@ -1416,62 +1243,26 @@ namespace NovetusLauncher
ConsolePrint("Novetus SDK Launcher Loaded.", 4); ConsolePrint("Novetus SDK Launcher Loaded.", 4);
} }
void ConsoleHelp(int page) void ConsoleHelp()
{ {
if (page == 1) ConsolePrint("Help:", 3);
{ ConsolePrint("---------", 1);
ConsolePrint("Help: config", 3); ConsolePrint("= client | Launches client with launcher settings", 3);
ConsolePrint("-------------------------", 1); ConsolePrint("= solo | Launches client in Play Solo mode with launcher settings", 3);
ConsolePrint("= save | Saves the config file", 4); ConsolePrint("= server 3d | Launches server with launcher settings", 3);
ConsolePrint("= load | Reloads the config file", 4); ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 3);
ConsolePrint("= reset | Resets the config file", 4); ConsolePrint("= studio map | Launches Roblox Studio with the selected map",34);
} ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 3);
else if (page == 2) ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 3);
{ ConsolePrint("---------", 1);
ConsolePrint("Help: sdk", 3); ConsolePrint("= config save | Saves the config file", 3);
ConsolePrint("-------------------------", 1); ConsolePrint("= config load | Reloads the config file", 3);
ConsolePrint("-- sdk | Launches the Novetus SDK Launcher", 4); ConsolePrint("= config reset | Resets the config file", 3);
ConsolePrint("= clientinfo | Launches the Novetus Client SDK", 4); ConsolePrint("---------", 1);
ConsolePrint("= itemmaker | Launches the Novetus Item SDK", 4); ConsolePrint("= webserver restart | Restarts the web server", 3);
ConsolePrint("= assetlocalizer | Launches the Novetus Asset Localizer", 4); ConsolePrint("= webserver stop | Stops a web server if there is one on.", 3);
ConsolePrint("= splashtester | Launches the Splash Tester", 4); ConsolePrint("= webserver start | Starts a web server if there isn't one on yet.", 3);
ConsolePrint("= obj2meshv1gui | Launches the OBJ2MeshV1 GUI", 4); ConsolePrint("---------", 1);
}
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) void Button21Click(object sender, EventArgs e)

View File

@ -1121,322 +1121,113 @@ 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);
else if (string.Compare(command,"server no3d",true, CultureInfo.InvariantCulture) == 0) break;
{ case string serverno3d when string.Compare(serverno3d, "server no3d", true, CultureInfo.InvariantCulture) == 0:
StartServer(true); StartServer(false);
} break;
else if (string.Compare(command,"no3d",true, CultureInfo.InvariantCulture) == 0) case string client when string.Compare(client, "client", true, CultureInfo.InvariantCulture) == 0:
{ StartClient();
StartServer(true); break;
} case string solo when string.Compare(solo, "solo", true, CultureInfo.InvariantCulture) == 0:
else if (string.Compare(command,"client",true, CultureInfo.InvariantCulture) == 0) StartSolo();
{ break;
StartClient(); case string studiomap when string.Compare(studiomap, "studio map", true, CultureInfo.InvariantCulture) == 0:
} StartStudio(false);
else if (string.Compare(command,"client solo",true, CultureInfo.InvariantCulture) == 0) break;
{ case string studionomap when string.Compare(studionomap, "studio nomap", true, CultureInfo.InvariantCulture) == 0:
StartSolo(); StartStudio(true);
} break;
else if (string.Compare(command,"solo",true, CultureInfo.InvariantCulture) == 0) case string configsave when string.Compare(configsave, "config save", true, CultureInfo.InvariantCulture) == 0:
{ WriteConfigValues();
StartSolo(); break;
} case string configload when string.Compare(configload, "config load", true, CultureInfo.InvariantCulture) == 0:
else if (string.Compare(command,"studio",true, CultureInfo.InvariantCulture) == 0) ReadConfigValues();
{ break;
StartStudio(false); case string configreset when string.Compare(configreset, "config reset", true, CultureInfo.InvariantCulture) == 0:
} ResetConfigValues();
else if (string.Compare(command, "studio map", true, CultureInfo.InvariantCulture) == 0) break;
{ case string help when string.Compare(help, "help", true, CultureInfo.InvariantCulture) == 0:
StartStudio(false); ConsoleHelp();
} break;
else if (string.Compare(command, "studio nomap", true, CultureInfo.InvariantCulture) == 0) case string sdk when string.Compare(sdk, "sdk", true, CultureInfo.InvariantCulture) == 0:
{ LoadLauncher();
StartStudio(true); break;
} case string webserverstart when string.Compare(webserverstart, "webserver start", true, CultureInfo.InvariantCulture) == 0:
else if (string.Compare(command,"config save",true, CultureInfo.InvariantCulture) == 0) if (GlobalVars.IsWebServerOn == false)
{ {
WriteConfigValues(); StartWebServer();
} }
else if (string.Compare(command,"config load",true, CultureInfo.InvariantCulture) == 0) else
{ {
ReadConfigValues(); ConsolePrint("WebServer: There is already a web server on.", 2);
} }
else if (string.Compare(command,"config reset",true, CultureInfo.InvariantCulture) == 0) break;
{ case string webserverstop when string.Compare(webserverstop, "webserver stop", true, CultureInfo.InvariantCulture) == 0:
ResetConfigValues(); if (GlobalVars.IsWebServerOn == true)
} {
else if (string.Compare(command,"help",true, CultureInfo.InvariantCulture) == 0) StopWebServer();
{ }
ConsoleHelp(0); else
} {
else if (string.Compare(command,"help config",true, CultureInfo.InvariantCulture) == 0) ConsolePrint("WebServer: There is no web server on.", 2);
{ }
ConsoleHelp(1); break;
} case string webserverrestart when string.Compare(webserverrestart, "webserver restart", true, CultureInfo.InvariantCulture) == 0:
else if (string.Compare(command,"config",true, CultureInfo.InvariantCulture) == 0) try
{ {
ConsoleHelp(1); ConsolePrint("WebServer: Restarting...", 4);
} StopWebServer();
else if (string.Compare(command,"help sdk",true, CultureInfo.InvariantCulture) == 0) StartWebServer();
{ }
ConsoleHelp(2); catch (Exception ex) when (!Env.Debugging)
} {
else if (string.Compare(command,"sdk",true, CultureInfo.InvariantCulture) == 0) ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2);
{ }
LoadLauncher(); break;
} case string important when string.Compare(important, GlobalVars.important, true, CultureInfo.InvariantCulture) == 0:
else if (string.Compare(command,"sdk clientinfo",true, CultureInfo.InvariantCulture) == 0) GlobalVars.AdminMode = true;
{ ConsolePrint("ADMIN MODE ENABLED.", 4);
LoadClientSDK(); ConsolePrint("YOU ARE GOD.", 2);
} break;
else if (string.Compare(command,"sdk itemmaker",true, CultureInfo.InvariantCulture) == 0) default:
{ ConsolePrint("ERROR 3 - Command is either not registered or valid", 2);
LoadItemSDK(); break;
}
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(); im.Show();
ConsolePrint("Novetus Item SDK Loaded.", 4); ConsolePrint("Novetus SDK Launcher Loaded.", 4);
} }
void LoadClientSDK() void ConsoleHelp()
{ {
ClientinfoEditor cie = new ClientinfoEditor(); ConsolePrint("Help:", 3);
cie.Show(); ConsolePrint("---------", 1);
ConsolePrint("Novetus Client SDK Loaded.", 4); 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);
void LoadAssetLocalizer() ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 4);
{ ConsolePrint("= studio map | Launches Roblox Studio with the selected map", 4);
AssetLocalizer al = new AssetLocalizer(); ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 4);
al.Show(); ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 4);
ConsolePrint("Novetus Asset Localizer Loaded.", 4); ConsolePrint("---------", 1);
} ConsolePrint("= config save | Saves the config file", 4);
ConsolePrint("= config load | Reloads the config file", 4);
void LoadSplashTester() ConsolePrint("= config reset | Resets the config file", 4);
{ ConsolePrint("---------", 1);
SplashTester st = new SplashTester(); ConsolePrint("= webserver restart | Restarts the web server", 4);
st.Show(); ConsolePrint("= webserver stop | Stops a web server if there is one on.", 4);
ConsolePrint("Splash Tester Loaded.", 4); ConsolePrint("= webserver start | Starts a web server if there isn't one on yet.", 4);
} ConsolePrint("---------", 1);
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) void Button21Click(object sender, EventArgs e)
@ -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); 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; bool nomap = false;
if (result == DialogResult.Cancel)
{ switch(result)
return; {
} case DialogResult.No:
else if (result == DialogResult.No) nomap = true;
{ break;
nomap = true; default:
} break;
}
WriteConfigValues(); WriteConfigValues();
StartStudio(nomap); StartStudio(nomap);

View File

@ -7,7 +7,7 @@ namespace NovetusLauncher
{ {
public partial class AssetLocalizer : Form public partial class AssetLocalizer : Form
{ {
private RobloxXMLLocalizer.DLType currentType; private DLType currentType;
private string path; private string path;
private string name; private string name;
private string meshname; private string meshname;
@ -21,7 +21,7 @@ namespace NovetusLauncher
{ {
OpenFileDialog openFileDialog1 = new OpenFileDialog 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" Title = "Open ROBLOX level or model"
}; };
@ -35,37 +35,32 @@ namespace NovetusLauncher
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboBox1.SelectedIndex == 0) switch (comboBox1.SelectedIndex)
{ {
currentType = RobloxXMLLocalizer.DLType.RBXL; case 1:
} currentType = DLType.RBXM;
else if (comboBox1.SelectedIndex == 1) break;
{ case 2:
currentType = RobloxXMLLocalizer.DLType.RBXM; currentType = DLType.Hat;
} break;
else if (comboBox1.SelectedIndex == 2) case 3:
{ currentType = DLType.Head;
currentType = RobloxXMLLocalizer.DLType.Hat; break;
} case 4:
else if (comboBox1.SelectedIndex == 3) currentType = DLType.Face;
{ break;
currentType = RobloxXMLLocalizer.DLType.Head; case 5:
} currentType = DLType.Shirt;
else if (comboBox1.SelectedIndex == 4) break;
{ case 6:
currentType = RobloxXMLLocalizer.DLType.Face; currentType = DLType.TShirt;
} break;
else if (comboBox1.SelectedIndex == 5) case 7:
{ currentType = DLType.Pants;
currentType = RobloxXMLLocalizer.DLType.Shirt; break;
} default:
else if (comboBox1.SelectedIndex == 6) currentType = DLType.RBXL;
{ break;
currentType = RobloxXMLLocalizer.DLType.TShirt;
}
else if (comboBox1.SelectedIndex == 7)
{
currentType = RobloxXMLLocalizer.DLType.Pants;
} }
} }
@ -121,7 +116,7 @@ namespace NovetusLauncher
switch (currentType) switch (currentType)
{ {
case RobloxXMLLocalizer.DLType.RBXL: case DLType.RBXL:
switch (percent) switch (percent)
{ {
case 0: case 0:
@ -168,7 +163,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.RBXM: case DLType.RBXM:
switch (percent) switch (percent)
{ {
case 0: case 0:
@ -212,7 +207,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.Hat: case DLType.Hat:
switch (percent) switch (percent)
{ {
case 0: case 0:
@ -229,7 +224,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.Head: case DLType.Head:
//meshes //meshes
switch (percent) switch (percent)
{ {
@ -238,7 +233,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.Face: case DLType.Face:
//decal //decal
switch (percent) switch (percent)
{ {
@ -247,7 +242,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.TShirt: case DLType.TShirt:
//texture //texture
switch (percent) switch (percent)
{ {
@ -256,7 +251,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.Shirt: case DLType.Shirt:
//texture //texture
switch (percent) switch (percent)
{ {
@ -265,7 +260,7 @@ namespace NovetusLauncher
break; break;
} }
break; break;
case RobloxXMLLocalizer.DLType.Pants: case DLType.Pants:
//texture //texture
switch (percent) switch (percent)
{ {
@ -291,7 +286,7 @@ namespace NovetusLauncher
{ {
switch (currentType) switch (currentType)
{ {
case RobloxXMLLocalizer.DLType.RBXL: case DLType.RBXL:
//backup the original copy //backup the original copy
try try
{ {
@ -344,7 +339,7 @@ namespace NovetusLauncher
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.RBXM: case DLType.RBXM:
//meshes //meshes
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.Fonts); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.Fonts);
@ -387,7 +382,7 @@ namespace NovetusLauncher
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.Hat: case DLType.Hat:
//meshes //meshes
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHatFonts, name, meshname); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHatFonts, name, meshname);
@ -401,32 +396,32 @@ namespace NovetusLauncher
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.LocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.Head: case DLType.Head:
//meshes //meshes
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHeadFonts, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHeadFonts, name);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHeadFonts, 1, 1, 1, 1, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemHeadFonts, 1, 1, 1, 1, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.Face: case DLType.Face:
//decal //decal
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemFaceTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemFaceTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.TShirt: case DLType.TShirt:
//texture //texture
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemTShirtTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemTShirtTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.Shirt: case DLType.Shirt:
//texture //texture
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemShirtTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemShirtTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxXMLLocalizer.DLType.Pants: case DLType.Pants:
//texture //texture
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemPantsTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, GlobalVars.ItemPantsTexture, name);
@ -452,17 +447,17 @@ namespace NovetusLauncher
// This event handler deals with the results of the background operation. // This event handler deals with the results of the background operation.
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{ {
if (e.Cancelled == true) switch (e)
{ {
label2.Text = "Canceled!"; case RunWorkerCompletedEventArgs can when can.Cancelled == true:
} label2.Text = "Canceled!";
else if (e.Error != null) break;
{ case RunWorkerCompletedEventArgs err when err.Error != null:
label2.Text = "Error: " + e.Error.Message; label2.Text = "Error: " + e.Error.Message;
} break;
else default:
{ label2.Text = "Done!";
label2.Text = "Done!"; break;
} }
} }

View File

@ -18,21 +18,10 @@ namespace NovetusLauncher
/// </summary> /// </summary>
public partial class ClientinfoEditor : Form public partial class ClientinfoEditor : Form
{ {
//clientinfocreator private ClientInfo loadedClientInfo = new ClientInfo();
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 string SelectedClientInfoPath = ""; private string SelectedClientInfoPath = "";
private bool Locked = false; private bool Locked = false;
private bool FixScriptMapMode = false;
private bool AlreadyHasSecurity = false;
private bool NoGraphicsModeOptions = false;
private bool IsVersion2 = false; private bool IsVersion2 = false;
private string CustomArgs = "";
public ClientinfoEditor() public ClientinfoEditor()
{ {
@ -48,31 +37,17 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e) void CheckBox1CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox1.Checked == true) checkBox1.Checked = loadedClientInfo.UsesPlayerName;
{
UsesPlayerName = true;
}
else if (checkBox1.Checked == false)
{
UsesPlayerName = false;
}
} }
void CheckBox2CheckedChanged(object sender, EventArgs e) void CheckBox2CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox2.Checked == true) checkBox2.Checked = loadedClientInfo.UsesID;
{
UsesID = true;
}
else if (checkBox2.Checked == false)
{
UsesID = false;
}
} }
void TextBox1TextChanged(object sender, EventArgs e) void TextBox1TextChanged(object sender, EventArgs e)
{ {
SelectedClientDesc = textBox1.Text; loadedClientInfo.Description = textBox1.Text;
} }
void ClientinfoCreatorLoad(object sender, EventArgs e) void ClientinfoCreatorLoad(object sender, EventArgs e)
@ -87,38 +62,24 @@ namespace NovetusLauncher
LauncherFuncs.Config(cfgpath, false); LauncherFuncs.Config(cfgpath, false);
} }
if (GlobalVars.AdminMode == true) checkBox4.Visible = GlobalVars.AdminMode;
{
checkBox4.Visible = true;
}
else
{
checkBox4.Visible = false;
}
} }
void CheckBox3CheckedChanged(object sender, EventArgs e) void CheckBox3CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox3.Checked == true) checkBox3.Checked = loadedClientInfo.LegacyMode;
{
LegacyMode = true;
}
else if (checkBox3.Checked == false)
{
LegacyMode = false;
}
} }
void TextBox2TextChanged(object sender, EventArgs e) void TextBox2TextChanged(object sender, EventArgs e)
{ {
textBox2.Text = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); 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) void TextBox3TextChanged(object sender, EventArgs e)
{ {
textBox3.Text = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); 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) void Button4Click(object sender, EventArgs e)
@ -134,7 +95,7 @@ namespace NovetusLauncher
string ClientName = ""; string ClientName = "";
if (!LegacyMode) if (!loadedClientInfo.LegacyMode)
{ {
ClientName = "\\RobloxApp_Client.exe"; ClientName = "\\RobloxApp_Client.exe";
} }
@ -149,7 +110,7 @@ namespace NovetusLauncher
{ {
textBox2.Text = ClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox2.Text = ClientMD5.ToUpper(CultureInfo.InvariantCulture);
textBox2.BackColor = System.Drawing.Color.Lime; textBox2.BackColor = System.Drawing.Color.Lime;
SelectedClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); loadedClientInfo.ClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture);
} }
else else
{ {
@ -162,7 +123,7 @@ namespace NovetusLauncher
{ {
textBox3.Text = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); textBox3.Text = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture);
textBox3.BackColor = System.Drawing.Color.Lime; textBox3.BackColor = System.Drawing.Color.Lime;
SelectedClientScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); loadedClientInfo.ScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture);
} }
else else
{ {
@ -174,79 +135,51 @@ namespace NovetusLauncher
void CheckBox4CheckedChanged(object sender, EventArgs e) void CheckBox4CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox4.Checked == true) Locked = true;
{
Locked = true;
}
else if (checkBox4.Checked == false && Locked == true)
{
Locked = true;
}
} }
void CheckBox6CheckedChanged(object sender, EventArgs e) void CheckBox6CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox6.Checked == true) checkBox6.Checked = loadedClientInfo.Fix2007;
{
FixScriptMapMode = true;
}
else if (checkBox6.Checked == false)
{
FixScriptMapMode = false;
}
} }
void CheckBox7CheckedChanged(object sender, EventArgs e) void CheckBox7CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox7.Checked == true) checkBox7.Checked = loadedClientInfo.AlreadyHasSecurity;
{
AlreadyHasSecurity = true;
}
else if (checkBox7.Checked == false)
{
AlreadyHasSecurity = false;
}
} }
void checkBox5_CheckedChanged(object sender, EventArgs e) void checkBox5_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox5.Checked == true) checkBox5.Checked = loadedClientInfo.NoGraphicsOptions;
{
NoGraphicsModeOptions = true;
}
else if (checkBox5.Checked == false)
{
NoGraphicsModeOptions = false;
}
} }
void NewToolStripMenuItemClick(object sender, EventArgs e) void NewToolStripMenuItemClick(object sender, EventArgs e)
{ {
label9.Text = "Not Loaded"; label9.Text = "Not Loaded";
UsesPlayerName = false; loadedClientInfo.UsesPlayerName = false;
UsesID = false; loadedClientInfo.UsesID = false;
Warning = ""; loadedClientInfo.Warning = "";
LegacyMode = false; loadedClientInfo.LegacyMode = false;
FixScriptMapMode = false; loadedClientInfo.Fix2007 = false;
AlreadyHasSecurity = false; loadedClientInfo.AlreadyHasSecurity = false;
SelectedClientDesc = ""; loadedClientInfo.Description = "";
SelectedClientMD5 = ""; loadedClientInfo.ClientMD5 = "";
SelectedClientScriptMD5 = ""; loadedClientInfo.ScriptMD5 = "";
SelectedClientInfoPath = ""; SelectedClientInfoPath = "";
CustomArgs = ""; loadedClientInfo.CommandLineArgs = "";
Locked = false; Locked = false;
checkBox1.Checked = UsesPlayerName; checkBox1.Checked = loadedClientInfo.UsesPlayerName;
checkBox2.Checked = UsesID; checkBox2.Checked = loadedClientInfo.UsesID;
checkBox3.Checked = LegacyMode; checkBox3.Checked = loadedClientInfo.LegacyMode;
checkBox4.Checked = Locked; checkBox4.Checked = Locked;
checkBox6.Checked = FixScriptMapMode; checkBox6.Checked = loadedClientInfo.Fix2007;
checkBox7.Checked = AlreadyHasSecurity; checkBox7.Checked = loadedClientInfo.AlreadyHasSecurity;
checkBox5.Checked = NoGraphicsModeOptions; checkBox5.Checked = loadedClientInfo.NoGraphicsOptions;
textBox3.Text = SelectedClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); textBox3.Text = loadedClientInfo.ScriptMD5.ToUpper(CultureInfo.InvariantCulture);
textBox2.Text = SelectedClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox2.Text = loadedClientInfo.ClientMD5.ToUpper(CultureInfo.InvariantCulture);
textBox1.Text = SelectedClientDesc; textBox1.Text = loadedClientInfo.Description;
textBox4.Text = CustomArgs; textBox4.Text = loadedClientInfo.CommandLineArgs;
textBox5.Text = Warning; textBox5.Text = loadedClientInfo.Warning;
textBox2.BackColor = System.Drawing.SystemColors.Control; textBox2.BackColor = System.Drawing.SystemColors.Control;
textBox3.BackColor = System.Drawing.SystemColors.Control; textBox3.BackColor = System.Drawing.SystemColors.Control;
} }
@ -326,58 +259,58 @@ namespace NovetusLauncher
} }
else else
{ {
Boolean bline8 = Convert.ToBoolean(Decryptline8); bool bline8 = Convert.ToBoolean(Decryptline8);
Locked = bline8; Locked = bline8;
checkBox4.Checked = Locked; checkBox4.Checked = Locked;
} }
Boolean bline1 = Convert.ToBoolean(Decryptline1); bool bline1 = Convert.ToBoolean(Decryptline1);
UsesPlayerName = bline1; loadedClientInfo.UsesPlayerName = bline1;
Boolean bline2 = Convert.ToBoolean(Decryptline2); bool bline2 = Convert.ToBoolean(Decryptline2);
UsesID = bline2; loadedClientInfo.UsesID = bline2;
Warning = Decryptline3; loadedClientInfo.Warning = Decryptline3;
Boolean bline4 = Convert.ToBoolean(Decryptline4); bool bline4 = Convert.ToBoolean(Decryptline4);
LegacyMode = bline4; loadedClientInfo.LegacyMode = bline4;
SelectedClientMD5 = Decryptline5; loadedClientInfo.ClientMD5 = Decryptline5;
SelectedClientScriptMD5 = Decryptline6; loadedClientInfo.ScriptMD5 = Decryptline6;
SelectedClientDesc = Decryptline7; loadedClientInfo.Description = Decryptline7;
bool bline9 = Convert.ToBoolean(Decryptline9); bool bline9 = Convert.ToBoolean(Decryptline9);
FixScriptMapMode = bline9; loadedClientInfo.Fix2007 = bline9;
bool bline10 = Convert.ToBoolean(Decryptline10); bool bline10 = Convert.ToBoolean(Decryptline10);
AlreadyHasSecurity = bline10; loadedClientInfo.AlreadyHasSecurity = bline10;
if (IsVersion2) if (IsVersion2)
{ {
bool bline11 = Convert.ToBoolean(Decryptline11); bool bline11 = Convert.ToBoolean(Decryptline11);
NoGraphicsModeOptions = bline11; loadedClientInfo.NoGraphicsOptions = bline11;
CustomArgs = Decryptline12; loadedClientInfo.CommandLineArgs = Decryptline12;
} }
else else
{ {
//Agin, fake it. //Agin, fake it.
NoGraphicsModeOptions = false; loadedClientInfo.NoGraphicsOptions = false;
CustomArgs = Decryptline11; loadedClientInfo.CommandLineArgs = Decryptline11;
} }
checkBox1.Checked = UsesPlayerName; checkBox1.Checked = loadedClientInfo.UsesPlayerName;
checkBox2.Checked = UsesID; checkBox2.Checked = loadedClientInfo.UsesID;
checkBox3.Checked = LegacyMode; checkBox3.Checked = loadedClientInfo.LegacyMode;
checkBox6.Checked = FixScriptMapMode; checkBox6.Checked = loadedClientInfo.Fix2007;
checkBox7.Checked = AlreadyHasSecurity; checkBox7.Checked = loadedClientInfo.AlreadyHasSecurity;
checkBox5.Checked = NoGraphicsModeOptions; checkBox5.Checked = loadedClientInfo.NoGraphicsOptions;
textBox3.Text = SelectedClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); textBox3.Text = loadedClientInfo.ScriptMD5.ToUpper(CultureInfo.InvariantCulture);
textBox2.Text = SelectedClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox2.Text = loadedClientInfo.ClientMD5.ToUpper(CultureInfo.InvariantCulture);
textBox1.Text = SelectedClientDesc; textBox1.Text = loadedClientInfo.Description;
textBox4.Text = CustomArgs; textBox4.Text = loadedClientInfo.CommandLineArgs;
textBox5.Text = Warning; textBox5.Text = loadedClientInfo.Warning;
} }
} }
textBox2.BackColor = System.Drawing.SystemColors.Control; textBox2.BackColor = System.Drawing.SystemColors.Control;
@ -396,18 +329,18 @@ namespace NovetusLauncher
if (sfd.ShowDialog() == DialogResult.OK) if (sfd.ShowDialog() == DialogResult.OK)
{ {
string[] lines = { string[] lines = {
SecurityFuncs.Base64Encode(UsesPlayerName.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.UsesPlayerName.ToString()),
SecurityFuncs.Base64Encode(UsesID.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.UsesID.ToString()),
SecurityFuncs.Base64Encode(Warning.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.Warning.ToString()),
SecurityFuncs.Base64Encode(LegacyMode.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.LegacyMode.ToString()),
SecurityFuncs.Base64Encode(SelectedClientMD5.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.ClientMD5.ToString()),
SecurityFuncs.Base64Encode(SelectedClientScriptMD5.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.ScriptMD5.ToString()),
SecurityFuncs.Base64Encode(SelectedClientDesc.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.Description.ToString()),
SecurityFuncs.Base64Encode(Locked.ToString()), SecurityFuncs.Base64Encode(Locked.ToString()),
SecurityFuncs.Base64Encode(FixScriptMapMode.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.Fix2007.ToString()),
SecurityFuncs.Base64Encode(AlreadyHasSecurity.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.AlreadyHasSecurity.ToString()),
SecurityFuncs.Base64Encode(NoGraphicsModeOptions.ToString()), SecurityFuncs.Base64Encode(loadedClientInfo.NoGraphicsOptions.ToString()),
SecurityFuncs.Base64Encode(CustomArgs.ToString()) SecurityFuncs.Base64Encode(loadedClientInfo.CommandLineArgs.ToString())
}; };
File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|",lines))); File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|",lines)));
SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName); SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName);
@ -421,12 +354,12 @@ namespace NovetusLauncher
void TextBox4TextChanged(object sender, EventArgs e) void TextBox4TextChanged(object sender, EventArgs e)
{ {
CustomArgs = textBox4.Text; loadedClientInfo.CommandLineArgs = textBox4.Text;
} }
void TextBox5TextChanged(object sender, EventArgs e) void TextBox5TextChanged(object sender, EventArgs e)
{ {
Warning = textBox5.Text; loadedClientInfo.Warning = textBox5.Text;
} }
private void documentationToolStripMenuItem_Click(object sender, EventArgs e) private void documentationToolStripMenuItem_Click(object sender, EventArgs e)
@ -486,15 +419,15 @@ namespace NovetusLauncher
if (sfd.ShowDialog() == DialogResult.OK) if (sfd.ShowDialog() == DialogResult.OK)
{ {
string[] lines = { string[] lines = {
UsesPlayerName.ToString(), loadedClientInfo.UsesPlayerName.ToString(),
UsesID.ToString(), loadedClientInfo.UsesID.ToString(),
Warning.ToString(), loadedClientInfo.Warning.ToString(),
LegacyMode.ToString(), loadedClientInfo.LegacyMode.ToString(),
SelectedClientDesc.ToString(), loadedClientInfo.Description.ToString(),
FixScriptMapMode.ToString(), loadedClientInfo.Fix2007.ToString(),
AlreadyHasSecurity.ToString(), loadedClientInfo.AlreadyHasSecurity.ToString(),
NoGraphicsModeOptions.ToString(), loadedClientInfo.NoGraphicsOptions.ToString(),
CustomArgs.ToString() loadedClientInfo.CommandLineArgs.ToString()
}; };
File.WriteAllLines(sfd.FileName, lines); File.WriteAllLines(sfd.FileName, lines);
} }