misc. fixes before snapshot release

This commit is contained in:
Bitl 2022-07-17 14:38:12 -07:00
parent c1c48bf2e6
commit 667bba2b9a
9 changed files with 175 additions and 131 deletions

View File

@ -3,13 +3,17 @@
local this = {} local this = {}
function this:Name() function this:Name()
return "Client Name Printer" return "Client Name and Script Printer"
end end
function this:PreInit(Script, Client) function this:PreInit(Script, Client)
local ver = Instance.new("StringValue",game.Lighting) local ver = Instance.new("StringValue",game.Lighting)
ver.Name = "Version" ver.Name = "Version"
ver.Value = Client ver.Value = Client
local scr = Instance.new("StringValue",game.Lighting)
scr.Name = "ScriptLoaded"
scr.Value = Script
end end
function AddModule(t) function AddModule(t)

View File

@ -20,6 +20,7 @@ end
-- executes every 0.1 seconds. (server, solo, studio) -- executes every 0.1 seconds. (server, solo, studio)
-- arguments: none -- arguments: none
function this:Update() function this:Update()
-- we already wait 0.1 seconds
if (ScriptName == "Server") then if (ScriptName == "Server") then
game.Lighting.ServerTicks.Value = game.Lighting.ServerTicks.Value + 1 game.Lighting.ServerTicks.Value = game.Lighting.ServerTicks.Value + 1
end end

View File

@ -1,4 +1,4 @@
-- allows 2007M, 2006S, and 2007E users to join Shaders servers, and vice versa -- allows 2007M, 2006S, 2007E, and 2009E users to join Shaders/HD servers, and vice versa
local this = {} local this = {}
local ClientName = "N/A" local ClientName = "N/A"
@ -15,7 +15,7 @@ end
function IsShaderSupportingClient() function IsShaderSupportingClient()
-- hate this so much -- hate this so much
if (ClientName == "2007E" or ClientName == "2007M" or ClientName == "2006S" or ClientName == "2007E-Shaders" or ClientName == "2007M-Shaders" or ClientName == "2006S-Shaders") then if (ClientName == "2007E" or ClientName == "2007M" or ClientName == "2006S" or ClientName == "2007E-Shaders" or ClientName == "2007M-Shaders" or ClientName == "2006S-Shaders" or ClientName == "2009E" or ClientName == "2009E-HD") then
return true return true
end end
end end
@ -28,22 +28,63 @@ function this:OnPrePlayerKicked(Player, Reason)
end end
if (IsShaderSupportingClient()) then if (IsShaderSupportingClient()) then
validLauncher = false invalidSecurityVals = 0
for _,newVal in pairs(Player.Security:children()) do for _,newVal in pairs(Player.Security:children()) do
if (newVal.Name == "ClientEXEMD5") then
if (newVal.Value ~= game.Lighting.Security.ClientEXEMD5.Value or newVal.Value == "") then
invalidSecurityVals = invalidSecurityVals + 1
end
end
if (newVal.Name == "LauncherMD5") then if (newVal.Name == "LauncherMD5") then
if (newVal.Value == game.Lighting.Security.LauncherMD5.Value or newVal.Value == "") then if (newVal.Value ~= game.Lighting.Security.LauncherMD5.Value or newVal.Value == "") then
validLauncher = true invalidSecurityVals = invalidSecurityVals + 1
end
end
if (newVal.Name == "ClientScriptMD5") then
if (newVal.Value ~= game.Lighting.Security.ClientScriptMD5.Value or newVal.Value == "") then
invalidSecurityVals = invalidSecurityVals + 1
end end
end end
end end
if (validLauncher == true) then if (invalidSecurityVals < 3) then
print(Player.Name .. " is using a valid modified client!") print(Player.Name .. " has "..invalidSecurityVals.." invalid security values! Verifying...")
local ver = Instance.new("StringValue",game.Lighting) validLauncher = false
ver.Name = "SkipSecurity" hasTripcode = false
local tempTag = Instance.new("StringValue",ver) securityValues = 0
tempTag.Name = "Temp"
for _,newVal in pairs(Player.Security:children()) do
if (newVal.Name == "LauncherMD5") then
if (newVal.Value == game.Lighting.Security.LauncherMD5.Value) then
validLauncher = true
end
end
securityValues = securityValues + 1
end
for _,newVal in pairs(Player:children()) do
if (newVal.Name == "Tripcode") then
if (newVal.Value ~= "") then
hasTripcode = true
end
end
end
if (validLauncher == true and hasTripcode == true and securityValues == 3) then
print(Player.Name .. " is using a valid modified client!")
local ver = Instance.new("StringValue",game.Lighting)
ver.Name = "SkipSecurity"
local tempTag = Instance.new("StringValue",ver)
tempTag.Name = "Temp"
else
print(Player.Name .. " is using an invalid modified client! Kicking...")
end
else
print(Player.Name .. " is using an invalid modified client! Kicking...")
end end
end end
end end

