Przeglądaj źródła

世界boss接口

cyzhao 3 miesięcy temu
rodzic
commit
92aa00be25

+ 33 - 1
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-14 16:30:29
+ // 日期: 2025-02-21 16:54:24
 ////////////////////
 ////////////////////
 
 
 namespace loyalsoft;
 namespace loyalsoft;
@@ -1176,6 +1176,38 @@ class GameConfig {
         return self::get_hash_item('activity_flipcardlottery_exchange', $itemid);
         return self::get_hash_item('activity_flipcardlottery_exchange', $itemid);
     }
     }
     /**
     /**
+    * 世界boss排名奖励
+    * @return \worldboss_rankreward
+    */
+    public static function worldboss_rankreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'worldboss_rankreward');
+    }
+    /**
+    * @return \sm_worldboss_rankreward worldboss_rankreward item数据 
+    */
+    public static function worldboss_rankreward_getItem($itemid)
+    { 
+        return self::get_hash_item('worldboss_rankreward', $itemid);
+    }
+    /**
+    * 世界boss奖励信息
+    * @return \worldboss_demagereward
+    */
+    public static function worldboss_demagereward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'worldboss_demagereward');
+    }
+    /**
+    * @return \sm_worldboss_demagereward worldboss_demagereward itemArray 
+    */
+    public static function worldboss_demagereward_getItemArray($key)
+    { 
+        return self::get_hash_item('worldboss_demagereward', $key);
+    }
+    /**
     * 当前版本(时间戳)
     * 当前版本(时间戳)
     * @return \ver
     * @return \ver
     */
     */

+ 33 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 16:54:40
+ // 日期: 2025-02-21 16:54:24
 ////////////////////
 ////////////////////
 
 
 /**
 /**
@@ -1174,6 +1174,38 @@ class GameConfig {
         return self::get_hash_item('activity_flipcardlottery_exchange', $itemid);
         return self::get_hash_item('activity_flipcardlottery_exchange', $itemid);
     }
     }
     /**
     /**
+    * 世界boss排名奖励
+    * @return \worldboss_rankreward
+    */
+    public static function worldboss_rankreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'worldboss_rankreward');
+    }
+    /**
+    * @return \sm_worldboss_rankreward worldboss_rankreward item数据 
+    */
+    public static function worldboss_rankreward_getItem($itemid)
+    { 
+        return self::get_hash_item('worldboss_rankreward', $itemid);
+    }
+    /**
+    * 世界boss奖励信息
+    * @return \worldboss_demagereward
+    */
+    public static function worldboss_demagereward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'worldboss_demagereward');
+    }
+    /**
+    * @return \sm_worldboss_demagereward worldboss_demagereward itemArray 
+    */
+    public static function worldboss_demagereward_getItemArray($key)
+    { 
+        return self::get_hash_item('worldboss_demagereward', $key);
+    }
+    /**
     * 当前版本(时间戳)
     * 当前版本(时间戳)
     * @return \ver
     * @return \ver
     */
     */

+ 1 - 1
Gameserver/App/model/Const/sm_activeTask.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 15:52:42
+ // 日期: 2025-02-21 15:10:38
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_activeTask_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 15:52:42
+ // 日期: 2025-02-21 15:10:38
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_equip.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2024-12-26 15:31:05
+ // 日期: 2025-02-21 15:46:51
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_gem.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-13 16:42:24
+ // 日期: 2025-02-20 17:31:29
 ////////////////////
 ////////////////////
 
 
 
 

+ 21 - 1
Gameserver/App/model/Const/sm_glc2.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-14 17:53:34
+ // 日期: 2025-02-21 16:53:44
 ////////////////////
 ////////////////////
 
 
 
 
@@ -83,5 +83,25 @@ class sm_glc2
     */
     */
     public $FlipCardLotteryTask;
     public $FlipCardLotteryTask;
 
 
+    /**
+    * @var String 世界boss的bossId信息  
+    */
+    public $WorldBoss_BossId;
+
+    /**
+    * @var Int32 世界boss上榜排名  
+    */
+    public $WorldBoss_RankShow;
+
+    /**
+    * @var Int32 世界boss需要统计到的排名  
+    */
+    public $WorldBoss_RankStatistics;
+
+    /**
+    * @var Int32 世界boss排名奖励需要统计到的名次  
+    */
+    public $WorldBoss_RankRewardStatistics;
+
 }
 }
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 14:43:53
+ // 日期: 2025-02-19 17:42:21
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_heroType_typeId.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 14:43:53
+ // 日期: 2025-02-19 17:42:21
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_item.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 14:45:48
+ // 日期: 2025-02-20 10:36:52
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_plots.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-01-10 14:08:42
+ // 日期: 2025-02-21 16:08:33
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_predicate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-18 16:52:35
+ // 日期: 2025-02-21 15:26:22
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_skills.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2025-02-17 14:13:16
+ // 日期: 2025-02-20 16:56:39
 ////////////////////
 ////////////////////
 
 
 
 

