|
@@ -41,6 +41,12 @@ class FightProc {
|
|
return self::GetRankInfo();
|
|
return self::GetRankInfo();
|
|
case CmdCode::fight_rank_uidEquipInfo: # 6812 获取主线关卡榜内玩家的装备信息
|
|
case CmdCode::fight_rank_uidEquipInfo: # 6812 获取主线关卡榜内玩家的装备信息
|
|
return self::GetUidEquipInfo_Rank();
|
|
return self::GetUidEquipInfo_Rank();
|
|
|
|
+ case CmdCode::fight_rank_GetMainGateRankRewardInfo: # 6813 荣誉榜信息
|
|
|
|
+ return self::GetmainGate_RankRewardInfo();
|
|
|
|
+ case CmdCode::fight_rank_GetFightPowerRankRewardInfo: # 6814 荣誉榜信息
|
|
|
|
+ return self::GetFightPower_RankRewardInfo();
|
|
|
|
+ case CmdCode::fight_rank_ReceiveRankReward: # 6815 领取荣誉榜奖励
|
|
|
|
+ return self::ReceiveRankReward();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
}
|
|
}
|
|
@@ -582,19 +588,39 @@ class FightProc {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 参与主线关卡排行榜
|
|
* 参与主线关卡排行榜
|
|
- * @param type $uid
|
|
|
|
* @param type $gateIndex
|
|
* @param type $gateIndex
|
|
*/
|
|
*/
|
|
- public static function Ranking_MainGateIndex($uid,$maxGateIndex) {
|
|
|
|
|
|
+ public static function Ranking_MainGateIndex($maxGateIndex) {
|
|
$memKey = MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid);
|
|
$memKey = MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid);
|
|
$mem = gMem();
|
|
$mem = gMem();
|
|
$arr = array();
|
|
$arr = array();
|
|
|
|
+ $uid = req()->uid;
|
|
$arr["$uid"] = $maxGateIndex;
|
|
$arr["$uid"] = $maxGateIndex;
|
|
$mem->zadd($memKey,$arr);
|
|
$mem->zadd($memKey,$arr);
|
|
|
|
|
|
$length = $mem->zlen($memKey);
|
|
$length = $mem->zlen($memKey);
|
|
if($length > glc()->Rank_MainGateIndex_OnListRank){
|
|
if($length > glc()->Rank_MainGateIndex_OnListRank){
|
|
- $num = $length - glc()->Rank_MainGateIndex_ShowRank;
|
|
|
|
|
|
+ $num = $length - glc()->Rank_MainGateIndex_OnListRank;
|
|
|
|
+ $mem->zremrangebyrank($memKey,0, $num-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 战力榜
|
|
|
|
+ * @param type $gateIndex
|
|
|
|
+ */
|
|
|
|
+ public static function Ranking_FightPower() {
|
|
|
|
+ $memKey = MemKey_GameRun::Rank_FightPower_Zone_zset(req()->zoneid);
|
|
|
|
+ $mem = gMem();
|
|
|
|
+ $arr = array();
|
|
|
|
+ $uid = req()->uid;
|
|
|
|
+ $power = 10;
|
|
|
|
+ $arr["$uid"] = $power;
|
|
|
|
+ $mem->zadd($memKey,$arr);
|
|
|
|
+
|
|
|
|
+ $length = $mem->zlen($memKey);
|
|
|
|
+ if($length > glc()->Rank_FightPower_OnListRank){
|
|
|
|
+ $num = $length - glc()->Rank_FightPower_OnListRank;
|
|
$mem->zremrangebyrank($memKey,0, $num-1);
|
|
$mem->zremrangebyrank($memKey,0, $num-1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -657,7 +683,7 @@ class FightProc {
|
|
$ins_rank->uid = $uid;
|
|
$ins_rank->uid = $uid;
|
|
$userInfo = UserProc::getUserGame(req()->zoneid, $uid);
|
|
$userInfo = UserProc::getUserGame(req()->zoneid, $uid);
|
|
$ins_rank->name = $userInfo->baseInfo->name;
|
|
$ins_rank->name = $userInfo->baseInfo->name;
|
|
- $ins_rank->headImg = $userInfo->baseInfo->name;
|
|
|
|
|
|
+ $ins_rank->headImg = $userInfo->baseInfo->headImg;
|
|
|
|
|
|
$ins_rank->score = $score;
|
|
$ins_rank->score = $score;
|
|
return $ins_rank;
|
|
return $ins_rank;
|
|
@@ -670,21 +696,101 @@ class FightProc {
|
|
public static function GetUidEquipInfo_Rank() {
|
|
public static function GetUidEquipInfo_Rank() {
|
|
list($uid) = req()->paras;
|
|
list($uid) = req()->paras;
|
|
$userInfo = UserProc::getUserGame(req()->zoneid, $uid);
|
|
$userInfo = UserProc::getUserGame(req()->zoneid, $uid);
|
|
- $attackNum = 0;
|
|
|
|
- $hp = 0;
|
|
|
|
- $equip = $userInfo->store->equip;
|
|
|
|
- $gem = $userInfo->store->gemEquip;
|
|
|
|
- $equipPag = $userInfo->store->equipPag;
|
|
|
|
|
|
+
|
|
|
|
+ $store = $userInfo->store;
|
|
|
|
+ $heros = $userInfo->heros;
|
|
|
|
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
$ret = array(
|
|
$ret = array(
|
|
- 'attackNum' => $attackNum,
|
|
|
|
- 'hp' =>$hp,
|
|
|
|
- 'equip' => $equip,
|
|
|
|
- 'gemEquip'=>$gem,
|
|
|
|
- 'equipPag'=>$equipPag,
|
|
|
|
|
|
+ 'store' => $store,
|
|
|
|
+ 'heros' =>$heros,
|
|
);
|
|
);
|
|
return Resp::ok($ret);
|
|
return Resp::ok($ret);
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通关奖励是否达成
|
|
|
|
+ * @param type $maxGateIndex
|
|
|
|
+ */
|
|
|
|
+ public static function IsAchievedMainGate_PassReward($maxGateIndex) {
|
|
|
|
+ $rewards = GameConfig::rank_passgatereward();
|
|
|
|
+
|
|
|
|
+ $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);
|
|
|
|
+ foreach ($rewards as $passGateId => $mo) {
|
|
|
|
+ if($passGateId == $maxGateIndex && !gMem()->hexists($memKey, $maxGateIndex)){
|
|
|
|
+ gMem()->hset($memKey, $maxGateIndex, req()->uid);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * 战力奖励是否达成
|
|
|
|
+ */
|
|
|
|
+ public static function IsAchievedFightPower_PassReward() {
|
|
|
|
+ $power = 0;//临时
|
|
|
|
+ $rewards = GameConfig::rank_fightpowerreward();
|
|
|
|
+
|
|
|
|
+ $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
|
|
|
|
+ foreach ($rewards as $fightPower => $mo) {
|
|
|
|
+ if($power>=$fightPower && !gMem()->hexists($memKey, $fightPower)){
|
|
|
|
+ gMem()->hset($memKey, $fightPower, req()->uid);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6813
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function GetmainGate_RankRewardInfo() {
|
|
|
|
+ //list($type) = req()->paras;
|
|
|
|
+
|
|
|
|
+ $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);
|
|
|
|
+ $dic = gMem()->hgetall($memKey);
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ $ret = array(
|
|
|
|
+ 'rankReward' => $dic,
|
|
|
|
+ );
|
|
|
|
+ return Resp::ok($ret);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6814
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function GetFightPower_RankRewardInfo() {
|
|
|
|
+ //list($type) = req()->paras;
|
|
|
|
+
|
|
|
|
+ $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
|
|
|
|
+ $dic = gMem()->hgetall($memKey);
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ $ret = array(
|
|
|
|
+ 'rankReward' => $dic,
|
|
|
|
+ );
|
|
|
|
+ return Resp::ok($ret);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6815
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function ReceiveRankReward() {
|
|
|
|
+ list($type,$id) = req()->paras;
|
|
|
|
+
|
|
|
|
+ my_Assert($gateMo != null, ErrCode::err_const_no);
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId), ErrCode::gate_NoUserGateInfo);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
|
|
|
|
+ $dic = gMem()->hgetall($memKey);
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ $ret = array(
|
|
|
|
+ 'rankReward' => $dic,
|
|
|
|
+ );
|
|
|
|
+ return Resp::ok($ret);
|
|
|
|
+ }
|
|
}
|
|
}
|