diff --git a/CSMPFunctions.lua b/CSMPFunctions.lua index bad3d2b..2cce0bb 100644 --- a/CSMPFunctions.lua +++ b/CSMPFunctions.lua @@ -861,7 +861,7 @@ function CSServer(Port,PlayerLimit,RespawnTime,IsPersonalServer,ChatType,HostID, end if (Player.userId == Blacklist1 or Player.userId == Blacklist2 or Player.userId == Blacklist3 or Player.userId == Blacklist4 or Player.userId == Blacklist5 or Player.userId == Blacklist6 or Player.userId == Blacklist7 or Player.userId == Blacklist8) then local message = Instance.new("Message") - message.Text = "You have been banned from playing this server." + message.Text = "You have been blacklisted from this server." message.Parent = Player wait(2) Player:remove() @@ -1061,7 +1061,7 @@ function CSServer(Port,PlayerLimit,RespawnTime,IsPersonalServer,ChatType,HostID, end end -function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,TorsoID,RArmID,LArmID,RLegID,LLegID,IconType,Gear1,Gear2,Gear3,IsAdminUser,Ticket) +function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,TorsoID,RArmID,LArmID,RLegID,LLegID,Gear1,Gear2,Gear3,IconType,IsAdminUser,Ticket) if (rbxlegacyversion >= 8) then pcall(function() game:SetPlaceID(-1, false) end) game:GetService("RunService"):Run() @@ -1198,7 +1198,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end InitalizeClientAppearance(Player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,TorsoID,RArmID,LArmID,RLegID,LLegID,Gear1,Gear2,Gear3) if (Player.Name == "QuackIAttack" or Player.Name == "CPunch" or Player.Name == "connor" or Player.Name == "Carrot" or Player.Name == "Bitl" or Player.Name == "khanglegos" or Player.Name == "Nukley" or Player.Name == "OliverA" or Player.Name == "coke" or Player.Name == "Peridorky" or Player.Name == "Raymonf" or Player.Name == "romulo27" or Player.Name == "TheLivingBee" or Player.Name == "robloxtester" or Player.Name == "winsupermario1234" and IsAdminUser == false) then - game:SetMessage("No faking, clever boy!") + game:SetMessage("Kicked for impersonating an administrator.") Player:Remove() end local isAdmin = Instance.new("BoolValue") @@ -1219,7 +1219,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He game:GetService("Visit") InitalizeClientAppearance(player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,TorsoID,RArmID,LArmID,RLegID,LLegID,Gear1,Gear2,Gear3) if (player.Name == "QuackIAttack" or player.Name == "CPunch" or Player.Name == "connor" or player.Name == "Carrot" or player.Name == "Bitl" or player.Name == "khanglegos" or player.Name == "Nukley" or player.Name == "OliverA" or player.Name == "coke" or player.Name == "Peridorky" or player.Name == "Raymonf" or player.Name == "romulo27" or player.Name == "TheLivingBee" or player.Name == "robloxtester" or player.Name == "winsupermario1234" and IsAdminUser == false) then - game:SetMessage("No faking, clever boy!") + game:SetMessage("Kicked for impersonating an administrator.") player:Remove() end local isAdmin = Instance.new("BoolValue") diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/CharacterCustomization.cs b/RBXLegacyLauncher/RBXLegacyLauncher/CharacterCustomization.cs index 195d784..73c9bce 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/CharacterCustomization.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/CharacterCustomization.cs @@ -1630,7 +1630,7 @@ namespace RBXLegacyLauncher void Button4Click(object sender, EventArgs e) { - LauncherFuncs.WriteConfigValues("config.txt"); + LauncherFuncs.WriteConfigValues("rbxlegacy_config.txt"); Start3DView(); } diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/GlobalVars.cs b/RBXLegacyLauncher/RBXLegacyLauncher/GlobalVars.cs index d2b607f..d0a5c06 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/GlobalVars.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/GlobalVars.cs @@ -38,7 +38,7 @@ public static int blacklist6 = 0; public static int blacklist7 = 0; public static int blacklist8 = 0; - public static int respawntime = 5; + public static string ChatType = "Both"; // player settings public static int UserID = 0; public static string PlayerName = "Player"; diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/LauncherFuncs.cs b/RBXLegacyLauncher/RBXLegacyLauncher/LauncherFuncs.cs index 25bfcc0..f2a7afd 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/LauncherFuncs.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/LauncherFuncs.cs @@ -20,9 +20,9 @@ namespace RBXLegacyLauncher public static void ReadConfigValues(string cfgpath) { string line1; - string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline8, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14, Decryptline15, Decryptline16, Decryptline17, Decryptline18, Decryptline19, Decryptline20, Decryptline21, Decryptline22, Decryptline23, Decryptline24, Decryptline25, Decryptline26, Decryptline27, Decryptline28, Decryptline29, Decryptline30, Decryptline31, Decryptline32, Decryptline33, Decryptline34, Decryptline35, Decryptline36; + string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline8, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14, Decryptline15, Decryptline16, Decryptline17, Decryptline18, Decryptline19, Decryptline20, Decryptline21, Decryptline22, Decryptline23, Decryptline24, Decryptline25, Decryptline26, Decryptline27, Decryptline28, Decryptline29, Decryptline30, Decryptline31, Decryptline32, Decryptline33, Decryptline34; - using(StreamReader reader = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\config.txt")) + using(StreamReader reader = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + cfgpath)) { line1 = reader.ReadLine(); } @@ -66,8 +66,6 @@ namespace RBXLegacyLauncher Decryptline32 = SecurityFuncs.Base64Decode(result[31]); Decryptline33 = SecurityFuncs.Base64Decode(result[32]); Decryptline34 = SecurityFuncs.Base64Decode(result[33]); - Decryptline35 = SecurityFuncs.Base64Decode(result[34]); - Decryptline36 = SecurityFuncs.Base64Decode(result[35]); bool bline1 = Convert.ToBoolean(Decryptline1); GlobalVars.CloseOnLaunch = bline1; @@ -79,63 +77,179 @@ namespace RBXLegacyLauncher GlobalVars.SelectedClient = Decryptline4; - GlobalVars.Map = Decryptline5; + GlobalVars.Custom_Hat1ID_Offline = Decryptline5; + GlobalVars.Custom_Hat2ID_Offline = Decryptline6; + GlobalVars.Custom_Hat3ID_Offline = Decryptline7; - int iline6 = Convert.ToInt32(Decryptline6); - GlobalVars.ServerPort = iline6; + int iline8 = Convert.ToInt32(Decryptline8); + GlobalVars.HeadColorID = iline8; - GlobalVars.Custom_Hat1ID_Offline = Decryptline7; - GlobalVars.Custom_Hat2ID_Offline = Decryptline8; - GlobalVars.Custom_Hat3ID_Offline = Decryptline9; + int iline9 = Convert.ToInt32(Decryptline9); + GlobalVars.TorsoColorID = iline9; int iline10 = Convert.ToInt32(Decryptline10); - GlobalVars.HeadColorID = iline10; + GlobalVars.LeftArmColorID = iline10; int iline11 = Convert.ToInt32(Decryptline11); - GlobalVars.TorsoColorID = iline11; + GlobalVars.RightArmColorID = iline11; int iline12 = Convert.ToInt32(Decryptline12); - GlobalVars.LeftArmColorID = iline12; + GlobalVars.LeftLegColorID = iline12; int iline13 = Convert.ToInt32(Decryptline13); - GlobalVars.RightArmColorID = iline13; + GlobalVars.RightLegColorID = iline13; - int iline14 = Convert.ToInt32(Decryptline14); - GlobalVars.LeftLegColorID = iline14; - - int iline15 = Convert.ToInt32(Decryptline15); - GlobalVars.RightLegColorID = iline15; - - GlobalVars.ColorMenu_HeadColor = Decryptline16; - GlobalVars.ColorMenu_TorsoColor = Decryptline17; - GlobalVars.ColorMenu_LeftArmColor = Decryptline18; - GlobalVars.ColorMenu_RightArmColor = Decryptline19; - GlobalVars.ColorMenu_LeftLegColor = Decryptline20; - GlobalVars.ColorMenu_RightLegColor = Decryptline21; - - int iline22 = Convert.ToInt32(Decryptline22); - GlobalVars.PlayerLimit = iline22; + GlobalVars.ColorMenu_HeadColor = Decryptline14; + GlobalVars.ColorMenu_TorsoColor = Decryptline15; + GlobalVars.ColorMenu_LeftArmColor = Decryptline16; + GlobalVars.ColorMenu_RightArmColor = Decryptline17; + GlobalVars.ColorMenu_LeftLegColor = Decryptline18; + GlobalVars.ColorMenu_RightLegColor = Decryptline19; + int iline20 = Convert.ToInt32(Decryptline20); + GlobalVars.Custom_TShirt = iline20; + int iline21 = Convert.ToInt32(Decryptline21); + GlobalVars.Custom_Shirt = iline21; + int iline22 = Convert.ToInt32(Decryptline22); + GlobalVars.Custom_Pants = iline22; + + GlobalVars.Custom_IconType = Decryptline23; + + GlobalVars.FaceID = Decryptline24; + GlobalVars.HeadID = Decryptline25; + GlobalVars.TorsoID = Decryptline26; + GlobalVars.LeftArmID = Decryptline27; + GlobalVars.RightArmID = Decryptline28; + GlobalVars.LeftLegID = Decryptline29; + GlobalVars.RightLegID = Decryptline30; + + GlobalVars.Custom_Gear1 = Decryptline31; + GlobalVars.Custom_Gear2 = Decryptline32; + GlobalVars.Custom_Gear3 = Decryptline33; + + bool bline34 = Convert.ToBoolean(Decryptline34); + GlobalVars.AdminMode = bline34; + } + + public static void ReadServerPrefs(string cfgpath) + { + string line1; + string Decryptline1, Decryptline2, Decryptline3, Decryptline4, Decryptline5, Decryptline6, Decryptline7, Decryptline8, Decryptline9, Decryptline10, Decryptline11, Decryptline12, Decryptline13, Decryptline14, Decryptline15, Decryptline16, Decryptline17, Decryptline18, Decryptline19, Decryptline20, Decryptline21, Decryptline22, Decryptline23, Decryptline24, Decryptline25, Decryptline26, Decryptline27, Decryptline28, Decryptline29, Decryptline30, Decryptline31, Decryptline32; + + using(StreamReader reader = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + cfgpath)) + { + line1 = reader.ReadLine(); + } + + if (!SecurityFuncs.IsBase64String(line1)) + return; + + string ConvertedLine = SecurityFuncs.Base64Decode(line1); + string[] result = ConvertedLine.Split('|'); + Decryptline1 = SecurityFuncs.Base64Decode(result[0]); + Decryptline2 = SecurityFuncs.Base64Decode(result[1]); + Decryptline3 = SecurityFuncs.Base64Decode(result[2]); + Decryptline4 = SecurityFuncs.Base64Decode(result[3]); + 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]); + Decryptline11 = SecurityFuncs.Base64Decode(result[10]); + Decryptline12 = SecurityFuncs.Base64Decode(result[11]); + Decryptline13 = SecurityFuncs.Base64Decode(result[12]); + Decryptline14 = SecurityFuncs.Base64Decode(result[13]); + Decryptline15 = SecurityFuncs.Base64Decode(result[14]); + Decryptline16 = SecurityFuncs.Base64Decode(result[15]); + Decryptline17 = SecurityFuncs.Base64Decode(result[16]); + Decryptline18 = SecurityFuncs.Base64Decode(result[17]); + Decryptline19 = SecurityFuncs.Base64Decode(result[18]); + Decryptline20 = SecurityFuncs.Base64Decode(result[19]); + Decryptline21 = SecurityFuncs.Base64Decode(result[20]); + Decryptline22 = SecurityFuncs.Base64Decode(result[21]); + Decryptline23 = SecurityFuncs.Base64Decode(result[22]); + Decryptline24 = SecurityFuncs.Base64Decode(result[23]); + Decryptline25 = SecurityFuncs.Base64Decode(result[24]); + Decryptline26 = SecurityFuncs.Base64Decode(result[25]); + Decryptline27 = SecurityFuncs.Base64Decode(result[26]); + Decryptline28 = SecurityFuncs.Base64Decode(result[27]); + Decryptline29 = SecurityFuncs.Base64Decode(result[28]); + Decryptline30 = SecurityFuncs.Base64Decode(result[29]); + Decryptline31 = SecurityFuncs.Base64Decode(result[30]); + Decryptline32 = SecurityFuncs.Base64Decode(result[31]); + + GlobalVars.Map = Decryptline1; + + int iline2 = Convert.ToInt32(Decryptline2); + GlobalVars.ServerPort = iline2; + + int iline3 = Convert.ToInt32(Decryptline3); + GlobalVars.DefaultRobloxPort = iline3; + + int iline4 = Convert.ToInt32(Decryptline4); + GlobalVars.PlayerLimit = iline4; + + int iline5 = Convert.ToInt32(Decryptline5); + GlobalVars.RespawnTime = iline5; + + bool bline6 = Convert.ToBoolean(Decryptline6); + GlobalVars.IsPersonalServer = bline6; + + bool bline7 = Convert.ToBoolean(Decryptline7); + GlobalVars.melee = bline7; + bool bline8 = Convert.ToBoolean(Decryptline8); + GlobalVars.navigation = bline8; + bool bline9 = Convert.ToBoolean(Decryptline9); + GlobalVars.social = bline9; + bool bline10 = Convert.ToBoolean(Decryptline10); + GlobalVars.powerup = bline10; + bool bline11 = Convert.ToBoolean(Decryptline11); + GlobalVars.explosives = bline11; + bool bline12 = Convert.ToBoolean(Decryptline12); + GlobalVars.transport = bline12; + bool bline13 = Convert.ToBoolean(Decryptline13); + GlobalVars.ranged = bline13; + bool bline14 = Convert.ToBoolean(Decryptline14); + GlobalVars.musical = bline14; + bool bline15 = Convert.ToBoolean(Decryptline15); + GlobalVars.building = bline15; + bool bline16 = Convert.ToBoolean(Decryptline16); + GlobalVars.navigation = bline16; + bool bline17 = Convert.ToBoolean(Decryptline17); + GlobalVars.social = bline17; + bool bline18 = Convert.ToBoolean(Decryptline18); + GlobalVars.explosives = bline18; + bool bline19 = Convert.ToBoolean(Decryptline19); + GlobalVars.transport = bline19; + bool bline20 = Convert.ToBoolean(Decryptline20); + GlobalVars.ranged = bline20; + bool bline21 = Convert.ToBoolean(Decryptline21); + GlobalVars.musical = bline21; + bool bline22 = Convert.ToBoolean(Decryptline22); + GlobalVars.building = bline22; + int iline23 = Convert.ToInt32(Decryptline23); - GlobalVars.Custom_TShirt = iline23; + GlobalVars.blacklist1 = iline23; int iline24 = Convert.ToInt32(Decryptline24); - GlobalVars.Custom_Shirt = iline24; + GlobalVars.blacklist2 = iline24; int iline25 = Convert.ToInt32(Decryptline25); - GlobalVars.Custom_Pants = iline25; + GlobalVars.blacklist3 = iline25; + int iline26 = Convert.ToInt32(Decryptline26); + GlobalVars.blacklist4 = iline26; + int iline27 = Convert.ToInt32(Decryptline27); + GlobalVars.blacklist5 = iline27; + int iline28 = Convert.ToInt32(Decryptline28); + GlobalVars.blacklist6 = iline28; + int iline29 = Convert.ToInt32(Decryptline29); + GlobalVars.blacklist7 = iline29; + int iline30 = Convert.ToInt32(Decryptline30); + GlobalVars.blacklist8 = iline30; - GlobalVars.Custom_IconType = Decryptline26; + bool bline31 = Convert.ToBoolean(Decryptline31); + GlobalVars.upnp = bline31; - GlobalVars.FaceID = Decryptline27; - GlobalVars.HeadID = Decryptline28; - GlobalVars.TorsoID = Decryptline29; - GlobalVars.LeftArmID = Decryptline30; - GlobalVars.RightArmID = Decryptline31; - GlobalVars.LeftLegID = Decryptline32; - GlobalVars.RightLegID = Decryptline33; - - GlobalVars.Custom_Gear1 = Decryptline34; - GlobalVars.Custom_Gear2 = Decryptline35; - GlobalVars.Custom_Gear3 = Decryptline36; + GlobalVars.ChatType = Decryptline32; } public static void WriteConfigValues(string cfgpath) @@ -173,7 +287,8 @@ namespace RBXLegacyLauncher SecurityFuncs.Base64Encode(GlobalVars.RightLegID.ToString()), SecurityFuncs.Base64Encode(GlobalVars.Custom_Gear1.ToString()), SecurityFuncs.Base64Encode(GlobalVars.Custom_Gear2.ToString()), - SecurityFuncs.Base64Encode(GlobalVars.Custom_Gear3.ToString()) + SecurityFuncs.Base64Encode(GlobalVars.Custom_Gear3.ToString()), + SecurityFuncs.Base64Encode(GlobalVars.AdminMode.ToString()) }; File.WriteAllText(cfgpath, SecurityFuncs.Base64Encode(string.Join("|",lines))); } @@ -211,7 +326,8 @@ namespace RBXLegacyLauncher SecurityFuncs.Base64Encode(GlobalVars.blacklist6.ToString()), SecurityFuncs.Base64Encode(GlobalVars.blacklist7.ToString()), SecurityFuncs.Base64Encode(GlobalVars.blacklist8.ToString()), - SecurityFuncs.Base64Encode(GlobalVars.respawntime.ToString()) + SecurityFuncs.Base64Encode(GlobalVars.upnp.ToString()), + SecurityFuncs.Base64Encode(GlobalVars.ChatType.ToString()) }; File.WriteAllText(cfgpath, SecurityFuncs.Base64Encode(string.Join("|",lines))); } @@ -255,6 +371,7 @@ namespace RBXLegacyLauncher GlobalVars.Custom_Shirt = 0; GlobalVars.Custom_Pants = 0; GlobalVars.Custom_IconType = "NBC"; + GlobalVars.AdminMode = false; } public static void ResetServerPrefs() @@ -283,7 +400,7 @@ namespace RBXLegacyLauncher GlobalVars.blacklist6 = 0; GlobalVars.blacklist7 = 0; GlobalVars.blacklist8 = 0; - GlobalVars.respawntime = 5; + GlobalVars.ChatType = "Both"; } public static void ReadClientValues(string clientpath) diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/LoaderForm.cs b/RBXLegacyLauncher/RBXLegacyLauncher/LoaderForm.cs index edc197c..83c52f6 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/LoaderForm.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/LoaderForm.cs @@ -184,7 +184,7 @@ namespace RBXLegacyLauncher void ReadConfigValues() { - LauncherFuncs.ReadConfigValues(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\config.txt"); + LauncherFuncs.ReadConfigValues(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\rbxlegacy_config.txt"); } void ReadClientValues(string ClientName) diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.Designer.cs b/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.Designer.cs index 3adb884..17b95c9 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.Designer.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.Designer.cs @@ -19,7 +19,6 @@ this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); - this.button6 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button(); this.label35 = new System.Windows.Forms.Label(); this.textBox4 = new System.Windows.Forms.TextBox(); @@ -65,6 +64,14 @@ this.tabPage8 = new System.Windows.Forms.TabPage(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.tabPage4 = new System.Windows.Forms.TabPage(); + this.label44 = new System.Windows.Forms.Label(); + this.label43 = new System.Windows.Forms.Label(); + this.label34 = new System.Windows.Forms.Label(); + this.label33 = new System.Windows.Forms.Label(); + this.label32 = new System.Windows.Forms.Label(); + this.label31 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.label11 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); @@ -91,14 +98,6 @@ this.label27 = new System.Windows.Forms.Label(); this.label28 = new System.Windows.Forms.Label(); this.textBox5 = new System.Windows.Forms.TextBox(); - this.label12 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label31 = new System.Windows.Forms.Label(); - this.label32 = new System.Windows.Forms.Label(); - this.label33 = new System.Windows.Forms.Label(); - this.label34 = new System.Windows.Forms.Label(); - this.label43 = new System.Windows.Forms.Label(); - this.label44 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -147,7 +146,6 @@ // // tabPage1 // - this.tabPage1.Controls.Add(this.button6); this.tabPage1.Controls.Add(this.button11); this.tabPage1.Controls.Add(this.label35); this.tabPage1.Controls.Add(this.textBox4); @@ -170,17 +168,6 @@ this.tabPage1.ToolTipText = "Join a server via IP Address"; this.tabPage1.UseVisualStyleBackColor = true; // - // button6 - // - this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.button6.Location = new System.Drawing.Point(281, 183); - this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(109, 24); - this.button6.TabIndex = 45; - this.button6.Text = "admin abilities"; - this.button6.UseVisualStyleBackColor = true; - this.button6.Visible = false; - // // button11 // this.button11.Location = new System.Drawing.Point(213, 47); @@ -676,6 +663,86 @@ this.tabPage4.ToolTipText = "About RBXLegacy"; this.tabPage4.UseVisualStyleBackColor = true; // + // label44 + // + this.label44.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label44.Location = new System.Drawing.Point(276, 263); + this.label44.Name = "label44"; + this.label44.Size = new System.Drawing.Size(123, 18); + this.label44.TabIndex = 16; + this.label44.Text = "Nukley - Clients, Hats"; + this.label44.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label43 + // + this.label43.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label43.Location = new System.Drawing.Point(291, 245); + this.label43.Name = "label43"; + this.label43.Size = new System.Drawing.Size(108, 18); + this.label43.TabIndex = 15; + this.label43.Text = "CPunch - Security"; + this.label43.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label34 + // + this.label34.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label34.Location = new System.Drawing.Point(6, 259); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(312, 22); + this.label34.TabIndex = 14; + this.label34.Text = "connor - Clients"; + this.label34.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label33 + // + this.label33.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label33.Location = new System.Drawing.Point(6, 241); + this.label33.Name = "label33"; + this.label33.Size = new System.Drawing.Size(312, 18); + this.label33.TabIndex = 13; + this.label33.Text = "iagoMAO - GUIs, Hats"; + this.label33.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label32 + // + this.label32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label32.Location = new System.Drawing.Point(6, 223); + this.label32.Name = "label32"; + this.label32.Size = new System.Drawing.Size(312, 18); + this.label32.TabIndex = 12; + this.label32.Text = "winsupermario1234 - Clients, GUIs"; + this.label32.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label31 + // + this.label31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label31.Location = new System.Drawing.Point(6, 205); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(300, 18); + this.label31.TabIndex = 11; + this.label31.Text = "Carrot - Programming, Security"; + this.label31.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(6, 187); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(244, 18); + this.label2.TabIndex = 10; + this.label2.Text = "Bitl - Lead Programmer, Project Creator"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label12.Location = new System.Drawing.Point(211, 164); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(69, 18); + this.label12.TabIndex = 9; + this.label12.Text = "Developers"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // pictureBox2 // this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -764,7 +831,7 @@ // button8 // this.button8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.button8.Location = new System.Drawing.Point(150, 107); + this.button8.Location = new System.Drawing.Point(150, 106); this.button8.Name = "button8"; this.button8.Size = new System.Drawing.Size(86, 24); this.button8.TabIndex = 35; @@ -809,7 +876,7 @@ // // label13 // - this.label13.Location = new System.Drawing.Point(31, 89); + this.label13.Location = new System.Drawing.Point(16, 89); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(23, 13); this.label13.TabIndex = 7; @@ -856,9 +923,9 @@ // // label22 // - this.label22.Location = new System.Drawing.Point(12, 50); + this.label22.Location = new System.Drawing.Point(59, 48); this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(224, 14); + this.label22.Size = new System.Drawing.Size(177, 14); this.label22.TabIndex = 13; this.label22.Text = "PLAYER INFO:"; this.label22.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -923,86 +990,6 @@ this.textBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.textBox5.TextChanged += new System.EventHandler(this.TextBox5TextChanged); // - // label12 - // - this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label12.Location = new System.Drawing.Point(211, 164); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(69, 18); - this.label12.TabIndex = 9; - this.label12.Text = "Developers"; - this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label2 - // - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(6, 187); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(200, 18); - this.label2.TabIndex = 10; - this.label2.Text = "Bitl - Everything in the Universe"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label31 - // - this.label31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label31.Location = new System.Drawing.Point(6, 205); - this.label31.Name = "label31"; - this.label31.Size = new System.Drawing.Size(303, 18); - this.label31.TabIndex = 11; - this.label31.Text = "Carrot - Launcher, Clients, GUIs, Security, Hats, Gears"; - this.label31.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label32 - // - this.label32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label32.Location = new System.Drawing.Point(6, 223); - this.label32.Name = "label32"; - this.label32.Size = new System.Drawing.Size(312, 18); - this.label32.TabIndex = 12; - this.label32.Text = "winsupermario1234 - Clients, GUIs"; - this.label32.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label33 - // - this.label33.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label33.Location = new System.Drawing.Point(6, 241); - this.label33.Name = "label33"; - this.label33.Size = new System.Drawing.Size(312, 18); - this.label33.TabIndex = 13; - this.label33.Text = "iagoMAO - GUIs, Hats"; - this.label33.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label34 - // - this.label34.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label34.Location = new System.Drawing.Point(6, 259); - this.label34.Name = "label34"; - this.label34.Size = new System.Drawing.Size(312, 22); - this.label34.TabIndex = 14; - this.label34.Text = "connor - Clients"; - this.label34.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label43 - // - this.label43.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label43.Location = new System.Drawing.Point(291, 245); - this.label43.Name = "label43"; - this.label43.Size = new System.Drawing.Size(108, 18); - this.label43.TabIndex = 15; - this.label43.Text = "CPunch - Security"; - this.label43.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label44 - // - this.label44.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label44.Location = new System.Drawing.Point(276, 263); - this.label44.Name = "label44"; - this.label44.Size = new System.Drawing.Size(123, 18); - this.label44.TabIndex = 16; - this.label44.Text = "Nukley - Clients, Hats"; - this.label44.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1060,7 +1047,6 @@ private System.Windows.Forms.Label label43; private System.Windows.Forms.Label label44; private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.Button button6; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label41; private System.Windows.Forms.Label label40; diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.cs b/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.cs index 5d6ba53..54769cc 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/MainForm.cs @@ -123,12 +123,6 @@ namespace RBXLegacyLauncher } } - void Button6Click(object sender, EventArgs e) - { - //bloblul - this.Close(); - } - void MainFormLoad(object sender, EventArgs e) { string line1; @@ -159,11 +153,16 @@ namespace RBXLegacyLauncher { ConsolePrint("ERROR 4 - changelog.txt not found.", 2); } - if (!File.Exists("config.txt")) + if (!File.Exists("rbxlegacy_config.txt")) { - ConsolePrint("WARNING 1 - config.txt not found. Creating one with default values.", 5); + ConsolePrint("WARNING 1 - rbxlegacy_config.txt not found. Creating one with default values.", 5); WriteConfigValues(); } + if (!File.Exists("serverhost_config.txt")) + { + ConsolePrint("WARNING 1 - serverhost_config.txt not found. Creating one with default values.", 5); + LauncherFuncs.WriteServerPrefs("serverhost_config.txt"); + } if (!File.Exists("servers.txt")) { ConsolePrint("WARNING 2 - servers.txt not found. Creating empty file.", 5); @@ -193,7 +192,7 @@ namespace RBXLegacyLauncher void ReadConfigValues() { - LauncherFuncs.ReadConfigValues("config.txt"); + LauncherFuncs.ReadConfigValues("rbxlegacy_config.txt"); if (GlobalVars.CloseOnLaunch == true) { @@ -218,11 +217,6 @@ namespace RBXLegacyLauncher { //We need at least a limit of 12 players. GlobalVars.PlayerLimit = 12; - textBox3.Text = GlobalVars.PlayerLimit.ToString(); - } - else - { - textBox3.Text = GlobalVars.PlayerLimit.ToString(); } textBox2.Text = GlobalVars.PlayerName; @@ -232,14 +226,21 @@ namespace RBXLegacyLauncher textBox4.Text = GlobalVars.RobloxPort.ToString(); label37.Text = GlobalVars.IP; label38.Text = GlobalVars.RobloxPort.ToString(); - ConsolePrint("Your configuration has been loaded.", 3); + ConsolePrint("Configuration has been loaded.", 3); + ReadServerPrefs(); ReadClientValues(GlobalVars.SelectedClient); } void WriteConfigValues() { - LauncherFuncs.WriteConfigValues("config.txt"); - ConsolePrint("Your configuration has been saved successfully.", 3); + LauncherFuncs.WriteConfigValues("rbxlegacy_config.txt"); + ConsolePrint("Configuration has been saved successfully.", 3); + } + + void ReadServerPrefs() + { + LauncherFuncs.ReadServerPrefs("serverhost_config.txt"); + ConsolePrint("Server configuration has been loaded.", 3); } void ReadClientValues(string ClientName) @@ -418,18 +419,18 @@ namespace RBXLegacyLauncher void Button9Click(object sender, EventArgs e) { ResetConfigValues(); - DialogResult result = MessageBox.Show("Your configuration has been reset to their default values.","RBXLegacy Launcher - Configuration", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); + DialogResult result = MessageBox.Show("Your configuration has been reset to the default values.","RBXLegacy Launcher - Configuration", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); } void ListBox3SelectedIndexChanged(object sender, EventArgs e) { try { - GlobalVars.IP = listBox3.SelectedItem.ToString(); - textBox1.Text = GlobalVars.IP; - checkBox3.Enabled = false; - GlobalVars.LocalPlayMode = false; - label37.Text = GlobalVars.IP; + GlobalVars.IP = listBox3.SelectedItem.ToString(); + textBox1.Text = GlobalVars.IP; + checkBox3.Enabled = false; + GlobalVars.LocalPlayMode = false; + label37.Text = GlobalVars.IP; } catch (Exception) { @@ -440,9 +441,9 @@ namespace RBXLegacyLauncher { try { - GlobalVars.RobloxPort = Convert.ToInt32(listBox4.SelectedItem.ToString()); - textBox4.Text = GlobalVars.RobloxPort.ToString(); - label38.Text = GlobalVars.RobloxPort.ToString(); + GlobalVars.RobloxPort = Convert.ToInt32(listBox4.SelectedItem.ToString()); + textBox4.Text = GlobalVars.RobloxPort.ToString(); + label38.Text = GlobalVars.RobloxPort.ToString(); } catch (Exception) { @@ -517,7 +518,7 @@ namespace RBXLegacyLauncher { if (GlobalVars.SelectedClientVersion >= 7) { - DialogResult result = MessageBox.Show("Note: If the health bar or scoreboard don't appear, just reset your character.","RBXLegacy Launcher - Play Solo", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult result = MessageBox.Show("Note: If the health bar or scoreboard don't appear, just reset your character.","RBXLegacy Launcher - Play Solo", MessageBoxButtons.OK, MessageBoxIcon.Information); } WriteConfigValues(); StartSolo(); @@ -567,47 +568,6 @@ namespace RBXLegacyLauncher } } - void TextBox3TextChanged(object sender, EventArgs e) - { - int parsedValue; - if (int.TryParse(textBox3.Text, out parsedValue)) - { - if (textBox3.Text.Equals("")) - { - GlobalVars.PlayerLimit = 12; - } - else - { - GlobalVars.PlayerLimit = Convert.ToInt32(textBox3.Text); - } - } - else - { - GlobalVars.PlayerLimit = 12; - } - } - - void TextBox7TextChanged(object sender, EventArgs e) - { - int parsedValue; - if (int.TryParse(textBox7.Text, out parsedValue)) - { - if (textBox7.Text.Equals("")) - { - //set it to the normal port, 53640. it wouldn't make any sense if we set it to 0. - GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort; - } - else - { - GlobalVars.ServerPort = Convert.ToInt32(textBox7.Text); - } - } - else - { - GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort; - } - } - void ResetConfigValues() { LauncherFuncs.ResetConfigValues(); @@ -805,7 +765,7 @@ namespace RBXLegacyLauncher } string quote = "\""; string args = ""; - args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "') _G.SetRBXLegacyVersion(" + GlobalVars.SelectedClientVersion + "); _G.CSServer(" + GlobalVars.ServerPort + "," + GlobalVars.PlayerLimit + ") " + quote; + args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "') _G.SetRBXLegacyVersion(" + GlobalVars.SelectedClientVersion + "); _G.CSServer(" + GlobalVars.ServerPort + "," + GlobalVars.PlayerLimit + "," + GlobalVars.RespawnTime + "," + GlobalVars.IsPersonalServer + "," + GlobalVars.UserID + "," + GlobalVars.blacklist1 + "," + GlobalVars.blacklist2 + "," + GlobalVars.blacklist3 + "," + GlobalVars.blacklist4 + "," + GlobalVars.blacklist5 + "," + GlobalVars.blacklist6 + "," + GlobalVars.blacklist7 + "," + GlobalVars.blacklist8 + "," + GlobalVars.melee + "," + GlobalVars.powerup + "," + GlobalVars.ranged + "," + GlobalVars.navigation + "," + GlobalVars.explosives + "," + GlobalVars.musical + "," + GlobalVars.social + "," + GlobalVars.transport + "," + GlobalVars.building + ") " + quote; try { ConsolePrint("Server Loaded.", 4); @@ -832,10 +792,10 @@ namespace RBXLegacyLauncher } string quote = "\""; string args = ""; - args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "') _G.SetRBXLegacyVersion(" + GlobalVars.SelectedClientVersion + "); _G.CSServer(" + GlobalVars.ServerPort + "," + GlobalVars.PlayerLimit + ") " + quote + " -no3d"; + args = quote + mapfile + "\" -script \"dofile('" + GlobalVars.DefaultScript + "') _G.SetRBXLegacyVersion(" + GlobalVars.SelectedClientVersion + "); _G.CSServer(" + GlobalVars.ServerPort + "," + GlobalVars.PlayerLimit + "," + GlobalVars.RespawnTime + "," + GlobalVars.IsPersonalServer + "," + GlobalVars.UserID + "," + GlobalVars.blacklist1 + "," + GlobalVars.blacklist2 + "," + GlobalVars.blacklist3 + "," + GlobalVars.blacklist4 + "," + GlobalVars.blacklist5 + "," + GlobalVars.blacklist6 + "," + GlobalVars.blacklist7 + "," + GlobalVars.blacklist8 + "," + GlobalVars.melee + "," + GlobalVars.powerup + "," + GlobalVars.ranged + "," + GlobalVars.navigation + "," + GlobalVars.explosives + "," + GlobalVars.musical + "," + GlobalVars.social + "," + GlobalVars.transport + "," + GlobalVars.building + ") " + quote + " -no3d"; try { - ConsolePrint("Server Loaded in No3d.", 4); + ConsolePrint("Server Loaded in No3D mode.", 4); Process.Start(rbxexe, args); } catch (Exception ex) diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/QuickConfigure.cs b/RBXLegacyLauncher/RBXLegacyLauncher/QuickConfigure.cs index 85f7a66..d53b17b 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/QuickConfigure.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/QuickConfigure.cs @@ -18,7 +18,7 @@ namespace RBXLegacyLauncher void QuickConfigureLoad(object sender, EventArgs e) { - string cfgpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\config.txt"; + string cfgpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\rbxlegacy_config.txt"; if (!File.Exists(cfgpath)) { LauncherFuncs.WriteConfigValues(cfgpath); @@ -95,7 +95,7 @@ namespace RBXLegacyLauncher protected override void OnFormClosing(FormClosingEventArgs e) { - string cfgpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\config.txt"; + string cfgpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\rbxlegacy_config.txt"; base.OnFormClosing(e); LauncherFuncs.WriteConfigValues(cfgpath); GlobalVars.ReadyToLaunch = true; diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/SecurityFuncs.cs b/RBXLegacyLauncher/RBXLegacyLauncher/SecurityFuncs.cs index 80db7a5..a46adf1 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/SecurityFuncs.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/SecurityFuncs.cs @@ -65,7 +65,7 @@ namespace RBXLegacyLauncher public static bool checkScriptMD5() { - string rbxexe = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\CSMPFunctions.lua"; + string rbxexe = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\scripts\\CSMPFunctions.lua"; using (var md5 = MD5.Create()) { using (var stream = File.OpenRead(rbxexe)) diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.Designer.cs b/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.Designer.cs index 06fdc14..716f166 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.Designer.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.Designer.cs @@ -148,6 +148,7 @@ this.textBox11.Size = new System.Drawing.Size(55, 20); this.textBox11.TabIndex = 65; this.textBox11.Text = "0"; + this.textBox11.TextChanged += new System.EventHandler(this.TextBox11TextChanged); // // textBox12 // @@ -156,6 +157,7 @@ this.textBox12.Size = new System.Drawing.Size(54, 20); this.textBox12.TabIndex = 64; this.textBox12.Text = "0"; + this.textBox12.TextChanged += new System.EventHandler(this.TextBox12TextChanged); // // textBox9 // @@ -164,6 +166,7 @@ this.textBox9.Size = new System.Drawing.Size(55, 20); this.textBox9.TabIndex = 63; this.textBox9.Text = "0"; + this.textBox9.TextChanged += new System.EventHandler(this.TextBox9TextChanged); // // textBox10 // @@ -172,6 +175,7 @@ this.textBox10.Size = new System.Drawing.Size(54, 20); this.textBox10.TabIndex = 62; this.textBox10.Text = "0"; + this.textBox10.TextChanged += new System.EventHandler(this.TextBox10TextChanged); // // textBox5 // @@ -180,6 +184,7 @@ this.textBox5.Size = new System.Drawing.Size(54, 20); this.textBox5.TabIndex = 61; this.textBox5.Text = "0"; + this.textBox5.TextChanged += new System.EventHandler(this.TextBox5TextChanged); // // textBox8 // @@ -188,6 +193,7 @@ this.textBox8.Size = new System.Drawing.Size(54, 20); this.textBox8.TabIndex = 60; this.textBox8.Text = "0"; + this.textBox8.TextChanged += new System.EventHandler(this.TextBox8TextChanged); // // textBox6 // @@ -196,6 +202,7 @@ this.textBox6.Size = new System.Drawing.Size(54, 20); this.textBox6.TabIndex = 59; this.textBox6.Text = "0"; + this.textBox6.TextChanged += new System.EventHandler(this.TextBox6TextChanged); // // label6 // @@ -215,6 +222,7 @@ this.textBox4.Size = new System.Drawing.Size(54, 20); this.textBox4.TabIndex = 56; this.textBox4.Text = "0"; + this.textBox4.TextChanged += new System.EventHandler(this.TextBox4TextChanged); // // label5 // @@ -227,10 +235,12 @@ // // radioButton3 // - this.radioButton3.Location = new System.Drawing.Point(8, 44); + this.radioButton3.Checked = true; + this.radioButton3.Location = new System.Drawing.Point(8, 24); this.radioButton3.Name = "radioButton3"; this.radioButton3.Size = new System.Drawing.Size(104, 16); this.radioButton3.TabIndex = 54; + this.radioButton3.TabStop = true; this.radioButton3.Text = "None"; this.radioButton3.UseVisualStyleBackColor = true; this.radioButton3.CheckedChanged += new System.EventHandler(this.RadioButton3CheckedChanged); @@ -242,6 +252,7 @@ this.textBox2.Size = new System.Drawing.Size(237, 20); this.textBox2.TabIndex = 53; this.textBox2.Text = "5"; + this.textBox2.TextChanged += new System.EventHandler(this.TextBox2TextChanged); // // label4 // @@ -262,6 +273,7 @@ this.checkBox11.TabIndex = 51; this.checkBox11.Text = "Enable UPnP (Universal Plug n\' Play)"; this.checkBox11.UseVisualStyleBackColor = true; + this.checkBox11.CheckedChanged += new System.EventHandler(this.CheckBox11CheckedChanged); // // checkBox10 // @@ -271,6 +283,7 @@ this.checkBox10.TabIndex = 50; this.checkBox10.Text = "Personal Building Server (PBS)"; this.checkBox10.UseVisualStyleBackColor = true; + this.checkBox10.CheckedChanged += new System.EventHandler(this.CheckBox10CheckedChanged); // // label45 // @@ -288,6 +301,7 @@ this.textBox7.Size = new System.Drawing.Size(237, 20); this.textBox7.TabIndex = 48; this.textBox7.Text = "53640"; + this.textBox7.TextChanged += new System.EventHandler(this.TextBox7TextChanged); // // textBox3 // @@ -296,6 +310,7 @@ this.textBox3.Size = new System.Drawing.Size(237, 20); this.textBox3.TabIndex = 47; this.textBox3.Text = "12"; + this.textBox3.TextChanged += new System.EventHandler(this.TextBox3TextChanged); // // label29 // @@ -336,6 +351,7 @@ this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(238, 21); this.comboBox1.TabIndex = 12; + this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.ComboBox1SelectedIndexChanged); // // label1 // @@ -355,6 +371,7 @@ this.checkBox7.TabIndex = 10; this.checkBox7.Text = "Building"; this.checkBox7.UseVisualStyleBackColor = true; + this.checkBox7.CheckedChanged += new System.EventHandler(this.CheckBox7CheckedChanged); // // checkBox8 // @@ -365,6 +382,7 @@ this.checkBox8.TabIndex = 9; this.checkBox8.Text = "Musical"; this.checkBox8.UseVisualStyleBackColor = true; + this.checkBox8.CheckedChanged += new System.EventHandler(this.CheckBox8CheckedChanged); // // checkBox9 // @@ -375,6 +393,7 @@ this.checkBox9.TabIndex = 8; this.checkBox9.Text = "Ranged"; this.checkBox9.UseVisualStyleBackColor = true; + this.checkBox9.CheckedChanged += new System.EventHandler(this.CheckBox9CheckedChanged); // // checkBox4 // @@ -385,6 +404,7 @@ this.checkBox4.TabIndex = 7; this.checkBox4.Text = "Transport"; this.checkBox4.UseVisualStyleBackColor = true; + this.checkBox4.CheckedChanged += new System.EventHandler(this.CheckBox4CheckedChanged); // // checkBox5 // @@ -395,6 +415,7 @@ this.checkBox5.TabIndex = 6; this.checkBox5.Text = "Explosives"; this.checkBox5.UseVisualStyleBackColor = true; + this.checkBox5.CheckedChanged += new System.EventHandler(this.CheckBox5CheckedChanged); // // checkBox6 // @@ -405,6 +426,7 @@ this.checkBox6.TabIndex = 5; this.checkBox6.Text = "Power ups"; this.checkBox6.UseVisualStyleBackColor = true; + this.checkBox6.CheckedChanged += new System.EventHandler(this.CheckBox6CheckedChanged); // // checkBox3 // @@ -415,6 +437,7 @@ this.checkBox3.TabIndex = 4; this.checkBox3.Text = "Social"; this.checkBox3.UseVisualStyleBackColor = true; + this.checkBox3.CheckedChanged += new System.EventHandler(this.CheckBox3CheckedChanged); // // checkBox2 // @@ -425,6 +448,7 @@ this.checkBox2.TabIndex = 3; this.checkBox2.Text = "Navigation"; this.checkBox2.UseVisualStyleBackColor = true; + this.checkBox2.CheckedChanged += new System.EventHandler(this.CheckBox2CheckedChanged); // // checkBox1 // @@ -435,6 +459,7 @@ this.checkBox1.TabIndex = 2; this.checkBox1.Text = "Melee"; this.checkBox1.UseVisualStyleBackColor = true; + this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1CheckedChanged); // // radioButton2 // @@ -448,12 +473,10 @@ // // radioButton1 // - this.radioButton1.Checked = true; - this.radioButton1.Location = new System.Drawing.Point(8, 23); + this.radioButton1.Location = new System.Drawing.Point(8, 39); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(104, 24); this.radioButton1.TabIndex = 0; - this.radioButton1.TabStop = true; this.radioButton1.Text = "All"; this.radioButton1.UseVisualStyleBackColor = true; this.radioButton1.CheckedChanged += new System.EventHandler(this.RadioButton1CheckedChanged); @@ -477,6 +500,7 @@ this.button1.TabIndex = 2; this.button1.Text = "Reset Server Preferences"; this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.Button1Click); // // ServerPrefs // @@ -484,7 +508,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(514, 271); + this.ClientSize = new System.Drawing.Size(514, 276); this.Controls.Add(this.button1); this.Controls.Add(this.tabControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; diff --git a/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.cs b/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.cs index f30d548..e128bee 100644 --- a/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.cs +++ b/RBXLegacyLauncher/RBXLegacyLauncher/ServerPrefs.cs @@ -42,7 +42,151 @@ namespace RBXLegacyLauncher }; string URI2 = "RBXLegacy://" + SecurityFuncs.Base64Encode(string.Join("|",lines2)); textBox1.AppendText("Local URI Link:"); - textBox1.AppendText(URI2); + textBox1.AppendText(URI2); + + if (GlobalVars.PlayerLimit == 0) + { + //We need at least a limit of 12 players. + GlobalVars.PlayerLimit = 12; + textBox3.Text = GlobalVars.PlayerLimit.ToString(); + } + else + { + textBox3.Text = GlobalVars.PlayerLimit.ToString(); + } + + if (GlobalVars.ServerPort == 0) + { + //We need at least a limit of 12 players. + GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort; + textBox7.Text = GlobalVars.ServerPort.ToString(); + } + else + { + textBox7.Text = GlobalVars.ServerPort.ToString(); + } + + if (GlobalVars.melee == true) + { + checkBox1.Checked = true; + } + else + { + checkBox1.Checked = false; + } + + if (GlobalVars.navigation == true) + { + checkBox2.Checked = true; + } + else + { + checkBox2.Checked = false; + } + + if (GlobalVars.social == true) + { + checkBox3.Checked = true; + } + else + { + checkBox3.Checked = false; + } + + if (GlobalVars.powerup == true) + { + checkBox6.Checked = true; + } + else + { + checkBox6.Checked = false; + } + + if (GlobalVars.explosives == true) + { + checkBox5.Checked = true; + } + else + { + checkBox5.Checked = false; + } + + if (GlobalVars.transport == true) + { + checkBox4.Checked = true; + } + else + { + checkBox4.Checked = false; + } + + if (GlobalVars.ranged == true) + { + checkBox9.Checked = true; + } + else + { + checkBox9.Checked = false; + } + + if (GlobalVars.musical == true) + { + checkBox8.Checked = true; + } + else + { + checkBox8.Checked = false; + } + + if (GlobalVars.building == true) + { + checkBox7.Checked = true; + } + else + { + checkBox7.Checked = false; + } + + if (GlobalVars.melee == true && GlobalVars.navigation == true + && GlobalVars.social == true && GlobalVars.powerup == true && + GlobalVars.explosives == true && GlobalVars.transport == true && + GlobalVars.ranged == true && GlobalVars.musical == true && + GlobalVars.building == true) + { + radioButton1.Checked = true; + } + else if (GlobalVars.melee == false && GlobalVars.navigation == false + && GlobalVars.social == false && GlobalVars.powerup == false && + GlobalVars.explosives == false && GlobalVars.transport == false && + GlobalVars.ranged == false && GlobalVars.musical == false && + GlobalVars.building == false) + { + radioButton3.Checked = true; + } + else + { + radioButton2.Checked = true; + } + + if (GlobalVars.upnp == true) + { + checkBox11.Checked = true; + } + else + { + checkBox11.Checked = false; + } + + if (GlobalVars.IsPersonalServer == true) + { + checkBox10.Checked = true; + } + else + { + checkBox10.Checked = false; + } + + comboBox1.SelectedText = GlobalVars.ChatType; } string GetExternalIPAddress() @@ -74,6 +218,26 @@ namespace RBXLegacyLauncher checkBox7.Enabled = false; checkBox8.Enabled = false; checkBox9.Enabled = false; + + checkBox1.Checked = true; + checkBox2.Checked = true; + checkBox3.Checked = true; + checkBox4.Checked = true; + checkBox5.Checked = true; + checkBox6.Checked = true; + checkBox7.Checked = true; + checkBox8.Checked = true; + checkBox9.Checked = true; + + GlobalVars.melee = true; + GlobalVars.navigation = true; + GlobalVars.social = true; + GlobalVars.powerup = true; + GlobalVars.explosives = true; + GlobalVars.transport = true; + GlobalVars.ranged = true; + GlobalVars.musical = true; + GlobalVars.building = true; } void RadioButton3CheckedChanged(object sender, EventArgs e) @@ -87,6 +251,26 @@ namespace RBXLegacyLauncher checkBox7.Enabled = false; checkBox8.Enabled = false; checkBox9.Enabled = false; + + checkBox1.Checked = false; + checkBox2.Checked = false; + checkBox3.Checked = false; + checkBox4.Checked = false; + checkBox5.Checked = false; + checkBox6.Checked = false; + checkBox7.Checked = false; + checkBox8.Checked = false; + checkBox9.Checked = false; + + GlobalVars.melee = false; + GlobalVars.navigation = false; + GlobalVars.social = false; + GlobalVars.powerup = false; + GlobalVars.explosives = false; + GlobalVars.transport = false; + GlobalVars.ranged = false; + GlobalVars.musical = false; + GlobalVars.building = false; } void RadioButton2CheckedChanged(object sender, EventArgs e) @@ -100,6 +284,397 @@ namespace RBXLegacyLauncher checkBox7.Enabled = true; checkBox8.Enabled = true; checkBox9.Enabled = true; + + checkBox1.Checked = false; + checkBox2.Checked = false; + checkBox3.Checked = false; + checkBox4.Checked = false; + checkBox5.Checked = false; + checkBox6.Checked = false; + checkBox7.Checked = false; + checkBox8.Checked = false; + checkBox9.Checked = false; + + GlobalVars.melee = false; + GlobalVars.navigation = false; + GlobalVars.social = false; + GlobalVars.powerup = false; + GlobalVars.explosives = false; + GlobalVars.transport = false; + GlobalVars.ranged = false; + GlobalVars.musical = false; + GlobalVars.building = false; + } + + void TextBox7TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox7.Text, out parsedValue)) + { + if (textBox7.Text.Equals("")) + { + //set it to the normal port, 53640. it wouldn't make any sense if we set it to 0. + GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort; + } + else + { + GlobalVars.ServerPort = Convert.ToInt32(textBox7.Text); + } + } + else + { + GlobalVars.ServerPort = GlobalVars.DefaultRobloxPort; + } + } + + void ComboBox1SelectedIndexChanged(object sender, EventArgs e) + { + GlobalVars.ChatType = comboBox1.SelectedText; + } + + void TextBox2TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox2.Text, out parsedValue)) + { + if (textBox2.Text.Equals("")) + { + GlobalVars.RespawnTime = 5; + } + else + { + GlobalVars.RespawnTime = Convert.ToInt32(textBox2.Text); + } + } + else + { + GlobalVars.RespawnTime = 5; + } + } + + void TextBox3TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox3.Text, out parsedValue)) + { + if (textBox3.Text.Equals("")) + { + GlobalVars.PlayerLimit = 12; + } + else + { + GlobalVars.PlayerLimit = Convert.ToInt32(textBox3.Text); + } + } + else + { + GlobalVars.PlayerLimit = 12; + } + } + + void Button1Click(object sender, EventArgs e) + { + LauncherFuncs.ResetServerPrefs(); + LauncherFuncs.WriteServerPrefs("serverhost_config.txt"); + DialogResult result = MessageBox.Show("Your server configuration has been reset to the default values.","RBXLegacy Launcher - Server Preferences", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); + } + + protected override void OnFormClosing(FormClosingEventArgs e) + { + base.OnFormClosing(e); + LauncherFuncs.WriteServerPrefs("serverhost_config.txt"); + } + + void CheckBox1CheckedChanged(object sender, EventArgs e) + { + if (checkBox1.Checked == true) + { + GlobalVars.melee = true; + } + else + { + GlobalVars.melee = false; + } + } + + void CheckBox2CheckedChanged(object sender, EventArgs e) + { + if (checkBox2.Checked == true) + { + GlobalVars.navigation = true; + } + else + { + GlobalVars.navigation = false; + } + } + + void CheckBox3CheckedChanged(object sender, EventArgs e) + { + if (checkBox3.Checked == true) + { + GlobalVars.social = true; + } + else + { + GlobalVars.social = false; + } + } + + void CheckBox4CheckedChanged(object sender, EventArgs e) + { + if (checkBox4.Checked == true) + { + GlobalVars.transport = true; + } + else + { + GlobalVars.transport = false; + } + } + + void CheckBox5CheckedChanged(object sender, EventArgs e) + { + if (checkBox5.Checked == true) + { + GlobalVars.explosives = true; + } + else + { + GlobalVars.explosives = false; + } + } + + void CheckBox6CheckedChanged(object sender, EventArgs e) + { + if (checkBox6.Checked == true) + { + GlobalVars.powerup = true; + } + else + { + GlobalVars.powerup = false; + } + } + + void CheckBox7CheckedChanged(object sender, EventArgs e) + { + if (checkBox7.Checked == true) + { + GlobalVars.building = true; + } + else + { + GlobalVars.building = false; + } + } + + void CheckBox8CheckedChanged(object sender, EventArgs e) + { + if (checkBox8.Checked == true) + { + GlobalVars.musical = true; + } + else + { + GlobalVars.musical = false; + } + } + + void CheckBox9CheckedChanged(object sender, EventArgs e) + { + if (checkBox9.Checked == true) + { + GlobalVars.ranged = true; + } + else + { + GlobalVars.ranged = false; + } + } + + void CheckBox11CheckedChanged(object sender, EventArgs e) + { + if (checkBox11.Checked == true) + { + GlobalVars.upnp = true; + } + else + { + GlobalVars.upnp = false; + } + } + + void CheckBox10CheckedChanged(object sender, EventArgs e) + { + if (checkBox10.Checked == true) + { + GlobalVars.IsPersonalServer = true; + } + else + { + GlobalVars.IsPersonalServer = false; + } + } + + void TextBox4TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox4.Text, out parsedValue)) + { + if (textBox4.Text.Equals("")) + { + GlobalVars.blacklist1 = 0; + } + else + { + GlobalVars.blacklist1 = Convert.ToInt32(textBox4.Text); + } + } + else + { + GlobalVars.blacklist1 = 0; + } + } + + void TextBox8TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox8.Text, out parsedValue)) + { + if (textBox8.Text.Equals("")) + { + GlobalVars.blacklist2 = 0; + } + else + { + GlobalVars.blacklist2 = Convert.ToInt32(textBox8.Text); + } + } + else + { + GlobalVars.blacklist2 = 0; + } + } + + void TextBox10TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox10.Text, out parsedValue)) + { + if (textBox10.Text.Equals("")) + { + GlobalVars.blacklist3 = 0; + } + else + { + GlobalVars.blacklist3 = Convert.ToInt32(textBox10.Text); + } + } + else + { + GlobalVars.blacklist3 = 0; + } + } + + void TextBox12TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox12.Text, out parsedValue)) + { + if (textBox12.Text.Equals("")) + { + GlobalVars.blacklist4 = 0; + } + else + { + GlobalVars.blacklist4 = Convert.ToInt32(textBox12.Text); + } + } + else + { + GlobalVars.blacklist4 = 0; + } + } + + void TextBox6TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox6.Text, out parsedValue)) + { + if (textBox6.Text.Equals("")) + { + GlobalVars.blacklist5 = 0; + } + else + { + GlobalVars.blacklist5 = Convert.ToInt32(textBox6.Text); + } + } + else + { + GlobalVars.blacklist5 = 0; + } + } + + void TextBox5TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox7.Text, out parsedValue)) + { + if (textBox7.Text.Equals("")) + { + GlobalVars.blacklist6 = 0; + } + else + { + GlobalVars.blacklist6 = Convert.ToInt32(textBox7.Text); + } + } + else + { + GlobalVars.blacklist6 = 0; + } + } + + void TextBox9TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox9.Text, out parsedValue)) + { + if (textBox9.Text.Equals("")) + { + GlobalVars.blacklist7 = 0; + } + else + { + GlobalVars.blacklist7 = Convert.ToInt32(textBox9.Text); + } + } + else + { + GlobalVars.blacklist7 = 0; + } + } + + void TextBox11TextChanged(object sender, EventArgs e) + { + int parsedValue; + if (int.TryParse(textBox11.Text, out parsedValue)) + { + if (textBox11.Text.Equals("")) + { + GlobalVars.blacklist8 = 0; + } + else + { + GlobalVars.blacklist8 = Convert.ToInt32(textBox11.Text); + } + } + else + { + GlobalVars.blacklist8 = 0; + } } } }