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.
Server-v1/placestats.php

19 lines
578 B
PHP

<?php
/**
* Get the stats for a place. Useful for reloading stats after doing something.
*/
require 'required.php';
if (is_empty($VARS['locationid'])) {
sendError("Missing internal location ID.", true);
}
$data['status'] = 'OK';
if (!$database->has('locations', ['locationid' => $VARS['locationid']])) {
sendError("No stats found.", true);
}
$gameinfo = $database->select('locations', ['locationid', 'teamid', 'owneruuid', 'currentlife', 'maxlife'], ['locationid' => $VARS['locationid']])[0];
$data['stats'] = $gameinfo;
echo json_encode($data);