diff --git a/NovetusLauncher/NovetusLauncher/ClientinfoCreator.Designer.cs b/NovetusLauncher/NovetusLauncher/ClientinfoCreator.Designer.cs index e908a61..790a749 100644 --- a/NovetusLauncher/NovetusLauncher/ClientinfoCreator.Designer.cs +++ b/NovetusLauncher/NovetusLauncher/ClientinfoCreator.Designer.cs @@ -54,6 +54,7 @@ namespace NovetusLauncher 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(); this.SuspendLayout(); // // checkBox1 @@ -78,16 +79,16 @@ namespace NovetusLauncher // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(9, 259); + this.textBox1.Location = new System.Drawing.Point(9, 280); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(310, 116); + this.textBox1.Size = new System.Drawing.Size(310, 128); this.textBox1.TabIndex = 4; this.textBox1.TextChanged += new System.EventHandler(this.TextBox1TextChanged); // // label1 // - this.label1.Location = new System.Drawing.Point(8, 240); + this.label1.Location = new System.Drawing.Point(8, 261); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(92, 16); this.label1.TabIndex = 5; @@ -103,7 +104,7 @@ namespace NovetusLauncher // // button1 // - this.button1.Location = new System.Drawing.Point(167, 410); + this.button1.Location = new System.Drawing.Point(167, 443); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(154, 30); this.button1.TabIndex = 7; @@ -113,7 +114,7 @@ namespace NovetusLauncher // // button2 // - this.button2.Location = new System.Drawing.Point(8, 410); + this.button2.Location = new System.Drawing.Point(8, 443); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(150, 30); this.button2.TabIndex = 10; @@ -133,7 +134,7 @@ namespace NovetusLauncher // // button3 // - this.button3.Location = new System.Drawing.Point(9, 381); + this.button3.Location = new System.Drawing.Point(9, 414); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(312, 23); this.button3.TabIndex = 12; @@ -153,7 +154,7 @@ namespace NovetusLauncher // // label3 // - this.label3.Location = new System.Drawing.Point(8, 134); + this.label3.Location = new System.Drawing.Point(8, 155); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(92, 13); this.label3.TabIndex = 14; @@ -161,7 +162,7 @@ namespace NovetusLauncher // // textBox2 // - this.textBox2.Location = new System.Drawing.Point(10, 150); + this.textBox2.Location = new System.Drawing.Point(10, 171); this.textBox2.Name = "textBox2"; this.textBox2.ReadOnly = true; this.textBox2.Size = new System.Drawing.Size(311, 20); @@ -170,7 +171,7 @@ namespace NovetusLauncher // // textBox3 // - this.textBox3.Location = new System.Drawing.Point(8, 189); + this.textBox3.Location = new System.Drawing.Point(8, 210); this.textBox3.Name = "textBox3"; this.textBox3.ReadOnly = true; this.textBox3.Size = new System.Drawing.Size(312, 20); @@ -179,7 +180,7 @@ namespace NovetusLauncher // // label4 // - this.label4.Location = new System.Drawing.Point(8, 173); + this.label4.Location = new System.Drawing.Point(8, 194); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(92, 13); this.label4.TabIndex = 17; @@ -187,7 +188,7 @@ namespace NovetusLauncher // // button4 // - this.button4.Location = new System.Drawing.Point(8, 215); + this.button4.Location = new System.Drawing.Point(8, 236); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(312, 22); this.button4.TabIndex = 18; @@ -216,12 +217,23 @@ namespace NovetusLauncher this.checkBox6.UseVisualStyleBackColor = true; this.checkBox6.CheckedChanged += new System.EventHandler(this.CheckBox6CheckedChanged); // + // checkBox7 + // + this.checkBox7.Location = new System.Drawing.Point(9, 125); + this.checkBox7.Name = "checkBox7"; + this.checkBox7.Size = new System.Drawing.Size(307, 24); + this.checkBox7.TabIndex = 21; + this.checkBox7.Text = "Already has security options"; + this.checkBox7.UseVisualStyleBackColor = true; + this.checkBox7.CheckedChanged += new System.EventHandler(this.CheckBox7CheckedChanged); + // // ClientinfoEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(332, 452); + this.ClientSize = new System.Drawing.Size(332, 485); + this.Controls.Add(this.checkBox7); this.Controls.Add(this.checkBox6); this.Controls.Add(this.checkBox4); this.Controls.Add(this.button4); @@ -248,6 +260,7 @@ namespace NovetusLauncher this.ResumeLayout(false); this.PerformLayout(); } + private System.Windows.Forms.CheckBox checkBox7; private System.Windows.Forms.CheckBox checkBox6; private System.Windows.Forms.CheckBox checkBox4; private System.Windows.Forms.Button button4; diff --git a/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs b/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs index cff4d41..bf7cc46 100644 --- a/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs +++ b/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs @@ -30,6 +30,8 @@ namespace NovetusLauncher private string SelectedClientScriptMD5 = ""; private string SelectedClientInfoPath = ""; private bool Locked = false; + private bool FixScriptMapMode = false; + private bool AlreadyHasSecurity = false; public ClientinfoEditor() { @@ -103,34 +105,29 @@ namespace NovetusLauncher Decryptline5 = SecurityFuncs.Base64Decode(result[4]); Decryptline6 = SecurityFuncs.Base64Decode(result[5]); Decryptline7 = SecurityFuncs.Base64Decode(result[6]); + Decryptline8 = SecurityFuncs.Base64Decode(result[7]); + //Decryptline9 = SecurityFuncs.Base64Decode(result[8]); + //Decryptline10 = SecurityFuncs.Base64Decode(result[9]); - try + if (GlobalVars.AdminMode != true) { - Decryptline8 = SecurityFuncs.Base64Decode(result[7]); - - if (GlobalVars.AdminMode != true) + Boolean bline8 = Convert.ToBoolean(Decryptline8); + if (bline8 == true) { - Boolean bline8 = Convert.ToBoolean(Decryptline8); - if (bline8 == true) - { - MessageBox.Show("This client is locked and therefore it cannot be loaded.","Novetus Launcher - Error when loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - else - { - Locked = bline8; - checkBox4.Checked = false; - } + MessageBox.Show("This client is locked and therefore it cannot be loaded.","Novetus Launcher - Error when loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; } else { - Boolean bline8 = Convert.ToBoolean(Decryptline8); Locked = bline8; checkBox4.Checked = false; } } - catch(IndexOutOfRangeException) + else { + Boolean bline8 = Convert.ToBoolean(Decryptline8); + Locked = bline8; + checkBox4.Checked = false; } Boolean bline1 = Convert.ToBoolean(Decryptline1); @@ -151,10 +148,18 @@ namespace NovetusLauncher SelectedClientDesc = Decryptline7; + //bool bline9 = Convert.ToBoolean(Decryptline9); + //FixScriptMapMode = Decryptline9; + + //bool bline10 = Convert.ToBoolean(Decryptline10); + //AlreadyHasSecurity = Decryptline10; + checkBox1.Checked = UsesPlayerName; checkBox2.Checked = UsesID; checkBox5.Checked = LoadsAssetsOnline; checkBox3.Checked = LegacyMode; + //checkBox6.Checked = FixScriptMapMode; + //checkBox7.Checked = AlreadyHasSecurity; textBox3.Text = SelectedClientScriptMD5.ToUpper(); textBox2.Text = SelectedClientMD5.ToUpper(); textBox1.Text = SelectedClientDesc; @@ -181,7 +186,9 @@ namespace NovetusLauncher SecurityFuncs.Base64Encode(SelectedClientMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientScriptMD5.ToString()), SecurityFuncs.Base64Encode(SelectedClientDesc.ToString()), - SecurityFuncs.Base64Encode(Locked.ToString()) + SecurityFuncs.Base64Encode(Locked.ToString()), + SecurityFuncs.Base64Encode(FixScriptMapMode.ToString()), + SecurityFuncs.Base64Encode(AlreadyHasSecurity.ToString()) }; File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|",lines))); } @@ -218,6 +225,8 @@ namespace NovetusLauncher UsesID = false; LoadsAssetsOnline = false; LegacyMode = false; + FixScriptMapMode = false; + AlreadyHasSecurity = false; SelectedClientDesc = ""; SelectedClientMD5 = ""; SelectedClientScriptMD5 = ""; @@ -225,6 +234,8 @@ namespace NovetusLauncher checkBox2.Checked = UsesID; checkBox5.Checked = LoadsAssetsOnline; checkBox3.Checked = LegacyMode; + checkBox6.Checked = FixScriptMapMode; + checkBox7.Checked = AlreadyHasSecurity; textBox3.Text = SelectedClientScriptMD5.ToUpper(); textBox2.Text = SelectedClientMD5.ToUpper(); textBox1.Text = SelectedClientDesc; @@ -317,5 +328,17 @@ namespace NovetusLauncher FixScriptMapMode = false; } } + + void CheckBox7CheckedChanged(object sender, EventArgs e) + { + if (checkBox7.Checked == true) + { + AlreadyHasSecurity = true; + } + else if (checkBox7.Checked == false) + { + AlreadyHasSecurity = false; + } + } } } diff --git a/NovetusLauncher/NovetusLauncher/LauncherFuncs.cs b/NovetusLauncher/NovetusLauncher/LauncherFuncs.cs index 23ed8a8..326f1de 100644 --- a/NovetusLauncher/NovetusLauncher/LauncherFuncs.cs +++ b/NovetusLauncher/NovetusLauncher/LauncherFuncs.cs @@ -282,6 +282,8 @@ namespace NovetusLauncher Decryptline5 = SecurityFuncs.Base64Decode(result[4]); Decryptline6 = SecurityFuncs.Base64Decode(result[5]); Decryptline7 = SecurityFuncs.Base64Decode(result[6]); + //Decryptline9 = SecurityFuncs.Base64Decode(result[8]); + //Decryptline10 = SecurityFuncs.Base64Decode(result[9]); bool bline1 = Convert.ToBoolean(Decryptline1); GlobalVars.UsesPlayerName = bline1; @@ -300,6 +302,12 @@ namespace NovetusLauncher GlobalVars.SelectedClientScriptMD5 = Decryptline6; GlobalVars.SelectedClientDesc = Decryptline7; + + //bool bline9 = Convert.ToBoolean(Decryptline9); + //GlobalVars.FixScriptMapMode = Decryptline9; + + //bool bline10 = Convert.ToBoolean(Decryptline10); + //GlobalVars.AlreadyHasSecurity = Decryptline10; } public static void GeneratePlayerID() @@ -709,381 +717,116 @@ namespace NovetusLauncher * * now, we have to call the funtion associated for the action, such as starting the main client or something * we also need to make sure that when we add the option, we'll need to adapt map loading to work RBX2007 style for the clients using the script generator. - * / + */ - /* public class ScriptGenerator { public ScriptGenerator() { } + + public enum ScriptType + { + Client = 0, + Server = 1, + Solo = 2, + Studio = 3 + } + + public static bool TypeSupportsCustom(ScriptType type) + { + if (type == ScriptType.Server || type == ScriptType.Studio) + { + return false; + } + else + { + return true; + } + } + + public static string GetScriptFuncForType(ScriptType type) + { + string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); + if (type == ScriptType.Client) + { + if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + { + return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')"; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + { + return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')"; + } + else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) + { + return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')"; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) + { + return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')"; + } + } + else if (type == ScriptType.Server) + { + return "_G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "'," + GlobalVars.DisableTeapotTurret.ToString().ToLower() + ")"; + } + else if (type == ScriptType.Solo) + { + if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + { + return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + { + return "_G.CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ")"; + } + else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) + { + return "_G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false ) + { + return "_G.CSSolo(0,'Player','" + GlobalVars.loadtext + ")"; + } + } + else if (type == ScriptType.Studio) + { + return ""; + } + else + { + return ""; + } + + return ""; + } + + private static void ReadConfigValues() + { + LauncherFuncs.ReadConfigValues(GlobalVars.BasePath + "\\config.txt"); + } - public static void GenerateScriptForClient() + public static void GenerateScriptForClient(ScriptType type) { //next, generate the header functions. - SecurityFuncs.ReadConfigValues(); - - int aasamples = GlobalVars.AASamples.Equals(0) ? 1 : GlobalVars.AASamples.Equals(1) ? 4 : GlobalVars.AASamples.Equals(2) ? 8 : 1; - - string header = MultiLine( - "--Header", - "function newWaitForChild(newParent,name)", - "local returnable = nil", - "if newParent:FindFirstChild(name) then", - "returnable = newParent:FindFirstChild(name)", - "else", - "repeat wait() returnable = newParent:FindFirstChild(name) until returnable ~= nil", - "end", - "return returnable", - "end", - "settings().Rendering.Shadows = " + GlobalVars.Shadows.ToString().ToLower(), - "settings().Rendering.AASamples = " + aasamples, - "AnimatedCharacter = " + GlobalVars.AnimatedCharacter.ToString().ToLower() - ); - - string playersettings = MultiLine( - "--Player Settings", - "UserID = " + GlobalVars.UserID, - "PlayerName = '" + GlobalVars.Name + "'" - ); - - string customizationsettings = ""; - - if (GlobalVars.AnimatedCharacter == false) - { - customizationsettings = MultiLine( - "--Customization Settings", - "Hat1ID = 'NoHat.rbxm'" - ); - } - else - { - customizationsettings = MultiLine( - "--Customization Settings", - "Hat1ID = '" + GlobalVars.HatName + "'" - ); - } - - string colorsettings = ""; - - if (GlobalVars.AnimatedCharacter == false) - { - if (GlobalVars.UseRandomColors) - { - colorsettings = GeneratePlayerColorString(); - } - else - { - colorsettings = GeneratePlayerColorPresetString(GlobalVars.PlayerColorPreset); - } - } - else - { - colorsettings = MultiLine( - "--Color Settings", - "HeadColorID = " + GlobalVars.HeadColor, - "TorsoColorID = " + GlobalVars.TorsoColor, - "LeftArmColorID = " + GlobalVars.LeftArmColor, - "RightArmColorID = " + GlobalVars.RightArmColor, - "LeftLegColorID = " + GlobalVars.LeftLegColor, - "RightLegColorID = " + GlobalVars.RightLegColor - ); - } - - //add customization funcs - string customizationgen = MultiLine( - "--Customization Code", - "function InitalizeClientAppearance(Player,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,HatID)", - "local newCharApp = Instance.new('IntValue',Player)", - "newCharApp.Name = 'Appearance'", - "for i=1,6,1 do", - "local BodyColor = Instance.new('BrickColorValue',newCharApp)", - "if (i == 1) then", - "if (HeadColorID ~= nil) then", - "BodyColor.Value = BrickColor.new(HeadColorID)", - "BodyColor.Name = 'HeadColor (ID: '..HeadColorID..')'", - "else", - "BodyColor.Value = BrickColor.new(1)", - "BodyColor.Name = 'HeadColor (ID: 1)'", - "end", - "elseif (i == 2) then", - "if (TorsoColorID ~= nil) then", - "BodyColor.Value = BrickColor.new(TorsoColorID)", - "BodyColor.Name = 'TorsoColor (ID: '..TorsoColorID..')'", - "else", - "BodyColor.Value = BrickColor.new(1)", - "BodyColor.Name = 'TorsoColor (ID: 1)'", - "end", - "elseif (i == 3) then", - "if (LeftArmColorID ~= nil) then", - "BodyColor.Value = BrickColor.new(LeftArmColorID)", - "BodyColor.Name = 'LeftArmColor (ID: '..LeftArmColorID..')'", - "else", - "BodyColor.Value = BrickColor.new(1)", - "BodyColor.Name = 'LeftArmColor (ID: 1)'", - "end", - "elseif (i == 4) then", - "if (RightArmColorID ~= nil) then", - "BodyColor.Value = BrickColor.new(RightArmColorID)", - "BodyColor.Name = 'RightArmColor (ID: '..RightArmColorID..')'", - "else", - "BodyColor.Value = BrickColor.new(1)", - "BodyColor.Name = 'RightArmColor (ID: 1)'", - "end", - "elseif (i == 5) then", - "if (LeftLegColorID ~= nil) then", - "BodyColor.Value = BrickColor.new(LeftLegColorID)", - "BodyColor.Name = 'LeftLegColor (ID: '..LeftLegColorID..')'", - "else", - "BodyColor.Value = BrickColor.new(1)", - "BodyColor.Name = 'LeftLegColor (ID: 1)'", - "end", - "elseif (i == 6) then", - "if (RightLegColorID ~= nil) then", - "BodyColor.Value = BrickColor.new(RightLegColorID)", - "BodyColor.Name = 'RightLegColor (ID: '..RightLegColorID..')'", - "else", - "BodyColor.Value = BrickColor.new(1)", - "BodyColor.Name = 'RightLegColor (ID: 1)'", - "end", - "end", - "local typeValue = Instance.new('NumberValue')", - "typeValue.Name = 'CustomizationType'", - "typeValue.Parent = BodyColor", - "typeValue.Value = 1", - "local indexValue = Instance.new('NumberValue')", - "indexValue.Name = 'ColorIndex'", - "indexValue.Parent = BodyColor", - "indexValue.Value = i", - "end", - "local newHat = Instance.new('StringValue',newCharApp)", - "if (HatID ~= nil) then", - "newHat.Value = HatID", - "newHat.Name = HatID", - "else", - "newHat.Value = 'NoHat.rbxm'", - "newHat.Name = 'NoHat.rbxm'", - "end", - "local typeValue = Instance.new('NumberValue')", - "typeValue.Name = 'CustomizationType'", - "typeValue.Parent = newHat", - "typeValue.Value = 2", - "end", - "function LoadCharacterNew(playerApp,newChar)", - "local charparts = {[1] = newWaitForChild(newChar,'Head'),[2] = newWaitForChild(newChar,'Torso'),[3] = newWaitForChild(newChar,'Left Arm'),[4] = newWaitForChild(newChar,'Right Arm'),[5] = newWaitForChild(newChar,'Left Leg'),[6] = newWaitForChild(newChar,'Right Leg')}", - "for _,newVal in pairs(playerApp:GetChildren()) do", - "newWaitForChild(newVal,'CustomizationType')", - "local customtype = newVal:FindFirstChild('CustomizationType')", - "if (customtype.Value == 1) then ", - "pcall(function()", - "newWaitForChild(newVal,'ColorIndex')", - "local colorindex = newVal:FindFirstChild('ColorIndex')", - "charparts[colorindex.Value].BrickColor = newVal.Value ", - "end)", - "elseif (customtype.Value == 2) then", - "pcall(function()", - "local newHat = game.Workspace:InsertContent('rbxasset://hats/'..newVal.Value)", - "if newHat[1] then ", - "if newHat[1].className == 'Hat' then", - "newHat[1].Parent = newChar", - "else", - "newHat[1]:remove()", - "end", - "end", - "end)", - "end", - "end", - "end" - ); - - //finally, we generate the actual script code. + ReadConfigValues(); string code = MultiLine( - "--Game Code", - "game:GetService('RunService'):run()", - "local plr = game.Players:CreateLocalPlayer(UserID)", - "plr.Name = PlayerName", - "plr:LoadCharacter()", - "pcall(function() plr:SetUnder13(false) end)", - "pcall(function() plr:SetAccountAge(365) end)", - "if (AnimatedCharacter == false) then", - "if plr.Character:FindFirstChild('Animate') then", - "plr.Character.Animate:Remove()", - "end", - "end", - "InitalizeClientAppearance(plr,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,Hat1ID)", - "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character)", - "game:GetService('Visit')", - "while true do", - "wait(0.001)", - "if (plr.Character ~= nil) then", - "if (plr.Character.Humanoid.Health == 0) then", - "wait(5)", - "plr:LoadCharacter()", - "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character,plr.Backpack)", - "if (AnimatedCharacter == false) then", - "if plr.Character:FindFirstChild('Animate') then", - "plr.Character.Animate:Remove()", - "end", - "end", - "elseif (plr.Character.Parent == nil) then", - "wait(5)", - "plr:LoadCharacter()", - "LoadCharacterNew(newWaitForChild(plr,'Appearance'),plr.Character,plr.Backpack)", - "if (AnimatedCharacter == false) then", - "if plr.Character:FindFirstChild('Animate') then", - "plr.Character.Animate:Remove()", - "end", - "end", - "end", - "end", - "end" + "--Load Script", + "dofile('rbxasset://scripts/" + GlobalVars.ScriptName + ".lua')", + GetScriptFuncForType(type) ); - - string scriptfile = MultiLine( - header, - playersettings, - customizationsettings, - colorsettings, - customizationgen, - code - ); - List list = new List(Regex.Split(scriptfile, Environment.NewLine)); + List list = new List(Regex.Split(code, Environment.NewLine)); string[] convertedList = list.ToArray(); - File.WriteAllLines(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + GlobalVars.ScriptLuaFile, convertedList); + File.WriteAllLines(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua", convertedList); } - public static string GeneratePlayerColorString() - { - CryptoRandom random = new CryptoRandom(); - int SkinPattern = random.Next(1,7); - int LegsPattern = random.Next(1,5); - int TorsoPattern = random.Next(1,8); - - int HeadColor = 0; - int TorsoColor= 0; - int LArmColor = 0; - int RArmColor = 0; - int LLegColor = 0; - int RLegColor = 0; - - if (SkinPattern == 1) - { - HeadColor = 24; - LArmColor = 24; - RArmColor = 24; - } - else if (SkinPattern == 2) - { - HeadColor = 226; - LArmColor = 226; - RArmColor = 226; - } - else if (SkinPattern == 3) - { - HeadColor = 101; - LArmColor = 101; - RArmColor = 101; - } - else if (SkinPattern == 4) - { - HeadColor = 9; - LArmColor = 9; - RArmColor = 9; - } - else if (SkinPattern == 5) - { - HeadColor = 38; - LArmColor = 38; - RArmColor = 38; - } - else if (SkinPattern == 6) - { - HeadColor = 18; - LArmColor = 18; - RArmColor = 18; - } - else if (SkinPattern == 7) - { - HeadColor = 128; - LArmColor = 128; - RArmColor = 128; - } - - if (LegsPattern == 1) - { - RLegColor = 119; - LLegColor = 119; - } - else if (LegsPattern == 2) - { - LLegColor = 11; - RLegColor = 11; - } - else if (LegsPattern == 3) - { - LLegColor = 23; - RLegColor = 23; - } - else if (LegsPattern == 4) - { - LLegColor = 1; - RLegColor = 1; - } - else if (LegsPattern == 5) - { - LLegColor = 45; - RLegColor = 45; - } - - if (TorsoPattern == 1) - { - TorsoColor = 194; - } - else if (TorsoPattern == 2) - { - TorsoColor = 199; - } - else if (TorsoPattern == 3) - { - TorsoColor = 1; - } - else if (TorsoPattern == 4) - { - TorsoColor = 21; - } - else if (TorsoPattern == 5) - { - TorsoColor = 37; - } - else if (TorsoPattern == 6) - { - TorsoColor = 23; - } - else if (TorsoPattern == 7) - { - TorsoColor = 45; - } - else if (TorsoPattern == 8) - { - TorsoColor = 11; - } - - string output = MultiLine( - "--Color Settings", - "HeadColorID = " + HeadColor, - "TorsoColorID = " + TorsoColor, - "LeftArmColorID = " + LArmColor, - "RightArmColorID = " + RArmColor, - "LeftLegColorID = " + LLegColor, - "RightLegColorID = " + RLegColor - ); - - return output; - } + // using this for a possible 2006 preset feature?? + /* public static string GeneratePlayerColorPresetString(int preset) { int HeadColor = 0; @@ -1178,13 +921,13 @@ namespace NovetusLauncher return output; } + */ public static string MultiLine(params string[] args) { return string.Join(Environment.NewLine, args); } } - */ public static class GlobalVars { @@ -1222,6 +965,8 @@ namespace NovetusLauncher public static bool LegacyMode = false; public static string SelectedClientMD5 = ""; public static string SelectedClientScriptMD5 = ""; + public static bool FixScriptMapMode = false; + public static bool AlreadyHasSecurity = false; //charcustom public static string Custom_Hat1ID_Offline = "NoHat.rbxm"; public static string Custom_Hat2ID_Offline = "NoHat.rbxm"; diff --git a/NovetusLauncher/NovetusLauncher/LoaderForm.cs b/NovetusLauncher/NovetusLauncher/LoaderForm.cs index adfc37a..9715ca3 100644 --- a/NovetusLauncher/NovetusLauncher/LoaderForm.cs +++ b/NovetusLauncher/NovetusLauncher/LoaderForm.cs @@ -55,7 +55,15 @@ namespace NovetusLauncher string port = SecurityFuncs.Base64Decode(SplitArg[1]); string client = SecurityFuncs.Base64Decode(SplitArg[2]); ReadClientValues(client); - string luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + string luafile = ""; + if (!GlobalVars.FixScriptMapMode) + { + luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + } + else + { + luafile = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + } string rbxexe = ""; if (GlobalVars.LegacyMode == true) { @@ -68,35 +76,55 @@ namespace NovetusLauncher string quote = "\""; string args = ""; string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); - if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + if (!GlobalVars.FixScriptMapMode) { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + ip + "'," + port + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + ip + "'," + port + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + ip + "'," + port + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } + else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + ip + "'," + port + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + ip + "'," + port + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } } - else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + else { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + ip + "'," + port + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; - } - else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) - { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + ip + "'," + port + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; - } - else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) - { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + ip + "'," + port + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client); + args = "-script " + quote + luafile + quote; } try { - if (SecurityFuncs.checkClientMD5(client) == true) + if (!GlobalVars.AlreadyHasSecurity) { - if (SecurityFuncs.checkScriptMD5(client) == true) + if (SecurityFuncs.checkClientMD5(client) == true) { - Process.Start(rbxexe, args); - this.Close(); + if (SecurityFuncs.checkScriptMD5(client) == true) + { + Process.Start(rbxexe, args); + this.Close(); + } + else + { + label1.Text = "The client has been detected as modified."; + } + } + else + { + label1.Text = "The client has been detected as modified."; } } else { - label1.Text = "The client has been detected as modified."; + Process.Start(rbxexe, args); + this.Close(); } } catch (Exception) diff --git a/NovetusLauncher/NovetusLauncher/MainForm.cs b/NovetusLauncher/NovetusLauncher/MainForm.cs index 188a845..c16d831 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm.cs @@ -151,7 +151,7 @@ namespace NovetusLauncher void Button2Click(object sender, EventArgs e) { WriteConfigValues(); - StartServer(); + StartServer(false); if (GlobalVars.CloseOnLaunch == true) { @@ -509,7 +509,7 @@ namespace NovetusLauncher void Button18Click(object sender, EventArgs e) { WriteConfigValues(); - StartServerNo3D(); + StartServer(true); if (GlobalVars.CloseOnLaunch == true) { @@ -604,7 +604,16 @@ namespace NovetusLauncher void StartClient() { - string luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + string luafile = ""; + if (!GlobalVars.FixScriptMapMode) + { + luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + } + else + { + luafile = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + } + string rbxexe = ""; if (GlobalVars.LegacyMode == true) { @@ -617,44 +626,71 @@ namespace NovetusLauncher string quote = "\""; string args = ""; string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); - if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + if (!GlobalVars.FixScriptMapMode) { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } + else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) + { + args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + } } - else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + else { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; - } - else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) - { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; - } - else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) - { - args = "-script " + quote + "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "');" + quote; + ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client); + args = "-script " + quote + luafile + quote; } try { ConsolePrint("Client Loaded.", 4); - if (SecurityFuncs.checkClientMD5(GlobalVars.SelectedClient) == true) + if (!GlobalVars.AlreadyHasSecurity) { - if (SecurityFuncs.checkScriptMD5(GlobalVars.SelectedClient) == true) + if (SecurityFuncs.checkClientMD5(GlobalVars.SelectedClient) == true) { - Process client = new Process(); - client.StartInfo.FileName = rbxexe; - client.StartInfo.Arguments = args; - client.EnableRaisingEvents = true; - ReadClientValues(GlobalVars.SelectedClient); - client.Exited += new EventHandler(ClientExited); - client.Start(); - GlobalVars.presence.largeImageKey = GlobalVars.imagekey_large; - GlobalVars.presence.details = ""; - GlobalVars.presence.state = "In " + GlobalVars.SelectedClient + " Game"; - GlobalVars.presence.startTimestamp = SecurityFuncs.UnixTimeNow(); - GlobalVars.presence.largeImageText = GlobalVars.PlayerName + " | In " + GlobalVars.SelectedClient + " Game"; - DiscordRpc.UpdatePresence(ref GlobalVars.presence); + if (SecurityFuncs.checkScriptMD5(GlobalVars.SelectedClient) == true) + { + Process client = new Process(); + client.StartInfo.FileName = rbxexe; + client.StartInfo.Arguments = args; + client.EnableRaisingEvents = true; + ReadClientValues(GlobalVars.SelectedClient); + client.Exited += new EventHandler(ClientExited); + client.Start(); + GlobalVars.presence.largeImageKey = GlobalVars.imagekey_large; + GlobalVars.presence.details = ""; + GlobalVars.presence.state = "In " + GlobalVars.SelectedClient + " Game"; + GlobalVars.presence.startTimestamp = SecurityFuncs.UnixTimeNow(); + GlobalVars.presence.largeImageText = GlobalVars.PlayerName + " | In " + GlobalVars.SelectedClient + " Game"; + DiscordRpc.UpdatePresence(ref GlobalVars.presence); + } } } + else + { + Process client = new Process(); + client.StartInfo.FileName = rbxexe; + client.StartInfo.Arguments = args; + client.EnableRaisingEvents = true; + ReadClientValues(GlobalVars.SelectedClient); + client.Exited += new EventHandler(ClientExited); + client.Start(); + GlobalVars.presence.largeImageKey = GlobalVars.imagekey_large; + GlobalVars.presence.details = ""; + GlobalVars.presence.state = "In " + GlobalVars.SelectedClient + " Game"; + GlobalVars.presence.startTimestamp = SecurityFuncs.UnixTimeNow(); + GlobalVars.presence.largeImageText = GlobalVars.PlayerName + " | In " + GlobalVars.SelectedClient + " Game"; + DiscordRpc.UpdatePresence(ref GlobalVars.presence); + } } catch (Exception ex) { @@ -675,26 +711,42 @@ namespace NovetusLauncher void StartSolo() { - string luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + string luafile = ""; + if (!GlobalVars.FixScriptMapMode) + { + luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + } + else + { + luafile = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + } string mapfile = GlobalVars.MapsDir + @"\\" + GlobalVars.Map; string rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe"; string quote = "\""; string args = ""; - if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + if (!GlobalVars.FixScriptMapMode) { - args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ");" + quote; + if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) + { + args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ");" + quote; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + { + args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ");" + quote; + } + else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) + { + args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ");" + quote; + } + else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false ) + { + args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(0,'Player','" + GlobalVars.loadtext + ");" + quote; + } } - else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) + else { - args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ");" + quote; - } - else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) - { - args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ");" + quote; - } - else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false ) - { - args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSSolo(0,'Player','" + GlobalVars.loadtext + ");" + quote; + ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Solo); + args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; } try { @@ -720,17 +772,34 @@ namespace NovetusLauncher } } - void StartServer() + void StartServer(bool no3d) { - string luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + string luafile = ""; + if (!GlobalVars.FixScriptMapMode) + { + luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + } + else + { + luafile = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + } string mapfile = GlobalVars.MapsDir + @"\\" + GlobalVars.Map; string rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe"; string quote = "\""; string args = ""; string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); - args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "'," + GlobalVars.DisableTeapotTurret.ToString().ToLower() + "); " + quote; + if (!GlobalVars.FixScriptMapMode) + { + args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "'," + GlobalVars.DisableTeapotTurret.ToString().ToLower() + "); " + quote + (no3d ? " -no3d" : ""); + } + else + { + ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server); + args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote; + } try { + //when we add upnp, change this ConsolePrint("Server Loaded.", 4); Process.Start(rbxexe, args); } @@ -741,37 +810,30 @@ namespace NovetusLauncher } } - void StartServerNo3D() - { - string luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; - string mapfile = GlobalVars.MapsDir + @"\\" + GlobalVars.Map; - string rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe"; - string quote = "\""; - string args = ""; - string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); - args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "'," + GlobalVars.DisableTeapotTurret.ToString().ToLower() + "); " + quote + " -no3d"; - try - { - ConsolePrint("Server Loaded in No3d.", 4); - Process.Start(rbxexe, args); - } - catch (Exception ex) - { - ConsolePrint("ERROR 2 - Failed to launch Novetus. (" + ex.Message + ")", 2); - DialogResult result2 = MessageBox.Show("Failed to launch Novetus. (Error: " + ex.Message + ")","Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - //sometext - void StartStudio() { - string luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + string luafile = ""; + if (!GlobalVars.FixScriptMapMode) + { + luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + } + else + { + luafile = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + } string mapfile = GlobalVars.MapsDir + @"\\" + GlobalVars.Map; string rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe"; string quote = "\""; string args = ""; - args = quote + mapfile + "\" -script \"dofile('" + luafile + "');" + quote; + if (!GlobalVars.FixScriptMapMode) + { + args = quote + mapfile + "\" -script \"dofile('" + luafile + "');" + quote; + } + else + { + ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Studio); + args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; + } try { ConsolePrint("Studio Loaded.", 4); @@ -810,15 +872,15 @@ namespace NovetusLauncher { if (command.Equals("server")) { - StartServer(); + StartServer(false); } else if (command.Equals("server no3d")) { - StartServerNo3D(); + StartServer(true); } else if (command.Equals("no3d")) { - StartServerNo3D(); + StartServer(true); } else if (command.Equals("client")) { diff --git a/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.FileListAbsolute.txt b/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.FileListAbsolute.txt index e6ebd03..bab40f3 100644 --- a/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.FileListAbsolute.txt +++ b/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.FileListAbsolute.txt @@ -10,3 +10,15 @@ C:\Users\BITL\Desktop\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\RBX C:\Users\BITL\Desktop\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.csproj.GenerateResource.Cache C:\Users\BITL\Desktop\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.exe C:\Users\BITL\Desktop\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\RBXLegacy-src-749b4965ca0c1d0e87b5902a59c70a68ab6942e1\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.ItemMaker.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\bin\Release\NovetusLauncher.exe.config +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\bin\Release\NovetusLauncher.exe +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.csprojResolveAssemblyReference.cache +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.CharacterCustomization.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.ClientinfoEditor.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.ItemMaker.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.LoaderForm.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.MainForm.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.QuickConfigure.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.ServerInfo.resources +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.csproj.GenerateResource.Cache +C:\Users\BITL\Documents\GitHub\Novetus_src\NovetusLauncher\NovetusLauncher\obj\Release\NovetusLauncher.exe diff --git a/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.GenerateResource.Cache b/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.GenerateResource.Cache index 7eb1d49..25b9e68 100644 Binary files a/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.GenerateResource.Cache and b/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.csproj.GenerateResource.Cache differ diff --git a/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.exe b/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.exe index aeef904..f992633 100644 Binary files a/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.exe and b/NovetusLauncher/NovetusLauncher/obj/Release/NovetusLauncher.exe differ