public function close() { if (!$this->_isExit) { $this->_isExit = true; //锁组件被启动 自动解锁 if (defined('LOCKRUN')) { Com_Lock::unLock(); } $this->push_cache(); $this->session_close(); $this->cache_close(); $this->db_close(); // if(IS_FRONT){ // Com_Log::log("action={$_POST['action']}|command={$_POST['command']}\ninclude files=".var_export(get_included_files(), true), 'corefile', 1); // } //DEBUG组件被启动 自动输出 if (defined('LOGRUN')) { Com_Log::output(); } if (IS_FRONT) { ob_end_flush(); } // global $scriptStartTime; // if($scriptStartTime){ // save_xhprof(); // } } }
public function CMD2_1159() { $lockKey = __FUNCTION__ . $this->_authuser['player_id']; if (!Com_Lock::lock($lockKey)) { //失败 $this->check_error('1714001'); } $data = $this->get_game('PlayerPVE')->get_invite_reward($this->_authuser['player_id']); Com_Lock::unLock($lockKey); Protocol::input($this->_authuser['player_id'], 3, 11, 1159, $data); }
/** * 主动向指定玩家抛出异常 * @param $player_id 玩家ID * @param $data 错误得id 或一个错误得数组 * @param $is_exit 抛出异常是否终止逻辑继续执行(true:终止false:继续) */ protected function initiative_throw_error($player_id, $data, $is_exit = true) { if ($this->is_trans()) { $this->rollback(); } Com_Lock::unLock(); if (is_array($data)) { $msg = Language_Message::make_message($data['code'], $data['params'], 1, $data['content']); } else { $msg = Language_Message::make_message($data); } Com_Log::log($player_id, 'z_fb_res', 1); Com_Log::log(array(0 => array($msg)), 'z_fb_res', 1); Protocol::input($player_id, 8, 7, 742, array(0 => array($msg))); Protocol::out(); if ($is_exit) { exit; } }
public function CMD2_2021() { //加锁 $lockKey = __FUNCTION__ . $this->_authuser['player_id']; if (!Com_Lock::lock($lockKey)) { $this->check_error('1714001'); //加锁失败 } $data = $this->get_game('GetBackCurrency')->get_back_all($this->_authuser['player_id'], $this->_param[0]); Com_Lock::unLock($lockKey); Protocol::input($this->_authuser['player_id'], 3, 20, 2021, $data); }
public function CMD2_775() { $lockKey = 'CMD2_775:' . $this->_param[0]; if (!Com_Lock::lock($lockKey)) { $this->check_error('1714001'); #加锁失败 } $data = $this->get_game('Auction')->buy_back($this->_authuser['player_id'], $this->_param[0]); Protocol::input($this->_authuser['player_id'], 3, 7, 775, $data); Com_Lock::unLock($lockKey); $this->CMD2_776(); }
public function CMD2_557() { #加锁 $lockKey = 'CMD2_557' . $this->_authuser['player_id']; if (!Com_Lock::lock($lockKey)) { $this->check_error('1714001'); #加锁失败 } $this->get_game('PlayerFunc')->get_func_is_open($this->_authuser['player_id'], 29); $data = $this->get_game('Hero')->player_hero_grow_upgrade($this->_authuser['player_id'], $this->_param[0], $this->_param[1], $this->_param[2]); Com_Lock::unLock($lockKey); Protocol::input($this->_authuser['player_id'], 3, 5, 557, $data); Protocol_Player::p2c_part_update($this->_authuser['player_id'], array('hero_info' => array(), 'attr' => array())); $this->CMD2_501(); }
public function CMD2_1779() { #加锁 $lockKey = 'CMD2_1779' . $this->_authuser['player_id']; if (!Com_Lock::lock($lockKey)) { $this->check_error('1714001'); #加锁失败 } $data = $this->get_game('UnionBoss')->send_box_reward_role($this->_param[0]); Com_Lock::unLock($lockKey); Protocol::input($this->_authuser['player_id'], 3, 17, 1779, $data); }
public function CMD2_1239() { //加锁 $lockKey = __FUNCTION__ . $this->_authuser['player_id']; if (!Com_Lock::lock($lockKey)) { //失败 $this->check_error('1714001'); } //鼓舞 $data = $this->get_game('KFDuel')->inspire($this->_authuser['player_id'], $this->_param[0]); Com_Lock::unLock($lockKey); Protocol::input($this->_authuser['player_id'], 3, 11, 1239, $data); }
public function CMD2_1026() { $lockKey = 'CMD2_1026:' . $this->_authuser['player_id']; if (!Com_Lock::lock($lockKey)) { $this->check_error('1714001'); #加锁失败 } $data = $this->get_game('TaskChain')->finish_task_chain($this->_authuser['player_id'], $this->_param[0]); Com_Lock::unLock($lockKey); Protocol::input($this->_authuser['player_id'], 3, 10, 1025, $data); }