Some corescript formatting fixes

This commit is contained in:
Lewin Kelly 2024-04-15 19:45:47 +01:00
parent 2ee432487e
commit cd89a4bf7f
7 changed files with 35 additions and 43 deletions

View File

@ -17,7 +17,7 @@ local NetworkServer = game:GetService "NetworkServer"
RunService:Run() RunService:Run()
local url = _BASE_URL local url = _BASE_URL -- can't use the BaseUrl module because ContentProvider.BaseUrl isn't set yet
-----------------------------------"CUSTOM" SHARED CODE---------------------------------- -----------------------------------"CUSTOM" SHARED CODE----------------------------------
@ -45,28 +45,26 @@ ScriptContext.ScriptsDisabled = true
-- game:SetPlaceId(nil, false) -- game:SetPlaceId(nil, false)
ChangeHistoryService:SetEnabled(false) ChangeHistoryService:SetEnabled(false)
if url ~= nil then pcall(function()
pcall(function() Players:SetAbuseReportUrl(url .. "/Report/Games.ashx")
Players:SetAbuseReportUrl(`{url}/Report/Games.ashx`) end)
end) pcall(function()
pcall(function() ScriptInformationProvider:SetAssetUrl(url .. "/Asset/")
ScriptInformationProvider:SetAssetUrl(`{url}/Asset/`) end)
end) pcall(function()
pcall(function() ContentProvider:SetBaseUrl(url .. "/")
ContentProvider:SetBaseUrl(`{url}/`) end)
end)
BadgeService:SetIsBadgeLegalUrl "" BadgeService:SetIsBadgeLegalUrl ""
InsertService:SetBaseSetsUrl( InsertService:SetBaseSetsUrl(
url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base" url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base"
) )
InsertService:SetUserSetsUrl( InsertService:SetUserSetsUrl(
url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d" url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d"
) )
InsertService:SetCollectionUrl(url .. "/Game/Tools/InsertAsset.ashx?sid=%d") InsertService:SetCollectionUrl(url .. "/Game/Tools/InsertAsset.ashx?sid=%d")
InsertService:SetAssetUrl(url .. "/asset?id=%d") InsertService:SetAssetUrl(url .. "/asset?id=%d")
InsertService:SetAssetVersionUrl(url .. "/Asset/?assetversionid=%d") InsertService:SetAssetVersionUrl(url .. "/Asset/?assetversionid=%d")
end
pcall(function() pcall(function()
NetworkServer:SetIsPlayerAuthenticationRequired(true) NetworkServer:SetIsPlayerAuthenticationRequired(true)

View File

@ -18,10 +18,6 @@ pcall(function()
game:SetPlaceId(_PLACE_ID, false) game:SetPlaceId(_PLACE_ID, false)
end) end)
-- if we are on a touch device, no blocking http calls allowed! This can cause a crash on iOS
-- In general we need a long term strategy to remove blocking http calls from all platforms
-- local isTouchDevice = UserInputService.TouchEnabled
settings()["Game Options"].CollisionSoundEnabled = true settings()["Game Options"].CollisionSoundEnabled = true
pcall(function() pcall(function()
settings().Rendering.EnableFRM = true settings().Rendering.EnableFRM = true
@ -35,8 +31,6 @@ pcall(function()
Enum.EnviromentalPhysicsThrottle.DefaultAuto Enum.EnviromentalPhysicsThrottle.DefaultAuto
end) end)
-- arguments ---------------------------------------
-- (there aren't any)
local threadSleepTime = 15 local threadSleepTime = 15
-- local test = _IS_STUDIO_JOIN -- unused -- local test = _IS_STUDIO_JOIN -- unused
@ -121,7 +115,6 @@ local function requestCharacter(replicator)
if not ok then if not ok then
reportError(err) reportError(err)
return
end end
end end
@ -172,15 +165,16 @@ local function onConnectionRejected()
end end
local function onPlayerIdled(idleTime) local function onPlayerIdled(idleTime)
if idleTime > 20 * 60 then if idleTime < 20 * 60 then
setMessage( return
string.format(
"You were disconnected for being idle %d minutes",
idleTime / 60
)
)
Client:Disconnect()
end end
setMessage(
string.format(
"You were disconnected for being idle %d minutes",
idleTime / 60
)
)
Client:Disconnect()
end end
-- main ------------------------------------------------------------ -- main ------------------------------------------------------------
@ -229,6 +223,6 @@ pcall(function()
game:SetScreenshotInfo "" game:SetScreenshotInfo ""
end) end)
pcall(function() pcall(function()
game:SetVideoInfo '<?xml version="1.0"?><entry xmlns="http://w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[Mercury Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit http://banland.xyz]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>Mercury, video, free game, online virtual world</media:keywords></media:group></entry>' game:SetVideoInfo '<?xml version="1.0"?><entry xmlns="http://w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[Mercury Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit https://mercury2.com]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>Mercury, video, free game, online virtual world</media:keywords></media:group></entry>'
end) end)
-- use single quotes here because the video info string may have unescaped double quotes -- use single quotes here because the video info string may have unescaped double quotes

View File

@ -5,7 +5,7 @@ local ThumbnailGenerator =
game:GetService "ThumbnailGenerator" :: ThumbnailGenerator game:GetService "ThumbnailGenerator" :: ThumbnailGenerator
local RenderModule = require "../Modules/Render" local RenderModule = require "../Modules/Render"
local SetupAvatar = require "../Modules/Render/SetupAvatar" local SetupAvatar = require "../Modules/Render/SetupAvatar"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation local Render = RenderModule(_BASE_URL, "_PING_URL", _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
local New = require("../Modules/New").New local New = require("../Modules/New").New
local player = SetupAvatar( local player = SetupAvatar(

View File

@ -4,7 +4,7 @@
local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local RenderModule = require "../Modules/Render" local RenderModule = require "../Modules/Render"
local SetupAvatar = require "../Modules/Render/SetupAvatar" local SetupAvatar = require "../Modules/Render/SetupAvatar"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation local Render = RenderModule(_BASE_URL, "_PING_URL", _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
SetupAvatar( SetupAvatar(
_BASE_URL, _BASE_URL,

View File

@ -3,7 +3,7 @@
local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local RenderModule = require "../Modules/Render" local RenderModule = require "../Modules/Render"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation local Render = RenderModule(_BASE_URL, "_PING_URL", _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
local New = require("../Modules/New").New local New = require("../Modules/New").New
print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`) print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`)

View File

@ -3,7 +3,7 @@
local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local RenderModule = require "../Modules/Render" local RenderModule = require "../Modules/Render"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation local Render = RenderModule(_BASE_URL, "_PING_URL", _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`) print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`)

View File

@ -48,7 +48,7 @@ InsertService:SetUserSetsUrl(
) )
InsertService:SetCollectionUrl(path "game/tools/insertasset?sid=%d") InsertService:SetCollectionUrl(path "game/tools/insertasset?sid=%d")
InsertService:SetAssetUrl(path "asset?id=%d") InsertService:SetAssetUrl(path "asset?id=%d")
InsertService:SetAssetVersionUrl(path "Asset/?assetversionid=%d") InsertService:SetAssetVersionUrl(path "asset?assetversionid=%d")
pcall(function() pcall(function()
SocialService:SetFriendUrl( SocialService:SetFriendUrl(