+ 37 - 0
Gameserver/App/model/Const/sm_worldboss_demagereward.php

@@ -0,0 +1,37 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2025-02-20 17:53:21
+////////////////////
+
+
+/**
+ * Static Model worldboss_demagereward 世界boss奖励信息
+ */
+class sm_worldboss_demagereward
+{
+
+    /**
+    * @var Int32 唯一  
+    */
+    public $id;
+
+    /**
+    * @var Int32 伤害值  
+    */
+    public $demageValId;
+
+    /**
+    * @var String 奖励信息  
+    */
+    public $reward;
+
+    /**
+    * @var Int32 所在轮次,不同轮次奖励不同  
+    */
+    public $orderId;
+
+}
+

+ 37 - 0
Gameserver/App/model/Const/sm_worldboss_rankreward.php

@@ -0,0 +1,37 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2025-02-20 17:46:41
+////////////////////
+
+
+/**
+ * Static Model worldboss_rankreward 世界boss排名奖励
+ */
+class sm_worldboss_rankreward
+{
+
+    /**
+    * @var Int32 唯一  
+    */
+    public $id;
+
+    /**
+    * @var Int32 名次  
+    */
+    public $rank_start;
+
+    /**
+    * @var Int32 名次  
+    */
+    public $rank_end;
+
+    /**
+    * @var String 奖励信息  
+    */
+    public $reward;
+
+}
+

+ 15 - 0
Gameserver/App/model/User/Enum_SubFunType.php

@@ -93,4 +93,19 @@ class Enum_SubFunType {
      */
      */
     const FlipCardLottery = 17;
     const FlipCardLottery = 17;
     
     
+    /// <summary>
+    /// 金蛇献瑞
+    /// </summary>
+    const FlipCardLottery_task = 18;
+
+    /// <summary>
+    /// 金蛇献瑞
+    /// </summary>
+    const FlipCardLottery_exchange = 19;
+
+    /// <summary>
+    /// 世界boss
+    /// </summary>
+    const WorldBoss = 20;
+    
 }
 }

+ 12 - 0
Gameserver/App/model/User/Info_PrivateState.php

@@ -538,6 +538,18 @@ class Info_PrivateState extends Object_ext {
      */
      */
     public $flipCardNum_turnNum = 0;
     public $flipCardNum_turnNum = 0;
     
     
+    /**
+     * 世界boss开始时间
+     * @var type
+     */
+    public $worldBoss_startTs = 0;
+    
+    /**
+     * 世界boss 当前轮次
+     * @var type
+     */
+    public $worldBoss_turnNum = 0;
+
     public function initialize() {      
     public function initialize() {      
         $this->onlineGiftts = 1;
         $this->onlineGiftts = 1;
     }
     }

+ 192 - 17
Gameserver/App/process/FightProc.php

@@ -65,6 +65,13 @@ class FightProc {
                 return self::ReceiveRankReward();
                 return self::ReceiveRankReward();
             case CmdCode::fight_PVP_match:                                      # 6825 PVP 匹配一个对手
             case CmdCode::fight_PVP_match:                                      # 6825 PVP 匹配一个对手
                 return self::PvpMatchPlayer();
                 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:
             default:
                 Err(ErrCode::cmd_err);
                 Err(ErrCode::cmd_err);
         }
         }
