private function onSolved(WC_Warflag $flag) { if ($this->box->isMultisolve()) { if (false !== ($err = $this->onMultiSolved($flag))) { return $err; } } else { if (false !== ($err = $this->onSingleSolved($flag))) { return $err; } } if (!$this->box->recalcPlayersAndScore()) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } if (false === ($this->flags = WC_Warflag::getForBoxAndUser($this->box, $this->user, 'wf_order ASC'))) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } $this->module->includeClass('WC_RegAt'); if ($this->site->isUserLinked($this->user->getID())) { $result = $this->site->onUpdateUser($this->user); return $result->display($this->site->displayName()); } else { return '_YOU_ARE_NOT_LINKED_TO_THE_SITE,_BUT_WELL_DONE!'; } }
function warscore_levelup($socket, WC_Warbox $box, GWF_User $user, $level) { if ($box->isMultisolve()) { $changed = warscore_levelup_multi($socket, $box, $user, $level); } else { $changed = warscore_levelup_single($socket, $box, $user, $level); } if ($changed) { $box->recalcPlayersAndScore(); if ($box->doesRecycleTokens()) { WC_WarToken::deleteWarToken($user); } warscore_update($socket, $box, $user, $level); } else { warscore_nochange($socket, $box, $user, $level); } }
private function formEdit(WC_Warbox $box) { $data = array('name' => array(GWF_Form::STRING, $box->getVar('wb_name'), $this->l('th_wb_name')), 'url' => array(GWF_Form::STRING, $box->getVar('wb_weburl'), $this->l('th_wb_url')), 'host' => array(GWF_Form::STRING, $box->getVar('wb_host'), $this->l('th_wb_host')), 'port' => array(GWF_Form::INT, $box->getVar('wb_port'), $this->l('th_wb_port')), 'user' => array(GWF_Form::STRING, $box->getVar('wb_user'), $this->l('th_wb_user')), 'pass' => array(GWF_Form::STRING, $box->getVar('wb_pass'), $this->l('th_wb_pass')), 'wlist' => array(GWF_Form::STRING, $box->getVar('wb_whitelist'), $this->l('th_wb_wlist')), 'blist' => array(GWF_Form::STRING, $box->getVar('wb_blacklist'), $this->l('th_wb_blist')), 'launch' => array(GWF_Form::DATE, $box->getVar('wb_launched_at'), $this->l('th_wb_launch'), '', 8), 'status' => array(GWF_Form::ENUM, $box->getVar('wb_status'), $this->l('th_wb_status'), '', $this->statusValues()), 'warbox' => array(GWF_Form::CHECKBOX, $box->isWarbox(), $this->l('th_warbox')), 'multi' => array(GWF_Form::CHECKBOX, $box->isMultisolve(), $this->l('th_multisolve')), 'buttons' => array(GWF_Form::SUBMITS, array('edit' => $this->l('btn_edit_warbox'), 'flags' => $this->l('btn_edit_warflags')))); return new GWF_Form($this, $data); }