From 61ddc385b45851e79b90e6e3800592820a6f3a95 Mon Sep 17 00:00:00 2001 From: Bitl Date: Sat, 30 Oct 2021 16:52:04 -0700 Subject: [PATCH] increased 2011 outfit loading speed. added proper kicking --- changelog.txt | 2 ++ scripts/game/2006S-Shaders/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2006S/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2007E-Shaders/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2007E/CSMPFunctions.lua | 29 ++++++++------- scripts/game/2007M-Shaders/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2007M/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2008M/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2009E-HD/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2009E/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2010L/CSMPFunctions.lua | 28 ++++++++------- scripts/game/2011E/CSMPFunctions.lua | 38 +++++++++++--------- scripts/game/2011M/CSMPFunctions.lua | 38 +++++++++++--------- scripts/launcher/3DView/CSView.lua | 5 ++- 14 files changed, 197 insertions(+), 167 deletions(-) diff --git a/changelog.txt b/changelog.txt index 1884712..ca0e369 100644 --- a/changelog.txt +++ b/changelog.txt @@ -48,6 +48,8 @@ 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. +- Increased the speed of loading outfits in 2011 clients. 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 726993d..73c25ef 100644 --- a/scripts/game/2006S-Shaders/CSMPFunctions.lua +++ b/scripts/game/2006S-Shaders/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -237,6 +234,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.maxPlayers = PlayerLimit end PlayerService.ChildAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -258,11 +265,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:children()) do - Child.Name = "ServerReplicator" - end - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) diff --git a/scripts/game/2006S/CSMPFunctions.lua b/scripts/game/2006S/CSMPFunctions.lua index 726993d..73c25ef 100644 --- a/scripts/game/2006S/CSMPFunctions.lua +++ b/scripts/game/2006S/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -237,6 +234,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.maxPlayers = PlayerLimit end PlayerService.ChildAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -258,11 +265,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:children()) do - Child.Name = "ServerReplicator" - end - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) diff --git a/scripts/game/2007E-Shaders/CSMPFunctions.lua b/scripts/game/2007E-Shaders/CSMPFunctions.lua index 4ae65e9..5a6dd89 100644 --- a/scripts/game/2007E-Shaders/CSMPFunctions.lua +++ b/scripts/game/2007E-Shaders/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -261,6 +258,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.maxPlayers = PlayerLimit end PlayerService.ChildAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -282,11 +289,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:children()) do - Child.Name = "ServerReplicator" - end - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) diff --git a/scripts/game/2007E/CSMPFunctions.lua b/scripts/game/2007E/CSMPFunctions.lua index 4ae65e9..1f8819b 100644 --- a/scripts/game/2007E/CSMPFunctions.lua +++ b/scripts/game/2007E/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -260,7 +257,18 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti else PlayerService.maxPlayers = PlayerLimit end + PlayerService.ChildAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -282,11 +290,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:children()) do - Child.Name = "ServerReplicator" - end - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) diff --git a/scripts/game/2007M-Shaders/CSMPFunctions.lua b/scripts/game/2007M-Shaders/CSMPFunctions.lua index 2b3dd18..55c6441 100644 --- a/scripts/game/2007M-Shaders/CSMPFunctions.lua +++ b/scripts/game/2007M-Shaders/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -352,6 +349,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -373,11 +380,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:GetChildren()) do - Child.Name = "ServerReplicator" - end - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) diff --git a/scripts/game/2007M/CSMPFunctions.lua b/scripts/game/2007M/CSMPFunctions.lua index 345af76..75bf9ea 100644 --- a/scripts/game/2007M/CSMPFunctions.lua +++ b/scripts/game/2007M/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -352,6 +349,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -373,11 +380,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:GetChildren()) do - Child.Name = "ServerReplicator" - end - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) diff --git a/scripts/game/2008M/CSMPFunctions.lua b/scripts/game/2008M/CSMPFunctions.lua index 973ae2a..33f3ff4 100644 --- a/scripts/game/2008M/CSMPFunctions.lua +++ b/scripts/game/2008M/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -482,6 +479,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -503,11 +510,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:GetChildren()) do - Child.Name = "ServerReplicator" - end - while true do wait(0.001) if (Player.Character ~= nil) then diff --git a/scripts/game/2009E-HD/CSMPFunctions.lua b/scripts/game/2009E-HD/CSMPFunctions.lua index a5b10fa..62ecbde 100644 --- a/scripts/game/2009E-HD/CSMPFunctions.lua +++ b/scripts/game/2009E-HD/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -563,6 +560,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -584,11 +591,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:GetChildren()) do - Child.Name = "ServerReplicator" - end - while true do wait(0.001) if (Player.Character ~= nil) then diff --git a/scripts/game/2009E/CSMPFunctions.lua b/scripts/game/2009E/CSMPFunctions.lua index a5b10fa..62ecbde 100644 --- a/scripts/game/2009E/CSMPFunctions.lua +++ b/scripts/game/2009E/CSMPFunctions.lua @@ -13,14 +13,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -563,6 +560,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) end) @@ -584,11 +591,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti end end - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(Server:GetChildren()) do - Child.Name = "ServerReplicator" - end - while true do wait(0.001) if (Player.Character ~= nil) then diff --git a/scripts/game/2010L/CSMPFunctions.lua b/scripts/game/2010L/CSMPFunctions.lua index 18e4a3b..0406101 100644 --- a/scripts/game/2010L/CSMPFunctions.lua +++ b/scripts/game/2010L/CSMPFunctions.lua @@ -14,14 +14,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -566,6 +563,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(NetworkServer:children()) do + name = "ServerReplicator"..Player.userId + if (NetworkServer:findFirstChild(name) == nil) then + if (string.match(Child.Name, "ServerReplicator") == nil) then + Child.Name = name + end + end + end + if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else @@ -584,11 +591,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (char ~= nil) then LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),char) end - - -- rename all Server replicators in NetworkServer to "ServerReplicator" - for _,Child in pairs(NetworkServer:GetChildren()) do - Child.Name = "ServerReplicator" - end end) Player.Changed:connect(function(Property) diff --git a/scripts/game/2011E/CSMPFunctions.lua b/scripts/game/2011E/CSMPFunctions.lua index de5688c..97c77f0 100644 --- a/scripts/game/2011E/CSMPFunctions.lua +++ b/scripts/game/2011E/CSMPFunctions.lua @@ -31,14 +31,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -69,8 +66,6 @@ function LoadCharacterNew(playerApp,newChar) PlayerService = game:GetService("Players") Player = PlayerService:GetPlayerFromCharacter(newChar) - wait(0.65) - local function kick() KickPlayer(Player, "Modified Client") end @@ -584,6 +579,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(NetworkServer:children()) do + if (Child:GetPlayer() == Player) then + name = "ServerReplicator"..Player.userId + if (NetworkServer:findFirstChild(name) == nil) then + Child.Name = name + end + end + end + if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else @@ -591,18 +596,17 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' joined") end + Player:LoadCharacter() - end - - Player.CharacterAdded:connect(function(char) + LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") LoadTripcode(Player) pcall(function() print("Player '" .. Player.Name .. "-" .. Player.userId .. "' security check success. Tripcode: '" .. Player.Tripcode.Value .. "'") end) - if (char ~= nil) then - LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),char) + if (Player.Character ~= nil) then + LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character) end - end) + end Player.Changed:connect(function(Property) if (Property=="Character") and (Player.Character~=nil) then @@ -742,7 +746,6 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He pcall(function() Visit:SetUploadUrl("") end) InitalizeClientAppearance(Player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) - wait(0.65) InitalizeSecurityValues(Player,ClientEXEMD5,LauncherMD5,ClientScriptMD5) InitalizeTripcode(Player,Tripcode) end @@ -763,6 +766,7 @@ 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 47090d0..beb757f 100644 --- a/scripts/game/2011M/CSMPFunctions.lua +++ b/scripts/game/2011M/CSMPFunctions.lua @@ -22,14 +22,11 @@ end function KickPlayer(Player,reason) if (Player ~= nil) then - local message = Instance.new("Message") - message.Text = "You were kicked. Reason: "..reason - message.Parent = Player - wait(2) - Player:remove() - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) - if (showServerNotifications) then - game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + for _,Child in pairs(Server:children()) do + name = "ServerReplicator"..Player.userId + if (Server:findFirstChild(name) ~= nil) then + Child:CloseConnection() + end end end end @@ -60,8 +57,6 @@ function LoadCharacterNew(playerApp,newChar) PlayerService = game:GetService("Players") Player = PlayerService:GetPlayerFromCharacter(newChar) - wait(0.65) - local function kick() KickPlayer(Player, "Modified Client") end @@ -575,6 +570,16 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti PlayerService.MaxPlayers = PlayerLimit end PlayerService.PlayerAdded:connect(function(Player) + -- rename all Server replicators in NetworkServer to "ServerReplicator" + for _,Child in pairs(NetworkServer:children()) do + if (Child:GetPlayer() == Player) then + name = "ServerReplicator"..Player.userId + if (NetworkServer:findFirstChild(name) == nil) then + Child.Name = name + end + end + end + if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else @@ -582,18 +587,17 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' joined") end + Player:LoadCharacter() - end - - Player.CharacterAdded:connect(function(char) + LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") LoadTripcode(Player) pcall(function() print("Player '" .. Player.Name .. "-" .. Player.userId .. "' security check success. Tripcode: '" .. Player.Tripcode.Value .. "'") end) - if (char ~= nil) then - LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),char) + if (Player.Character ~= nil) then + LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"), Player.Character) end - end) + end Player.Changed:connect(function(Property) if (Property=="Character") and (Player.Character~=nil) then @@ -734,7 +738,6 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He pcall(function() Visit:SetUploadUrl("") end) InitalizeClientAppearance(Player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) - wait(0.65) InitalizeSecurityValues(Player,ClientEXEMD5,LauncherMD5,ClientScriptMD5) InitalizeTripcode(Player,Tripcode) end @@ -756,6 +759,7 @@ 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 f308dc4..304e6d6 100644 --- a/scripts/launcher/3DView/CSView.lua +++ b/scripts/launcher/3DView/CSView.lua @@ -13,8 +13,6 @@ function newWaitForChild(newParent,name) end function LoadCharacterNew(playerApp,newChar) - wait(0.65) - local path = "rbxasset://../../../shareddata/charcustom/" local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")} @@ -428,9 +426,9 @@ function CS3DView(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorI 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") - game:GetService("Visit"):SetUploadUrl("") newWaitForChild(game.StarterGui, "Playerlist") game.StarterGui.Playerlist:clone().Parent = plr.PlayerGui @@ -459,6 +457,7 @@ function CS3DView(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorI human.WalkSpeed = 0 human.Jumping:connect(fixJump) + game:GetService("Visit"):SetUploadUrl("") game:ClearMessage() end