feat: replace CreateHTTPRequest with CreateHTTPRequestScriptVM

Allows the game client to make HTTP API calls from a listen server
(local lobby) instead of requiring a Steam dedicated server.
CreateHTTPRequestScriptVM has the exact same API signature but works
in both dedicated server and listen server contexts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
achmad
2026-05-29 17:36:08 +07:00
parent 49b790349f
commit 72b73c4dd6
16 changed files with 70 additions and 70 deletions
+6 -6
View File
@@ -2689,7 +2689,7 @@ function CardSystem.prototype.saveCardLevelsToServer(self)
if not steamId then
return
end
local request = CreateHTTPRequest(
local request = CreateHTTPRequestScriptVM(
"PUT",
((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/card-levels"
)
@@ -2707,7 +2707,7 @@ function CardSystem.prototype.loadCardLevelsFromServer(self)
self.cardLevelsLoaded = true
return
end
local request = CreateHTTPRequest(
local request = CreateHTTPRequestScriptVM(
"GET",
((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/card-levels"
)
@@ -2845,7 +2845,7 @@ function CardSystem.prototype.SaveDeckToServer(self, index, cards, deckName)
finalDeckName = "Колода " .. tostring(index)
end
end
local request = CreateHTTPRequest(
local request = CreateHTTPRequestScriptVM(
"PUT",
(((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/decks/") .. tostring(index)
)
@@ -2878,7 +2878,7 @@ function CardSystem.prototype.DeleteDeckFromServer(self, index)
if not steamId then
return
end
local request = CreateHTTPRequest(
local request = CreateHTTPRequestScriptVM(
"DELETE",
(((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/decks/") .. tostring(index)
)
@@ -2935,7 +2935,7 @@ function CardSystem.prototype.UpdateActiveDeckOnServer(self)
function(____, card) return type(card) == "number" end
)
end
local request = CreateHTTPRequest(
local request = CreateHTTPRequestScriptVM(
"PUT",
(((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/decks/") .. tostring(index)
)
@@ -2964,7 +2964,7 @@ function CardSystem.prototype.LoadDecks(self)
if not steamId then
return
end
local request = CreateHTTPRequest(
local request = CreateHTTPRequestScriptVM(
"GET",
((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/decks"
)