PHP game server for TerranQuest (version 1) https://terranquest.net
You can not 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.
 
 
 
 

34 lines
787 B

<?php
require 'required.php';
require 'onlyloggedin.php';
$where = ['inventory.playeruuid' => $_SESSION['uuid']];
if (!is_empty($VARS['classname'])) {
$where = ["AND" => ['inventory.playeruuid' => $_SESSION['uuid'], 'itemclasses.classname' => $VARS['classname']]];
}
$inv = $database->select(
'items', [
'[>]inventory' => ['itemid' => 'itemid'],
'[>]itemclasses' => ['classid', 'classid']
], [
'inventory.itemuuid',
'inventory.itemid',
'inventory.itemjson',
'items.itemname',
'items.itemdesc',
'items.itemcode',
'itemclasses.classid',
'itemclasses.classname'
], $where
);
if ($inv == FALSE) {
$inv = [];
}
$out['status'] = 'OK';
$out['items'] = $inv;
echo json_encode($out);