Update gameserver.php

This commit is contained in:
Thomas G 2022-08-04 10:09:11 +10:00
parent 69efab264c
commit fcf98859b5
1 changed files with 41 additions and 24 deletions

View File

@ -183,8 +183,22 @@ function GetDescendants(o)
end end
local replacedProperties = 0--Amount of properties changed local replacedProperties = 0--Amount of properties changed
local replacedSourceCodes = 0
for i, v in pairs(GetDescendants(game)) do for i, v in pairs(GetDescendants(game)) do
if v.ClassName == 'Script' or v.ClassName == 'LocalScript' then
local SourceCode = v.Source
if SourceCode then
for _, variation in pairs(variations) do
local String, Number = string.gsub(SourceCode, variation, "http://www%.morblox%.us/asset/%?id=")
SourceCode = String
if Number > 0 then
replacedSourceCodes = replacedSourceCodes + Number
end
end
v.Source = SourceCode
end
end
for _, property in pairs(assetPropertyNames) do for _, property in pairs(assetPropertyNames) do
pcall(function() 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 if v[property] and not v:FindFirstChild(property) then --Check for property, make sure we're not getting a child instead of a property
@ -201,6 +215,9 @@ for i, v in pairs(GetDescendants(game)) do
end) end)
end end
end end
print("Updated " .. replacedProperties .. " AssetIds")
print("Changed " .. replacedSourceCodes .. " lines of code")
-- other stuff -- other stuff
ns:Start(<?php echo $port; ?>, sleeptime) ns:Start(<?php echo $port; ?>, sleeptime)
pcall(function() game.LocalSaveEnabled = true end) pcall(function() game.LocalSaveEnabled = true end)