This commit is contained in:
hujiabin 2022-10-10 19:33:11 +08:00
parent eb49388adb
commit e318d5b3fe
2 changed files with 7 additions and 13 deletions

View File

@ -115,7 +115,7 @@ class MissionController extends BaseAuthedController {
public function commitMission()
{
$missionId = getReqVal('mission_id', 0);
$missionMeta = mt\Task::get($missionId);
$missionMeta = mt\Task::get($missionId);print_r($missionMeta);die;
if (!$missionMeta) {
$this->_rspErr(1, 'mission_id parameter error');
return;
@ -152,12 +152,12 @@ class MissionController extends BaseAuthedController {
$this->_rspErr(3, 'Unknown mission status');
return;
}
$dropMeta = mt\Drop::get($missionMeta['reward']);
if (!$dropMeta) {
$this->_rspErr(10, 'server internal error:' . $missionMeta['reward']);
return;
}
$this->_scatterDrop('mission:' . $missionId, $dropMeta, $this->awardService, $this->propertyChgService);
// $dropMeta = mt\Drop::get($missionMeta['reward']);
// if (!$dropMeta) {
// $this->_rspErr(10, 'server internal error:' . $missionMeta['reward']);
// return;
// }
// $this->_scatterDrop('mission:' . $missionId, $dropMeta, $this->awardService, $this->propertyChgService);
$this->procSpecMissionCommit($missionDto, $missionMeta);
Mission::add($missionId);
$missionDb = Mission::find($missionId);

View File

@ -638,16 +638,10 @@ class MissionService extends BaseService {
}
$missionDto['objects'] = $mission['objects'];
$missionDto['ceg_num'] = $this->calcCegPreview($mission['objects']);
// $missionDto['boost_ceg_num'] = $this->calcBoostCeg($missionDto['ceg_num'],$missionDto['lefttime'],$missionMeta['time']);
}
}
}
private function calcBoostCeg($ceg,$time,$timeSum){
//悬赏加速所需CEG=MAX(ROUND(10%*当次悬赏任务获得CEG*当次已悬赏时间/当次悬赏所需时间,2),0.01)
return max(round(0.1*$ceg*$time/$timeSum,2),0.01);
}
public function sendOfferRewardMission($missionId, $propertyChgService)
{
$missionMeta = mt\Task::get($missionId);