|
@@ -31,7 +31,7 @@ class SweepGatesProc {
|
|
|
$gold = self::getProperty_n($smGate, "gold", $i);
|
|
|
$exp = self::getProperty_n($smGate, "exp", $i);
|
|
|
|
|
|
- self::newRecordFight($req, $gateId, $difficulty, $star); # 更新战斗记录
|
|
|
+ self::newRecordFight($req, $gateId, $difficulty, $star); # 更新战斗记录
|
|
|
|
|
|
$canfighterr = SweepGatesProc::CanFight($req, $gateId, $difficulty); # 是否可以挑战当前关卡计算
|
|
|
|
|
@@ -218,10 +218,10 @@ class SweepGatesProc {
|
|
|
return Resp::err($err);
|
|
|
}
|
|
|
|
|
|
- UserGameModel::Add_Gold($req->mem, $req->userInfo->game, $gold); // 增加发经验和发金币
|
|
|
+ UserGameModel::Add_Gold($req->mem, $req->userInfo->game, $gold); # 增加发经验和发金币
|
|
|
UserGameModel::Add_Exp($req, $exp);
|
|
|
|
|
|
- UserProc::updateUserInfo($req); // 在获取战利品那里已经update了.
|
|
|
+ UserProc::updateUserInfo($req); # 在获取战利品那里已经update了.
|
|
|
|
|
|
$result = array(
|
|
|
'store' => $req->userInfo->game->store,
|
|
@@ -292,23 +292,6 @@ class SweepGatesProc {
|
|
|
*/
|
|
|
public static function ClearGateTimes($req) {
|
|
|
$req->userInfo->game->gates->Times = 0;
|
|
|
-// if (!CommUtil::isPropertyExists($req->userInfo->game->gates, 'newGateRecord')) {
|
|
|
-// $req->userInfo->game->gates->newGateRecord = ObjectInit();
|
|
|
-// }
|
|
|
-// if (!CommUtil::isPropertyExists($req->userInfo->game->gates->newGateRecord, 'record')) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// $obj = $req->userInfo->game->gates->newGateRecord->record;
|
|
|
-// //$result = empty($obj);
|
|
|
-// // if ($result == true) {
|
|
|
-// // return;
|
|
|
-// //}
|
|
|
-// foreach ($obj as $key => $value) {
|
|
|
-// $value->normalToday = 0;
|
|
|
-// $value->hardToday = 0;
|
|
|
-// $value->eliteToday = 0;
|
|
|
-// }
|
|
|
-// UserProc::updateUserInfo($req);
|
|
|
}
|
|
|
|
|
|
//
|
|
@@ -496,35 +479,24 @@ class SweepGatesProc {
|
|
|
* @deprecated since version 0 用新版
|
|
|
*/
|
|
|
public static function GetArenasStarReward($req) {
|
|
|
- $resp = Resp::err(ErrCode::err_method_notimplement);
|
|
|
- $gamedata = $req->userInfo->game;
|
|
|
+ return Resp::err(ErrCode::err_method_notimplement); # 屏蔽此方法
|
|
|
+
|
|
|
$rewardID = $req->paras[0]; //奖励的数据ID
|
|
|
-//1.检查奖励数据是否存在
|
|
|
- $rewardCfg = GameConfig::gate_starreward_getItem($rewardID); // ConstProc::getArenasGate_StarReward($rewardID);
|
|
|
- if (!$rewardCfg) {
|
|
|
+
|
|
|
+ $rewardCfg = GameConfig::gate_starreward_getItem($rewardID);
|
|
|
+ if (!$rewardCfg) { //1.检查奖励数据是否存在
|
|
|
return Resp::err(ErrCode::err_arenas_starreward_const_no);
|
|
|
}
|
|
|
-//2.检查玩家是否已经领取了
|
|
|
$gates = $req->userInfo->game->gates;
|
|
|
$getStarRewardRecord = ArrayInit();
|
|
|
- if (CommUtil::isPropertyExists($gates, "starRewards")) {
|
|
|
+ if (CommUtil::isPropertyExists($gates, "starRewards")) { //2.检查玩家是否已经领取了
|
|
|
$getStarRewardRecord = $gates->starRewards;
|
|
|
}
|
|
|
if (CommUtil::isInArray($getStarRewardRecord, $rewardID)) {
|
|
|
return Resp::err(ErrCode::err_arenas_hasgetstarreward);
|
|
|
}
|
|
|
-//3.检查玩家的当前星星数是否满足数量要求
|
|
|
-//"normal": {
|
|
|
-// "latest": 502001,
|
|
|
-// "highest": 502001,
|
|
|
-// "gates": {
|
|
|
-// "502001": {
|
|
|
-// "star": 3,
|
|
|
-// "cleared": 1,
|
|
|
-// "challengeTimes": 1
|
|
|
-// }
|
|
|
-// }
|
|
|
- $totalStarNum = 0;
|
|
|
+
|
|
|
+ $totalStarNum = 0; # 总得星数
|
|
|
$normalRecord = $gates->normal;
|
|
|
foreach ($normalRecord->gates as $key => $gate) {
|
|
|
$totalStarNum += $gate->star;
|
|
@@ -541,7 +513,7 @@ class SweepGatesProc {
|
|
|
}
|
|
|
|
|
|
DebugHelper::var_dump($totalStarNum);
|
|
|
- if ($totalStarNum < $rewardCfg->star) {
|
|
|
+ if ($totalStarNum < $rewardCfg->star) { //3.检查玩家的当前星星数是否满足数量要求
|
|
|
return Resp::err(ErrCode::err_arenas_starreward_starNotEnough);
|
|
|
}
|
|
|
$rewardStr = $rewardCfg->reward;
|
|
@@ -550,39 +522,34 @@ class SweepGatesProc {
|
|
|
$itemNum = $arr_reward[1];
|
|
|
$str1 = substr($itemId, 0, 3);
|
|
|
switch ($str1) {
|
|
|
-///怪物卡或者英雄卡牌获取
|
|
|
- case "101":
|
|
|
+ case "101": ///怪物卡或者英雄卡牌获取
|
|
|
case "201":
|
|
|
// HeroProc::AddHeroTFromStore($req, $itemId);
|
|
|
break;
|
|
|
-///装备物品的获取.
|
|
|
- case "301":
|
|
|
+ case "301": ///装备物品的获取.
|
|
|
case "302":
|
|
|
case "303":
|
|
|
StoreProc::PutEquipInStore($itemId, $req);
|
|
|
break;
|
|
|
-///宝石的获取
|
|
|
- case "304":
|
|
|
+ case "304": // 宝石的获取
|
|
|
StoreProc:: PutOverlyingItemInStore($itemId, $itemNum, $req);
|
|
|
break;
|
|
|
-//金币的获取
|
|
|
case "399":
|
|
|
- if ($itemId == "399002") {
|
|
|
+ if ($itemId == "399002") { // 金币的获取
|
|
|
UserGameModel::Add_Gold($req->mem, $req->userInfo->game, $itemNum);
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
-//保存记录
|
|
|
- $getStarRewardRecord[] = $rewardID;
|
|
|
+
|
|
|
+ $getStarRewardRecord[] = $rewardID; // 保存记录
|
|
|
$req->userInfo->game->gates->starRewards = $getStarRewardRecord;
|
|
|
-// 更新数据库数据
|
|
|
- UserProc::updateUserInfo($req);
|
|
|
- $result = ObjectInit();
|
|
|
- $result->getreward = true;
|
|
|
- $resp = Resp::ok($result);
|
|
|
- return $resp;
|
|
|
+ UserProc::updateUserInfo($req); // 更新数据库数据
|
|
|
+ $result = array(
|
|
|
+ "getreward" => true
|
|
|
+ );
|
|
|
+ return Resp::ok($result);
|
|
|
}
|
|
|
|
|
|
//
|