Files
pulse/mod/scripts/vscripts/pulse.gnut
T
okvdai 9d5c9956ad Fix sh_stats.gnut
We can now enter the lobby!
2023-04-19 18:22:56 +02:00

19 lines
659 B
Plaintext

global function GetStatsFromToneAPI
table JSONForConversion = {}
void function GetStatsFromToneAPI()
{
HttpRequest getStats
getStats.method = HttpRequestMethod.GET
getStats.url = "https://tone.sleepycat.date/v1/client/weapons"
getStats.queryParameters["player"] <- [NSGetLocalPlayerUID().tostring()]
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response)
{
JSONForConversion = DecodeJSON(response.body)
foreach (key, value in JSONForConversion) {
globalToneAPIKillData[string(key)] <- int(value)
}
}
bool result = NSHttpRequest(getStats, onSuccess)
}