|
@@ -65,6 +65,13 @@ class FightProc {
|
|
|
return self::ReceiveRankReward();
|
|
|
case CmdCode::fight_PVP_match: # 6825 PVP 匹配一个对手
|
|
|
return self::PvpMatchPlayer();
|
|
|
+
|
|
|
+ case CmdCode::fight_WorldBoss_rankInfo: # 6826 世界boss的排名信息
|
|
|
+ return self::GetWorldBoss_RankInfo();
|
|
|
+ case CmdCode::fight_WorldBoss_getRankDamageVal: # 6827 当前轮次下 自己的最高伤害值
|
|
|
+ return self::GetWorldBoss_RankDamageVal();
|
|
|
+ case CmdCode::fight_WorldBoss_getSelfRankId: # 6827 获取自己的排名
|
|
|
+ return self::GetWorldBoss_SelfRankId();
|
|
|
default:
|
|
|
Err(ErrCode::cmd_err);
|
|
|
}
|
|
@@ -214,7 +221,7 @@ class FightProc {
|
|
|
ctx()->gates->evolveMaxId_left = $nextId;
|
|
|
|
|
|
GuideProc::Shop_Guide_Trigger(ctx()->gates->evolveMaxId_left);
|
|
|
-
|
|
|
+
|
|
|
TaskProc::OnCompleteNumQiLing();
|
|
|
} else {
|
|
|
$nextId = ctx()->gates->evolveMaxId_right + 1;
|
|
@@ -639,7 +646,7 @@ class FightProc {
|
|
|
|
|
|
if ($tag) {
|
|
|
my_Assert(!in_array($mask, $gateInfo->FirstReward), ErrCode::gate_GatePriceHasReceive);
|
|
|
- $gateInfo->FirstReward[] = $mask;
|
|
|
+ $gateInfo->FirstReward[] = $mask;
|
|
|
GuideProc::HeroChange_Guide_Trigger($gateId, $index);
|
|
|
|
|
|
StoreProc::AddMultiItemInStore($prize);
|
|
@@ -657,7 +664,7 @@ class FightProc {
|
|
|
'reward' => StoreProc::$reward,
|
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
|
'reward_equip' => StoreProc::$reward_equip,
|
|
|
- 'heros'=> ctx()->heros,
|
|
|
+ 'heros' => ctx()->heros,
|
|
|
'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
|
|
|
'funUnlockRecord_2' => ctx()->privateState->funUnlockRecord_2,
|
|
|
'funUnlockRecord_3' => ctx()->privateState->funUnlockRecord_3,
|
|
@@ -688,7 +695,7 @@ class FightProc {
|
|
|
if ($resultType) { # 胜利
|
|
|
self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
|
|
|
GuideProc::GateBoxReceived_Guide_Trigger($gateId, 1);
|
|
|
-
|
|
|
+
|
|
|
if (ctx()->gates->GateList->$gateId->pass == 0) {
|
|
|
ctx()->gates->GateList->$gateId->pass = 1;
|
|
|
|
|
@@ -790,21 +797,21 @@ class FightProc {
|
|
|
}
|
|
|
|
|
|
ctx()->gates->GateList->$gateId->fightNum += 1;
|
|
|
-
|
|
|
+
|
|
|
GuideProc::MainTaskRewardReceived_Guide_Trigger($gateId, ctx()->gates->GateList->$gateId->fightNum);
|
|
|
-
|
|
|
+
|
|
|
//TaskProc::Day7TaskReset();
|
|
|
TaskProc::OnFightNumMainGate();
|
|
|
TaskProc::OnKillCommonNumMonster($killMonsterNum);
|
|
|
TaskProc::OnKillleaderNumMonster($killBossNum);
|
|
|
TaskProc::OnFightGate_X($gateId);
|
|
|
|
|
|
- if($gateId == 11000){
|
|
|
+ if ($gateId == 11000) {
|
|
|
ctx()->gates()->UnlockNextPlotGate(11000);
|
|
|
ctx()->gates(true)->CurrentGateId = 11001;
|
|
|
- StlUtil::dictRemove(ctx()->gates->GateList,11000);
|
|
|
+ StlUtil::dictRemove(ctx()->gates->GateList, 11000);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
UserProc::updateUserInfo();
|
|
|
$ret = array(
|
|
|
'gates' => ctx()->gates,
|
|
@@ -900,9 +907,9 @@ class FightProc {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function unlockGuideType($id) {
|
|
|
- GuideProc::Qingling_EquipWear_Guide_Trigger($id);
|
|
|
+ GuideProc::Qingling_EquipWear_Guide_Trigger($id);
|
|
|
// $type = 0;
|
|
|
// switch ($id) {
|
|
|
// case 16://启灵
|
|
@@ -918,7 +925,6 @@ class FightProc {
|
|
|
// if($type >0 && !in_array($type,ctx()->privateData(true)->funUnlockRecord_3)){
|
|
|
// ctx()->privateData(true)->funUnlockRecord_3[] = $type;
|
|
|
// }
|
|
|
-
|
|
|
//return $type;
|
|
|
}
|
|
|
|
|
@@ -1414,8 +1420,11 @@ class FightProc {
|
|
|
|
|
|
if ($type == 1) {
|
|
|
$lv = gMem()->zrevrank(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), $uid);
|
|
|
- } else {
|
|
|
+ } else if($type == 2){
|
|
|
$lv = gMem()->zrevrank(MemKey_GameRun::Rank_FightPower_Zone_zset(req()->zoneid), $uid);
|
|
|
+ } elseif ($type == 3) {
|
|
|
+ $memKey = self::GetWorldBoss_DamageMemKey();
|
|
|
+ $lv = gMem()->zrevrank($memKey, $uid);
|
|
|
}
|
|
|
|
|
|
if ($lv == null) {
|
|
@@ -1427,10 +1436,6 @@ class FightProc {
|
|
|
$userInfo = UserProc::getUserGame(req()->zoneid, $uid);
|
|
|
$ins_rank->name = $userInfo->baseInfo->name;
|
|
|
$ins_rank->headImg = $userInfo->baseInfo->headImg;
|
|
|
- //$ret = intval($score);
|
|
|
-// if(!$isToRank){
|
|
|
-// $ret = $score;
|
|
|
-// }
|
|
|
$ins_rank->score = intval($score);
|
|
|
return $ins_rank;
|
|
|
}
|
|
@@ -1864,4 +1869,174 @@ class FightProc {
|
|
|
}
|
|
|
|
|
|
// </editor-fold>
|
|
|
+// <editor-fold defaultstate="collapsed" desc="世界boss 排行榜">
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 一个赛季完成后 排名数据清理掉 同时轮次要改变
|
|
|
+ */
|
|
|
+ public static function ResetWorldBossRank() {
|
|
|
+ if (!FightProc::isFunUnlock(25)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::WorldBoss);
|
|
|
+ if ($mo == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (now() < $mo->startTs) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $memKey = MemKey_GameRun::WorldBoss_StartTs(req()->zoneid);
|
|
|
+ $mem = gMem();
|
|
|
+
|
|
|
+ $ts = $mem->get($memKey);
|
|
|
+ $durationTs = $mo->ts * 24 * 60 * 60;
|
|
|
+ if ($ts == null && now() - $mo->startTs < $durationTs) {
|
|
|
+ $mem->set($memKey, $mo->startTs);
|
|
|
+ $ts = $mo->startTs;
|
|
|
+ }
|
|
|
+ if (now() - $ts >= $durationTs) {
|
|
|
+ $nextTs = TimeUtil::getNextDayTs($mo->startTs, $mo->ts);
|
|
|
+ $mem->set($memKey, $nextTs); //下一轮赛季的开始时间回存
|
|
|
+ //清理排行榜
|
|
|
+ self::ClearWorldBossRank();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 清理世界boss排行榜数据
|
|
|
+ */
|
|
|
+ public static function ClearWorldBossRank() {
|
|
|
+ $mem = gMem();
|
|
|
+ $arr = array();
|
|
|
+ for ($i = 1; $i <= 9; $i++) {
|
|
|
+ $memKey = MemKey_GameRun::WorldBoss_Rank($i, req()->zoneid);
|
|
|
+ $arr[] = $memKey;
|
|
|
+ }
|
|
|
+ $mem->deleteMulti($arr);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当前所在世界boss 的轮次 //当前轮次可以算出来
|
|
|
+ */
|
|
|
+ public static function GetCurTurnNum() {
|
|
|
+ $memKey = MemKey_GameRun::WorldBoss_StartTs(req()->zoneid);
|
|
|
+ $mem = gMem();
|
|
|
+ $ts = $mem->get($memKey);
|
|
|
+
|
|
|
+ $curDay = TimeUtil::totalDays(now());
|
|
|
+ $lastDay = TimeUtil::totalDays($ts);
|
|
|
+
|
|
|
+ $val = $curDay - $lastDay;
|
|
|
+ $num = intval($val / 3);
|
|
|
+
|
|
|
+ return $num + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function GetWorldBoss_DamageMemKey(){
|
|
|
+ $num = self::GetCurTurnNum();
|
|
|
+ $memKey = MemKey_GameRun::WorldBoss_Rank($num, req()->zoneid);
|
|
|
+ return $memKey;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 世界boss榜 伤害值入榜
|
|
|
+ * @param type $gateIndex
|
|
|
+ */
|
|
|
+ public static function Ranking_DamageVal($damageVal) {
|
|
|
+ $num = self::GetCurTurnNum();
|
|
|
+ $memKey = MemKey_GameRun::WorldBoss_Rank($num, req()->zoneid);
|
|
|
+ $mem = gMem();
|
|
|
+
|
|
|
+ $uid = req()->uid;
|
|
|
+ $val = gMem()->zscore($memKey, $uid);
|
|
|
+ if ($damageVal > $val) {
|
|
|
+ $arr = array();
|
|
|
+ $arr["$uid"] = self::createScore($damageVal);
|
|
|
+ $mem->zadd($memKey, $arr);
|
|
|
+ }
|
|
|
+
|
|
|
+ $length = $mem->zlen($memKey);
|
|
|
+ if ($length > GameConfig::glc2()->WorldBoss_RankRewardStatistics) {
|
|
|
+ $num = $length - GameConfig::glc2()->WorldBoss_RankRewardStatistics;
|
|
|
+ $mem->zremrangebyrank($memKey, 0, $num - 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6826 世界boss的排名信息
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ public static function GetWorldBoss_RankInfo() {
|
|
|
+ //list() = req()->paras;
|
|
|
+
|
|
|
+ $selfIsHasRank = 0; //本人是否上榜 0未上榜没有排名 1上榜则selfRank就是排名
|
|
|
+
|
|
|
+ $num = self::GetCurTurnNum();
|
|
|
+ $memKey = MemKey_GameRun::WorldBoss_Rank($num, req()->zoneid);
|
|
|
+
|
|
|
+ $list = gMem()->zrevrange($memKey, 0, GameConfig::glc2()->WorldBoss_RankRewardStatistics, true);
|
|
|
+
|
|
|
+ $selfRank = null;
|
|
|
+ $retArr = array();
|
|
|
+ if (count($list) > 0) {
|
|
|
+ foreach ($list as $uid => $score) {
|
|
|
+ $rankInfo = self::initOtherUidRankInfo($uid, $score, 3);
|
|
|
+ if ($rankInfo->uid == req()->uid) {
|
|
|
+ $selfIsHasRank = 1;
|
|
|
+ $selfRank = $rankInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ $retArr[] = $rankInfo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($selfRank == null) {
|
|
|
+ $selfRank = self::initOtherUidRankInfo(req()->uid, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ $ret = array(
|
|
|
+ 'rankInfo' => $retArr,
|
|
|
+ 'selfRank' => $selfRank,
|
|
|
+ 'selfIsHasRank' => $selfIsHasRank,
|
|
|
+ );
|
|
|
+ return Resp::ok($ret);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6827 当前轮次下 自己的最高伤害值
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ public static function GetWorldBoss_RankDamageVal() {
|
|
|
+ $val = gMem()->zscore(self::GetWorldBoss_DamageMemKey(), req()->uid);
|
|
|
+ if($val == null){
|
|
|
+ $val = 0;
|
|
|
+ }
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ $ret = array(
|
|
|
+ 'DamageVal' => intval($val),
|
|
|
+ );
|
|
|
+ return Resp::ok($ret);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6828 获取自己的排名
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ public static function GetWorldBoss_SelfRankId() {
|
|
|
+ $lv = gMem()->zrevrank(self::GetWorldBoss_DamageMemKey(), req()->uid);
|
|
|
+ if($lv == null){
|
|
|
+ $lv = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ $ret = array(
|
|
|
+ 'selfRank' => $lv,
|
|
|
+
|
|
|
+ );
|
|
|
+ return Resp::ok($ret);
|
|
|
+ }
|
|
|
+// </editor-fold>
|
|
|
}
|