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/main/vacation/library/start.inc

31 lines
675 B
PHP

<?php
class main_vacation_start {
function main_vacation_start($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->accounts = $this->lib->game->getLib('main/account');
}
function run($uid) {
foreach (config::getGames() as $game) {
if ($game->name == 'main') {
continue;
}
$lib = $game->getLib();
$pid = $lib->call('doesUserPlay', $uid);
if (!is_null($pid)) {
$lib->call('startVacation', $pid);
}
}
$this->db->query("UPDATE account SET status='VAC',vac_start=NULL,vac_credits=vac_credits-1 WHERE id=$uid");
$this->accounts->call('log', $uid, 'vs');
logText("Account $uid has entered vacation mode");
}
}
?>