Forráskód Böngészése

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

王刚 11 hónapja
szülő
commit
6cd419ab02

+ 1 - 0
Gameserver/App/AutoLoad.php

@@ -22,6 +22,7 @@ class AutoLoad {
                 ROOTDIR . '/process/', #                                        # 逻辑处理代码
                 ROOTDIR . '/model/User/', #                                     # 数据结构定义
                 ROOTDIR . '/process/ActiveProc/',
+                ROOTDIR . '/Services/',
             );
             if (defined("CodeGen_Folder")) {
                 $incs[] = CodeGen_Folder;

+ 1 - 0
Gameserver/App/base/OpeCode.php

@@ -25,6 +25,7 @@ class OpeCode {
     const Hero = 66;
     const Email = 67;
     const Fight = 68;
+    const System = 69;
 
     // <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-06-20 17:10:35
+ // 日期: 2024-06-25 11:02:01
 ////////////////////
 
 /**

+ 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-06-07 18:24:30
+ // 日期: 2024-06-24 14:05:46
 ////////////////////
 
 

+ 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-06-07 18:24:30
+ // 日期: 2024-06-24 14:05:46
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-11 11:20:50
+ // 日期: 2024-06-21 18: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-06-14 14:24:46
+ // 日期: 2024-06-24 11:15:02
 ////////////////////
 
 

+ 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-06-14 14:24:46
+ // 日期: 2024-06-24 11:15:02
 ////////////////////
 
 

+ 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-06-20 14:54:52
+ // 日期: 2024-06-25 10:35:46
 ////////////////////
 
 
@@ -228,5 +228,10 @@ class sm_globalsettings
     */
     public $Relive_cost;
 
+    /**
+    * @var int 购买特权月卡后体力上限增加  
+    */
+    public $tili_RecoverrMax_Add_HonourCard;
+
 }
 

+ 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-06-20 11:05:46
+ // 日期: 2024-06-24 18:05:46
 ////////////////////
 
 

+ 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-06-20 11:05:46
+ // 日期: 2024-06-24 18:05:46
 ////////////////////
 
 

+ 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-06-20 15:05:46
+ // 日期: 2024-06-24 11:43:04
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-07 18:24:37
+ // 日期: 2024-06-20 17:35:46
 ////////////////////
 
 

+ 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-06-20 17:11:02
+ // 日期: 2024-06-25 10:49:10
 ////////////////////
 
 

+ 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-06-20 17:11:02
+ // 日期: 2024-06-25 10:49:10
 ////////////////////
 
 

+ 20 - 5
Gameserver/App/model/User/Info_UserBase.php

@@ -143,19 +143,33 @@ class Info_UserBase extends Object_ext {
         //ActiveProc::ChangeTili($amt);
         TaskProc::OnAccumulateTiliNum($amt);
         for ($i = 0; $i < $amt; $i++) {
-            if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < glc()->tili_RecoverrMax) {
+            if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < $this->GetTili_RecoverrMax()) {
                 $this->tili_ts -= glc()->tili_RecoverTS;
             } else {
                 $this->tili++;
             }
         }
     }
