|
@@ -348,10 +348,14 @@ class FightProc {
|
|
|
* @return type
|
|
|
*/
|
|
|
public static function ChallengeGateStartFight() {
|
|
|
- if (ctx()->gates()->TowerGateInfo()->TodayChanNum > glc()->tower_daily_chanceNum) {
|
|
|
+ list($layerNum) = req()->paras;
|
|
|
+ if ($layerNum != ctx()->gates()->TowerGateInfo()->CurLayer) { # 起始层数校验
|
|
|
+ return Resp::err(ErrCode::tower_layerNum);
|
|
|
+ }
|
|
|
+ if (ctx()->gates()->TowerGateInfo()->TodayChanNum > glc()->tower_daily_chanceNum) { # 剩余次数校验
|
|
|
return Resp::err(ErrCode::tower_timeNo);
|
|
|
}
|
|
|
- ctx()->gates()->TowerGateInfo()->TodayChanNum++;
|
|
|
+ ctx()->gates()->TowerGateInfo()->TodayChanNum++; # 增加次数
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok();
|
|
|
}
|
|
@@ -361,21 +365,25 @@ class FightProc {
|
|
|
* @return type
|
|
|
*/
|
|
|
public static function GateChallengeRewards() {
|
|
|
- $arr = req()->paras; # 关卡列表
|
|
|
+ list($finalLayer) = req()->paras; # 战斗结束时的层数
|
|
|
|
|
|
- foreach ($arr as $layerId) {
|
|
|
- $layerMo = GameConfig::tower_gate_getItem($layerId);
|
|
|
- my_Assert($layerMo != null, ErrCode::err_const_no);
|
|
|
- StoreProc::AddMultiItemInStore($layerMo->rewards); # 发放奖励
|
|
|
- }
|
|
|
+ $lastLayer = ctx()->gates()->TowerGateInfo()->CurLayer;
|
|
|
+ if ($finalLayer > $lastLayer) {
|
|
|
+ for ($layerId = $lastLayer; $layerId++; $layerId < $finalLayer) {
|
|
|
|
|
|
- UserProc::updateUserInfo();
|
|
|
- $ret = array(
|
|
|
- 'store' => ctx()->store,
|
|
|
- 'gold' => ctx()->base()->gold,
|
|
|
- 'cash' => ctx()->base()->cash
|
|
|
- );
|
|
|
- return Resp::ok($ret);
|
|
|
+ $layerMo = GameConfig::tower_gate_getItem($layerId);
|
|
|
+ my_Assert($layerMo != null, ErrCode::err_const_no);
|
|
|
+ StoreProc::AddMultiItemInStore($layerMo->rewards); # 发放奖励
|
|
|
+ }
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ $ret = array(
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ 'gold' => ctx()->base()->gold,
|
|
|
+ 'cash' => ctx()->base()->cash
|
|
|
+ );
|
|
|
+ return Resp::ok($ret);
|
|
|
+ }
|
|
|
+ return Resp::err(ErrCode::tower_rewardNo); # 没有奖励
|
|
|
}
|
|
|
|
|
|
/**
|