Browse Source

Add kick code to getstats.php

master
Skylar Ittner 5 years ago
parent
commit
3e63bab9d7
  1. 11
      getstats.php

11
getstats.php

@ -8,8 +8,17 @@ if (is_empty($VARS['user'])) {
sendError("Missing data.", true);
}
$stats = $database->select('players', ['level', 'energy', 'maxenergy', 'teamid', 'lastping'], ['nickname' => $VARS['user']])[0];
$stats = $database->select('players', ['level', 'energy', 'maxenergy', 'teamid', 'lastping', 'kick'], ['nickname' => $VARS['user']])[0];
$uuid = $_SESSION['uuid'];
$kick = $database->select('players', ['kick'], ['uuid' => $uuid])[0]['kick'];
if (!is_empty($kick)) {
$_SESSION['loggedin'] = false;
session_unset();
session_destroy();
$database->update('players', ['kick' => ''], ['uuid' => $uuid]);
die(json_encode(['status' => 'ERROR', 'kick' => 1, 'message' => $kick]));
}
$out = [];
$out['status'] = 'OK';