This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/library/isFinished.inc

31 lines
664 B
PHP

<?php
class beta5_isFinished {
function __construct($lib) {
$this->lib = $lib;
$this->game = $this->lib->game;
$this->db = $this->game->getDBAccess();
}
function run() {
if ($this->game->params['victory'] == 0) {
return false;
}
// Check for victory on normal matches
if ($this->game->params['victory'] == 1) {
$q = $this->db->query("SELECT COUNT(*) FROM alliance_victory "
. "WHERE UNIX_TIMESTAMP(NOW()) >= time_of_victory");
list($c) = dbFetchArray($q);
return ($c > 0);
}
// Check for victory on CTF matches
$q = $this->db->query("SELECT * FROM ctf_points WHERE points = 100");
return (dbCount($q) == 1);
}
}
?>