فهرست منبع

金币商城bug修复

cyzhao 1 سال پیش
والد
کامیت
f7d6dc4706

+ 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-11 16:15:33
+ // 日期: 2024-05-13 10:24:00
 ////////////////////
 
 /**

+ 4 - 2
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-11 14:56:02
+ // 日期: 2024-05-11 17:10:38
 ////////////////////
 
 
@@ -134,7 +134,9 @@ class sm_gate
     public $sweep_gem;
 
     /**
-    * @var String 扫荡得到的启灵材料 没有不需要填  
+    * @var String 扫荡得到的启灵材料:扫荡得到的材料:获取道具数量区间;材料道具ID:概率
+    *  概率总和值为100举例:
+    *  1-3;1:30,2,40,3:30;  
     */
     public $sweep_qiling;
 

+ 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-05-11 16:08:14
+ // 日期: 2024-05-11 16:32:56
 ////////////////////
 
 

+ 3 - 3
Gameserver/App/model/User/Info_PrivateState.php

@@ -150,7 +150,7 @@ class Info_PrivateState extends Object_ext {
      * 金币商城第一个冷却时间记录
      * @var type
      */
-    public $goldShop_GuangGaoTs_1 = 0;
+    public $goldShop_CoolDownTs_1 = 0;
 
     public $goldShop_GuangGaoNum = 0;
 
@@ -158,12 +158,12 @@ class Info_PrivateState extends Object_ext {
      * 金币商城第二个冷却时间记录
      * @var type
      */
-    public $goldShop_GuangGaoTs_2 = 0;
+    public $goldShop_CoolDownTs_2 = 0;
     /**
      * 金币商城第三个冷却时间记录
      * @var type
      */
-    public $goldShop_GuangGaoTs_3 = 0;
+    public $goldShop_CoolDownTs_3 = 0;
     
     /**
      * 月卡

+ 30 - 6
Gameserver/App/process/ShopProc.php

@@ -370,13 +370,13 @@ class ShopProc {
                         $ts = 0;
                         switch ($typeId) {
                             case 1:
-                                $ts = $user->privateState->goldShop_GuangGaoTs_1;
+                                $ts = $user->privateState->goldShop_CoolDownTs_1;
                                 break;
                             case 2:
-                                $ts = $user->privateState->goldShop_GuangGaoTs_2;
+                                $ts = $user->privateState->goldShop_CoolDownTs_2;
                                 break;
                             case 3:
-                                $ts = $user->privateState->goldShop_GuangGaoTs_3;
+                                $ts = $user->privateState->goldShop_CoolDownTs_3;
                                 break;
                         }
 
@@ -384,18 +384,30 @@ class ShopProc {
                             //收费买
                             my_Assert($user->baseInfo->cash >= $mo->price, ErrCode::notenough_cash_msg);
                             ctx()->baseInfo->Consume_Cash($mo->price);
+                            switch ($typeId) {
+                                case 1:
+                                    $user->privateState->goldShop_CoolDownTs_1 = now();
+                                    break;
+                                case 2:
+                                    $user->privateState->goldShop_CoolDownTs_2 = now();
+                                    break;
+                                case 3:
+                                    $user->privateState->goldShop_CoolDownTs_3 = now();
+                                    break;
+                            }
+                            
                             //$user->privateState->goldShopReceived[] = $typeId;
                         } else {
                             my_Assert(now() - $ts >= $mo->downTs, ErrCode::user_shop_FreeNumLimit);
                             switch ($typeId) {
                                 case 1:
-                                    $user->privateState->goldShop_GuangGaoTs_1 = now();
+                                    $user->privateState->goldShop_CoolDownTs_1 = now();
                                     break;
                                 case 2:
-                                    $user->privateState->goldShop_GuangGaoTs_2 = now();
+                                    $user->privateState->goldShop_CoolDownTs_2 = now();
                                     break;
                                 case 3:
-                                    $user->privateState->goldShop_GuangGaoTs_3 = now();
+                                    $user->privateState->goldShop_CoolDownTs_3 = now();
                                     break;
                             }
                         }
@@ -448,6 +460,18 @@ class ShopProc {
     public static function ShopDailyClear() {
         ctx()->privateState->dailyShopReceived = array();
         ctx()->privateState->goldShopReceived = array();
+        $num = count(ctx()->privateState->goldShopReceived); 
+        
+        $arr = ctx()->privateState->goldShopReceived;
+        for ($i = 0; $i < $num; $i++) {
+            if($arr[$i] == 1){
+                StlUtil::arrayRemoveAt($arr, $i);
+            }           
+        }       
+        
+        ctx()->privateState->goldShop_CoolDownTs_1 = 0;
+        ctx()->privateState->goldShop_GuangGaoNum = 0;
+        
         ctx()->privateState->junbeiShopNumRecord = new \stdClass();
 
         ctx()->privateState->dailyShop_GuangGaoNum = 0;