This repository has been archived on 2019-05-05. You can view files and clone it, but cannot push or open issues or pull requests.
Server-v1/getstats.php
2016-10-11 01:20:32 -06:00

19 lines
395 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'], ['uuid' => $_SESSION['uuid']])[0];
$out = [];
$out['status'] = 'OK';
$out['stats'] = $stats;
$out['stats']['lastping'] = 0;
echo json_encode($out);