diff --git a/webapp/controller/MissionController.class.php b/webapp/controller/MissionController.class.php index d786c40..7811164 100644 --- a/webapp/controller/MissionController.class.php +++ b/webapp/controller/MissionController.class.php @@ -118,6 +118,23 @@ class MissionController extends BaseAuthedController { public function commitAll() { + $type = getReqVal('type', 0); + $missionMetaList = mt\Task::getCustomTypeMetaList($type); + $missionHash = Mission::allToHash(); + $missionDtoList = array(); + foreach ($missionMetaList as $missionMeta) { + $missionDb = getXVal($missionHash, $missionMeta['id'], null); + $missionDto = $this->getMissionDto($this->userInfo, $this->seasonDb, $missionDb, $missionMeta); + array_push($missionDtoList, $missionDto); + } + $propertyChgService = new services\PropertyChgService(); + $awardService = new services\AwardService(); + $this->_scatterDrop($dropMeta, $awardService, $propertyChgService); + Mission::add($missionId); + $this->_rspData(array( + 'award' => $awardService->toDto(), + 'property_chg' => $propertyChgService->toDto(), + )); } }