diff --git a/mod.json b/mod.json index 84e3c75..20f4a7f 100644 --- a/mod.json +++ b/mod.json @@ -11,10 +11,5 @@ "After": "GetStatsFromToneAPI" } } - ], - "ConVars": [ - { - "ToneURL": "https://tone.sleepycat.date/v1" - } ] } \ No newline at end of file diff --git a/mod/scripts/vscripts/pulse.gnut b/mod/scripts/vscripts/pulse.gnut index ca4762f..8bb8be3 100644 --- a/mod/scripts/vscripts/pulse.gnut +++ b/mod/scripts/vscripts/pulse.gnut @@ -6,7 +6,7 @@ void function GetStatsFromToneAPI() { HttpRequest getStats getStats.method = HttpRequestMethod.GET - getStats.url = GetConVarString("ToneURL") + "/client/weapons" + getStats.url = "https://tone.sleepycat.date/v1/client/weapons" getStats.queryParameters["player"] <- [NSGetLocalPlayerUID().tostring()] void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response) { @@ -16,5 +16,4 @@ void function GetStatsFromToneAPI() } } bool result = NSHttpRequest(getStats, onSuccess) - return result } \ No newline at end of file diff --git a/mod/scripts/vscripts/sh_stats.gnut b/mod/scripts/vscripts/sh_stats.gnut index 195d3e0..0a4e236 100644 --- a/mod/scripts/vscripts/sh_stats.gnut +++ b/mod/scripts/vscripts/sh_stats.gnut @@ -458,9 +458,9 @@ int function GetPlayerStatInt( entity player, string category, string alias, str { Assert( IsUI() || IsValid( player ) ) string statString = GetStatVar( category, alias, subAlias ) - foreach (string key, int value in globalToneAPIKillData) { - if(statString == "weaponKillStats[" + key + "].total") return value - } + foreach (string key, int value in globalToneAPIKillData) { + if(statString == "weaponKillStats[mp_weapon" + key + "].total") return value + } return player.GetPersistentVarAsInt( statString ) }