Fix sh_stats.gnut
We can now enter the lobby!
This commit is contained in:
@@ -11,10 +11,5 @@
|
|||||||
"After": "GetStatsFromToneAPI"
|
"After": "GetStatsFromToneAPI"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"ConVars": [
|
|
||||||
{
|
|
||||||
"ToneURL": "https://tone.sleepycat.date/v1"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ void function GetStatsFromToneAPI()
|
|||||||
{
|
{
|
||||||
HttpRequest getStats
|
HttpRequest getStats
|
||||||
getStats.method = HttpRequestMethod.GET
|
getStats.method = HttpRequestMethod.GET
|
||||||
getStats.url = GetConVarString("ToneURL") + "/client/weapons"
|
getStats.url = "https://tone.sleepycat.date/v1/client/weapons"
|
||||||
getStats.queryParameters["player"] <- [NSGetLocalPlayerUID().tostring()]
|
getStats.queryParameters["player"] <- [NSGetLocalPlayerUID().tostring()]
|
||||||
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response)
|
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response)
|
||||||
{
|
{
|
||||||
@@ -16,5 +16,4 @@ void function GetStatsFromToneAPI()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool result = NSHttpRequest(getStats, onSuccess)
|
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 ) )
|
Assert( IsUI() || IsValid( player ) )
|
||||||
string statString = GetStatVar( category, alias, subAlias )
|
string statString = GetStatVar( category, alias, subAlias )
|
||||||
foreach (string key, int value in globalToneAPIKillData) {
|
foreach (string key, int value in globalToneAPIKillData) {
|
||||||
if(statString == "weaponKillStats[" + key + "].total") return value
|
if(statString == "weaponKillStats[mp_weapon" + key + "].total") return value
|
||||||
}
|
}
|
||||||
return player.GetPersistentVarAsInt( statString )
|
return player.GetPersistentVarAsInt( statString )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user