瀏覽代碼

Merge branch 'dev' of http://ylsjtt.game7000.com:3000/YLSJ/jzhj2024server into dev

王刚 1 年之前
父節點
當前提交
0e416b33ed

+ 5 - 0
Gameserver/App/base/CmdCode.php

@@ -353,6 +353,11 @@ class CmdCode {
      * 
      */
     const fight_rank_ReceiveRankReward_FightPower = 6816;
+    
+    /**
+     * 荣誉榜奖励
+     */
+    const fight_rank_IsExistRankReward = 6817;
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-31 15:56:19
+ // 日期: 2024-06-07 10:54:59
 ////////////////////
 
 /**

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-22 14:46:41
+ // 日期: 2024-06-03 18:13:18
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-22 14:46:41
+ // 日期: 2024-06-03 18:13:18
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-20 17:15:16
+ // 日期: 2024-06-04 16:13:18
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-30 09:12:59
+ // 日期: 2024-06-06 09:25:21
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-30 09:12:59
+ // 日期: 2024-06-06 09:25:21
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-05 18:14:13
+ // 日期: 2024-06-05 18:25:21
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-30 10:31:14
+ // 日期: 2024-06-07 10:50:44
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-22 09:33:18
+ // 日期: 2024-06-06 15:47:13
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-29 11:43:18
+ // 日期: 2024-06-06 14:59:46
 ////////////////////
 
 

+ 3 - 2
Gameserver/App/model/Const/sm_waveItem.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-31 15:13:18
+ // 日期: 2024-06-07 10:11:04
 ////////////////////
 
 
@@ -59,7 +59,8 @@ class sm_waveItem
     public $bossId2;
 
     /**
-    * @var String 通向下一波的条件(1:击杀数量(不限种类)满足xxx后跳转; 2:倒计时xx秒结束后跳转; 3: 击杀指定id的怪物后跳转, 4: 限定xx秒内击杀指定id的怪物(boss)后跳转)  
+    * @var String 通向下一波的条件(1:击杀数量(不限种类)满足xxx后跳转; 2:倒计时xx秒结束后跳转; 3: 击杀指定id的怪物后跳转, 4: 限定xx秒内击杀指定id的怪物(boss)后跳转)例如(4:30,bossID)
+    *    
     */
     public $condition;
 

+ 3 - 2
Gameserver/App/model/Const/sm_waves.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-31 15:13:18
+ // 日期: 2024-06-07 10:11:04
 ////////////////////
 
 
@@ -59,7 +59,8 @@ class sm_waves
     public $bossId2;
 
     /**
-    * @var String 通向下一波的条件(1:击杀数量(不限种类)满足xxx后跳转; 2:倒计时xx秒结束后跳转; 3: 击杀指定id的怪物后跳转, 4: 限定xx秒内击杀指定id的怪物(boss)后跳转)  
+    * @var String 通向下一波的条件(1:击杀数量(不限种类)满足xxx后跳转; 2:倒计时xx秒结束后跳转; 3: 击杀指定id的怪物后跳转, 4: 限定xx秒内击杀指定id的怪物(boss)后跳转)例如(4:30,bossID)
+    *    
     */
     public $condition;
 

+ 91 - 22
Gameserver/App/process/FightProc.php

@@ -49,6 +49,8 @@ class FightProc {
                 return self::ReceiveRankReward_MainGate();
             case CmdCode::fight_rank_ReceiveRankReward_FightPower:              # 6816 领取战力荣誉榜奖励
                 return self::ReceiveRankReward_FightPower();
+            case CmdCode::fight_rank_IsExistRankReward:                         #6817 是否存在未领取的荣誉榜奖励
+                return self::IsExistRankReward();
             default:
                 Err(ErrCode::cmd_err);
         }
@@ -60,8 +62,10 @@ class FightProc {
      */
     public static function FightSweep() {
         //list($gateId) = req()->paras;
-        my_Assert(ctx()->gates->UnlockedGatesMaxId != 0, ErrCode::gate_NoSweep);
-        $mo = GameConfig::gate_getItem(ctx()->gates->UnlockedGatesMaxId);
+
+        $passGateId = ctx()->gates->maxPassGateId();
+        my_Assert($passGateId != 0, ErrCode::gate_NoSweep);
+        //$mo = GameConfig::gate_getItem(ctx()->gates->UnlockedGatesMaxId);
         $costTili = glc()->sweep_cost_tili;
         my_Assert(ctx()->baseInfo->tili >= $costTili, ErrCode::notenough_tili);
         $max = glc()->sweepMaxNum;
@@ -69,21 +73,39 @@ class FightProc {
         ctx()->gates->fightSweepNum += 1;
         ctx()->baseInfo->Consume_tili($costTili);
         $prizeArr = array();
-        $prizeArr[] = $mo->reward_win;
-        if ($mo->sweep_gold != null) {
-            $goodsStr = self::sweepRandReward($mo->sweep_gold);
-            $prizeArr[] = $goodsStr;
-            StoreProc::AddMultiItemInStore($goodsStr);
-        }
 
-        if ($mo->sweep_tuzhi != null) {
-            $goodsStr = self::sweepRandReward($mo->sweep_tuzhi);
+        $wavesArr = GameConfig::waves_getItemArray($passGateId);
+        $count = count($wavesArr);
+        $wavesMo = $wavesArr[$count - 1];
+
+        ctx()->baseInfo->Add_Gold($wavesMo->rewardGold);
+        $gold = $wavesMo->rewardGold;
+        $prizeArr[] = "1," . $gold;
+
+        $exp = $wavesMo->rewardExp;
+        $prizeArr[] = "1," . $exp;
+        ctx()->baseInfo->Add_Exp($exp);
+        if ($wavesMo->rewardTuZhi != null) {
+            $tuzhi = explode('-', $wavesMo->rewardTuZhi);
+            $n = rand($tuzhi[0], $tuzhi[1]);
+
+            $tuzhiArr = array();
+            $item = GameConfig::item();
+            foreach ($item as $id => $mo) {
+                if ($mo->itemType == 100) {
+                    $tuzhiArr[] = $id;
+                }
+            }
+
+            $index = rand(0, count($tuzhiArr) - 1);
+            $goodsStr = $tuzhiArr[$index] . ',' . $n;
+
             $prizeArr[] = $goodsStr;
             StoreProc::AddMultiItemInStore($goodsStr);
         }
 
-        if ($mo->sweep_gem != null) {
-            $goodsStr = self::sweepRandReward($mo->sweep_gem);
+        if ($wavesMo->rewardGem != null) {
+            $goodsStr = self::sweepRandReward($wavesMo->rewardGem);
             $list = explode(',', $goodsStr);
             $posId = rand(1, 6);
             $qual = $list[0];
@@ -98,11 +120,6 @@ class FightProc {
             }
         }
 
-        if ($mo->sweep_qiling != null) {
-            $goodsStr = self::sweepRandReward($mo->sweep_qiling);
-            $prizeArr[] = $goodsStr;
-            StoreProc::AddMultiItemInStore($goodsStr);
-        }
 
         UserProc::updateUserInfo();
         $ret = array(
@@ -120,12 +137,22 @@ class FightProc {
         $numArr = explode('-', $ctxArr[0]);
         $num = rand($numArr[0], $numArr[1]);
 
-        $randNum = rand(1, 100);
+        $rand = 0;
+        $itemArr = explode(',', $ctxArr[1]);
+        foreach ($itemArr as $value) {
+            $arr = explode(':', $value);
+            $itemId = $arr[0];
+            $per = $arr[1];
+
+            $rand += $per;
+        }
+
+        $randNum = rand(1, $rand);
         $start = 0;
         $end = 0;
 
         $res = "";
-        $itemArr = explode(',', $ctxArr[1]);
+
         foreach ($itemArr as $str) {
             $arr = explode(':', $str);
             $itemId = $arr[0];
@@ -769,9 +796,9 @@ class FightProc {
 
     public static function GetRankUid($uid_rank, $type) {
         if ($type == 1) {
-            $dic = gMem()->zrevrangebyscore(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), 0, glc()->Rank_MainGateIndex_OnListRank, true);
+            $dic = gMem()->zrevrange(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), 0, glc()->Rank_MainGateIndex_OnListRank, true);
         } else {
-            $dic = gMem()->zrevrangebyscore(MemKey_GameRun::Rank_FightPower_Zone_zset(req()->zoneid), 0, glc()->Rank_FightPower_OnListRank, true);
+            $dic = gMem()->zrevrange(MemKey_GameRun::Rank_FightPower_Zone_zset(req()->zoneid), 0, glc()->Rank_FightPower_OnListRank, true);
         }
 
         $arr = array();
@@ -952,6 +979,10 @@ class FightProc {
         $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);
         $dic = gMem()->hgetall($memKey);
 
+        if ($dic == null) {
+            $dic = new \stdClass();
+        }
+
         UserProc::updateUserInfo();
         $ret = array(
             'rankReward' => $dic,
@@ -969,6 +1000,10 @@ class FightProc {
         $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
         $dic = gMem()->hgetall($memKey);
 
+        if ($dic == null) {
+            $dic = new \stdClass();
+        }
+
         UserProc::updateUserInfo();
         $ret = array(
             'rankReward' => $dic,
@@ -1008,7 +1043,7 @@ class FightProc {
 
         my_Assert(!in_array($fightPower, ctx()->privateState->rankReward_drawed_fightPower), ErrCode::rankReward_HasReceive);
 
-        $mo = GameConfig::rank_passgatereward_getItem($fightPower);
+        $mo = GameConfig::rank_fightpowerreward_getItem($fightPower);
         my_Assert($mo != null, ErrCode::err_const_no);
 
         $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
@@ -1022,6 +1057,40 @@ class FightProc {
         return Resp::ok($ret);
     }
 
+    /**
+     * 6817
+     */
+    public static function IsExistRankReward() {
+        list($type) = req()->paras;
+
+        $isExistFinishReward = false;
+        if ($type == 1) {
+            $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);
+            $dic = gMem()->hgetall($memKey);
+            foreach ($dic as $gateId => $ins_rank) {
+                if (!in_array($gateId, ctx()->privateState->rankReward_drawed_MainGate)) {
+                    $isExistFinishReward = true;
+                    break;
+                }
+            }
+        } else {
+            $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
+            $dic = gMem()->hgetall($memKey);
+            foreach ($dic as $fightPower => $ins_rank) {
+                if (!in_array($fightPower, ctx()->privateState->rankReward_drawed_fightPower)) {
+                    $isExistFinishReward = true;
+                    break;
+                }
+            }
+        }
+
+        UserProc::updateUserInfo();
+        $ret = array(
+            'isExistFinishReward' => $isExistFinishReward,
+        );
+        return Resp::ok($ret);
+    }
+
     /*
      * 删除排行榜内注销账号的玩家
      */

+ 4 - 2
Gameserver/App/process/ShopProc.php

@@ -117,7 +117,7 @@ class ShopProc {
                 my_Assert($mo != null, ErrCode::err_const_no);
 
                 my_Assert(in_array($typeId, $user->privateState->dailyShopRandItems), ErrCode::err_const_no);
-                if ($typeId == 10001) {
+                if ($mo->type == 1) {
                     $getNum = 0;
                     foreach ($user->privateState->dailyShopReceived as $id) {
                         if ($id == $typeId) {
@@ -148,6 +148,8 @@ class ShopProc {
                         default:
                             break;
                     }
+                    
+                    TaskProc::OnBuyNumDailyShop();
                 }
 
                 $str = explode(',', $mo->reward);
@@ -157,7 +159,7 @@ class ShopProc {
 
                 StoreProc::AddMultiItemInStore($mo->reward);
                 ctx()->privateState->dailyShopReceived[] = $typeId;
-                TaskProc::OnBuyNumDailyShop();
+                
                 break;
 
             case EnumShopGift::GemBox_Shop ://宝石宝箱