Update gameserver.php

This commit is contained in:
Thomas G 2022-07-11 04:05:08 +10:00
parent 691ce8f01a
commit 830efeafd2
1 changed files with 36 additions and 0 deletions

View File

@ -166,6 +166,42 @@ end)
-- Now start the connection
game:Load("rbxasset://<?php echo $rbxl; ?>")
-- fix asset ids
local assetPropertyNames = {"Texture", "TextureId", "SoundId", "MeshId", "SkyboxUp", "SkyboxLf", "SkyboxBk", "SkyboxRt", "SkyboxFt", "SkyboxDn", "PantsTemplate", "ShirtTemplate", "Graphic", "Frame", "ImageLabel", "GuiMain", "Image", "LinkedSource", "AnimationId"}
local variations = {"http://www%.roblox%.com/asset/%?id=", "http://www%.roblox%.com/asset%?id=", "http://%.roblox%.com/asset/%?id=", "http://%.roblox%.com/asset%?id="}
function GetDescendants(o)
local allObjects = {}
function FindChildren(Object)
for _,v in pairs(Object:GetChildren()) do
table.insert(allObjects,v)
FindChildren(v)
end
end
FindChildren(o)
return allObjects
end
local replacedProperties = 0--Amount of properties changed
for i, v in pairs(GetDescendants(game)) do
for _, property in pairs(assetPropertyNames) do
pcall(function()
if v[property] and not v:FindFirstChild(property) then --Check for property, make sure we're not getting a child instead of a property
assetText = string.lower(v[property])
for _, variation in pairs(variations) do
v[property], matches = string.gsub(assetText, variation, "http://www%.morblox%.us/asset/%?id=")
if matches > 0 then
replacedProperties = replacedProperties + 1
print("Replaced " .. property .. " asset link for " .. v.Name)
break
end
end
end
end)
end
end
-- other stuff
ns:Start(<?php echo $port; ?>, sleeptime)
pcall(function() game.LocalSaveEnabled = true end)