updated game and join
This commit is contained in:
parent
bede59e504
commit
e9d35d245e
|
|
@ -9,42 +9,6 @@ ob_start();
|
||||||
?>
|
?>
|
||||||
-- Start Game Script Arguments
|
-- 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 --------------------------
|
------------------- UTILITY FUNCTIONS --------------------------
|
||||||
|
|
||||||
local cdnSuccess = 0
|
local cdnSuccess = 0
|
||||||
|
|
|
||||||
|
|
@ -111,9 +111,9 @@ end
|
||||||
-- called when the client connection closes
|
-- called when the client connection closes
|
||||||
function onDisconnection(peer, lostConnection)
|
function onDisconnection(peer, lostConnection)
|
||||||
if lostConnection then
|
if lostConnection then
|
||||||
showErrorWindow("You have lost connection", "LostConnection", "LostConnection")
|
showErrorWindow("You have lost connection (ID: 200)", "LostConnection", "LostConnection")
|
||||||
else
|
else
|
||||||
showErrorWindow("This game has been shutdown", "Kick", "Kick")
|
showErrorWindow("This game has been shut down (ID: 210)", "Kick", "Kick")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -187,13 +187,13 @@ end
|
||||||
|
|
||||||
-- called when the client connection fails
|
-- called when the client connection fails
|
||||||
function onConnectionFailed(_, error)
|
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
|
end
|
||||||
|
|
||||||
-- called when the client connection is rejected
|
-- called when the client connection is rejected
|
||||||
function onConnectionRejected()
|
function onConnectionRejected()
|
||||||
connectionFailed:disconnect()
|
connectionFailed:disconnect()
|
||||||
showErrorWindow("This game is not available. Please try another", "WrongVersion", "WrongVersion")
|
showErrorWindow("Your connection has been rejected. (ID: 300)", "WrongVersion", "WrongVersion")
|
||||||
end
|
end
|
||||||
|
|
||||||
pcall(function() settings().Diagnostics:LegacyScriptMode() end)
|
pcall(function() settings().Diagnostics:LegacyScriptMode() end)
|
||||||
|
|
@ -201,7 +201,7 @@ local success, err = pcall(function()
|
||||||
|
|
||||||
game:SetRemoteBuildMode(true)
|
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.ConnectionAccepted:connect(onConnectionAccepted)
|
||||||
client.ConnectionRejected:connect(onConnectionRejected)
|
client.ConnectionRejected:connect(onConnectionRejected)
|
||||||
connectionFailed = client.ConnectionFailed:connect(onConnectionFailed)
|
connectionFailed = client.ConnectionFailed:connect(onConnectionFailed)
|
||||||
|
|
@ -220,7 +220,7 @@ local success, err = pcall(function()
|
||||||
|
|
||||||
player.CharacterAppearance = "<?php echo $app; ?>"
|
player.CharacterAppearance = "<?php echo $app; ?>"
|
||||||
if not test then visit:SetUploadUrl("")end
|
if not test then visit:SetUploadUrl("")end
|
||||||
player.Name = "<?php echo $username; ?>"
|
player.Name = "<?php echo $username; ?>"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
pcall(function() game:SetScreenshotInfo("") end)
|
pcall(function() game:SetScreenshotInfo("") end)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue