Преглед на файлове

限时贩售时间字段不在写死

cyzhao преди 8 месеца
родител
ревизия
dbbae60b78

+ 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-10-10 10:09:20
+ // 日期: 2024-10-11 17:37:58
 ////////////////////
 
 /**

+ 6 - 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-09-29 17:35:51
+ // 日期: 2024-10-11 17:33:35
 ////////////////////
 
 
@@ -308,5 +308,10 @@ class sm_globalsettings
     */
     public $TowerGateId;
 
+    /**
+    * @var Int32 限时贩售一共几种礼包类型  
+    */
+    public $activity_limitTsBuy_giftTypeNum;
+
 }
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-10-09 17:17:51
+ // 日期: 2024-10-10 14:35:52
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-10-09 17:17:51
+ // 日期: 2024-10-10 14:35:52
 ////////////////////
 
 

+ 8 - 7
Gameserver/App/process/ActiveProc.php

@@ -415,18 +415,19 @@ class ActiveProc {
         ctx()->privateState->limitTsBuy_RewardRecord = array();
         
         $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::LimitTsSale);
+        $day = $mo->ts;
         $startDay = TimeUtil::totalDays($mo->startTs);
         $nextDay = TimeUtil::totalDays();
      
         $num = $nextDay - $startDay;
-        $refershType = $num % 2; //余数只会是0 或 1; 0:两天后在刷新,1就是已经过了一天了,在过一天就刷新,当前时间减一天
-        ctx()->privateState->nextDayLogin = now();
-        if ($refershType == 1) {
-            ctx()->privateState->nextDayLogin = now() - 86400;
-        }
+        $refershType = $num % $day; //day 2天一刷新 余数只会是0 或 1; 0:两天后在刷新,1就是已经过了一天了,在过一天就刷新,当前时间减一天
+        ctx()->privateState->nextDayLogin = now() - 86400*$refershType;
+//        if ($refershType == 1) {
+//            ctx()->privateState->nextDayLogin = now() - 86400;
+//        }
       
-        $val = intval($num / 2);
-        $yushu = $val % 5;
+        $val = intval($num / $day);
+        $yushu = $val % glc()->activity_limitTsBuy_giftTypeNum;
         $type = $yushu + 1;
 
         $arr = GameConfig::activity_promopackinfo_type_getItemArray($type);

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

@@ -492,8 +492,10 @@ class UserProc {
         //2天一刷 
         $curDay = TimeUtil::totalDays();
         $nextDay = TimeUtil::totalDays(ctx()->privateState->nextDayLogin);
-                                    
-        if (ctx()->privateState->nextDayLogin > 0 && $curDay - $nextDay >= 2) {
+        
+        $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::LimitTsSale);
+        $day = $mo->ts;
+        if (ctx()->privateState->nextDayLogin > 0 && $curDay - $nextDay >= $day) {
             ActiveProc::ResetLimitTsBuy();
         }
     }