View File

@ -1,9 +1,18 @@
1.3 Snapshot v22.8222.20490.3 1.3 Snapshot v22.8222.20490.3
Enhancements: Enhancements:
- Added support for multiple addon scripts! - Added support for multiple addon scripts!
- Thanks to BRAVONATCHO for the idea! - Thanks to BRAVONATCHO for the idea on how to implement this!
- Added OnPrePlayerKicked to the scripting API. - Added 2 functions to the scripting API.
- OnPrePlayerKicked
- Update
- 2008M no longer uses OpenGL Legacy as the default graphics mode.
- You can now join normal 2007 servers with Shaders clients (and vice versa)! - You can now join normal 2007 servers with Shaders clients (and vice versa)!
- Added the ability to view client name, and script type in game.Lighting.
- Added the ability to view server time in game.Lighting.
Fixes:
- Fixed 2010L server joining not working.
- Fixed 2007E based clients not loading all customized parts properly.
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
1.3 Snapshot v22.8222.20490.2 1.3 Snapshot v22.8222.20490.2
Enhancements: Enhancements:

View File

@ -59,6 +59,8 @@ function LoadCharacterNew(playerApp,newChar)
do return end do return end
end end
wait(0.65)
PlayerService = game:service("Players") PlayerService = game:service("Players")
Player = PlayerService:playerFromCharacter(newChar) Player = PlayerService:playerFromCharacter(newChar)

View File

@ -58,6 +58,8 @@ function LoadCharacterNew(playerApp,newChar)
if (game.Lighting:findFirstChild("DisableCustomization") ~= nil) then if (game.Lighting:findFirstChild("DisableCustomization") ~= nil) then
do return end do return end
end end
wait(0.65)
PlayerService = game:service("Players") PlayerService = game:service("Players")
Player = PlayerService:playerFromCharacter(newChar) Player = PlayerService:playerFromCharacter(newChar)

View File

@ -59,6 +59,8 @@ function LoadCharacterNew(playerApp,newChar)
do return end do return end
end end
wait(0.65)
PlayerService = game:service("Players") PlayerService = game:service("Players")
Player = PlayerService:playerFromCharacter(newChar) Player = PlayerService:playerFromCharacter(newChar)

View File

@ -59,6 +59,8 @@ function LoadCharacterNew(playerApp,newChar)
do return end do return end
end end
wait(0.65)
PlayerService = game:service("Players") PlayerService = game:service("Players")
Player = PlayerService:playerFromCharacter(newChar) Player = PlayerService:playerFromCharacter(newChar)

View File