+    
+    /**
+     * 体力恢复的最大值(购买或者邮件领取的可以超出,超出后体力恢复失效)  
+     */
+    function GetTili_RecoverrMax() {
+        $maxTili = glc()->tili_RecoverrMax;
+        $monthTs = 30 * 24 * 60 * 60;
+        if(ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts < $monthTs){
+            $maxTili += glc()->tili_RecoverrMax_Add_HonourCard;
+        }
+        
+        return $maxTili;
+    }
 
     /**
      * 检查并修改体力ts的最小值.
      */
     function Reset_tilits() {
-        $min = now() - glc()->tili_RecoverTS * glc()->tili_RecoverrMax;
+        $maxTili = $this->GetTili_RecoverrMax();
+        $min = now() - glc()->tili_RecoverTS * $maxTili;
         if ($this->tili_ts < $min) {
             $this->tili_ts = $min;
         }
@@ -191,8 +205,9 @@ class Info_UserBase extends Object_ext {
      * @return int 计算当前可用体力值
      */
     function CurTili() {
+        $maxTili = $this->GetTili_RecoverrMax();       
         $rec = (now() - $this->tili_ts) / glc()->tili_RecoverTS;
-        $rec = glc()->tili_RecoverrMax < $rec ? glc()->tili_RecoverrMax : $rec;
+        $rec = $maxTili < $rec ? $maxTili : $rec;
         $t = $this->tili + $rec;
         return $t;
     }
@@ -240,11 +255,11 @@ class Info_UserBase extends Object_ext {
         if ($amt >= 0) {
             if ($this->cash - $amt >= 0) {
                 $this->cash -= $amt;
+                TaskProc::OnConsumeCashNum($amt);
                 return true;
             }
         }
-
-        TaskProc::OnConsumeCashNum($amt);
+        
         return false;
     }
 

+ 11 - 3
Gameserver/App/process/SystemProc.php

@@ -52,6 +52,12 @@ class SysMessageModel extends Object_ext {
 
     /** @var int */
     public $ts;
+    
+    /**
+     * 同时获取多个相同的东西,通关这个来控制 zset里member的唯一
+     * @var type
+     */
+    public $uniqueMask;
 
 }
 
@@ -106,7 +112,7 @@ class SystemProc {
     static function getSysMessage() {
         //客户端参数解析
         $ts = req()->paras[0];                                                   # 消息列表有效时间戳
-        $defaultwaitcont = 60;                                                  # 暂时使用60秒作为频率,若是有压力就调大些. 若是没有问题,可以调小些.
+        $defaultwaitcont = 30;                                                  # 暂时使用60秒作为频率,若是有压力就调大些. 若是没有问题,可以调小些.
         $itemDisplayTime = 7;                                                   # 7秒显示完一条消息
 
         $sysMessage = self::mem_getSysMsg_zset(req()->zoneid, $ts);
@@ -147,7 +153,7 @@ class SystemProc {
      */
     private static function mem_addSysMsg_zset($zoneid, $value) {
         $ts = $value->ts;
-        $key = MemKey_GameRun::Game_SysMsgByZone_zset($zoneid);
+        $key = MemKey_GameRun::Game_SysMsgByZone_zset($zoneid);             
         gMem()->zadd($key, array(json_encode($value) => $ts));                  # 插入消息
         gMem()->zremrangebyscore($key, 0, $ts - self::SYS_MSG_OUTTS);           # 清理过期数据
     }
@@ -159,10 +165,12 @@ class SystemProc {
      * @param array $datas
      */
     static function pushSysMessage($zoneid, $type, $datas) {
+        $randNum = mt_rand(1, now());
         $newMsg = new SysMessageModel(array(#                                   # 添加新系统消息
             'type' => $type,
             'datas' => $datas,
-            'ts' => now()
+            'ts' => now(),
+            'uniqueMask' => $randNum
         ));
         self::mem_addSysMsg_zset($zoneid, $newMsg);                             # 写入mem
     }

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

@@ -44,7 +44,8 @@ class UserProc {
     public static function delUserUid() {
         TestServer::deleteUserUId(req()->uid, req()->zoneid);
         FightProc::DeleteRankInvalidUser(req()->uid);
-
+        self::delRegRole(req()->zoneid, req()->uid, ctx()->baseInfo->name);
+        
         UserProc::updateUserInfo();
         $ret = array();
         return Resp::ok($ret);
@@ -279,6 +280,25 @@ class UserProc {
                             'plat' => $plat
                         ))->exec();
     }
+    
+    /**
+     * 
+     * @param type $zoneid
+     * @param type $userID
+     * @param type $nickname
+     * @param type $gender
+     * @param type $profile_img
+     * @param type $plat
+     * @return type
+     */
+    static function delRegRole($zoneid, $userID, $nickname) {             
+        return daoInst()->del('tab_rolename')
+                        ->data(array(
+                            'zoneid' => $zoneid,
+                            'userID' => $userID,
+                            'roleName' => $nickname,                          
+                        ))->exec();
+    }
 
     /**
      * 检测连续登录状态,重置必要字段[时间戳自动记录]

+ 28 - 0
Gameserver/App/util/dao.php

@@ -405,6 +405,21 @@ class dao {
         $this->setTable($table);
         return $this;
     }
+    
+    /**
+     * The insert method, call sql::insert().
+     *
+     * @param  string $table
+     * @access public
+     * @return object the dao object self.
+     */
+    public function del($table) {
+        $this->setMode('raw');
+        $this->setMethod('DELETE');
+        $this->sqlobj = sql::del($table);
+        $this->setTable($table);
+        return $this;
+    }
 
     /**
      * The replace method, call sql::replace().
@@ -1316,6 +1331,19 @@ class sql {
         $sqlobj->sql = "INSERT INTO $table SET ";
         return $sqlobj;
     }
+    
+    /**
+     * The sql is insert.
+     *
+     * @param  string $table
+     * @access public
+     * @return object the sql object.
+     */
+    public static function del($table) {
+        $sqlobj = self::factory();     
+        $sqlobj->sql = "DELETE FROM $table WHERE ";
+        return $sqlobj;
+    }
 
     /**
      * The sql is replace.