handle kill endpoint errors
This commit is contained in:
@@ -19,13 +19,11 @@
|
||||
},
|
||||
{
|
||||
"Name": "Tone_ID",
|
||||
"DefaultValue": "default",
|
||||
"Flags": "ARCHIVE"
|
||||
"DefaultValue": "23"
|
||||
},
|
||||
{
|
||||
"Name": "Tone_token",
|
||||
"DefaultValue": "default",
|
||||
"Flags": 4256
|
||||
"DefaultValue": "0c06e4c7-17b3-497f-881b-49ac88873435"
|
||||
},
|
||||
{
|
||||
"Name": "killstat_custom_parameters",
|
||||
|
||||
@@ -184,8 +184,22 @@ void function killstat_Record(entity victim, entity attacker, var damageInfo) {
|
||||
values["distance"] <- format("%.3f", dist)
|
||||
|
||||
string json = EncodeJSON(values)
|
||||
print("sending here... I realise")
|
||||
NSHttpPostBody(GetToneURIWithAuth()+ "/servers/"+file.Tone_ID+"/kill", json)
|
||||
void functionref( HttpRequestResponse ) onSuccess = void function ( HttpRequestResponse response )
|
||||
{
|
||||
if(response.statusCode == 200 || response.statusCode == 201){
|
||||
print("[Tone API] Kill data sent!")
|
||||
}else{
|
||||
print("[Tone API][WARN] Couldn't send kill data")
|
||||
print("[Tone API][WARN] " + response.body )
|
||||
}
|
||||
}
|
||||
|
||||
void functionref( HttpRequestFailure ) onFailure = void function ( HttpRequestFailure failure )
|
||||
{
|
||||
print("[Tone API][WARN] Couldn't send kill data")
|
||||
print("[Tone API][WARN] " + failure.errorMessage )
|
||||
}
|
||||
NSHttpPostBody(GetToneURIWithAuth()+ "/servers/"+file.Tone_ID+"/kill", json, onSuccess, onFailure)
|
||||
}
|
||||
|
||||
void function killstat_End() {
|
||||
@@ -332,7 +346,7 @@ void function Tone_Test_Auth(){
|
||||
HttpRequest request
|
||||
request.method = HttpRequestMethod.POST
|
||||
request.url = GetToneURIWithAuth() + "/servers/"+file.Tone_ID
|
||||
//print(GetToneURIWithAuth())
|
||||
print(GetToneURIWithAuth())
|
||||
void functionref( HttpRequestResponse ) onSuccess = void function ( HttpRequestResponse response )
|
||||
{
|
||||
if(response.statusCode == 200){
|
||||
|
||||
Reference in New Issue
Block a user