|
@@ -79,7 +79,7 @@ class SweepGatesProc {
|
|
list($chapterId, $hard, $stars) = $req->paras; # 参数: 章节id, 难度, 分数
|
|
list($chapterId, $hard, $stars) = $req->paras; # 参数: 章节id, 难度, 分数
|
|
$hard = $hard + 1;
|
|
$hard = $hard + 1;
|
|
$userGates = new Info_UserGateDifficulty($req->userInfo->game->gates);
|
|
$userGates = new Info_UserGateDifficulty($req->userInfo->game->gates);
|
|
- if (!property_exists($userGates->chapterStarsRwd . $chapterId)) { # 防御第一次读取本章节数据
|
|
|
|
|
|
+ if (!property_exists($userGates->chapterStarsRwd, $chapterId)) { # 防御第一次读取本章节数据
|
|
$userGates->chapterStarsRwd->$chapterId = ObjectInit();
|
|
$userGates->chapterStarsRwd->$chapterId = ObjectInit();
|
|
}
|
|
}
|
|
$chapterInfo = $userGates->chapterStarsRwd->$chapterId; # 本章节数据
|
|
$chapterInfo = $userGates->chapterStarsRwd->$chapterId; # 本章节数据
|
|
@@ -91,7 +91,7 @@ class SweepGatesProc {
|
|
$rwdCfgArr = GameConfig::gate_starreward_getItem($chapterId, $hard); # 奖励配置数组
|
|
$rwdCfgArr = GameConfig::gate_starreward_getItem($chapterId, $hard); # 奖励配置数组
|
|
// isEditor() and $starCfg = new \sm_gate_starreward;
|
|
// isEditor() and $starCfg = new \sm_gate_starreward;
|
|
// var_dump($rwdCfgArr);
|
|
// var_dump($rwdCfgArr);
|
|
- $starCfg = StlUtil::arrayFind($rwdCfgArr, function ($v, $k)use($stars) { # 在数组中查找到对应星数的奖励
|
|
|
|
|
|
+ $starCfg = StlUtil::arrayFind($rwdCfgArr, function ($v, $k)use ($stars) { # 在数组中查找到对应星数的奖励
|
|
return ($v->star == $stars);
|
|
return ($v->star == $stars);
|
|
});
|
|
});
|
|
// var_dump($starCfg);
|
|
// var_dump($starCfg);
|
|
@@ -113,7 +113,7 @@ class SweepGatesProc {
|
|
}
|
|
}
|
|
my_Assert(null != $userGateL, ErrCode::err_innerfault); # 玩家数据有问题
|
|
my_Assert(null != $userGateL, ErrCode::err_innerfault); # 玩家数据有问题
|
|
// var_dump($userGateL);
|
|
// var_dump($userGateL);
|
|
- array_walk($userGateL->gates, function($v, $k)use(&$sumOfStars) { # 累加星数
|
|
|
|
|
|
+ array_walk($userGateL->gates, function ($v, $k)use (&$sumOfStars) { # 累加星数
|
|
$sinfo = new GateStar($v->star);
|
|
$sinfo = new GateStar($v->star);
|
|
$sumOfStars += $sinfo->Stars();
|
|
$sumOfStars += $sinfo->Stars();
|
|
});
|
|
});
|