Przeglądaj źródła

Merge branch 'dev' into tap

wanggangzero 5 miesięcy temu
rodzic
commit
a62fbad32b

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-11-28 09:12:24
+ // 日期: 2024-12-17 10:12:28
 ////////////////////
 
 namespace loyalsoft;
@@ -1039,6 +1039,15 @@ class GameConfig {
         return self::get_hash_item('activity_day7sign_newplayer', $itemid);
     }
     /**
+    * 全局参数2
+    * @return \sm_glc2
+    */
+    public static function glc2()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'glc2');
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-13 11:18:46
+ // 日期: 2024-12-17 10:12:28
 ////////////////////
 
 /**
@@ -1037,6 +1037,15 @@ class GameConfig {
         return self::get_hash_item('activity_day7sign_newplayer', $itemid);
     }
     /**
+    * 全局参数2
+    * @return \glc2
+    */
+    public static function glc2()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'glc2');
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 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-12-12 21:04:29
+ // 日期: 2024-12-16 10:05:55
 ////////////////////
 
 

+ 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-12-12 21:04:29
+ // 日期: 2024-12-16 10:05:55
 ////////////////////
 
 

+ 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-12-05 17:30:57
+ // 日期: 2024-12-16 09:37:06
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-13 10:20:46
+ // 日期: 2024-12-13 13:57:12
 ////////////////////
 
 

+ 32 - 0
Gameserver/App/model/Const/sm_glc2.php

@@ -0,0 +1,32 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-12-17 09:33:54
+////////////////////
+
+
+/**
+ * Static Model sm_glc2 全局参数2
+ */
+class sm_glc2
+{
+
+    /**
+    * @var Int32 免费抽奖次数  
+    */
+    public $activity_lottery_FreeNum;
+
+    /**
+    * @var Int32 仙树抽奖广告  
+    */
+    public $activity_lottery_GuanggaoNum;
+
+    /**
+    * @var Int32 仙树抽奖倒计时时间  
+    */
+    public $activity_lottery_GuanggaoDownTs;
+
+}
+

+ 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-12-11 18:05:55
+ // 日期: 2024-12-17 09:33:54
 ////////////////////
 
 

+ 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-12-12 19:05:55
+ // 日期: 2024-12-16 16:05:55
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 19:05:55
+ // 日期: 2024-12-16 16:05:55
 ////////////////////
 
 

+ 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-12-12 14:37:01
+ // 日期: 2024-12-17 10:10:19
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-03 10:48:11
+ // 日期: 2024-12-16 10:23:40
 ////////////////////
 
 

+ 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-12-06 18:05:55
+ // 日期: 2024-12-13 16:15:17
 ////////////////////
 
 

+ 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-12-12 21:02:21
+ // 日期: 2024-12-17 09:41:22
 ////////////////////
 
 

+ 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-12-12 21:02:21
+ // 日期: 2024-12-17 09:41:22
 ////////////////////
 
 

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

