You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

28 lines
769 B
PHP

<?php
require 'required.php';
require 'onlyloggedin.php';
if (is_empty($VARS['user'])) {
sendError("Missing data.", true);
}
$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';
$out['stats'] = $stats;
$out['stats']['lastping'] = 0;
echo json_encode($out);