diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 82d77e8c..18596580 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -406,6 +406,10 @@ class BaseController { } } + public static function _verifySwitch($name) { + myself()->_callServiceStatic('ServerSwitchService', 'verifySwitch', $name); + } + public function _mergeAlikeItemKey($items){ $hashItems = array(); foreach ($items as $item){ diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 21c8f008..1aec2f20 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -72,16 +72,10 @@ class BattleController extends BaseAuthedController { return; } $data = json_decode(file_get_contents('php://input'), true); - /*error_log(json_encode(array( - 'a' => 'battleReport', - 'post_data' => $data - )));*/ - $teamList = array(); if ($data) { $teamList = $data['team_list']; } -// error_log(json_encode($teamList)); $battleDataService = new services\BattleDataService(); $battleDataService->teamList = $teamList; $battleDataService->updateBattleData(); @@ -95,7 +89,6 @@ class BattleController extends BaseAuthedController { 'modifytime' => $this->_getNowTime(), ) ); -// error_log(json_encode($battleDataService->getReward())); $data = array( 'reward' => $battleDataService->getReward() ); @@ -138,7 +131,6 @@ class BattleController extends BaseAuthedController { return; } $data = json_decode(file_get_contents('php://input'), true); - error_log(json_encode($data)); foreach ($data['team_list'] as $teamData){ $this->_handleTeamReport($teamData); } @@ -214,7 +206,6 @@ class BattleController extends BaseAuthedController { return; } $data = json_decode(file_get_contents('php://input'), true); - error_log(json_encode($data)); $this->_handleTeamReport($data); // $battle_uuid = getXVal($data,'battle_uuid', 0); // $room_uuid = getXVal($data,'room_uuid', 0); @@ -285,9 +276,6 @@ class BattleController extends BaseAuthedController { return; } $input = json_decode(file_get_contents('php://input'), true); - if (myself()->_getAccountId() == '6513_2006_U1JcRueKMQxN9BDw8p7pu61gfdzsS7G3') { - error_log(json_encode($input)); - } $roomBattleDataService = new services\RoomBattleDataService(); $roomBattleDataService->mapMode = getXVal($input,'map_mode', 0); error_log('roomReportMode:'.getXVal($input,'map_mode', 0)); @@ -361,7 +349,6 @@ class BattleController extends BaseAuthedController { } } } - error_log(json_encode($realPlayerHash)); $accountIdPair = array(); foreach ($realPlayerHash as $accountId => $val) { foreach ($realPlayerHashCopy as $accountIdCopy => $valCopy) { @@ -379,7 +366,6 @@ class BattleController extends BaseAuthedController { } } } - error_log(json_encode($accountIdPair)); $nowTime = myself()->_getNowTime(); foreach ($accountIdPair as $pair) { $accountId1 = $pair[0]; @@ -422,7 +408,6 @@ class BattleController extends BaseAuthedController { public function getBattleData() { - error_log(json_encode($_REQUEST)); $data = array( 'members' => array() ); @@ -538,7 +523,6 @@ class BattleController extends BaseAuthedController { $customData = array(); { $rawData = file_get_contents('php://input'); - error_log($rawData); $sign = strstr($rawData, '|', true); $customData = strstr($rawData, '|'); $customData = substr($customData, 1); @@ -553,7 +537,6 @@ class BattleController extends BaseAuthedController { $customData = json_decode($customData, true); } - error_log(json_encode($customData)); $zoneId = $customData['zone_id']; $nodeId = $customData['node_id']; $roomUuid = $customData['room_uuid']; @@ -687,7 +670,6 @@ class BattleController extends BaseAuthedController { } array_push($data['ob_list'], $info); } - error_log(json_encode($data)); myself()->_rspData($data); } @@ -702,7 +684,7 @@ class BattleController extends BaseAuthedController { $customData = array(); { $rawData = file_get_contents('php://input'); - error_log($rawData); + $headStr = strstr($rawData, '|', true); $sign = strstr($headStr, ':', true); $customData = strstr($rawData, '|'); @@ -719,7 +701,7 @@ class BattleController extends BaseAuthedController { } $currSeason = mt\RankSeason::getCurrentSeason(); - error_log(json_encode($customData)); + $zoneId = $customData['zone_id']; $nodeId = $customData['node_id']; $modeId = $customData['mode_id']; @@ -833,7 +815,6 @@ class BattleController extends BaseAuthedController { } array_push($data['team_list'], $teamInfo); } - error_log(json_encode($data)); $this->decTicket($r, $customData, $mapModeMeta); myself()->_rspData($data); } @@ -844,7 +825,6 @@ class BattleController extends BaseAuthedController { $customData = array(); { $rawData = file_get_contents('php://input'); - error_log($rawData); $headStr = strstr($rawData, '|', true); $sign = strstr($headStr, ':', true); $customData = strstr($rawData, '|'); @@ -937,7 +917,6 @@ class BattleController extends BaseAuthedController { } array_push($data['team_list'], $teamInfo); } - error_log(json_encode($data)); myself()->_rspData($data); } @@ -979,7 +958,6 @@ class BattleController extends BaseAuthedController { public function getBattleDataNew() { - error_log(json_encode($_REQUEST)); $members = json_decode(getReqVal('members', ''), true); $data = array( 'members' => array() @@ -1197,7 +1175,6 @@ class BattleController extends BaseAuthedController { public function requestAllocBoxNum() { - error_log(json_encode($_REQUEST)); $roomUuid = getReqVal('room_uuid', ''); $row = SqlHelper::ormSelectOne( $this->_getSelfMysql(), @@ -1254,7 +1231,6 @@ class BattleController extends BaseAuthedController { public function requestReturnBoxNum() { - error_log(json_encode($_REQUEST)); $roomUuid = getReqVal('room_uuid', ''); $usedNum = getReqVal('used_num', 0); $allocBoxNum = getReqVal('alloc_box_num', 0); diff --git a/webapp/controller/BattleDataController.class.php b/webapp/controller/BattleDataController.class.php index b9783a77..eefa4b6a 100644 --- a/webapp/controller/BattleDataController.class.php +++ b/webapp/controller/BattleDataController.class.php @@ -138,7 +138,6 @@ class BattleDataController extends BaseAuthedController { return; } $data = json_decode(file_get_contents('php://input'), true); - error_log(json_encode($data)); foreach ($data['team_list'] as $teamData){ $this->_handleTeamReport($teamData); } @@ -212,7 +211,6 @@ class BattleDataController extends BaseAuthedController { return; } $data = json_decode(file_get_contents('php://input'), true); - error_log(json_encode($data)); $this->_handleTeamReport($data); // $battle_uuid = getXVal($data,'battle_uuid', 0); // $room_uuid = getXVal($data,'room_uuid', 0); @@ -283,9 +281,6 @@ class BattleDataController extends BaseAuthedController { return; } $input = json_decode(file_get_contents('php://input'), true); - if (myself()->_getAccountId() == '6513_2006_U1JcRueKMQxN9BDw8p7pu61gfdzsS7G3') { - error_log(json_encode($input)); - } $roomBattleDataService = new services\RoomBattleDataService(); $roomBattleDataService->mapMode = getXVal($input,'map_mode', 0); error_log('roomReportMode:'.getXVal($input,'map_mode', 0)); @@ -359,7 +354,6 @@ class BattleDataController extends BaseAuthedController { } } } - error_log(json_encode($realPlayerHash)); $accountIdPair = array(); foreach ($realPlayerHash as $accountId => $val) { foreach ($realPlayerHashCopy as $accountIdCopy => $valCopy) { @@ -377,7 +371,6 @@ class BattleDataController extends BaseAuthedController { } } } - error_log(json_encode($accountIdPair)); $nowTime = myself()->_getNowTime(); foreach ($accountIdPair as $pair) { $accountId1 = $pair[0]; @@ -536,7 +529,7 @@ class BattleDataController extends BaseAuthedController { $customData = array(); { $rawData = file_get_contents('php://input'); - error_log($rawData); + $sign = strstr($rawData, '|', true); $customData = strstr($rawData, '|'); $customData = substr($customData, 1); @@ -551,7 +544,7 @@ class BattleDataController extends BaseAuthedController { $customData = json_decode($customData, true); } - error_log(json_encode($customData)); + $zoneId = $customData['zone_id']; $nodeId = $customData['node_id']; $roomUuid = $customData['room_uuid']; @@ -685,7 +678,7 @@ class BattleDataController extends BaseAuthedController { } array_push($data['ob_list'], $info); } - error_log(json_encode($data)); + myself()->_rspData($data); } @@ -700,7 +693,7 @@ class BattleDataController extends BaseAuthedController { $customData = array(); { $rawData = file_get_contents('php://input'); - error_log($rawData); + $headStr = strstr($rawData, '|', true); $sign = strstr($headStr, ':', true); $customData = strstr($rawData, '|'); @@ -717,7 +710,7 @@ class BattleDataController extends BaseAuthedController { } $currSeason = mt\RankSeason::getCurrentSeason(); - error_log(json_encode($customData)); + $zoneId = $customData['zone_id']; $nodeId = $customData['node_id']; $modeId = $customData['mode_id']; @@ -831,7 +824,7 @@ class BattleDataController extends BaseAuthedController { } array_push($data['team_list'], $teamInfo); } - error_log(json_encode($data)); + $this->decTicket($r, $customData, $mapModeMeta); myself()->_rspData($data); } @@ -842,7 +835,7 @@ class BattleDataController extends BaseAuthedController { $customData = array(); { $rawData = file_get_contents('php://input'); - error_log($rawData); + $headStr = strstr($rawData, '|', true); $sign = strstr($headStr, ':', true); $customData = strstr($rawData, '|'); @@ -935,7 +928,7 @@ class BattleDataController extends BaseAuthedController { } array_push($data['team_list'], $teamInfo); } - error_log(json_encode($data)); + myself()->_rspData($data); } diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index a6ef1509..f0cc1e54 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -54,6 +54,7 @@ class BigwheelController extends BaseAuthedController { public function drawS() { + myself()->_verifySwitch('bigWheel'); $drawType = getReqVal('type', 0); if (!($drawType == 0 || $drawType == 1 || $drawType == 2)) { myself()->_rspErr(2, 'type param error'); @@ -293,6 +294,7 @@ class BigwheelController extends BaseAuthedController { public function buyS() { + myself()->_verifySwitch('bigWheel'); $key = $this->getMidDataKey(); $data = $this->getAndCreateData($key); $gridRef = null; diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index d2efad82..771858c8 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -46,6 +46,7 @@ class BlockChainController extends BaseAuthedController { public function active721Nft() { + myself()->_verifySwitch('heroMint'); $type = getReqVal('type', 0); $uniid = getReqVal('uniid', 0); $accountAddress = strtolower(getReqVal('account_address', '')); @@ -109,6 +110,7 @@ class BlockChainController extends BaseAuthedController { public function mintGoldBullion() { + myself()->_verifySwitch('goldSyn'); $type = getReqVal('type', 0); $accountAddress = strtolower(getReqVal('account_address', '')); if ($accountAddress != myself()->_getAddress()) { diff --git a/webapp/controller/OutAppMintController.class.php b/webapp/controller/OutAppMintController.class.php index b4c1e0c5..e91c899a 100644 --- a/webapp/controller/OutAppMintController.class.php +++ b/webapp/controller/OutAppMintController.class.php @@ -18,6 +18,7 @@ class OutAppMintController extends BaseController { public function mintHero() { + myself()->_verifySwitch('heroMint'); error_log(json_encode($_REQUEST)); $accountId = getReqVal('account_id', ''); //$accountAddress = User::findUserAddress($accountId); diff --git a/webapp/services/ServerSwitchService.php b/webapp/services/ServerSwitchService.php index 812f6a3e..608f6c2b 100644 --- a/webapp/services/ServerSwitchService.php +++ b/webapp/services/ServerSwitchService.php @@ -1,5 +1,7 @@ 0){ + return; + } + myself()->_rspErr(1008, 'function is disabled'); + die(); + } + // private $switchConfig = null; // // private function initConfig(){