2016-01-10 11:01:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class beta5_getPlayerCount {
|
|
|
|
|
2024-12-31 00:25:05 +01:00
|
|
|
function __construct($lib) {
|
2016-01-10 11:01:49 +01:00
|
|
|
$this->lib = $lib;
|
|
|
|
$this->db = $this->lib->game->db;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Get player count. */
|
|
|
|
function run() {
|
|
|
|
$r = $this->db->query("SELECT COUNT(*) FROM player "
|
|
|
|
. "WHERE (quit IS NULL OR UNIX_TIMESTAMP(NOW())-quit<86400) AND NOT hidden");
|
|
|
|
if (!$r) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
list($c) = dbFetchArray($r);
|
|
|
|
return $c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|