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:
@@ -203,7 +203,7 @@ function ContractsManager.prototype.grantOneContract(self, playerId, minTier)
|
||||
if not steamId then
|
||||
return
|
||||
end
|
||||
local req = CreateHTTPRequest(
|
||||
local req = CreateHTTPRequestScriptVM(
|
||||
"POST",
|
||||
((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/contracts/grant"
|
||||
)
|
||||
@@ -228,7 +228,7 @@ function ContractsManager.prototype.loadContractsFromServer(self, playerId, sync
|
||||
end
|
||||
return
|
||||
end
|
||||
local request = CreateHTTPRequest(
|
||||
local request = CreateHTTPRequestScriptVM(
|
||||
"GET",
|
||||
((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/contracts"
|
||||
)
|
||||
@@ -261,7 +261,7 @@ function ContractsManager.prototype.persistContractsToServer(self, playerId)
|
||||
return
|
||||
end
|
||||
local list = self.contractsByPlayer:get(playerId) or ({})
|
||||
local request = CreateHTTPRequest(
|
||||
local request = CreateHTTPRequestScriptVM(
|
||||
"PUT",
|
||||
((SERVER_CONFIG.API_URL .. "/player/") .. tostring(steamId)) .. "/contracts"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user