Fix sh_stats.gnut
We can now enter the lobby!
This commit is contained in:
@@ -11,10 +11,5 @@
|
||||
"After": "GetStatsFromToneAPI"
|
||||
}
|
||||
}
|
||||
],
|
||||
"ConVars": [
|
||||
{
|
||||
"ToneURL": "https://tone.sleepycat.date/v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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 )
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user