@@ -214,7 +221,7 @@ class FightProc {
             ctx()->gates->evolveMaxId_left = $nextId;
             ctx()->gates->evolveMaxId_left = $nextId;
 
 
             GuideProc::Shop_Guide_Trigger(ctx()->gates->evolveMaxId_left);
             GuideProc::Shop_Guide_Trigger(ctx()->gates->evolveMaxId_left);
-            
+
             TaskProc::OnCompleteNumQiLing();
             TaskProc::OnCompleteNumQiLing();
         } else {
         } else {
             $nextId = ctx()->gates->evolveMaxId_right + 1;
             $nextId = ctx()->gates->evolveMaxId_right + 1;
@@ -639,7 +646,7 @@ class FightProc {
 
 
         if ($tag) {
         if ($tag) {
             my_Assert(!in_array($mask, $gateInfo->FirstReward), ErrCode::gate_GatePriceHasReceive);
             my_Assert(!in_array($mask, $gateInfo->FirstReward), ErrCode::gate_GatePriceHasReceive);
-            $gateInfo->FirstReward[] = $mask;                 
+            $gateInfo->FirstReward[] = $mask;
             GuideProc::HeroChange_Guide_Trigger($gateId, $index);
             GuideProc::HeroChange_Guide_Trigger($gateId, $index);
 
 
             StoreProc::AddMultiItemInStore($prize);
             StoreProc::AddMultiItemInStore($prize);
@@ -657,7 +664,7 @@ class FightProc {
             'reward' => StoreProc::$reward,
             'reward' => StoreProc::$reward,
             'reward_Gem' => StoreProc::$reward_Gem,
             'reward_Gem' => StoreProc::$reward_Gem,
             'reward_equip' => StoreProc::$reward_equip,
             'reward_equip' => StoreProc::$reward_equip,
-            'heros'=> ctx()->heros,
+            'heros' => ctx()->heros,
             'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
             'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
             'funUnlockRecord_2' => ctx()->privateState->funUnlockRecord_2,
             'funUnlockRecord_2' => ctx()->privateState->funUnlockRecord_2,
             'funUnlockRecord_3' => ctx()->privateState->funUnlockRecord_3,
             'funUnlockRecord_3' => ctx()->privateState->funUnlockRecord_3,
@@ -688,7 +695,7 @@ class FightProc {
         if ($resultType) {                                                      # 胜利
         if ($resultType) {                                                      # 胜利
             self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
             self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
             GuideProc::GateBoxReceived_Guide_Trigger($gateId, 1);
             GuideProc::GateBoxReceived_Guide_Trigger($gateId, 1);
-            
+
             if (ctx()->gates->GateList->$gateId->pass == 0) {
             if (ctx()->gates->GateList->$gateId->pass == 0) {
                 ctx()->gates->GateList->$gateId->pass = 1;
                 ctx()->gates->GateList->$gateId->pass = 1;
 
 
@@ -790,21 +797,21 @@ class FightProc {
         }
         }
 
 
         ctx()->gates->GateList->$gateId->fightNum += 1;
         ctx()->gates->GateList->$gateId->fightNum += 1;
-        
+
         GuideProc::MainTaskRewardReceived_Guide_Trigger($gateId, ctx()->gates->GateList->$gateId->fightNum);
         GuideProc::MainTaskRewardReceived_Guide_Trigger($gateId, ctx()->gates->GateList->$gateId->fightNum);
-        
+
         //TaskProc::Day7TaskReset();
         //TaskProc::Day7TaskReset();
         TaskProc::OnFightNumMainGate();
         TaskProc::OnFightNumMainGate();
         TaskProc::OnKillCommonNumMonster($killMonsterNum);
         TaskProc::OnKillCommonNumMonster($killMonsterNum);
         TaskProc::OnKillleaderNumMonster($killBossNum);
         TaskProc::OnKillleaderNumMonster($killBossNum);
         TaskProc::OnFightGate_X($gateId);
         TaskProc::OnFightGate_X($gateId);
 
 
-        if($gateId == 11000){
+        if ($gateId == 11000) {
             ctx()->gates()->UnlockNextPlotGate(11000);
             ctx()->gates()->UnlockNextPlotGate(11000);
             ctx()->gates(true)->CurrentGateId = 11001;
             ctx()->gates(true)->CurrentGateId = 11001;
-            StlUtil::dictRemove(ctx()->gates->GateList,11000);
+            StlUtil::dictRemove(ctx()->gates->GateList, 11000);
         }
         }
-        
+
         UserProc::updateUserInfo();
         UserProc::updateUserInfo();
         $ret = array(
         $ret = array(
             'gates' => ctx()->gates,
             'gates' => ctx()->gates,
@@ -900,9 +907,9 @@ class FightProc {
             }
             }
         }
         }
     }
     }
-    
+
     public static function unlockGuideType($id) {
     public static function unlockGuideType($id) {
-        GuideProc::Qingling_EquipWear_Guide_Trigger($id);         
+        GuideProc::Qingling_EquipWear_Guide_Trigger($id);
 //        $type = 0;
 //        $type = 0;
 //        switch ($id) {           
 //        switch ($id) {           
 //            case 16://启灵
 //            case 16://启灵
@@ -918,7 +925,6 @@ class FightProc {
 //        if($type >0 && !in_array($type,ctx()->privateData(true)->funUnlockRecord_3)){
 //        if($type >0 && !in_array($type,ctx()->privateData(true)->funUnlockRecord_3)){
 //            ctx()->privateData(true)->funUnlockRecord_3[] = $type;
 //            ctx()->privateData(true)->funUnlockRecord_3[] = $type;
 //        }
 //        }
-        
         //return $type;
         //return $type;
     }
     }
 
 
@@ -1414,8 +1420,11 @@ class FightProc {
 
 
         if ($type == 1) {
         if ($type == 1) {
             $lv = gMem()->zrevrank(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), $uid);
             $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);
             $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) {
         if ($lv == null) {
@@ -1427,10 +1436,6 @@ class FightProc {
         $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->headImg;
         $ins_rank->headImg = $userInfo->baseInfo->headImg;
-        //$ret = intval($score);
-//        if(!$isToRank){
-//            $ret = $score;
-//        }
         $ins_rank->score = intval($score);
         $ins_rank->score = intval($score);
         return $ins_rank;
         return $ins_rank;
     }
     }
@@ -1864,4 +1869,174 @@ class FightProc {
     }
     }
 
 
     // </editor-fold>
     // </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>    
 }
 }