updated game and join

This commit is contained in:
Thomas G 2022-07-11 03:39:18 +10:00
parent bede59e504
commit e9d35d245e
2 changed files with 6 additions and 42 deletions

View File

@ -9,42 +9,6 @@ ob_start();
?>
-- Start Game Script Arguments
-- test
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%.roblox%.com/asset/%?id=")
if matches > 0 then
replacedProperties = replacedProperties + 1
print("Replaced " .. property .. " asset link for " .. v.Name)
break
end
end
end
end)
end
end
------------------- UTILITY FUNCTIONS --------------------------
local cdnSuccess = 0

View File

@ -111,9 +111,9 @@ end
-- called when the client connection closes
function onDisconnection(peer, lostConnection)
if lostConnection then
showErrorWindow("You have lost connection", "LostConnection", "LostConnection")
showErrorWindow("You have lost connection (ID: 200)", "LostConnection", "LostConnection")
else
showErrorWindow("This game has been shutdown", "Kick", "Kick")
showErrorWindow("This game has been shut down (ID: 210)", "Kick", "Kick")
end
end
@ -187,13 +187,13 @@ end
-- called when the client connection fails
function onConnectionFailed(_, error)
showErrorWindow("Failed to connect to the Game. (ID=" .. error .. ")", "ID" .. error, "Other")
showErrorWindow("Failed to connect. (ID=" .. error .. ")", "ID" .. error, "Other")
end
-- called when the client connection is rejected
function onConnectionRejected()
connectionFailed:disconnect()
showErrorWindow("This game is not available. Please try another", "WrongVersion", "WrongVersion")
showErrorWindow("Your connection has been rejected. (ID: 300)", "WrongVersion", "WrongVersion")
end
pcall(function() settings().Diagnostics:LegacyScriptMode() end)
@ -201,7 +201,7 @@ local success, err = pcall(function()
game:SetRemoteBuildMode(true)
setMessage("Connecting to <?php echo $ip; ?>:<?php echo $port; ?>")
setMessage("Joining <?php echo $ip; ?>:<?php echo $port; ?>")
client.ConnectionAccepted:connect(onConnectionAccepted)
client.ConnectionRejected:connect(onConnectionRejected)
connectionFailed = client.ConnectionFailed:connect(onConnectionFailed)
@ -220,7 +220,7 @@ local success, err = pcall(function()
player.CharacterAppearance = "<?php echo $app; ?>"
if not test then visit:SetUploadUrl("")end
player.Name = "<?php echo $username; ?>"
player.Name = "<?php echo $username; ?>"
end)
pcall(function() game:SetScreenshotInfo("") end)