|
@@ -37,6 +37,10 @@ class FightProc {
|
|
return self::TowerRefreshSkills();
|
|
return self::TowerRefreshSkills();
|
|
case CmdCode::fight_tower_updatelocklist: # 6810 挑战关卡: 更新技能锁定列表
|
|
case CmdCode::fight_tower_updatelocklist: # 6810 挑战关卡: 更新技能锁定列表
|
|
return self::TowerUpdateLockskillList();
|
|
return self::TowerUpdateLockskillList();
|
|
|
|
+ case CmdCode::fight_rankInfo: # 6811 获取主线关卡排行榜信息
|
|
|
|
+ return self::GetRankInfo();
|
|
|
|
+ case CmdCode::fight_rank_uidEquipInfo: # 6812 获取主线关卡榜内玩家的装备信息
|
|
|
|
+ return self::GetUidEquipInfo_Rank();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
}
|
|
}
|
|
@@ -575,4 +579,104 @@ class FightProc {
|
|
);
|
|
);
|
|
return Resp::ok($ret);
|
|
return Resp::ok($ret);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 参与主线关卡排行榜
|
|
|
|
+ * @param type $uid
|
|
|
|
+ * @param type $gateIndex
|
|
|
|
+ */
|
|
|
|
+ public static function Ranking_MainGateIndex($uid,$maxGateIndex) {
|
|
|
|
+ $memKey = MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid);
|
|
|
|
+ $mem = gMem();
|
|
|
|
+ $arr = array();
|
|
|
|
+ $arr["$uid"] = $maxGateIndex;
|
|
|
|
+ $mem->zadd($memKey,$arr);
|
|
|
|
+
|
|
|
|
+ $length = $mem->zlen($memKey);
|
|
|
|
+ if($length > glc()->Rank_MainGateIndex_OnListRank){
|
|
|
|
+ $num = $length - glc()->Rank_MainGateIndex_ShowRank;
|
|
|
|
+ $mem->zremrangebyrank($memKey,0, $num-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6811 获取主线关卡排行榜信息
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function GetRankInfo() {
|
|
|
|
+ list($type) = req()->paras;
|
|
|
|
+ $selfRank = 0;
|
|
|
|
+ $selfIsHasRank = 0; //本人是否上榜 0未上榜没有排名 1上榜则selfRank就是排名
|
|
|
|
+ $selfExtraInfo = 0;
|
|
|
|
+
|
|
|
|
+ if($type == 1){
|
|
|
|
+ $list = gMem()->zrevrange(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid),0, glc()->Rank_MainGateIndex_OnListRank, true);
|
|
|
|
+ $selfExtraInfo = ctx()->gates->UnlockedGatesMaxId;
|
|
|
|
+ } else {
|
|
|
|
+ $list = gMem()->zrevrange(MemKey_GameRun::Rank_FightPower_Zone_zset(req()->zoneid),0, glc()->Rank_FightPower_OnListRank, true);
|
|
|
|
+ $selfExtraInfo = 0;//战力还没有
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $retArr = array();
|
|
|
|
+ if(count($list)>0){
|
|
|
|
+ foreach ($list as $uid => $score) {
|
|
|
|
+ $rankInfo = self::initOtherUidRankInfo($uid, $score);
|
|
|
|
+ if($rankInfo->uid == req()->uid){
|
|
|
|
+ $selfIsHasRank = 1;
|
|
|
|
+ $selfRank = $rankInfo->rank;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $retArr[] = $rankInfo;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ $ret = array(
|
|
|
|
+ 'rankInfo' => $retArr,
|
|
|
|
+ 'selfRank' =>$selfRank,
|
|
|
|
+ 'selfIsHasRank' => $selfIsHasRank,
|
|
|
|
+ 'selfExtraInfo'=> $selfExtraInfo,
|
|
|
|
+ );
|
|
|
|
+ return Resp::ok($ret);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 初始化玩家rank
|
|
|
|
+ * @param type $uid
|
|
|
|
+ * @param type $score
|
|
|
|
+ * @return \loyalsoft\Ins_rank
|
|
|
|
+ */
|
|
|
|
+ static function initOtherUidRankInfo($uid,$score) {
|
|
|
|
+ $ins_rank = new Ins_rank();
|
|
|
|
+ $ins_rank->rank = gMem()->zrank(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), $uid)+1;
|
|
|
|
+ $ins_rank->uid = $uid;
|
|
|
|
+ $ins_rank->name = UserProc::getUserGame(req()->zoneid, $uid)->baseInfo->name;
|
|
|
|
+ $ins_rank->score = $score;
|
|
|
|
+ return $ins_rank;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6812 获取排行榜内玩家的装备信息
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function GetUidEquipInfo_Rank() {
|
|
|
|
+ list($uid) = req()->paras;
|
|
|
|
+ $userInfo = UserProc::getUserGame(req()->zoneid, $uid);
|
|
|
|
+ $attackNum = 0;
|
|
|
|
+ $hp = 0;
|
|
|
|
+ $equip = $userInfo->store->equip;
|
|
|
|
+ $gem = $userInfo->store->gemEquip;
|
|
|
|
+ $equipPag = $userInfo->store->equipPag;
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ $ret = array(
|
|
|
|
+ 'attackNum' => $attackNum,
|
|
|
|
+ 'hp' =>$hp,
|
|
|
|
+ 'equip' => $equip,
|
|
|
|
+ 'gem'=>$gem,
|
|
|
|
+ 'equipPag'=>$equipPag,
|
|
|
|
+ );
|
|
|
|
+ return Resp::ok($ret);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|