@ -65,8 +65,6 @@ function LoadCharacterNew(playerApp,newChar)
PlayerService = game:GetService("Players") PlayerService = game:GetService("Players")
Player = PlayerService:GetPlayerFromCharacter(newChar) Player = PlayerService:GetPlayerFromCharacter(newChar)
wait(0.65)
local function kick() local function kick()
KickPlayer(Player, "Modified Client") KickPlayer(Player, "Modified Client")
end end
@ -562,14 +560,14 @@ print("ROBLOX Client version '" .. rbxversion .. "' loaded.")
function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications)
pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end)
pcall(function() _G.CSScript_PreInit("Server", "2010L") end) pcall(function() _G.CSScript_PreInit("Server", "2010L") end)
assert((type(Port)~="number" or tonumber(Port)~=nil or Port==nil),"CSRun Error: Port must be nil or a number.") Server = game:GetService("NetworkServer")
local NetworkServer=game:GetService("NetworkServer") RunService = game:GetService("RunService")
local RunService = game:GetService("RunService") Server:start(Port, 20)
local PlayerService = game:GetService("Players") RunService:run()
game:GetService("Visit"):SetUploadUrl("") game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm")
showServerNotifications = Notifications showServerNotifications = Notifications
pcall(NetworkServer.Stop,NetworkServer) PlayerService = game:GetService("Players")
NetworkServer:Start(Port) game:GetService("Visit"):SetUploadUrl("")
if (showServerNotifications) then if (showServerNotifications) then
PlayerService.MaxPlayers = PlayerLimit + 1 PlayerService.MaxPlayers = PlayerLimit + 1
--create a fake player to record connections and disconnections --create a fake player to record connections and disconnections
@ -589,15 +587,19 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti
code.Name = "AnonymousIdentifier" code.Name = "AnonymousIdentifier"
-- rename all Server replicators in NetworkServer to "ServerReplicator" -- rename all Server replicators in NetworkServer to "ServerReplicator"
for _,Child in pairs(NetworkServer:children()) do for _,Child in pairs(Server:children()) do
name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value
if (NetworkServer:findFirstChild(name) == nil) then if (Server:findFirstChild(name) == nil) then
if (string.match(Child.Name, "ServerReplicator") == nil) then if (string.match(Child.Name, "ServerReplicator") == nil) then
Child.Name = name Child.Name = name
end end
end end
end end
Player.Chatted:connect(function(msg)
print(Player.Name.."; "..msg)
end)
if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then
KickPlayer(Player, "Too many players on server.") KickPlayer(Player, "Too many players on server.")
else else
@ -606,33 +608,33 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti
game.Players:Chat("Player '" .. Player.Name .. "' joined") game.Players:Chat("Player '" .. Player.Name .. "' joined")
end end
Player:LoadCharacter() Player:LoadCharacter()
end
Player.CharacterAdded:connect(function(pchar)
LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting)
newWaitForChildSecurity(Player,"Tripcode") newWaitForChildSecurity(Player,"Tripcode")
LoadTripcode(Player) LoadTripcode(Player)
pcall(function() print("Player '" .. Player.Name .. "-" .. Player.userId .. "' security check success. Tripcode: '" .. Player.Tripcode.Value .. "'") end) pcall(function() print("Player '" .. Player.Name .. "-" .. Player.userId .. "' security check success. Tripcode: '" .. Player.Tripcode.Value .. "'") end)
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),pchar) if (Player.Character ~= nil) then
end) LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
end
end
Player.Changed:connect(function(Property) pcall(function() _G.CSScript_OnPlayerAdded(Player) end)
while true do
wait(0.001)
if (game.Lighting:findFirstChild("DisableRespawns") == nil) then if (game.Lighting:findFirstChild("DisableRespawns") == nil) then
if (Property=="Character") and (Player.Character~=nil) then if (Player.Character ~= nil) then
local Character=Player.Character if (Player.Character:FindFirstChild("Humanoid") and (Player.Character.Humanoid.Health == 0)) then
local Humanoid=Character:FindFirstChild("Humanoid") wait(5)
if (Humanoid~=nil) then Player:LoadCharacter()
Humanoid.Died:connect(function() delay(5,function() Player:LoadCharacter() LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character) end) end) LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
elseif (Player.Character.Parent == nil) then
wait(5)
Player:LoadCharacter() -- to make sure nobody is deleted.
LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),Player.Character)
end end
end end
end end
end) end
Player.Chatted:connect(function(msg)
print(Player.Name.."; "..msg)
end)
pcall(function() _G.CSScript_OnPlayerAdded(Player) end)
end) end)
PlayerService.PlayerRemoving:connect(function(Player) PlayerService.PlayerRemoving:connect(function(Player)
print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving")
@ -642,11 +644,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti
pcall(function() _G.CSScript_OnPlayerRemoved(Player) end) pcall(function() _G.CSScript_OnPlayerRemoved(Player) end)
end) end)
RunService:Run()
game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm")
InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5)
NetworkServer.IncommingConnection:connect(IncommingConnection) Server.IncommingConnection:connect(IncommingConnection)
pcall(function() game.Close:connect(function() NetworkServer:Stop() end) end) pcall(function() game.Close:connect(function() Server:Stop() end) end)
pcall(function() _G.CSScript_PostInit() end) pcall(function() _G.CSScript_PostInit() end)
coroutine.resume(coroutine.create(function() coroutine.resume(coroutine.create(function()
while true do while true do
@ -669,96 +669,77 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He
pcall(function() game.CoreGui.RobloxGui.BigPlayerlist:Remove() end) pcall(function() game.CoreGui.RobloxGui.BigPlayerlist:Remove() end)
end) end)
end) end)
game:GetService("RunService"):Run()
assert((ServerIP~=nil and ServerPort~=nil),"CSConnect Error: ServerIP and ServerPort must be defined.")
local function SetMessage(Message) game:SetMessage(Message) end
local Visit,NetworkClient,PlayerSuccess,Player,ConnectionFailedHook=game:GetService("Visit"),game:GetService("NetworkClient")
local function GetClassCount(Class,Parent) local suc, err = pcall(function()
local Objects=Parent:GetChildren() client = game:GetService("NetworkClient")
local Number=0 player = game:GetService("Players"):CreateLocalPlayer(UserID)
for Index,Object in pairs(Objects) do player:SetSuperSafeChat(false)
if (Object.className==Class) then pcall(function() player:SetUnder13(false) end)
Number=Number+1 pcall(function() player:SetMembershipType(Enum.MembershipType.BuildersClub) end)
end pcall(function() player:SetAccountAge(365) end)
Number=Number+GetClassCount(Class,Object) player.CharacterAppearance=0
end pcall(function() player.Name=PlayerName or "" end)
return Number game:GetService("Visit"):SetUploadUrl("")
end InitalizeClientAppearance(player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID)
InitalizeSecurityValues(player,ClientEXEMD5,LauncherMD5,ClientScriptMD5)
local function RequestCharacter(Replicator) InitalizeTripcode(player,Tripcode)
local Connection
Connection=Player.Changed:connect(function(Property)
if (Property=="Character") then
game:ClearMessage()
end
end)
SetMessage("Requesting character...")
Replicator:RequestCharacter()
SetMessage("Waiting for character...")
end
local function Disconnection(Peer,LostConnection)
SetMessage("You have lost connection to the game")
end
local function ConnectionAccepted(Peer,Replicator)
Replicator.Disconnection:connect(Disconnection)
local RequestingMarker=true
game:SetMessageBrickCount()
local Marker=Replicator:SendMarker()
Marker.Received:connect(function()
RequestingMarker=false
RequestCharacter(Replicator)
end)
while RequestingMarker do
Workspace:ZoomToExtents()
wait(0.5)
end
end
local function ConnectionFailed(Peer, Code, why)
SetMessage("Failed to connect to the Game. (ID="..Code..")")
end
pcall(function() settings().Diagnostics:LegacyScriptMode() end)
pcall(function() game:SetRemoteBuildMode(true) end)
SetMessage("Connecting to server...")
NetworkClient.ConnectionAccepted:connect(ConnectionAccepted)
ConnectionFailedHook=NetworkClient.ConnectionFailed:connect(ConnectionFailed)
NetworkClient.ConnectionRejected:connect(function()
pcall(function() ConnectionFailedHook:disconnect() end)
SetMessage("Failed to connect to the Game. (Connection rejected)")
end) end)
pcall(function() NetworkClient.Ticket=Ticket or "" end) -- 2008 client has no ticket :O local function dieerror(errmsg)
PlayerSuccess,Player=pcall(function() return NetworkClient:PlayerConnect(UserID,ServerIP,ServerPort) end) game:SetMessage(errmsg)
wait(math.huge)
if (not PlayerSuccess) then
SetMessage("Failed to connect to the Game. (Invalid IP Address)")
NetworkClient:Disconnect()
end end
if (not PlayerSuccess) then if not suc then
local Error,Message=pcall(function() dieerror(err)
Player=game:GetService("Players"):CreateLocalPlayer(UserID) end
NetworkClient:Connect(ServerIP,ServerPort)
local function disconnect(peer,lostconnection)
game:SetMessage("You have lost connection to the game")
end
local function connected(url, replicator)
replicator.Disconnection:connect(disconnect)
local marker = nil
local suc, err = pcall(function()
game:SetMessageBrickCount()
marker = replicator:SendMarker()
end) end)
if (not Error) then if not suc then
SetMessage("Failed to connect to the Game.") dieerror(err)
end end
marker.Received:connect(function()
local suc, err = pcall(function()
game:ClearMessage()
end)
if not suc then
dieerror(err)
end
end)
end
local function rejected()
dieerror("Failed to connect to the Game. (Connection rejected)")
end
local function failed(peer, errcode, why)
dieerror("Failed to connect to the Game. (ID="..errcode..")")
end
local suc, err = pcall(function()
game:SetMessage("Connecting to server...")
client.ConnectionAccepted:connect(connected)
client.ConnectionRejected:connect(rejected)
client.ConnectionFailed:connect(failed)
client:Connect(ServerIP,ServerPort, 0, 20)
end)
if not suc then
local x = Instance.new("Message")
x.Text = err
x.Parent = workspace
wait(math.huge)
end end
pcall(function() Player.Name=PlayerName or "" end)
InitalizeSecurityValues(Player,ClientEXEMD5,LauncherMD5,ClientScriptMD5)
InitalizeClientAppearance(Player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID)
InitalizeTripcode(Player,Tripcode)
pcall(function() Player:SetUnder13(false) end)
pcall(function() Player:SetMembershipType(Enum.MembershipType.BuildersClub) end)
pcall(function() Player:SetAccountAge(365) end)
Player:SetSuperSafeChat(false)
Player.CharacterAppearance=0
pcall(function() Visit:SetUploadUrl("") end)
end end
function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID) function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID)