0){ return true; } return false; } public static function heroUpIsOpen(){ if (self::getConfig()['heroUp'] > 0){ return true; } return false; } public static function goldSynIsOpen(){ if (self::getConfig()['goldSyn'] > 0){ return true; } return false; } public static function heroPieceSynIsOpen(){ if (self::getConfig()['heroPieceSyn'] > 0){ return true; } return false; } public static function chipPieceSynIsOpen(){ if (self::getConfig()['chipPieceSyn'] > 0){ return true; } return false; } public static function verifySwitch($name) { if (self::getConfig()[$name] > 0){ return; } myself()->_rspErr(1008, 'function is disabled'); die(); } public static function switchIsOpen($name) { return self::getConfig()[$name] > 0; } // private $switchConfig = null; // // private function initConfig(){ // $this->switchConfig = getServerSwitchConfig(); // } public static function getGameSwitch(){ $redis = myself()->_getRedis(self::SERVER_SWITCH_KEY); if ($redis->exists(self::SERVER_SWITCH_KEY)){ $data = json_decode($redis->get(self::SERVER_SWITCH_KEY),true); }else{ $data = self::selectSwitchTable(); $redis->set(self::SERVER_SWITCH_KEY,json_encode($data)); $redis->pexpire(self::SERVER_SWITCH_KEY , 10*1000); } if (myself()->_getZid() == 17) { $data['normal']['ui.popup.circuitTask'] = 0; $data['auditing']['ui.popup.circuitTask'] = 0; } return $data; } public static function selectSwitchTable(){ $rows = SqlHelper::ormSelect(myself()->_getConfDbMysql(), 't_game_switch', array()); $data = array( 'normal' => array(), 'auditing' => array(), ); if (count($rows) > 0){ foreach ($rows as $row){ $data['normal'][$row['switch_name']] = $row['is_open']; $data['auditing'][$row['switch_name']] = $row['audit_is_open']; } } return $data; } }