From b1af3a2c9ba37db2d54f2de5c8e90451a9ff337b Mon Sep 17 00:00:00 2001 From: Bitl Date: Sat, 4 Jan 2020 14:21:26 -0700 Subject: [PATCH] removed unused code comments --- NovetusLauncher/NovetusFuncs/LauncherFuncs.cs | 46 ------------------ .../NovetusFuncs/RobloxXMLLocalizer.cs | 1 - .../NovetusFuncs/ScriptGenerator.cs | 31 ------------ NovetusLauncher/NovetusFuncs/SecurityFuncs.cs | 1 - NovetusLauncher/NovetusFuncs/WebServer.cs | 28 +---------- .../NovetusLauncher/CharacterCustomization.cs | 47 ------------------- NovetusLauncher/NovetusLauncher/MainForm.cs | 2 +- .../NovetusLauncher/SDK/AssetLocalizer.cs | 7 +-- .../NovetusLauncher/URI/LoaderForm.cs | 5 -- 9 files changed, 7 insertions(+), 161 deletions(-) diff --git a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs index 886fccd..d53e2f4 100644 --- a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs +++ b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs @@ -483,52 +483,6 @@ public class LauncherFuncs public static void ReloadLoadtextValue() { - //Temporarily removed until i can figure out a way to better integrate this. - - /* - if (GlobalVars.IsWebServerOn == true) - { - string extra = GlobalVars.Custom_Extra_SelectionIsHat == true ? GlobalVars.WebServer_HatDir + GlobalVars.Custom_Extra : GlobalVars.WebServer_ExtraDir + GlobalVars.Custom_Extra; - - GlobalVars.loadtext = "'" + GlobalVars.WebServer_BodyColors + "','" + - GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat1ID_Offline + "','" + - GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat2ID_Offline + "','" + - GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat3ID_Offline + "'," + - GlobalVars.WebServer_TShirtDir + GlobalVars.Custom_T_Shirt_Offline + "','" + - GlobalVars.WebServer_ShirtDir + GlobalVars.Custom_Shirt_Offline + "','" + - GlobalVars.WebServer_PantsDir + GlobalVars.Custom_Pants_Offline + "','" + - GlobalVars.WebServer_FaceDir + GlobalVars.Custom_Face_Offline + "','" + - GlobalVars.WebServer_HeadDir + GlobalVars.Custom_Head_Offline + "','" + - GlobalVars.Custom_Icon_Offline + "','" + - extra + "', true"; - - GlobalVars.sololoadtext = GlobalVars.loadtext.Replace(GlobalVars.WebServerURI,GlobalVars.LocalWebServerURI); - } - else - { - - GlobalVars.loadtext = "'" + GlobalVars.Custom_Hat1ID_Offline + "','" + - GlobalVars.Custom_Hat2ID_Offline + "','" + - GlobalVars.Custom_Hat3ID_Offline + "'," + - GlobalVars.HeadColorID + "," + - GlobalVars.TorsoColorID + "," + - GlobalVars.LeftArmColorID + "," + - GlobalVars.RightArmColorID + "," + - GlobalVars.LeftLegColorID + "," + - GlobalVars.RightLegColorID + ",'" + - GlobalVars.Custom_T_Shirt_Offline + "','" + - GlobalVars.Custom_Shirt_Offline + "','" + - GlobalVars.Custom_Pants_Offline + "','" + - GlobalVars.Custom_Face_Offline + "','" + - GlobalVars.Custom_Head_Offline + "','" + - GlobalVars.Custom_Icon_Offline + "','" + - //GlobalVars.Custom_Extra + "', false"; - GlobalVars.Custom_Extra + "'"; - - GlobalVars.sololoadtext = GlobalVars.loadtext; - } - */ - string hat1 = (GlobalVars.Custom_Hat1ID_Offline != "TeapotTurret.rbxm") ? GlobalVars.Custom_Hat1ID_Offline : "NoHat.rbxm"; string hat2 = (GlobalVars.Custom_Hat2ID_Offline != "TeapotTurret.rbxm") ? GlobalVars.Custom_Hat2ID_Offline : "NoHat.rbxm"; string hat3 = (GlobalVars.Custom_Hat3ID_Offline != "TeapotTurret.rbxm") ? GlobalVars.Custom_Hat3ID_Offline : "NoHat.rbxm"; diff --git a/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs b/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs index 5cb5969..4019c5a 100644 --- a/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs +++ b/NovetusLauncher/NovetusFuncs/RobloxXMLLocalizer.cs @@ -65,7 +65,6 @@ public static class RobloxXMLLocalizer //do whatever with your value string url = item3.Value; string urlFixed = url.Replace("&", "&").Replace("amp;", "&"); - //MessageBox.Show(urlFixed, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information); string peram = "id="; if (string.IsNullOrWhiteSpace(name)) diff --git a/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs b/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs index 3798e01..de47b5b 100644 --- a/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs +++ b/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs @@ -95,39 +95,8 @@ public class ScriptGenerator return ""; } } - - /* - public static string[] GetScriptContents(string scriptPath) - { - List array = new List(); - string line = ""; - using (StreamReader sr = new StreamReader(scriptPath)) - { - while ((line = sr.ReadLine()) != null) - { - array.Add(line); - } - } - - return array.ToArray(); - } - - - private static void ReadConfigValues() - { - LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); - } - - */ - public static void GenerateScriptForClient(ScriptType type, string client) { - //next, generate the header functions. - - //ReadConfigValues(); - - //string scriptcontents = MultiLine(GetScriptContents(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua")); - string code = GlobalVars.MultiLine( "--Load Script", //scriptcontents, diff --git a/NovetusLauncher/NovetusFuncs/SecurityFuncs.cs b/NovetusLauncher/NovetusFuncs/SecurityFuncs.cs index 41117d6..8de7d2e 100644 --- a/NovetusLauncher/NovetusFuncs/SecurityFuncs.cs +++ b/NovetusLauncher/NovetusFuncs/SecurityFuncs.cs @@ -38,7 +38,6 @@ public class SecurityFuncs public static string RandomString() { - CryptoRandom random = new CryptoRandom(); return RandomString(20); } diff --git a/NovetusLauncher/NovetusFuncs/WebServer.cs b/NovetusLauncher/NovetusFuncs/WebServer.cs index e1932f0..d9cfdfd 100644 --- a/NovetusLauncher/NovetusFuncs/WebServer.cs +++ b/NovetusLauncher/NovetusFuncs/WebServer.cs @@ -225,19 +225,7 @@ public class SimpleHTTPServer context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; } - } /*else { - if (context.Request.HttpMethod.Equals("GET") && filename.Contains("bodycolors.rbxm", StringComparison.OrdinalIgnoreCase)) { - string output = WebServerGenerator.GenerateBodyColorsXML(); - byte[] input = ASCIIEncoding.UTF8.GetBytes(output); - context.Response.ContentType = "text/xml"; - context.Response.ContentLength64 = input.Length; - context.Response.OutputStream.Write(input, 0, input.Length); - context.Response.StatusCode = (int)HttpStatusCode.OK; - context.Response.OutputStream.Flush(); - } else { - context.Response.StatusCode = (int)HttpStatusCode.NotFound; - } - }*/ + } context.Response.OutputStream.Close(); } @@ -250,16 +238,4 @@ public class SimpleHTTPServer _serverThread.Start(); GlobalVars.IsWebServerOn = true; } -} - -/* -public static class WebServerGenerator -{ - public static string GenerateBodyColorsXML() - { - string xmltemplate = GlobalVars.MultiLine(File.ReadAllLines(GlobalVars.CustomPlayerDir + "\\BodyColors.xml")); - string xml = String.Format(xmltemplate, GlobalVars.HeadColorID, GlobalVars.LeftArmColorID, GlobalVars.LeftLegColorID, GlobalVars.RightArmColorID, GlobalVars.RightLegColorID, GlobalVars.TorsoColorID); - return xml; - } -} -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs b/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs index 7fa9519..aa86a6a 100644 --- a/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs +++ b/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs @@ -1343,52 +1343,5 @@ namespace NovetusLauncher LauncherFuncs.WriteCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization); MessageBox.Show("Outfit Saved!"); } - - /* - private void button61_Click(object sender, EventArgs e) - { - try - { - if (GlobalVars.IsWebServerOn == true) - { - string IP = SecurityFuncs.GetExternalIPAddress(); - string localWebServerURL = "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString(); - string localWebServer_CustomPlayerDir = localWebServerURL + "/charcustom/"; - string localWebServer_HatDir = localWebServer_CustomPlayerDir + "hats/"; - string localWebServer_FaceDir = localWebServer_CustomPlayerDir + "faces/"; - string localWebServer_HeadDir = localWebServer_CustomPlayerDir + "heads/"; - string localWebServer_TShirtDir = localWebServer_CustomPlayerDir + "tshirts/"; - string localWebServer_ShirtDir = localWebServer_CustomPlayerDir + "shirts/"; - string localWebServer_PantsDir = localWebServer_CustomPlayerDir + "pants/"; - string localWebServer_ExtraDir = localWebServer_CustomPlayerDir + "custom/"; - string localWebServer_BodyColors = localWebServer_CustomPlayerDir + "bodycolors.rbxm"; - string charapp = localWebServer_BodyColors + ";" + - localWebServer_HatDir + GlobalVars.Custom_Hat1ID_Offline + ";" + - localWebServer_HatDir + GlobalVars.Custom_Hat2ID_Offline + ";" + - localWebServer_HatDir + GlobalVars.Custom_Hat3ID_Offline + ";" + - localWebServer_HeadDir + GlobalVars.Custom_Head_Offline + ";" + - localWebServer_FaceDir + GlobalVars.Custom_Face_Offline + ";" + - localWebServer_TShirtDir + GlobalVars.Custom_T_Shirt_Offline + ";" + - localWebServer_ShirtDir + GlobalVars.Custom_Shirt_Offline + ";" + - localWebServer_PantsDir + GlobalVars.Custom_Pants_Offline + ";" + - localWebServer_ExtraDir + GlobalVars.Custom_Extra; - textBox1.Text = charapp; - GlobalVars.CharacterID = charapp; - } - else - { - MessageBox.Show("Could not generate charapp. Are you running Novetus as as administrator and is the webserver running?"); - textBox1.Text = ""; - GlobalVars.CharacterID = ""; - } - } - catch(Exception ex) when (!Env.Debugging) - { - MessageBox.Show("Could not generate charapp. Error: " + ex.Message); - textBox1.Text = ""; - GlobalVars.CharacterID = ""; - } - } - */ } } diff --git a/NovetusLauncher/NovetusLauncher/MainForm.cs b/NovetusLauncher/NovetusLauncher/MainForm.cs index 7879e66..ce86ab6 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm.cs @@ -1349,7 +1349,7 @@ namespace NovetusLauncher string loadstring = GlobalVars.BasePath + "/" + System.AppDomain.CurrentDomain.FriendlyName; SecurityFuncs.RegisterURLProtocol("Novetus", loadstring, "Novetus URI"); ConsolePrint("URI Successfully Installed!", 3); - DialogResult result1 = MessageBox.Show("URI Successfully Installed!","Novetus - Install URI", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("URI Successfully Installed!","Novetus - Install URI", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) when (!Env.Debugging) { diff --git a/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs b/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs index 3d1b90e..c7577d0 100644 --- a/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs +++ b/NovetusLauncher/NovetusLauncher/SDK/AssetLocalizer.cs @@ -24,7 +24,7 @@ namespace NovetusLauncher private void button1_Click(object sender, EventArgs e) { - OpenFileDialog openFileDialog1 = new OpenFileDialog() + OpenFileDialog openFileDialog1 = new OpenFileDialog { Filter = (currentType == RobloxXMLLocalizer.DLType.RBXL) ? "ROBLOX Level (*.rbxl)|*.rbxl" : "ROBLOX Model (*.rbxm)|*.rbxm", Title = "Open ROBLOX level or model" @@ -104,7 +104,7 @@ namespace NovetusLauncher } } - private string GetProgressString(RobloxXMLLocalizer.DLType type, int percent) + private string GetProgressString(int percent) { string progressString = ""; @@ -422,6 +422,7 @@ namespace NovetusLauncher worker.ReportProgress(100); break; default: + worker.ReportProgress(100); break; } } @@ -434,7 +435,7 @@ namespace NovetusLauncher // This event handler updates the progress. private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { - label2.Text = GetProgressString(currentType, e.ProgressPercentage); + label2.Text = GetProgressString(e.ProgressPercentage); } // This event handler deals with the results of the background operation. diff --git a/NovetusLauncher/NovetusLauncher/URI/LoaderForm.cs b/NovetusLauncher/NovetusLauncher/URI/LoaderForm.cs index 133c73c..736c94e 100644 --- a/NovetusLauncher/NovetusLauncher/URI/LoaderForm.cs +++ b/NovetusLauncher/NovetusLauncher/URI/LoaderForm.cs @@ -209,11 +209,6 @@ namespace NovetusLauncher } } - void ReadConfigValues() - { - LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); - } - void ReadClientValues(string ClientName) { string clientpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\clients\\" + ClientName + "\\clientinfo.nov";