Attempt to fix issues with RCC and JSON encoding/decoding or gzip

This commit is contained in:
Lewin Kelly 2023-11-05 23:56:06 +00:00
parent 948b4e27a7
commit 972397b695
2 changed files with 28 additions and 9 deletions

View File

@ -35,13 +35,15 @@ game:HttpPost(
.. thumbnailKey
.. "&taskID="
.. game.JobId,
'{"Status": "Rendering"}',
"Rendering",
true,
"text/json"
)
local player = game:GetService("Players"):CreateLocalPlayer(0)
player.CharacterAppearance = baseUrl .. "/asset/characterfetch?userID=" .. assetId
player.CharacterAppearance = baseUrl
.. "/asset/characterfetch?userID="
.. assetId
player:LoadCharacter(false)
-- Raise up the character's arm if they have gear.
@ -74,15 +76,14 @@ workspace.CurrentCamera = Camera
local clickHead = ThumbnailGenerator:Click("PNG", 300, 300, true)
local result = '{"Status": "Completed", "ClickBody": "'
local result = "Completed\n"
.. tostring(clickBody)
.. '", "ClickHead": "'
.. "\n"
.. tostring(clickHead)
.. '"}'
print("[" .. game.JobId .. "] Rendered headshot")
while true do
for i = 1, 3 do
local ok, err = pcall(function()
game:HttpPost(
baseUrl
@ -98,6 +99,15 @@ while true do
if ok then
print("[" .. game.JobId .. "] Upload successful! Moving on...")
break
elseif i == 3 then
print(
"["
.. game.JobId
.. "] An error occurred! ("
.. err
.. "). Giving up..."
)
break
end
print(
"["

View File

@ -35,7 +35,7 @@ game:HttpPost(
.. thumbnailKey
.. "&taskID="
.. game.JobId,
'{"Status": "Rendering"}',
"Rendering",
true,
"text/json"
)
@ -57,10 +57,10 @@ end
local click = ThumbnailGenerator:Click("PNG", 2048, 2048, true)
local result = '{"Status": "Completed", "Click": "' .. tostring(click) .. '"}'
local result = "Completed\n" .. tostring(click)
print("[" .. game.JobId .. "] Successfully rendered, moving on...")
while true do
for i = 1, 3 do
local ok, err = pcall(function()
game:HttpPost(
baseUrl
@ -76,6 +76,15 @@ while true do
if ok then
print("[" .. game.JobId .. "] Upload successful! Moving on...")
break
elseif i == 3 then
print(
"["
.. game.JobId
.. "] An error occurred! ("
.. err
.. "). Giving up..."
)
break
end
print(
"["