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:
@@ -564,7 +564,7 @@ function GameStatsTracker.prototype.registerPlayerGame(self, playerId, hero)
|
||||
nil,
|
||||
(((((("[GameStatsTracker] 👤 Регистрируем игрока " .. playerName) .. " (SteamID: ") .. steamId) .. "), герой: ") .. hero:GetUnitName()) .. ", уровень: ") .. tostring(heroLevel)
|
||||
)
|
||||
local request = CreateHTTPRequest("POST", SERVER_CONFIG.API_URL .. "/game/start")
|
||||
local request = CreateHTTPRequestScriptVM("POST", SERVER_CONFIG.API_URL .. "/game/start")
|
||||
setApiHeadersLong(nil, request)
|
||||
local dataToSend = {
|
||||
steam_id = steamId,
|
||||
@@ -1158,7 +1158,7 @@ function GameStatsTracker.prototype.saveGameResult(self, steamId, isVictory, dur
|
||||
if dsContractEnd then
|
||||
dataToSend.death_sentence_contract = dsContractEnd
|
||||
end
|
||||
local request = CreateHTTPRequest("POST", SERVER_CONFIG.API_URL .. "/game")
|
||||
local request = CreateHTTPRequestScriptVM("POST", SERVER_CONFIG.API_URL .. "/game")
|
||||
setApiHeadersLong(nil, request)
|
||||
request:SetHTTPRequestRawPostBody(
|
||||
"application/json",
|
||||
|
||||
Reference in New Issue
Block a user