From cd89a4bf7fd4e59772bb84940f7454217a2653b3 Mon Sep 17 00:00:00 2001 From: Lewin Kelly Date: Mon, 15 Apr 2024 19:45:47 +0100 Subject: [PATCH] Some corescript formatting fixes --- luau/host.luau | 42 +++++++++++++++++++--------------------- luau/join.luau | 26 ++++++++++--------------- luau/renderAvatar.luau | 2 +- luau/renderClothing.luau | 2 +- luau/renderMesh.luau | 2 +- luau/renderModel.luau | 2 +- luau/visit.luau | 2 +- 7 files changed, 35 insertions(+), 43 deletions(-) diff --git a/luau/host.luau b/luau/host.luau index 1a7de26..f2c74f1 100644 --- a/luau/host.luau +++ b/luau/host.luau @@ -17,7 +17,7 @@ local NetworkServer = game:GetService "NetworkServer" 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---------------------------------- @@ -45,28 +45,26 @@ ScriptContext.ScriptsDisabled = true -- game:SetPlaceId(nil, false) ChangeHistoryService:SetEnabled(false) -if url ~= nil then - pcall(function() - Players:SetAbuseReportUrl(`{url}/Report/Games.ashx`) - end) - pcall(function() - ScriptInformationProvider:SetAssetUrl(`{url}/Asset/`) - end) - pcall(function() - ContentProvider:SetBaseUrl(`{url}/`) - end) +pcall(function() + Players:SetAbuseReportUrl(url .. "/Report/Games.ashx") +end) +pcall(function() + ScriptInformationProvider:SetAssetUrl(url .. "/Asset/") +end) +pcall(function() + ContentProvider:SetBaseUrl(url .. "/") +end) - BadgeService:SetIsBadgeLegalUrl "" - InsertService:SetBaseSetsUrl( - url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base" - ) - InsertService:SetUserSetsUrl( - url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d" - ) - InsertService:SetCollectionUrl(url .. "/Game/Tools/InsertAsset.ashx?sid=%d") - InsertService:SetAssetUrl(url .. "/asset?id=%d") - InsertService:SetAssetVersionUrl(url .. "/Asset/?assetversionid=%d") -end +BadgeService:SetIsBadgeLegalUrl "" +InsertService:SetBaseSetsUrl( + url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base" +) +InsertService:SetUserSetsUrl( + url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d" +) +InsertService:SetCollectionUrl(url .. "/Game/Tools/InsertAsset.ashx?sid=%d") +InsertService:SetAssetUrl(url .. "/asset?id=%d") +InsertService:SetAssetVersionUrl(url .. "/Asset/?assetversionid=%d") pcall(function() NetworkServer:SetIsPlayerAuthenticationRequired(true) diff --git a/luau/join.luau b/luau/join.luau index 537e01e..04191fe 100644 --- a/luau/join.luau +++ b/luau/join.luau @@ -18,10 +18,6 @@ pcall(function() game:SetPlaceId(_PLACE_ID, false) 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 pcall(function() settings().Rendering.EnableFRM = true @@ -35,8 +31,6 @@ pcall(function() Enum.EnviromentalPhysicsThrottle.DefaultAuto end) --- arguments --------------------------------------- --- (there aren't any) local threadSleepTime = 15 -- local test = _IS_STUDIO_JOIN -- unused @@ -121,7 +115,6 @@ local function requestCharacter(replicator) if not ok then reportError(err) - return end end @@ -172,15 +165,16 @@ local function onConnectionRejected() end local function onPlayerIdled(idleTime) - if idleTime > 20 * 60 then - setMessage( - string.format( - "You were disconnected for being idle %d minutes", - idleTime / 60 - ) - ) - Client:Disconnect() + if idleTime < 20 * 60 then + return end + setMessage( + string.format( + "You were disconnected for being idle %d minutes", + idleTime / 60 + ) + ) + Client:Disconnect() end -- main ------------------------------------------------------------ @@ -229,6 +223,6 @@ pcall(function() game:SetScreenshotInfo "" end) pcall(function() - game:SetVideoInfo 'GamesMercury, video, free game, online virtual world' + game:SetVideoInfo 'GamesMercury, video, free game, online virtual world' end) -- use single quotes here because the video info string may have unescaped double quotes diff --git a/luau/renderAvatar.luau b/luau/renderAvatar.luau index cf7cfb7..f31e4aa 100644 --- a/luau/renderAvatar.luau +++ b/luau/renderAvatar.luau @@ -5,7 +5,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator" :: ThumbnailGenerator local RenderModule = require "../Modules/Render" 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 player = SetupAvatar( diff --git a/luau/renderClothing.luau b/luau/renderClothing.luau index bad85b7..7c9ba35 100644 --- a/luau/renderClothing.luau +++ b/luau/renderClothing.luau @@ -4,7 +4,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local RenderModule = require "../Modules/Render" 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( _BASE_URL, diff --git a/luau/renderMesh.luau b/luau/renderMesh.luau index d278048..f1b8fb8 100644 --- a/luau/renderMesh.luau +++ b/luau/renderMesh.luau @@ -3,7 +3,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator" 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 print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`) diff --git a/luau/renderModel.luau b/luau/renderModel.luau index c87e3a9..95b4577 100644 --- a/luau/renderModel.luau +++ b/luau/renderModel.luau @@ -3,7 +3,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator" 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}`) diff --git a/luau/visit.luau b/luau/visit.luau index 187b12b..d03a306 100644 --- a/luau/visit.luau +++ b/luau/visit.luau @@ -48,7 +48,7 @@ InsertService:SetUserSetsUrl( ) InsertService:SetCollectionUrl(path "game/tools/insertasset?sid=%d") InsertService:SetAssetUrl(path "asset?id=%d") -InsertService:SetAssetVersionUrl(path "Asset/?assetversionid=%d") +InsertService:SetAssetVersionUrl(path "asset?assetversionid=%d") pcall(function() SocialService:SetFriendUrl(