Manage render compression and passing with proxy to hopefully prevent garbled responses

This commit is contained in:
Lewin Kelly 2024-03-03 11:41:55 +00:00
parent a003f15d55
commit 0e4523c8ca
3 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@ local function post(url: string, body: string)
game:HttpPost(url, body, true, "text/json") game:HttpPost(url, body, true, "text/json")
end end
return function(baseUrl: string, thumbnailKey: string) return function(baseUrl: string, pingUrl: string, thumbnailKey: string)
local Render = {} local Render = {}
function Render.SetupAvatar( function Render.SetupAvatar(
@ -32,7 +32,7 @@ return function(baseUrl: string, thumbnailKey: string)
`[{game.JobId}] Starting new render for {renderType} ID {assetId}` `[{game.JobId}] Starting new render for {renderType} ID {assetId}`
) )
post( post(
`{baseUrl}/api/render/update?apiKey={thumbnailKey}&taskID={game.JobId}`, `{pingUrl}/{game.JobId}?apiKey={thumbnailKey}`,
"Rendering" "Rendering"
) )
@ -54,7 +54,7 @@ return function(baseUrl: string, thumbnailKey: string)
for i = 1, 3 do for i = 1, 3 do
local ok, err = pcall(function() local ok, err = pcall(function()
post( post(
`{baseUrl}/api/render/update?apiKey={thumbnailKey}&taskID={game.JobId}`, `{pingUrl}/{game.JobId}?apiKey={thumbnailKey}`,
result result
) )
end) end)

View File

@ -1,7 +1,8 @@
-- Render script for R6 avatars -- Render script for R6 avatars
local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local Render = require "../Modules/Render.luau"(_BASE_URL, _THUMBNAIL_KEY) local RenderModule = require "../Modules/Render.luau"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
local player = local player =
Render.SetupAvatar(_RENDER_TYPE, _ASSET_ID, `/asset/characterfetch?userID=`) Render.SetupAvatar(_RENDER_TYPE, _ASSET_ID, `/asset/characterfetch?userID=`)

View File

@ -1,7 +1,8 @@
-- Render script for R6 clothing -- Render script for R6 clothing
local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local Render = require "../Modules/Render.luau"(_BASE_URL, _THUMBNAIL_KEY) local RenderModule = require "../Modules/Render.luau"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
Render.SetupAvatar(_RENDER_TYPE, _ASSET_ID, `/api/render/characterasset?id=`) Render.SetupAvatar(_RENDER_TYPE, _ASSET_ID, `/api/render/characterasset?id=`)