lwb5-in-2025/scripts/game/beta5/player/library/isOnVacation.inc

32 lines
633 B
PHP

<?php
class beta5_player_isOnVacation {
public function __construct($lib) {
$this->lib = $lib;
$this->game = $this->lib->game;
$this->db = $this->game->getDBAccess();
$this->main = $this->game->getLib();
$this->vac = $this->game->getLib('main/vacation');
}
// Checks whether a player is currently on vacation
function run($pid) {
if ($this->main->call('isFinished')) {
return true;
}
if ($this->lib->game->params['novacation'] ?? 0 == 1) {
return false;
}
$p = $this->lib->call('get', $pid);
if (is_null($p)) {
return false;
}
return $this->vac->call('isOnVacation', $p['uid']);
}
}
?>