diff --git a/Novetus/NovetusCore/Classes/RobloxXML.cs b/Novetus/NovetusCore/Classes/RobloxXML.cs index 9bf5586..c070a63 100644 --- a/Novetus/NovetusCore/Classes/RobloxXML.cs +++ b/Novetus/NovetusCore/Classes/RobloxXML.cs @@ -575,7 +575,7 @@ public static class RobloxXML try { - download.InitDownload(path, fileext); + download.InitDownload(path, fileext, "", true); } catch (Exception ex) { diff --git a/Novetus/NovetusCore/SDK/Downloader.cs b/Novetus/NovetusCore/SDK/Downloader.cs index fecbee7..cbcc391 100644 --- a/Novetus/NovetusCore/SDK/Downloader.cs +++ b/Novetus/NovetusCore/SDK/Downloader.cs @@ -50,9 +50,24 @@ class Downloader public void InitDownload(string path, string fileext, string additionalText = "") { - string downloadOutcomeAddText = additionalText; + InitDownload(path, fileext, additionalText); + } - string outputfilename = fileName + fileext; + public void InitDownload(string path, string fileext, string additionalText, bool removeSpaces = false) + { + string downloadOutcomeAddText = additionalText; + string outputfilename = ""; + + if (removeSpaces == true) + { + outputfilename = (fileName + fileext).Replace(" ", ""); + } + else + { + outputfilename = fileName + fileext; + } + + string fullpath = path + "\\" + outputfilename; try diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs index 2a7ecc1..97564e6 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs @@ -43,11 +43,6 @@ partial class ClientinfoEditor this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.checkBox3 = new System.Windows.Forms.CheckBox(); - this.label3 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.button4 = new System.Windows.Forms.Button(); this.checkBox4 = new System.Windows.Forms.CheckBox(); this.checkBox6 = new System.Windows.Forms.CheckBox(); this.checkBox7 = new System.Windows.Forms.CheckBox(); @@ -56,8 +51,6 @@ partial class ClientinfoEditor this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toClientToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsTextFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.iNIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -213,53 +206,6 @@ partial class ClientinfoEditor this.checkBox3.UseVisualStyleBackColor = true; this.checkBox3.CheckedChanged += new System.EventHandler(this.CheckBox3CheckedChanged); // - // label3 - // - this.label3.Location = new System.Drawing.Point(309, 34); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(311, 13); - this.label3.TabIndex = 14; - this.label3.Text = "Client EXE MD5"; - this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // textBox2 - // - this.textBox2.BackColor = System.Drawing.SystemColors.Control; - this.textBox2.Location = new System.Drawing.Point(309, 50); - this.textBox2.Name = "textBox2"; - this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(311, 20); - this.textBox2.TabIndex = 15; - this.textBox2.TextChanged += new System.EventHandler(this.TextBox2TextChanged); - // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(309, 89); - this.textBox3.Name = "textBox3"; - this.textBox3.ReadOnly = true; - this.textBox3.Size = new System.Drawing.Size(312, 20); - this.textBox3.TabIndex = 16; - this.textBox3.TextChanged += new System.EventHandler(this.TextBox3TextChanged); - // - // label4 - // - this.label4.Location = new System.Drawing.Point(309, 73); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(311, 13); - this.label4.TabIndex = 17; - this.label4.Text = "Client Script MD5"; - this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // button4 - // - this.button4.Location = new System.Drawing.Point(383, 115); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(168, 29); - this.button4.TabIndex = 18; - this.button4.Text = "Load MD5s from client directory"; - this.button4.UseVisualStyleBackColor = true; - this.button4.Click += new System.EventHandler(this.Button4Click); - // // checkBox4 // this.checkBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -332,26 +278,10 @@ partial class ClientinfoEditor // // saveToolStripMenuItem // - this.saveToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toDirectoryToolStripMenuItem, - this.toClientToolStripMenuItem}); this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "Save"; - // - // toDirectoryToolStripMenuItem - // - this.toDirectoryToolStripMenuItem.Name = "toDirectoryToolStripMenuItem"; - this.toDirectoryToolStripMenuItem.Size = new System.Drawing.Size(192, 22); - this.toDirectoryToolStripMenuItem.Text = "To client directory..."; - this.toDirectoryToolStripMenuItem.Click += new System.EventHandler(this.SaveToClientToolStripMenuItemClick); - // - // toClientToolStripMenuItem - // - this.toClientToolStripMenuItem.Name = "toClientToolStripMenuItem"; - this.toClientToolStripMenuItem.Size = new System.Drawing.Size(192, 22); - this.toClientToolStripMenuItem.Text = "To separate directory..."; - this.toClientToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick); + this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToClientToolStripMenuItemClick); // // saveAsTextFileToolStripMenuItem // @@ -365,14 +295,14 @@ partial class ClientinfoEditor // textToolStripMenuItem // this.textToolStripMenuItem.Name = "textToolStripMenuItem"; - this.textToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.textToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.textToolStripMenuItem.Text = "Text"; this.textToolStripMenuItem.Click += new System.EventHandler(this.saveAsTextFileToolStripMenuItem_Click); // // iNIToolStripMenuItem // this.iNIToolStripMenuItem.Name = "iNIToolStripMenuItem"; - this.iNIToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.iNIToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.iNIToolStripMenuItem.Text = "INI"; this.iNIToolStripMenuItem.Click += new System.EventHandler(this.saveAsINIFileToolStripMenuItem_Click); // @@ -1041,17 +971,17 @@ partial class ClientinfoEditor // // textBox4 // - this.textBox4.Location = new System.Drawing.Point(309, 173); + this.textBox4.Location = new System.Drawing.Point(309, 55); this.textBox4.Multiline = true; this.textBox4.Name = "textBox4"; this.textBox4.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBox4.Size = new System.Drawing.Size(311, 156); + this.textBox4.Size = new System.Drawing.Size(311, 274); this.textBox4.TabIndex = 23; this.textBox4.TextChanged += new System.EventHandler(this.TextBox4TextChanged); // // label5 // - this.label5.Location = new System.Drawing.Point(309, 154); + this.label5.Location = new System.Drawing.Point(306, 36); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(311, 16); this.label5.TabIndex = 24; @@ -1160,11 +1090,6 @@ partial class ClientinfoEditor this.Controls.Add(this.checkBox7); this.Controls.Add(this.checkBox6); this.Controls.Add(this.checkBox4); - this.Controls.Add(this.button4); - this.Controls.Add(this.label4); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.label3); this.Controls.Add(this.checkBox3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); @@ -1198,11 +1123,6 @@ partial class ClientinfoEditor private System.Windows.Forms.CheckBox checkBox7; private System.Windows.Forms.CheckBox checkBox6; private System.Windows.Forms.CheckBox checkBox4; - private System.Windows.Forms.Button button4; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.Label label3; private System.Windows.Forms.CheckBox checkBox3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; @@ -1299,6 +1219,4 @@ partial class ClientinfoEditor private System.Windows.Forms.Label label10; private System.Windows.Forms.ToolStripMenuItem textToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem iNIToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toDirectoryToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toClientToolStripMenuItem; } diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs index dc11b25..507792e 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs @@ -48,72 +48,6 @@ public partial class ClientinfoEditor : Form SelectedClientInfo.LegacyMode = checkBox3.Checked; } - void TextBox2TextChanged(object sender, EventArgs e) - { - textBox2.Text = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); - SelectedClientInfo.ClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); - } - - void TextBox3TextChanged(object sender, EventArgs e) - { - textBox3.Text = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); - SelectedClientInfo.ScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); - } - - void Button4Click(object sender, EventArgs e) - { - if (string.IsNullOrWhiteSpace(SelectedClientInfoPath)) - { - FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog(); - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) - { - SelectedClientInfoPath = folderBrowserDialog1.SelectedPath; - } - } - - string ClientName = ""; - - if (!SelectedClientInfo.LegacyMode) - { - ClientName = "\\RobloxApp_client.exe"; - } - else - { - ClientName = "\\RobloxApp.exe"; - } - - string ClientMD5 = File.Exists(SelectedClientInfoPath + ClientName) ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + ClientName) : ""; - - if (!string.IsNullOrWhiteSpace(ClientMD5)) - { - textBox2.Text = ClientMD5.ToUpper(CultureInfo.InvariantCulture); - textBox2.BackColor = System.Drawing.Color.Lime; - SelectedClientInfo.ClientMD5 = textBox2.Text.ToUpper(CultureInfo.InvariantCulture); - } - else - { - MessageBox.Show("Cannot load '" + ClientName.Trim('/') + "'. Please make sure you selected the directory","Novetus Launcher - Error while generating MD5 for client", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - string ClientScriptMD5 = File.Exists(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; - - if (!string.IsNullOrWhiteSpace(ClientScriptMD5)) - { - textBox3.Text = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); - textBox3.BackColor = System.Drawing.Color.Lime; - SelectedClientInfo.ScriptMD5 = textBox3.Text.ToUpper(CultureInfo.InvariantCulture); - } - else - { - MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you selected the directory","Novetus Launcher - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - if (!string.IsNullOrWhiteSpace(ClientMD5) && !string.IsNullOrWhiteSpace(ClientScriptMD5)) - { - MessageBox.Show("MD5s generated.", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - void CheckBox4CheckedChanged(object sender, EventArgs e) { if (checkBox4.Checked == true) @@ -300,56 +234,15 @@ public partial class ClientinfoEditor : Form comboBox1.SelectedIndex = 0; break; } - textBox3.Text = SelectedClientInfo.ScriptMD5.ToUpper(CultureInfo.InvariantCulture); - textBox2.Text = SelectedClientInfo.ClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox1.Text = SelectedClientInfo.Description; textBox4.Text = SelectedClientInfo.CommandLineArgs; textBox5.Text = SelectedClientInfo.Warning; - - textBox2.BackColor = System.Drawing.SystemColors.Control; - textBox3.BackColor = System.Drawing.SystemColors.Control; - } - - void SaveToolStripMenuItemClick(object sender, EventArgs e) - { - using (var sfd = new SaveFileDialog()) - { - sfd.Filter = "Novetus Clientinfo files (*.nov)|*.nov"; - sfd.FilterIndex = 1; - string filename = "clientinfo.nov"; - sfd.FileName = filename; - sfd.Title = "Save " + filename; - - if (sfd.ShowDialog() == DialogResult.OK) - { - string[] lines = { - SecurityFuncs.Base64Encode(SelectedClientInfo.UsesPlayerName.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.UsesID.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.Warning.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.LegacyMode.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.ClientMD5.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.ScriptMD5.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.Description.ToString()), - SecurityFuncs.Base64Encode(Locked.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.Fix2007.ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.AlreadyHasSecurity.ToString()), - SecurityFuncs.Base64Encode(Settings.GraphicsOptions.GetIntForClientLoadOptions(SelectedClientInfo.ClientLoadOptions).ToString()), - SecurityFuncs.Base64Encode(SelectedClientInfo.CommandLineArgs.ToString()) - }; - File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|", lines))); - SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName); - - MessageBox.Show(sfd.FileName + " saved!", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - - label9.Text = "v2 (v" + GlobalVars.ProgramInformation.Version + ")"; - textBox2.BackColor = System.Drawing.SystemColors.Control; - textBox3.BackColor = System.Drawing.SystemColors.Control; } void SaveToClientToolStripMenuItemClick(object sender, EventArgs e) { + GenerateMD5s(); + if (!string.IsNullOrWhiteSpace(SelectedClientInfoPath)) { string[] lines = { @@ -369,8 +262,6 @@ public partial class ClientinfoEditor : Form File.WriteAllText(SelectedClientInfoPath + "\\clientinfo.nov", SecurityFuncs.Base64Encode(string.Join("|", lines))); label9.Text = "v2 (v" + GlobalVars.ProgramInformation.Version + ")"; - textBox2.BackColor = System.Drawing.SystemColors.Control; - textBox3.BackColor = System.Drawing.SystemColors.Control; MessageBox.Show(SelectedClientInfoPath + "\\clientinfo.nov saved!", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -534,6 +425,58 @@ public partial class ClientinfoEditor : Form #endregion #region Functions + private void GenerateMD5s() + { + if (string.IsNullOrWhiteSpace(SelectedClientInfoPath)) + { + MessageBox.Show("Please choose the folder where you would like to save your clientinfo file.", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + + FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog(); + if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) + { + SelectedClientInfoPath = folderBrowserDialog1.SelectedPath; + } + } + + string ClientName = ""; + + if (!SelectedClientInfo.LegacyMode) + { + ClientName = "\\RobloxApp_client.exe"; + } + else + { + ClientName = "\\RobloxApp.exe"; + } + + string ClientMD5 = File.Exists(SelectedClientInfoPath + ClientName) ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + ClientName) : ""; + + if (!string.IsNullOrWhiteSpace(ClientMD5)) + { + SelectedClientInfo.ClientMD5 = ClientMD5.ToUpper(CultureInfo.InvariantCulture); + } + else + { + MessageBox.Show("Cannot load '" + ClientName.Trim('/') + "'. Please make sure you saved the clientinfo.nov into the client directory and if the file exists.", "Novetus Launcher - Error while generating MD5 for client", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + string ClientScriptMD5 = File.Exists(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; + + if (!string.IsNullOrWhiteSpace(ClientScriptMD5)) + { + SelectedClientInfo.ScriptMD5 = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); + } + else + { + MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you saved the clientinfo.nov into the client directory and if the file exists.", "Novetus Launcher - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + if (!string.IsNullOrWhiteSpace(ClientMD5) && !string.IsNullOrWhiteSpace(ClientScriptMD5)) + { + MessageBox.Show("MD5s generated.", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + private void AddClientinfoText(string text) { textBox4.Paste(text); @@ -591,13 +534,9 @@ public partial class ClientinfoEditor : Form comboBox1.SelectedIndex = 0; break; } - textBox3.Text = SelectedClientInfo.ScriptMD5.ToUpper(CultureInfo.InvariantCulture); - textBox2.Text = SelectedClientInfo.ClientMD5.ToUpper(CultureInfo.InvariantCulture); textBox1.Text = SelectedClientInfo.Description; textBox4.Text = SelectedClientInfo.CommandLineArgs; textBox5.Text = SelectedClientInfo.Warning; - textBox2.BackColor = System.Drawing.SystemColors.Control; - textBox3.BackColor = System.Drawing.SystemColors.Control; } #endregion }