Przeglądaj źródła

fix: 体力ts检查修正.

王刚 1 rok temu
rodzic
commit
54e2dd5c2d

+ 11 - 0
Gameserver/App/model/User/Info_UserBase.php

@@ -141,6 +141,16 @@ class Info_UserBase extends Object_ext {
         }
     }
 
+    /**
+     * 检查并修改体力ts的最小值.
+     */
+    function Reset_tilits() {
+        $min = now() - glc()->tili_RecoverTS * glc()->tili_RecoverrMax;
+        if ($this->tili_ts < $min) {
+            $this->tili_ts = $min;
+        }
+    }
+
     /**
      * 扣除玩家体力
      * @param int $amt
@@ -172,6 +182,7 @@ class Info_UserBase extends Object_ext {
      */
     function CurTili() {
         $rec = (now() - $this->tili_ts) / glc()->tili_RecoverTS;
+        $rec = glc()->tili_RecoverrMax < $rec ? glc()->tili_RecoverrMax : $rec;
         $t = $this->tili + $rec;
         return $t;
     }

+ 1 - 1
Gameserver/App/process/UserProc.php

@@ -190,6 +190,7 @@ class UserProc {
             return $resp;
         } else {                                                                # 2.如果玩家已存在,则处理普通登录流程
             req()->game = $game;                                                # 给Req挂载玩家数据
+            $game->base()->Reset_tilits();                                      # 修正体力ts
             UserProc::checkContidays();                                         # 连续登录,状态检查
             //PayProc::m_refreshChargeOrders();                                   # 刷新订单, 多平台版本
             //PayProc::checkDeltest();                                            # 检查内侧充值记录(函数内部会只检查一次)
@@ -266,7 +267,6 @@ class UserProc {
         ShopProc::DailyShopItemRand();
         ShopProc::ShopDailyClear();
         //FightProc::FightDailyClear();
-        
     }
 
 // <editor-fold defaultstate="collapsed" desc="创建新用户">