503 Database Unavailable"; echo 'Error reading database - ' . $fname . ' #' . $serverid; cleanupDb(); exit; } if (!$loginenabled) { echo $content; } else if(isset($json->loginrequired) && $json->loginrequired && !$loggedin) { echo "{ \"error\": \"login-required\" }"; } else { $json = json_decode($content); $json->loggedin = $loggedin; if (isset($json->protected) && $json->protected) { $ss = stristr($seeallmarkers, $uid); if($ss === false) { if(isset($playervisible[$useridlc])) { $plist = $playervisible[$useridlc]; $pcnt = count($json->players); for($i = 0; $i < $pcnt; $i++) { $p = $json->players[$i]; if(!stristr($plist, '[' . $p->account . ']')) { $p->world = "-some-other-bogus-world-"; $p->x = 0.0; $p->y = 64.0; $p->z = 0.0; } } } else { $pcnt = count($json->players); for($i = 0; $i < $pcnt; $i++) { $p = $json->players[$i]; if(strcasecmp($userid, $p->account) != 0) { $p->world = "-some-other-bogus-world-"; $p->x = 0.0; $p->y = 64.0; $p->z = 0.0; } } } } } echo json_encode($json); } cleanupDb(); ?>