diff --git a/webapp/controller/BoxController.class.php b/webapp/controller/BoxController.class.php new file mode 100644 index 00000000..978b0806 --- /dev/null +++ b/webapp/controller/BoxController.class.php @@ -0,0 +1,90 @@ +propertyChgService = new services\PropertyChgService(); + $this->awardService = new services\AwardService(); + } + + public function requestReward() + { + $this->_rspData(array( + "item_list" => array() + )); + return; + $userInfo = $this->_getOrmUserInfo(); + if (!$userInfo) { + $this->_rspErr(1, 'Without this player1'); + return; + } +// $ranked = getReqVal('pvp_personal_rank', 0); + $teamBattleDataService = new services\TameBattleDataService(); + $teamBattleDataService->calStarNum(); + $mode = getReqVal('room_mode', 0); + $item = array(); + $currentMeta = \mt\ServerTaskTime::getCurrentTime(); + if ($currentMeta && + myself()->_getNowTime() >= strtotime($currentMeta['income_start_time']) && + myself()->_getNowTime() < strtotime($currentMeta['income_end_time'])){ + $hashRateService = new services\HashRateService(); + $hashRateService->init(); + $status = $hashRateService->getServerASKBoxMode(); + switch ($status){ + case \mt\ServerTask::MOBA_DROP_STATE :{ + if ($mode == \services\TameBattleDataService::ROOM_MODE_PVP){ + array_push($item,array( + "item_id" => 300001, + "item_num" => 1, + )); + + } + } + break; + case \mt\ServerTask::PVP_DROP_STATE : { + if ($mode == \services\TameBattleDataService::ROOM_MODE_MOBA){ + array_push($item,array( + "item_id" => 300001, + "item_num" => 1, + )); + } + } + break; + } + } + if ($item){ + Bag::addItem($item['item_id'],$item['item_num']); + } + $this->_rspData(array( + "items" => $item + )); + } + +}