From 4b1ccdb1e93f8d07679f32c687b39d6cbcf0f469 Mon Sep 17 00:00:00 2001 From: Bitl Date: Sun, 31 Oct 2021 15:13:59 -0700 Subject: [PATCH] server browser fixes, better replicator solution --- .itch.toml | 8 +++- .../StorageAndFunctions/VarStorage.cs | 29 +++++++++++- .../Compact/LauncherFormCompact.cs | 2 +- .../Extended/LauncherFormExtended.cs | 2 +- .../Forms/LauncherForm/LauncherFormShared.cs | 34 +++++++++++--- .../Stylish/LauncherFormStylish.cs | 23 ++++++++-- .../LauncherFormStylishInterface.xaml.cs | 10 +++-- .../Forms/ServerBrowser.Designer.cs | 11 +++-- .../NovetusLauncher/Forms/ServerBrowser.cs | 33 +++++++++----- .../NovetusLauncherEntryPoint.cs | 45 ++++++++++--------- .../Properties/Resources.Designer.cs | 10 +++++ .../NovetusLauncher/Properties/Resources.resx | 3 ++ changelog.txt | 4 +- scripts/game/2006S-Shaders/CSMPFunctions.lua | 21 +++++++-- scripts/game/2006S/CSMPFunctions.lua | 21 +++++++-- scripts/game/2007E-Shaders/CSMPFunctions.lua | 21 +++++++-- scripts/game/2007E/CSMPFunctions.lua | 20 +++++++-- scripts/game/2007M-Shaders/CSMPFunctions.lua | 21 +++++++-- scripts/game/2007M/CSMPFunctions.lua | 21 +++++++-- scripts/game/2008M/CSMPFunctions.lua | 21 +++++++-- scripts/game/2009E-HD/CSMPFunctions.lua | 21 +++++++-- scripts/game/2009E/CSMPFunctions.lua | 21 +++++++-- scripts/game/2010L/CSMPFunctions.lua | 21 +++++++-- scripts/game/2011E/CSMPFunctions.lua | 22 ++++++--- scripts/game/2011M/CSMPFunctions.lua | 22 ++++++--- scripts/launcher/3DView/CSView.lua | 3 +- 26 files changed, 364 insertions(+), 106 deletions(-) diff --git a/.itch.toml b/.itch.toml index dd2debf..642ca4f 100644 --- a/.itch.toml +++ b/.itch.toml @@ -1,10 +1,16 @@ [[actions]] name = "Play" -path = "NovetusLauncher.exe" +path = "NovetusBootstrapper.exe" sandbox = true [[actions]] name = "Play (Legacy Launcher. USE THIS IF YOU DON'T HAVE NET FRAMEWORK 4.0 INSTALLED.)" path = "Novetus_launcher_legacy.bat" console = true +sandbox = true + +[[actions]] +name = "Install Dependencies" +path = "Novetus_dependency_installer.bat" +console = true sandbox = true \ No newline at end of file diff --git a/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs b/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs index 58b7ace..3b43b9b 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs @@ -1,6 +1,8 @@ #region Usings using System; using System.Drawing; +using System.Net.NetworkInformation; +using System.Net.Sockets; #endregion #region Variable Storage @@ -36,6 +38,7 @@ public class VarStorage ServerIP = SecurityFuncs.Base64DecodeOld(ip); ServerPort = Convert.ToInt32(SecurityFuncs.Base64DecodeOld(port)); ServerClient = SecurityFuncs.Base64DecodeOld(client); + ServerStatus = PingServer(ServerIP, ServerPort); } public bool IsValid() @@ -45,7 +48,8 @@ public class VarStorage !string.IsNullOrWhiteSpace(ServerIP) && !string.IsNullOrWhiteSpace(ServerPort.ToString()) && GlobalFuncs.IsClientValid(ServerClient) && - (!ServerIP.Equals("localhost") || !ServerIP.Equals("127.0.0.1"))) + (!ServerIP.Equals("localhost") || !ServerIP.Equals("127.0.0.1")) && + !GetStatusString().Equals("Offline")) { return true; } @@ -55,10 +59,33 @@ public class VarStorage } } + //Modified from https://stackoverflow.com/questions/22903861/how-to-check-remote-ip-and-port-is-available + public static bool PingServer(string hostUri, int portNumber) + { + try + { + using (var client = new UdpClient(hostUri, portNumber)) + return true; + } + catch (SocketException ex) + { +#if URI || LAUNCHER || CMD + GlobalFuncs.LogExceptions(ex); +#endif + return false; + } + } + + public string GetStatusString() + { + return (ServerStatus ? "Online" : "Offline"); + } + public string ServerName { get; set; } public string ServerIP { get; set; } public int ServerPort { get; set; } public string ServerClient { get; set; } + public bool ServerStatus { get; set; } } #endregion } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index 10f7d3a..a94c12a 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -63,7 +63,7 @@ namespace NovetusLauncher void MainFormClose(object sender, CancelEventArgs e) { - launcherForm.CloseEvent(); + launcherForm.CloseEvent(e); } void TextBox1TextChanged(object sender, EventArgs e) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index d0188b5..f666061 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -68,7 +68,7 @@ namespace NovetusLauncher void MainFormClose(object sender, CancelEventArgs e) { - launcherForm.CloseEvent(); + launcherForm.CloseEvent(e); } void TextBox1TextChanged(object sender, EventArgs e) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index 0c1a82e..ef4eb8d 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -2,6 +2,7 @@ using Mono.Nat; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Globalization; using System.IO; @@ -288,7 +289,23 @@ namespace NovetusLauncher } } - public void CloseEvent() + public void CloseEvent(CancelEventArgs e) + { + if (GlobalVars.AdminMode) + { + DialogResult closeNovetus = MessageBox.Show("You are in Admin Mode.\nAre you sure you want to quit Novetus?", "Novetus - Admin Mode Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (closeNovetus == DialogResult.No) + { + e.Cancel = true; + } + else + { + CloseEventInternal(); + } + } + } + + public void CloseEventInternal() { if (!GlobalVars.LocalPlayMode) { @@ -744,16 +761,18 @@ namespace NovetusLauncher if (FormStyle != Settings.Style.Extended) { GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Extended; - CloseEvent(); - Application.Restart(); + CloseEventInternal(); + System.Diagnostics.Process.Start(Application.ExecutablePath); + Application.Exit(); } break; case 1: if (FormStyle != Settings.Style.Compact) { GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Compact; - CloseEvent(); - Application.Restart(); + CloseEventInternal(); + System.Diagnostics.Process.Start(Application.ExecutablePath); + Application.Exit(); } break; case 2: @@ -761,8 +780,9 @@ namespace NovetusLauncher if (FormStyle != Settings.Style.Stylish) { GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Stylish; - CloseEvent(); - Application.Restart(); + CloseEventInternal(); + System.Diagnostics.Process.Start(Application.ExecutablePath); + Application.Exit(); } break; } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs index aa16499..dccab6d 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs @@ -89,13 +89,28 @@ namespace NovetusLauncher void LauncherFormStylish_Close(object sender, CancelEventArgs e) { - CloseEvent(); - Application.Exit(); + CloseEvent(e); } #endregion #region Functions - public void CloseEvent() + public void CloseEvent(CancelEventArgs e) + { + if (GlobalVars.AdminMode) + { + DialogResult closeNovetus = MessageBox.Show("You are in Admin Mode.\nAre you sure you want to quit Novetus?", "Novetus - Admin Mode Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (closeNovetus == DialogResult.No) + { + e.Cancel = true; + } + else + { + CloseEventInternal(); + } + } + } + + public void CloseEventInternal() { WriteConfigValues(); @@ -103,6 +118,8 @@ namespace NovetusLauncher { DiscordRPC.Shutdown(); } + + Application.Exit(); } void splashLabel_Paint(object sender, PaintEventArgs e) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs index 675d1f0..de2d7f7 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs @@ -455,13 +455,15 @@ namespace NovetusLauncher { case 0: GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Extended; - FormParent.CloseEvent(); - System.Windows.Forms.Application.Restart(); + FormParent.CloseEventInternal(); + System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath); + System.Windows.Forms.Application.Exit(); break; case 1: GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Compact; - FormParent.CloseEvent(); - System.Windows.Forms.Application.Restart(); + FormParent.CloseEventInternal(); + System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath); + System.Windows.Forms.Application.Exit(); break; default: break; diff --git a/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs b/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs index fd09429..e80d36f 100644 --- a/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs @@ -50,9 +50,11 @@ namespace NovetusLauncher // // MasterServerBox // + this.MasterServerBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.MasterServerBox.Location = new System.Drawing.Point(135, 10); this.MasterServerBox.Name = "MasterServerBox"; - this.MasterServerBox.Size = new System.Drawing.Size(131, 20); + this.MasterServerBox.Size = new System.Drawing.Size(323, 20); this.MasterServerBox.TabIndex = 1; this.MasterServerBox.TextChanged += new System.EventHandler(this.MasterServerBox_TextChanged); // @@ -67,12 +69,13 @@ namespace NovetusLauncher // // MasterServerRefreshButton // + this.MasterServerRefreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.MasterServerRefreshButton.AutoEllipsis = true; - this.MasterServerRefreshButton.Location = new System.Drawing.Point(272, 8); + this.MasterServerRefreshButton.Image = global::NovetusLauncher.Properties.Resources.refresh; + this.MasterServerRefreshButton.Location = new System.Drawing.Point(464, 8); this.MasterServerRefreshButton.Name = "MasterServerRefreshButton"; - this.MasterServerRefreshButton.Size = new System.Drawing.Size(125, 23); + this.MasterServerRefreshButton.Size = new System.Drawing.Size(25, 23); this.MasterServerRefreshButton.TabIndex = 3; - this.MasterServerRefreshButton.Text = "REFRESH SERVERS"; this.MasterServerRefreshButton.UseVisualStyleBackColor = true; this.MasterServerRefreshButton.Click += new System.EventHandler(this.MasterServerRefreshButton_Click); // diff --git a/Novetus/NovetusLauncher/Forms/ServerBrowser.cs b/Novetus/NovetusLauncher/Forms/ServerBrowser.cs index 0afc6b4..22e1d98 100644 --- a/Novetus/NovetusLauncher/Forms/ServerBrowser.cs +++ b/Novetus/NovetusLauncher/Forms/ServerBrowser.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; +using System.Net.NetworkInformation; using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; @@ -16,7 +17,7 @@ namespace NovetusLauncher { #region Private Variables List serverList = new List(); - private int selectedServer; + private VarStorage.GameServer selectedServer; private string oldIP; private int oldPort; #endregion @@ -38,16 +39,15 @@ namespace NovetusLauncher { try { - if (ServerListView.Items.Count > 0 && ServerListView.Items[selectedServer] != null && serverList[selectedServer] != null) + if (ServerListView.Items.Count > 0 && selectedServer != null) { - VarStorage.GameServer curServer = serverList[selectedServer]; - if (curServer.IsValid()) + if (selectedServer.IsValid()) { oldIP = GlobalVars.IP; oldPort = GlobalVars.JoinPort; - GlobalVars.IP = curServer.ServerIP; - GlobalVars.JoinPort = curServer.ServerPort; - GlobalFuncs.LaunchRBXClient(curServer.ServerClient, ScriptType.Client, false, true, new EventHandler(ClientExited), null); + GlobalVars.IP = selectedServer.ServerIP; + GlobalVars.JoinPort = selectedServer.ServerPort; + GlobalFuncs.LaunchRBXClient(selectedServer.ServerClient, ScriptType.Client, false, true, new EventHandler(ClientExited), null); } } else @@ -80,7 +80,7 @@ namespace NovetusLauncher int intselectedindex = ServerListView.SelectedIndices[0]; if (intselectedindex >= 0) { - selectedServer = ServerListView.Items[intselectedindex].Index; + selectedServer = serverList.Find(item => item.ServerName == ServerListView.Items[intselectedindex].Text); } } catch (Exception ex) @@ -137,10 +137,7 @@ namespace NovetusLauncher string DecodedLine = SecurityFuncs.Base64DecodeOld(line); string[] serverInfo = DecodedLine.Split('|'); VarStorage.GameServer gameServer = new VarStorage.GameServer(serverInfo[0], serverInfo[1], serverInfo[2], serverInfo[3]); - if (gameServer.IsValid() && !serverList.Any(item => item.ServerName.Equals(gameServer.ServerName))) - { - serverList.Add(gameServer); - } + serverList.Add(gameServer); } } } @@ -176,13 +173,25 @@ namespace NovetusLauncher ColumnClient.Width = 75; ServerListView.Columns.Add(ColumnClient); + var ColumnStatus = new ColumnHeader(); + ColumnStatus.Text = "Status"; + ColumnStatus.TextAlign = HorizontalAlignment.Center; + ColumnStatus.Width = 75; + ServerListView.Columns.Add(ColumnStatus); + foreach (var server in serverList) { + if (!server.IsValid()) + continue; + var serverItem = new ListViewItem(server.ServerName); var serverClient = new ListViewItem.ListViewSubItem(serverItem, server.ServerClient); serverItem.SubItems.Add(serverClient); + var serverStatus = new ListViewItem.ListViewSubItem(serverItem, server.GetStatusString()); + serverItem.SubItems.Add(serverStatus); + ServerListView.Items.Add(serverItem); } } diff --git a/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs b/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs index ae32ef5..cc3b216 100644 --- a/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs +++ b/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs @@ -27,26 +27,7 @@ namespace NovetusLauncher GlobalVars.ColorsLoaded = GlobalFuncs.InitColors(); if (args.Length == 0) { - try - { - switch (GlobalVars.UserConfiguration.LauncherStyle) - { - case Settings.Style.Compact: - System.Windows.Forms.Application.Run(new LauncherFormCompact()); - break; - case Settings.Style.Extended: - System.Windows.Forms.Application.Run(new LauncherFormExtended()); - break; - case Settings.Style.Stylish: - default: - System.Windows.Forms.Application.Run(new LauncherFormStylish()); - break; - } - } - catch(Exception ex) - { - GlobalFuncs.LogExceptions(ex); - } + RunLauncher(); } else { @@ -58,6 +39,30 @@ namespace NovetusLauncher } } } + + static void RunLauncher() + { + try + { + switch (GlobalVars.UserConfiguration.LauncherStyle) + { + case Settings.Style.Compact: + System.Windows.Forms.Application.Run(new LauncherFormCompact()); + break; + case Settings.Style.Extended: + System.Windows.Forms.Application.Run(new LauncherFormExtended()); + break; + case Settings.Style.Stylish: + default: + System.Windows.Forms.Application.Run(new LauncherFormStylish()); + break; + } + } + catch (Exception ex) + { + GlobalFuncs.LogExceptions(ex); + } + } } #endregion } diff --git a/Novetus/NovetusLauncher/Properties/Resources.Designer.cs b/Novetus/NovetusLauncher/Properties/Resources.Designer.cs index 1640661..6c9aec0 100644 --- a/Novetus/NovetusLauncher/Properties/Resources.Designer.cs +++ b/Novetus/NovetusLauncher/Properties/Resources.Designer.cs @@ -79,5 +79,15 @@ namespace NovetusLauncher.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap refresh { + get { + object obj = ResourceManager.GetObject("refresh", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Novetus/NovetusLauncher/Properties/Resources.resx b/Novetus/NovetusLauncher/Properties/Resources.resx index a708903..edc3f58 100644 --- a/Novetus/NovetusLauncher/Properties/Resources.resx +++ b/Novetus/NovetusLauncher/Properties/Resources.resx @@ -124,4 +124,7 @@ ..\Resources\NOVETUS_small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index ca0e369..ced8587 100644 --- a/changelog.txt +++ b/changelog.txt @@ -48,8 +48,10 @@ Changes from Pre-Release 5: - The server browser will now load the current master server address on bootup. - Fixed a bug where joining a game with the Server Browser loads the wrong IP address in the game title. - The user will now know when the Server Browser is loading servers. -- Novetus will now properly kick players. +- Novetus will now properly kick players who join with modified clients/scripts. +- Server hosters may now insert a "SkipSecurity" object into Lighting that will skip security. SkipSecurity may also be removed to re-enable security. - Increased the speed of loading outfits in 2011 clients. +- Fixed issues with launching Novetus from itch.io. Changes from 1.2.4.1: - The OBJ2MeshV1GUI, The Asset Localizer, and the Item SDK have been merged to form the Asset SDK! - Works with the Roblox Asset Delivery API! Note: Script assets wil have to be downloaded manually in order to be used in scripts. diff --git a/scripts/game/2006S-Shaders/CSMPFunctions.lua b/scripts/game/2006S-Shaders/CSMPFunctions.lua index 73c25ef..d2e8b4f 100644 --- a/scripts/game/2006S-Shaders/CSMPFunctions.lua +++ b/scripts/game/2006S-Shaders/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:findFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -233,10 +237,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.maxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.ChildAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -347,7 +360,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -371,8 +384,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:createLocalPlayer(UserID) game:service("RunService"):run() + local plr = game.Players:createLocalPlayer(UserID) game.Workspace:insertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:SetAdminMode(true) diff --git a/scripts/game/2006S/CSMPFunctions.lua b/scripts/game/2006S/CSMPFunctions.lua index 73c25ef..7300df1 100644 --- a/scripts/game/2006S/CSMPFunctions.lua +++ b/scripts/game/2006S/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:findFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -233,10 +237,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.maxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.ChildAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -347,7 +360,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -371,8 +384,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:createLocalPlayer(UserID) game:service("RunService"):run() + local plr = game.Players:createLocalPlayer(UserID) game.Workspace:insertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:SetAdminMode(true) diff --git a/scripts/game/2007E-Shaders/CSMPFunctions.lua b/scripts/game/2007E-Shaders/CSMPFunctions.lua index 5a6dd89..281411e 100644 --- a/scripts/game/2007E-Shaders/CSMPFunctions.lua +++ b/scripts/game/2007E-Shaders/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:findFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -257,10 +261,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.maxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.ChildAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -371,7 +384,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -391,8 +404,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:createLocalPlayer(UserID) game:service("RunService"):run() + local plr = game.Players:createLocalPlayer(UserID) game.Workspace:insertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:SetAdminMode(true) diff --git a/scripts/game/2007E/CSMPFunctions.lua b/scripts/game/2007E/CSMPFunctions.lua index 1f8819b..281411e 100644 --- a/scripts/game/2007E/CSMPFunctions.lua +++ b/scripts/game/2007E/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:findFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -258,10 +262,18 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.maxPlayers = PlayerLimit end + local playerCount = 0 PlayerService.ChildAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -372,7 +384,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -392,8 +404,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:createLocalPlayer(UserID) game:service("RunService"):run() + local plr = game.Players:createLocalPlayer(UserID) game.Workspace:insertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:SetAdminMode(true) diff --git a/scripts/game/2007M-Shaders/CSMPFunctions.lua b/scripts/game/2007M-Shaders/CSMPFunctions.lua index 55c6441..5808a25 100644 --- a/scripts/game/2007M-Shaders/CSMPFunctions.lua +++ b/scripts/game/2007M-Shaders/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -348,10 +352,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -461,7 +474,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -481,8 +494,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):run() + local plr = game.Players:CreateLocalPlayer(UserID) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:LoadCharacter() diff --git a/scripts/game/2007M/CSMPFunctions.lua b/scripts/game/2007M/CSMPFunctions.lua index 75bf9ea..f963847 100644 --- a/scripts/game/2007M/CSMPFunctions.lua +++ b/scripts/game/2007M/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -348,10 +352,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -461,7 +474,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -481,8 +494,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):run() + local plr = game.Players:CreateLocalPlayer(UserID) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:LoadCharacter() diff --git a/scripts/game/2008M/CSMPFunctions.lua b/scripts/game/2008M/CSMPFunctions.lua index 33f3ff4..f2787a2 100644 --- a/scripts/game/2008M/CSMPFunctions.lua +++ b/scripts/game/2008M/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -478,10 +482,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -591,7 +604,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -611,8 +624,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):run() + local plr = game.Players:CreateLocalPlayer(UserID) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:LoadCharacter() diff --git a/scripts/game/2009E-HD/CSMPFunctions.lua b/scripts/game/2009E-HD/CSMPFunctions.lua index 62ecbde..3dc7e3d 100644 --- a/scripts/game/2009E-HD/CSMPFunctions.lua +++ b/scripts/game/2009E-HD/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -559,10 +563,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -685,7 +698,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -705,8 +718,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):run() + local plr = game.Players:CreateLocalPlayer(UserID) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:LoadCharacter() diff --git a/scripts/game/2009E/CSMPFunctions.lua b/scripts/game/2009E/CSMPFunctions.lua index 62ecbde..3dc7e3d 100644 --- a/scripts/game/2009E/CSMPFunctions.lua +++ b/scripts/game/2009E/CSMPFunctions.lua @@ -12,9 +12,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -559,10 +563,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -685,7 +698,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function failed(peer, errcode, why) - dieerror("Failed to connect to the Game. (ID="..errcode.." ["..why.."])") + dieerror("Failed to connect to the Game. (ID="..errcode..")") end local suc, err = pcall(function() @@ -705,8 +718,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):run() + local plr = game.Players:CreateLocalPlayer(UserID) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") plr.Name = PlayerName plr:LoadCharacter() diff --git a/scripts/game/2010L/CSMPFunctions.lua b/scripts/game/2010L/CSMPFunctions.lua index 0406101..afdb5d8 100644 --- a/scripts/game/2010L/CSMPFunctions.lua +++ b/scripts/game/2010L/CSMPFunctions.lua @@ -13,9 +13,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -562,10 +566,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(NetworkServer:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (NetworkServer:findFirstChild(name) == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then Child.Name = name @@ -683,7 +696,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function ConnectionFailed(Peer, Code, why) - SetMessage("Failed to connect to the Game. (ID="..Code.." ["..why.."])") + SetMessage("Failed to connect to the Game. (ID="..Code..")") end pcall(function() settings().Diagnostics:LegacyScriptMode() end) @@ -727,8 +740,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):Run() + local plr = game.Players:CreateLocalPlayer(UserID) plr.Name = PlayerName plr:LoadCharacter() plr.CharacterAppearance=0 diff --git a/scripts/game/2011E/CSMPFunctions.lua b/scripts/game/2011E/CSMPFunctions.lua index 97c77f0..1ed1ef3 100644 --- a/scripts/game/2011E/CSMPFunctions.lua +++ b/scripts/game/2011E/CSMPFunctions.lua @@ -30,9 +30,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -578,11 +582,20 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(NetworkServer:children()) do if (Child:GetPlayer() == Player) then - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (NetworkServer:findFirstChild(name) == nil) then Child.Name = name end @@ -698,7 +711,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function ConnectionFailed(Peer, Code, why) - SetMessage("Failed to connect to the Game. (ID="..Code.." ["..why.."])") + SetMessage("Failed to connect to the Game. (ID="..Code..")") end pcall(function() settings().Diagnostics:LegacyScriptMode() end) @@ -751,8 +764,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):Run() + local plr = game.Players:CreateLocalPlayer(UserID) plr.Name = PlayerName plr:LoadCharacter() if (IconType == "BC") then @@ -766,7 +779,6 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, end plr.CharacterAppearance=0 InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) - wait(0.5) LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") newWaitForChild(game.StarterGui, "Dialogs") diff --git a/scripts/game/2011M/CSMPFunctions.lua b/scripts/game/2011M/CSMPFunctions.lua index beb757f..d19643f 100644 --- a/scripts/game/2011M/CSMPFunctions.lua +++ b/scripts/game/2011M/CSMPFunctions.lua @@ -21,9 +21,13 @@ function newWaitForChild(newParent,name) end function KickPlayer(Player,reason) + if (game.Lighting:FindFirstChild("SkipSecurity") ~= nil) then + do return end + end + if (Player ~= nil) then for _,Child in pairs(Server:children()) do - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (Server:findFirstChild(name) ~= nil) then Child:CloseConnection() end @@ -569,11 +573,20 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.MaxPlayers = PlayerLimit end + + local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) + -- create anonymous player identifier. This is so we can track clients without tripcodes + playerCount = playerCount + 1 + + local code = Instance.new("StringValue", Player) + code.Value = playerCount + code.Name = "AnonymousIdentifier" + -- rename all Server replicators in NetworkServer to "ServerReplicator" for _,Child in pairs(NetworkServer:children()) do if (Child:GetPlayer() == Player) then - name = "ServerReplicator"..Player.userId + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value if (NetworkServer:findFirstChild(name) == nil) then Child.Name = name end @@ -689,7 +702,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end local function ConnectionFailed(Peer, Code, why) - SetMessage("Failed to connect to the Game. (ID="..Code.." ["..why.."])") + SetMessage("Failed to connect to the Game. (ID="..Code..")") end pcall(function() settings().Diagnostics:LegacyScriptMode() end) @@ -743,8 +756,8 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) - local plr = game.Players:CreateLocalPlayer(UserID) game:GetService("RunService"):Run() + local plr = game.Players:CreateLocalPlayer(UserID) plr.Name = PlayerName plr:LoadCharacter() if (IconType == "BC") then @@ -759,7 +772,6 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, game.GuiRoot.ScoreHud:Remove() plr.CharacterAppearance=0 InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) - wait(0.5) LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") newWaitForChild(game.StarterGui, "Dialogs") diff --git a/scripts/launcher/3DView/CSView.lua b/scripts/launcher/3DView/CSView.lua index 304e6d6..2bb7729 100644 --- a/scripts/launcher/3DView/CSView.lua +++ b/scripts/launcher/3DView/CSView.lua @@ -404,6 +404,8 @@ end print("3DView loaded. Nerd.") function CS3DView(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) + game:GetService("RunService"):Run() + game.CoreGui.RobloxGui:Remove() game.GuiRoot.RightPalette:Remove() game.GuiRoot.ChatMenuPanel:Remove() @@ -412,7 +414,6 @@ function CS3DView(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorI game:SetMessage("Loading Player...") local plr = game.Players:CreateLocalPlayer(UserID) - game:GetService("RunService"):Run() plr.Name = PlayerName plr:LoadCharacter() if (IconType == "BC") then