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/leave.inc

31 lines
632 B
PHP

<?php
class main_vacation_leave {
function main_vacation_leave($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('leaveVacation', $pid);
}
}
$this->accounts->call('log', $uid, 've');
$this->db->query("UPDATE account SET status='STD' WHERE id=$uid");
logText("Account $uid has left vacation mode");
}
}
?>