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

View File

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