@@ -330,6 +330,18 @@ class Info_PrivateState extends Object_ext {
      * @var type
      */
     public $lotteryNum = 0;
+    
+    /**
+     * 转盘抽奖免费次数
+     * @var type
+     */
+    public $lotteryNum_free = 0;
+   
+    /*
+     * 
+     */
+    public $activity_lottery_guanggaoTs = 0;
+
 
     /**
      * 抽奖得到过紫色品阶的宝石

+ 30 - 13
Gameserver/App/process/ActiveProc.php

@@ -120,24 +120,40 @@ class ActiveProc {
         my_Assert(in_array($num, $arr), ErrCode::active_lotteryNumErr);
         my_Assert(ctx()->privateState->lotteryNum + $num <= glc()->activity_lottery_allNum, ErrCode::active_lotteryNumLimit);
 
-        $cost = "";
-        if ($num == 1) {
-            $cost = glc()->activity_lottery_tree_one_cost;
-        } else {
-            $cost = glc()->activity_lottery_tree_ten_cost;
+        $costTag = true;
+        if ($num == 1 && ctx()->privateState->lotteryNum_free < GameConfig::glc2()->activity_lottery_FreeNum + GameConfig::glc2()->activity_lottery_GuanggaoNum) {
+            $costTag = false;            
+        }
+
+        if($num == 1){
+            ctx()->privateState->lotteryNum_free += 1;
+        }
+        
+        if ($costTag) {
+            $cost = "";
+            if ($num == 1) {
+                $cost = glc()->activity_lottery_tree_one_cost;
+            } else {
+                $cost = glc()->activity_lottery_tree_ten_cost;
+            }
+            my_Assert($cost != "", ErrCode::active_lotteryCostErr);
+            $costArr = explode(',', $cost);
+            $item = ctx()->store->items;
+            $costId = $costArr[0];
+            $costNum = $costArr[1];
+            my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum, ErrCode::notenough_item);
+            ctx()->store->removeItem($costId, $costNum);
+        }
+
+        if (ctx()->privateState->lotteryNum_free > GameConfig::glc2()->activity_lottery_FreeNum && ctx()->privateState->lotteryNum_free <= GameConfig::glc2()->activity_lottery_FreeNum + GameConfig::glc2()->activity_lottery_GuanggaoNum) {
+            my_Assert(now() - ctx()->privateData(true)->activity_lottery_guanggaoTs >= GameConfig::glc2()->activity_lottery_GuanggaoDownTs, ErrCode::user_shop_DownTsLimit);
+            ctx()->privateData(true)->activity_lottery_guanggaoTs = now();                
         }
-        my_Assert($cost != "", ErrCode::active_lotteryCostErr);
-        $costArr = explode(',', $cost);
-        $item = ctx()->store->items;
-        $costId = $costArr[0];
-        $costNum = $costArr[1];
-        my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum, ErrCode::notenough_item);
-        ctx()->store->removeItem($costId, $costNum);
 
         if (ctx()->privateState->lotteryNum < glc()->activity_lottery_allNum) {
             ctx()->privateState->lotteryNum += $num;
         }
-
+      
         $rewardList = array();
         $dic = GameConfig::activity_lottery_tree();
         for ($i = 0; $i < $num; $i++) {
@@ -614,4 +630,5 @@ class ActiveProc {
                     'reward_equip' => StoreProc::$reward_equip,
         ));
     }
+
 }

+ 19 - 15
Gameserver/App/process/FightProc.php

@@ -255,19 +255,21 @@ class FightProc {
      */
     public static function FightSweep() {
         //list($gateId) = req()->paras;
+// 2024.12.17 扫荡修改: 前3次免费, 后面可以一直看广告免费.
 
-        $passGateId = ctx()->gates->maxPassGateId();
-        my_Assert($passGateId != 0, ErrCode::gate_NoSweep);
-        $mo = GameConfig::gate_getItem($passGateId);
+        $passGateId = ctx()->gates->maxPassGateId();                            # 最高通关关卡id
+        my_Assert($passGateId != 0, ErrCode::gate_NoSweep);                     # 还没有通关关卡
+        $mo = GameConfig::gate_getItem($passGateId);                            # 关卡配置数据
+        my_Assert(null != $mo, ErrCode::err_const_no);                          # 防御: 关卡配置找不到
         $gateName = $mo->gateName;
         $costTili = glc()->sweep_cost_tili;
         $curTili = ctx()->baseInfo->CurTili();
-        my_Assert($curTili >= $costTili, ErrCode::notenough_tili);
-
-        if (ctx()->privateState->honourCardShop_ts == 0) {
-            $max = glc()->sweepMaxNum;
-            my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
-        }
+        my_Assert($curTili >= $costTili, ErrCode::notenough_tili);              # 检查: 体力不足
+        # 2024.12.17 去掉了次数限制, 故这段废弃
+//        if (ctx()->privateState->honourCardShop_ts == 0) {
+//            $max = glc()->sweepMaxNum;
+//            my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
+//        }
 
         ctx()->gates->fightSweepNum += 1;
         ctx()->baseInfo->Consume_tili($costTili);
@@ -304,9 +306,9 @@ class FightProc {
 
         if ($wavesMo->rewardItem != null) {
             $reward = StoreProc::Distribute_Rewards($wavesMo->rewardItem);
-            StoreProc::AddMultiItemInStore($reward);            
+            StoreProc::AddMultiItemInStore($reward);
         }
-        
+
         if ($wavesMo->rewardGem != null) {
             $goodsStr = self::sweepRandReward($wavesMo->rewardGem);
             $str = explode(';', $goodsStr);
@@ -426,6 +428,9 @@ class FightProc {
         return Resp::ok(array("tili" => ctx()->baseInfo->tili, "tili_ts" => ctx()->baseInfo->tili_ts));
     }
 
+    /**
+     * 战斗模块 - 每日清理变量
+     */
     public static function FightDailyClear() {
         //ctx()->gates->xunluo_quick_buyRecord = 0;
         ctx()->gates->fightSweepNum = 0;
@@ -625,9 +630,8 @@ class FightProc {
 
         if ($tag) {
             my_Assert(!in_array($mask, $gateInfo->FirstReward), ErrCode::gate_GatePriceHasReceive);
-            $gateInfo->FirstReward[] = $mask;                 
+            $gateInfo->FirstReward[] = $mask;
             StoreProc::AddMultiItemInStore($prize);
-                       
         }
         ctx()->gates->GateList->$gateId = $gateInfo;
         TaskProc::OnReceiveGateBoxReward();
@@ -721,7 +725,7 @@ class FightProc {
         if ($waveMo->rewardItem != null) {
             $reward = StoreProc::Distribute_Rewards($waveMo->rewardItem);
             StoreProc::AddMultiItemInStore($reward);
-            
+
 //            if(count(StoreProc::$reward_equip) > 0){
 //                self::funUnlock_equip_firstTime();
 //            }
@@ -1043,7 +1047,7 @@ class FightProc {
             if ($mo->funTypeId == 5 && $mo->id == Enum_SubFunType::Day7_Sign) {
                 ActiveProc::DailyResetDay7Task(true);
             }
-            
+
             if ($mo->funTypeId == 21 && $mo->id == Enum_SubFunType::Day7_Sign_NewPlayer) {
                 ActiveProc::InitDay7_Sign_NewPlayer(true);
                 ctx()->privateState->day7_drawed_newPlayer_startTs = now();

+ 15 - 3
Gameserver/App/process/PayProc.php

@@ -57,7 +57,7 @@ class PayProc {
             case CmdCode::cmd_mpay_UserRechargeDrawPrize:                       # 8814 充值领奖励 2022.10
                 return self::UserRechargeDrawPrize();
             case CmdCode::cmd_mpay_NewFirstRecharge:                            # 8815 新首充功能 2022.10
-                return self::NewFirstRecharge();           
+                return self::NewFirstRecharge();
             default:
                 return Resp::err(ErrCode::cmd_err);
         }
@@ -498,6 +498,18 @@ class PayProc {
 // </editor-fold>
 
         $user->baseInfo->charge_amt += $order->amount;                          # 统计下累充金额
+
+        if ($order->amount > 0) {
+            if (ctx()->privateState->firstRecharge_receiveTag == 0) {
+                ctx()->privateState->firstRechargeUI_OpenTip = 1;
+                ctx()->privateState->firstRecharge_receiveTag = 1;
+            }
+
+//            if (ctx()->privateState->firstRecharge_receiveTag < 1) {
+//                ctx()->privateState->firstRecharge_receiveTag = 1;
+//            }
+        }
+
         ctx($user);
 
         return [true, $mod];
@@ -652,7 +664,7 @@ class PayProc {
                             'goods' => $item->goods, #                                  # 发货内容
                             'count' => $product_count, #                                # 发货数量
                         )
-                );
+        );
     }
 
     /**
@@ -1029,7 +1041,7 @@ class PayProc {
                     'reward' => StoreProc::$reward,
                     'reward_Gem' => StoreProc::$reward_Gem,
                     'reward_equip' => StoreProc::$reward_equip,
-                    'heros'=> ctx()->heros,
+                    'heros' => ctx()->heros,
         ));
     }
 

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

@@ -518,16 +518,9 @@ class ShopProc {
 
         StoreProc::AddMultiItemInStore($reward);
         ctx()->baseInfo->accumulateYuanBao += $addYuanbao;
-        ctx()->baseInfo->charge_amt += $mo->price;
+        //ctx()->baseInfo->charge_amt += $mo->price;
         ctx()->privateState->cashShopReceived[] = $typeId;
-
-        if (ctx()->privateState->firstRecharge_receiveTag == 0) {
-            ctx()->privateState->firstRechargeUI_OpenTip = 1;
-        }
-
-        if (ctx()->privateState->firstRecharge_receiveTag < 1) {
-            ctx()->privateState->firstRecharge_receiveTag = 1;
-        }
+      
         TaskProc::OnRecharge();
         return $reward;
     }