Explorar o código

Merge branch 't2' into dev

王刚 %!s(int64=2) %!d(string=hai) anos
pai
achega
529b189be9
Modificáronse 43 ficheiros con 726 adicións e 191 borrados
  1. 1 1
      Gameserver/Amfphp/Services/AppServer.php
  2. 56 56
      Gameserver/Amfphp/Services/TestServer.php
  3. 9 1
      Gameserver/Amfphp/base/CmdCode.php
  4. 7 0
      Gameserver/Amfphp/base/ErrCode.php
  5. 4 0
      Gameserver/Amfphp/config.php
  6. 49 1
      Gameserver/Amfphp/configs/GameConfig.php
  7. 4 1
      Gameserver/Amfphp/configs/config_and.php
  8. 2 0
      Gameserver/Amfphp/configs/config_ios.php
  9. 2 0
      Gameserver/Amfphp/configs/config_web.php
  10. 4 3
      Gameserver/Amfphp/main.php
  11. 49 1
      Gameserver/Amfphp/model/Const/GameConfig.php
  12. 1 1
      Gameserver/Amfphp/model/Const/globalsettings.php
  13. 1 1
      Gameserver/Amfphp/model/Const/primordial_data.php
  14. 1 1
      Gameserver/Amfphp/model/Const/sm_drop.php
  15. 32 0
      Gameserver/Amfphp/model/Const/sm_eHeroAddProperties.php
  16. 1 1
      Gameserver/Amfphp/model/Const/sm_gate.php
  17. 1 1
      Gameserver/Amfphp/model/Const/sm_gate_zone.php
  18. 1 1
      Gameserver/Amfphp/model/Const/sm_hero.php
  19. 1 1
      Gameserver/Amfphp/model/Const/sm_hero_levelexp.php
  20. 2 2
      Gameserver/Amfphp/model/Const/sm_item_base.php
  21. 1 1
      Gameserver/Amfphp/model/Const/sm_item_stones.php
  22. 1 1
      Gameserver/Amfphp/model/Const/sm_item_stones_type.php
  23. 1 1
      Gameserver/Amfphp/model/Const/sm_item_taskcard.php
  24. 1 1
      Gameserver/Amfphp/model/Const/sm_item_taskcard_type.php
  25. 1 1
      Gameserver/Amfphp/model/Const/sm_item_weapon.php
  26. 6 1
      Gameserver/Amfphp/model/Const/sm_item_yanling.php
  27. 1 1
      Gameserver/Amfphp/model/Const/sm_playerlevel.php
  28. 1 1
      Gameserver/Amfphp/model/Const/sm_plot.php
  29. 42 0
      Gameserver/Amfphp/model/Const/sm_rank_playerlevel_reward.php
  30. 1 1
      Gameserver/Amfphp/model/Const/sm_weaponextra_level.php
  31. 57 0
      Gameserver/Amfphp/model/Const/sm_yanling_compose.php
  32. 1 1
      Gameserver/Amfphp/model/Const/sm_yanlingextra_level.php
  33. 2 2
      Gameserver/Amfphp/model/User/Info_PrivateState.php
  34. 2 0
      Gameserver/Amfphp/model/User/Info_UserBase.php
  35. 94 24
      Gameserver/Amfphp/process/AuctionProc.php
  36. 49 1
      Gameserver/Amfphp/process/EmailProc.php
  37. 1 1
      Gameserver/Amfphp/process/EventProc/CornerSignEventProc.php
  38. 90 12
      Gameserver/Amfphp/process/RankProc.php
  39. 36 36
      Gameserver/Amfphp/process/UserProc.php
  40. 24 2
      Gameserver/Amfphp/test.php
  41. 9 7
      Gameserver/Amfphp/util/MongoUtil.php
  42. 1 1
      Gameserver/Amfphp/util/SelfChecker.php
  43. 76 22
      patchTTT.diff

+ 1 - 1
Gameserver/Amfphp/Services/AppServer.php

@@ -86,7 +86,7 @@ class AppServer {
      * @param Resp $resp
      */
     private static function LogCmdMongo($resp) {
-        $tablename = 'ylsj2019.tab_op_log' . date('Ym');                        # 当月的日志表名 
+        $tablename = 'tab_op_log' . date('Ym');                        # 当月的日志表名 
         $arr = array(
             'uid' => req()->uid,
             'req' => req()->storage(),

+ 56 - 56
Gameserver/Amfphp/Services/TestServer.php

@@ -38,7 +38,7 @@ class TestServer {
 //----------------------------------------------------
 
 
-    public function testRedisLua($key, $value) {
+    static public function testRedisLua($key, $value) {
         $mem = gMem();
         $script = <<<SCR
 if redis.call("get",KEYS[1]) == ARGV[1]
@@ -55,7 +55,7 @@ SCR;
         $mem->close();
     }
 
-    public function testBinSearch($v) {
+    static public function testBinSearch($v) {
         $arr = array(1, 2, 3, 4, 4, 11, 12, 124);
         $start = 0;
         $end = count($arr) - 1;
@@ -92,17 +92,17 @@ SCR;
 
         echo '邮件已经成功发送';
     }
-    
+
     /**
      * 删除账号-区别内外网
      * @param type $uid
      * @param type $type
      */
-    public function deleteUserUId($uid,$zoneid) {    
+    static public function deleteUserUId($uid, $zoneid) {
         $mem = gMem();
-        
+
         $list = array();
-        
+
         $zoneKey = MemKey_User::Union_PlayedZoneInfo_normal($uid);
         $list[] = $zoneKey;
         $publicKey = MemKey_User::Union_PublicState_hash($uid);
@@ -121,67 +121,67 @@ SCR;
         $list[] = $PVP_DefensiveLogKey;
         $SigKey = MemKey_User::Sig($zoneid, $uid);
         $list[] = $SigKey;
-        
+
         $CurIdKey = MemKey_User::Mail_CurId_int($zoneid, $uid);
         $list[] = $CurIdKey;
         $SysRecordKey = MemKey_User::Mail_SysRecord_set($zoneid, $uid);
         $list[] = $SysRecordKey;
         $QueueKey = MemKey_User::Mail_Queue_hash($zoneid, $uid);
         $list[] = $QueueKey;
-        
+
         foreach ($list as $key) {
-            if($mem->exists($key)){
+            if ($mem->exists($key)) {
                 $mem->delete($key);
             }
         }
-        
-        
-      
-        
+
+
+
+
         /*
-        if($type=='true'){//默认外网          
-            $userUid = "u-".$uid."-".$zoneid."-g";
-            //u-EA74E58DCEB076ACC2D824684499CDA2-1-m-ci
-            //u-EA74E58DCEB076ACC2D824684499CDA2-1-m-q
-            //u-EA74E58DCEB076ACC2D824684499CDA2-1-m-s
-            //u-EA74E58DCEB076ACC2D824684499CDA2-1-s-cp
-                  
-            $userUidCi = "u-".$uid."-".$zoneid."-m-ci";
-            $userUidQ = "u-".$uid."-".$zoneid."-m-q";
-            $userUidS = "u-".$uid."-".$zoneid."-m-s";
-            $userUidCp = "u-".$uid."-".$zoneid."-s-cp";
-            if($mem->exists($userUidCp)){
-                $mem->delete($userUidCp);
-            } 
-        } else {         
-            $userUid = "user-".$uid."-zone".$zoneid."-gameinfo";          
-            $userUidCi = "user-".$uid."-zone".$zoneid."-mail-curid";
-            $userUidQ = "user-".$uid."-zone".$zoneid."-mail-queue";
-            $userUidS = "user-".$uid."-zone".$zoneid."-mail-sysrecord";
-            $userUidGuild = "user-".$uid."-zone".$zoneid."-guild";   
-            if($mem->exists($userUidGuild)){
-                $mem->delete($userUidGuild);
-            }          
-        }
-              
-        
-        if($mem->exists($userUid)){
-            $mem->delete($userUid);
-        }
-        
-        if($mem->exists($userUidCi)){
-            $mem->delete($userUidCi);
-        }
-        
-        if($mem->exists($userUidQ)){
-            $mem->delete($userUidQ);
-        }
-        
-        if($mem->exists($userUidS)){
-            $mem->delete($userUidS);
-        }
-   */
+          if($type=='true'){//默认外网
+          $userUid = "u-".$uid."-".$zoneid."-g";
+          //u-EA74E58DCEB076ACC2D824684499CDA2-1-m-ci
+          //u-EA74E58DCEB076ACC2D824684499CDA2-1-m-q
+          //u-EA74E58DCEB076ACC2D824684499CDA2-1-m-s
+          //u-EA74E58DCEB076ACC2D824684499CDA2-1-s-cp
+
+          $userUidCi = "u-".$uid."-".$zoneid."-m-ci";
+          $userUidQ = "u-".$uid."-".$zoneid."-m-q";
+          $userUidS = "u-".$uid."-".$zoneid."-m-s";
+          $userUidCp = "u-".$uid."-".$zoneid."-s-cp";
+          if($mem->exists($userUidCp)){
+          $mem->delete($userUidCp);
+          }
+          } else {
+          $userUid = "user-".$uid."-zone".$zoneid."-gameinfo";
+          $userUidCi = "user-".$uid."-zone".$zoneid."-mail-curid";
+          $userUidQ = "user-".$uid."-zone".$zoneid."-mail-queue";
+          $userUidS = "user-".$uid."-zone".$zoneid."-mail-sysrecord";
+          $userUidGuild = "user-".$uid."-zone".$zoneid."-guild";
+          if($mem->exists($userUidGuild)){
+          $mem->delete($userUidGuild);
+          }
+          }
+
+
+          if($mem->exists($userUid)){
+          $mem->delete($userUid);
+          }
+
+          if($mem->exists($userUidCi)){
+          $mem->delete($userUidCi);
+          }
+
+          if($mem->exists($userUidQ)){
+          $mem->delete($userUidQ);
+          }
+
+          if($mem->exists($userUidS)){
+          $mem->delete($userUidS);
+          }
+         */
         echo '删除账号成功';
     }
-   
+
 }

+ 9 - 1
Gameserver/Amfphp/base/CmdCode.php

@@ -857,7 +857,13 @@ class CmdCode {
     /**
      * 排行榜 - 通关榜
      */
-    const rank_passgate_getrank = 6605;
+    //const rank_passgate_getrank = 6605;
+
+    /**
+     * 排行榜--玩家等级榜信息
+     */
+    const rank_playerlevel_getrank = 6605;
+
 
     /**
      * 排行榜 - 领取通关榜突破奖励
@@ -874,6 +880,8 @@ class CmdCode {
      */
     const rank_passgate_breachLog = 6608;
 
+    
+    
     //
     // </editor-fold>
     //

+ 7 - 0
Gameserver/Amfphp/base/ErrCode.php

@@ -1221,6 +1221,13 @@ class ErrCode {
      * 出价低于当前价
      */
     const auction_failprice = 4708;
+    
+    /**
+     * 上传拍品价格太低
+     */
+    const auction_loadpricelow = 4709;
+
+
 // </editor-fold>
     //
     // <editor-fold defaultstate="collapsed" desc="公会错误码 - 48xx开始">

+ 4 - 0
Gameserver/Amfphp/config.php

@@ -90,14 +90,18 @@ abstract class config {
             $this->nosql->host = '192.168.10.16';                               # host/ip
             $this->nosql->port = 6004;                                          # 端口
             $this->nosql->pwd = 'wanggang1985';                                 # 密钥 
+            $this->nosql->db = 0;                                               # db索引
         }
     }
 
     private function _InitMongoDB() {
+        $this->mongo = new \stdClass();
         if (GAME_ONLINE) {
             $this->_InitOuterMongoDB();
         } else {
             $this->mongodb = "mongodb://ylsj2019eXNsag==:wanggang1985@192.168.10.16:27017/?authSource=ylsj2019";
+            $this->mongo->db = "ylsj2019_t2";
+            $this->mongo->conn = "mongodb://gwang:wanggang1985@localhost:23333/?authSource=admin";
         }
     }
 

+ 49 - 1
Gameserver/Amfphp/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-23 16:11:44
+ // 日期: 2022-06-27 17:26:43
 ////////////////////
 
 namespace loyalsoft;
@@ -1754,6 +1754,54 @@ class GameConfig {
         return self::get_hash_item('map_scene_zoneid', $key);
     }
     /**
+    * 言灵套装表
+    * @return \yanling_compose
+    */
+    public static function yanling_compose()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'yanling_compose');
+    }
+    /**
+    * @return \sm_yanling_compose yanling_compose item数据 
+    */
+    public static function yanling_compose_getItem($itemid)
+    { 
+        return self::get_hash_item('yanling_compose', $itemid);
+    }
+    /**
+    * 加成属性
+    * @return \eHeroAddProperties
+    */
+    public static function eHeroAddProperties()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'eHeroAddProperties');
+    }
+    /**
+    * @return \sm_eHeroAddProperties eHeroAddProperties item数据 
+    */
+    public static function eHeroAddProperties_getItem($itemid)
+    { 
+        return self::get_hash_item('eHeroAddProperties', $itemid);
+    }
+    /**
+    * 玩家等级排行奖励表
+    * @return \rank_playerlevel_reward
+    */
+    public static function rank_playerlevel_reward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'rank_playerlevel_reward');
+    }
+    /**
+    * @return \sm_rank_playerlevel_reward rank_playerlevel_reward item数据 
+    */
+    public static function rank_playerlevel_reward_getItem($itemid)
+    { 
+        return self::get_hash_item('rank_playerlevel_reward', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 4 - 1
Gameserver/Amfphp/configs/config_and.php

@@ -30,7 +30,7 @@ class config_and extends config {
     protected function _InitOuterNetPaydb() {
         $this->paydb->host = '172.17.16.5';
         $this->paydb->port = '3306';
-        $this->paydb->name = 'ylsj2019_pay';
+        $this->paydb->name = 'ylsj2019_pay_t2';
         $this->paydb->user = 'ylsjMTY0LjkyLjE5NC4x';
         $this->paydb->password = 'wanggang1985';
     }
@@ -42,6 +42,7 @@ class config_and extends config {
         $this->nosql->host = "172.17.16.5";                                       # host/ip
         $this->nosql->port = 6379;                                              # 端口
         $this->nosql->pwd = 'wanggang1985';                                     # 密钥
+        $this->nosql->db = 2;                                                   # db索引
     }
 
     /**
@@ -49,6 +50,8 @@ class config_and extends config {
      */
     protected function _InitOuterMongoDB() {
         $this->mongodb = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@172.17.16.5:23333/?authSource=ylsj2019";
+        $this->mongo->db = "ylsj2019_t2";
+        $this->mongo->conn = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@172.17.16.5:23333/?authSource=ylsj2019";
     }
 
 }

+ 2 - 0
Gameserver/Amfphp/configs/config_ios.php

@@ -43,6 +43,8 @@ class config_ios extends config {
      */
     protected function _InitOuterMongoDB() {
         $this->mongodb = "mongodb://gwang:wanggang1985@localhost:27017/?authSource=admin";
+        $this->mongo->db = "ylsj2019";
+        $this->mongo->conn = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@192.168.10.16:27017/?authSource=ylsj2019";
     }
 
 }

+ 2 - 0
Gameserver/Amfphp/configs/config_web.php

@@ -42,6 +42,8 @@ class config_web extends config {
      */
     protected function _InitOuterMongoDB() {
         $this->mongodb = "mongodb://gwang:wanggang1985@localhost:27017/?authSource=admin";
+        $this->mongo->db = "ylsj2019";
+        $this->mongo->conn = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@192.168.10.16:27017/?authSource=ylsj2019";
     }
 
 }

+ 4 - 3
Gameserver/Amfphp/main.php

@@ -4,7 +4,7 @@ namespace loyalsoft;
 
 header('Cache-Control: no-store');                                              # 防御缓存设施
 header('Host:' . PHP_OS . "-" . (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : ""));   # 这里提取服务器地址返给客户端,方便留意负载均衡/弹性扩容的效果
-header('PoweredBy: PHP' . PHP_VERSION);
+header('PoweredBy: PHP-' . PHP_VERSION);
 
 $GLOBALS['OS'] = "win32";                                                       # os,      used by JsonUtil::encode()
 
@@ -65,7 +65,7 @@ function gMem() {
 //            $cmem->auth($nosql->pwd);
 //        } else {
         $cmem = new CRedisUtil();
-        $cmem->conn($nosql->host, $nosql->port, $nosql->pwd);
+        $cmem->conn($nosql->host, $nosql->port, $nosql->pwd, $nosql->db);
 
 //        }
     }
@@ -80,7 +80,8 @@ function gMongo() {
     static $mu = null;
     if (null == $mu) {
         $mu = new MongoUtil();
-        $mgr = $mu->conn(config::Inst()->mongodb);
+        $mc = config::Inst()->mongo;
+        $mgr = $mu->conn($mc->conn, $mc->db);
         if ($mgr === false) {
             CLog::err("MongoDB连接异常!");
         }

+ 49 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-25 17:33:15
+ // 日期: 2022-06-29 17:28:19
 ////////////////////
 
 /**
@@ -1752,6 +1752,54 @@ class GameConfig {
         return self::get_hash_item('map_scene_zoneid', $key);
     }
     /**
+    * 言灵套装表
+    * @return \yanling_compose
+    */
+    public static function yanling_compose()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'yanling_compose');
+    }
+    /**
+    * @return \sm_yanling_compose yanling_compose item数据 
+    */
+    public static function yanling_compose_getItem($itemid)
+    { 
+        return self::get_hash_item('yanling_compose', $itemid);
+    }
+    /**
+    * 加成属性
+    * @return \eHeroAddProperties
+    */
+    public static function eHeroAddProperties()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'eHeroAddProperties');
+    }
+    /**
+    * @return \sm_eHeroAddProperties eHeroAddProperties item数据 
+    */
+    public static function eHeroAddProperties_getItem($itemid)
+    { 
+        return self::get_hash_item('eHeroAddProperties', $itemid);
+    }
+    /**
+    * 玩家等级排行奖励表
+    * @return \rank_playerlevel_reward
+    */
+    public static function rank_playerlevel_reward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'rank_playerlevel_reward');
+    }
+    /**
+    * @return \sm_rank_playerlevel_reward rank_playerlevel_reward item数据 
+    */
+    public static function rank_playerlevel_reward_getItem($itemid)
+    { 
+        return self::get_hash_item('rank_playerlevel_reward', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 1 - 1
Gameserver/Amfphp/model/Const/globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-06-07 14:43:48
+ // 日期: 2022-06-17 09:55:10
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/primordial_data.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-26 14:55:18
+ // 日期: 2022-06-24 13:52:12
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_drop.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-03-25 15:17:11
+ // 日期: 2022-06-28 16:29:04
 ////////////////////
 
 

+ 32 - 0
Gameserver/Amfphp/model/Const/sm_eHeroAddProperties.php

@@ -0,0 +1,32 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2022-06-23 16:38:37
+////////////////////
+
+
+/**
+ * Static Model eHeroAddProperties 加成属性
+ */
+class sm_eHeroAddProperties
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $typeId;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $name;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $etc;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-28 16:35:47
+ // 日期: 2022-06-14 16:16:16
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gate_zone.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-17 12:02:38
+ // 日期: 2022-06-14 16:18:52
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-24 15:58:58
+ // 日期: 2022-06-24 14:53:10
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_hero_levelexp.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-21 14:42:31
+ // 日期: 2022-06-08 13:51:14
 ////////////////////
 
 

+ 2 - 2
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-25 15:44:20
+ // 日期: 2022-06-29 15:42:52
 ////////////////////
 
 
@@ -129,7 +129,7 @@ class sm_item_base
     public $channel;
 
     /**
-    * @var Int32 竞拍初始价格不得低于此价格 default(0) 
+    * @var String 竞拍初始价格不得低于此价格 default(0) 
     */
     public $auctionPrice;
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_stones.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-16 09:29:50
+ // 日期: 2022-06-29 15:44:53
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_stones_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-16 09:29:50
+ // 日期: 2022-06-29 15:44:53
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-24 11:15:29
+ // 日期: 2022-06-14 11:29:18
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-24 11:15:29
+ // 日期: 2022-06-14 11:29:18
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_weapon.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-16 17:40:30
+ // 日期: 2022-05-31 17:47:31
 ////////////////////
 
 

+ 6 - 1
Gameserver/Amfphp/model/Const/sm_item_yanling.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-28 17:14:43
+ // 日期: 2022-06-29 15:05:16
 ////////////////////
 
 
@@ -23,6 +23,11 @@ class sm_item_yanling
     */
     public $type;
 
+    /**
+    * @var Int32 套系id default(0) 
+    */
+    public $composeId;
+
     /**
     * @var Int32 下一星级得言灵id-------废弃 default(0) 
     */

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_playerlevel.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-21 14:42:36
+ // 日期: 2022-05-31 10:24:28
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_plot.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-24 11:16:36
+ // 日期: 2022-06-14 11:31:08
 ////////////////////
 
 

+ 42 - 0
Gameserver/Amfphp/model/Const/sm_rank_playerlevel_reward.php

@@ -0,0 +1,42 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2022-06-27 14:43:27
+////////////////////
+
+
+/**
+ * Static Model rank_playerlevel_reward 玩家等级排行奖励表
+ */
+class sm_rank_playerlevel_reward
+{
+
+    /**
+    * @var Int32 编号 default(0) 
+    */
+    public $id;
+
+    /**
+    * @var Int32 达成条件(关卡id)  
+    */
+    public $condition;
+
+    /**
+    * @var String 奖励  
+    */
+    public $reward;
+
+    /**
+    * @var String 备注  
+    */
+    public $desc;
+
+    /**
+    * @var DateTime 修改时间 default(CURRENT_TIMESTAMP) 
+    */
+    public $lastupdate;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_weaponextra_level.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-21 14:42:46
+ // 日期: 2022-05-31 17:46:48
 ////////////////////
 
 

+ 57 - 0
Gameserver/Amfphp/model/Const/sm_yanling_compose.php

@@ -0,0 +1,57 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2022-06-29 17:20:23
+////////////////////
+
+
+/**
+ * Static Model yanling_compose 言灵套装表
+ */
+class sm_yanling_compose
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $tid;
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    */
+    public $typeId;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $name;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $two_compose;
+
+    /**
+    * @var String 2套系属性描述  
+    */
+    public $two_desc;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $three_compose;
+
+    /**
+    * @var String 3套系属性描述  
+    */
+    public $three_desc;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $etc;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_yanlingextra_level.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-27 18:00:31
+ // 日期: 2022-06-29 15:03:59
 ////////////////////
 
 

+ 2 - 2
Gameserver/Amfphp/model/User/Info_PrivateState.php

@@ -80,11 +80,11 @@ class Info_PrivateState extends Object_ext {
     public $RankFpowerRewardRec = array();
 
     /**
-     * 排行榜, 通关记录突破奖励领取记录
+     * 排行榜, 通关记录突破奖励领取记录----改成了玩家等级榜
      * @var type
      */
     public $RankPassGateRewardRec = array();
-
+    
     /**
      * @var int 上次检查被挑战记录的时间戳
      */

+ 2 - 0
Gameserver/Amfphp/model/User/Info_UserBase.php

@@ -279,6 +279,8 @@ class Info_UserBase extends Object_ext {
             TaskProc::OnUserLevelUp($this->level);                              # 通知任务模块,这里应该有事件模块
             EventProc::OnUserLevelup($initLevel, $this->level);                 # 事件模块          
             StatisticsProc::TargetStatistics(Enum_TargetStatistics::userlevel, $this->level,$initLevel);
+            
+            RankProc::recordPlayerLevelInfo(req()->uid, $this->level, req()->zoneid);
         }
     }
 

+ 94 - 24
Gameserver/Amfphp/process/AuctionProc.php

@@ -87,7 +87,11 @@ class AuctionProc {
         my_Assert(ctx()->baseInfo->cash >= $buyoutPrice, ErrCode::notenough_cash_msg);
         //扣除钻石--交易费用 + 手续费
         ctx()->base()->Consume_Cash($buyoutPrice);
-        //ctx()->baseInfo->cash -= $buyoutPrice; 
+        $sList = explode(',', $aucItem->contents);
+        if($aucItem->currpeopleid != null){//竞拍玩家邮件返回钻石
+            EmailProc::SendAuctionItemsBidCashFallback(req()->zoneid, req()->uid, $sList[0], 2, $aucItem->currprice-$aucItem->addstep);
+        }
+        
         //更新表里的交易状态
         $aucItem->result = "完成";
         $aucItem->currpeopleid = req()->uid;
@@ -97,12 +101,11 @@ class AuctionProc {
 //更新拍品缓存
 
         $obj = self::updateAuctionUserItemListCache();
-//发送邮件,给拍品
-        $sList = explode(',', $aucItem->contents);
+//发送邮件,给拍品       
         EmailProc::SendAuctionItemsMail(req()->zoneid, req()->uid, $sList[0], $sList[1]);
 
         EmailProc::SendAuctionCashMail(req()->zoneid, $aucItem->sellerid, $sList[0], 2, $buyoutPrice - intval($buyoutPrice * 0.05)); //上架玩家给钻石邮件  
-
+     
         UserProc::updateUserInfo();                                             # 回写玩家数据
         return Resp::ok(array(
                     "auction" => $obj->data,
@@ -111,7 +114,7 @@ class AuctionProc {
     }
 
     /**
-     * 取消出售
+     * 取消出售---增加回退竞拍者的竞价钱
      */
     static function CancelAuction() {
         list($uId) = req()->paras;
@@ -121,6 +124,9 @@ class AuctionProc {
         $ctxList = explode(',', $aucItem->contents);
         EmailProc::SendCantSellAuctionItemsMail(req()->zoneid, req()->uid, $ctxList[0], $ctxList[1]);
 
+        #回退竞拍者钻石
+        EmailProc::SendCantSellAuctionItemsBidCash(req()->zoneid, $aucItem->currpeopleid,$ctxList[0],2,$aucItem->currprice);
+                
         self::updateAuctionItemState($aucItem);
         self::updateAuctionUserItemListCache();
 
@@ -133,11 +139,11 @@ class AuctionProc {
     }
 
     /**
-     * 上传拍品
+     * 上传拍品--7406
      * @return type
      */
     static function UploadAuctionItems() {
-        list($itemId, $num, $bugoutPrice) = req()->paras; //上传拍品的 id 数量 竞拍价 一口价
+        list($itemId, $num, $bugoutPrice,$userBidPrice) = req()->paras; //上传拍品的 id 数量 竞拍价 一口价
 
         $user = ctx();
 
@@ -146,15 +152,18 @@ class AuctionProc {
         my_Assert($mo != null, ErrCode::err_const_no);
 
         $sList = explode(',', $mo->buyoutPrice);
-        my_Assert($bugoutPrice >= $sList[1], ErrCode::notenough_cash_msg);
-
+        $pList = explode(',', $mo->auctionPrice);
+        my_Assert($bugoutPrice >= $sList[1], ErrCode::auction_loadpricelow);
+        my_Assert($userBidPrice >= $pList[1], ErrCode::auction_loadpricelow);
+        
         StoreProc::removeItemFromStore($user->store, $itemId, $num);
 
         $aucItem = new Ins_AuctionItemModel();
-        $aucItem->addstep = 1;
+        $aucItem->addstep = 10;
         $aucItem->contents = $itemId . "," . $num;
-        $aucItem->startprice = 0;
-        $aucItem->buyoutPrice = $sList[1] * $num;
+        $aucItem->startprice = $userBidPrice;
+        $aucItem->buyoutPrice = $bugoutPrice;
+        $aucItem->currprice = $userBidPrice;
         $aucItem->startts = time();
         $aucItem->endts = glc()->AuctionEndTs * 60 * 60 + time(); # 24小时 
         $aucItem->sellerid = req()->uid;
@@ -177,29 +186,78 @@ class AuctionProc {
     }
 
     /**
-     * 竞价
+     * 竞价--7407
      */
-    static function UserAuctionBidItem() {
-        list($uId) = req()->paras;
+    static function UserAuctionBidItem() {       
+        $uId = req()->paras[0];
+//        $price = req()->paras[1];
+              
         $aucItem = self::getAuctionItem($uId);
-
+        
+        $ts = time();
+        my_Assert($aucItem->startts < $ts, ErrCode::auction_beforstart);
+        my_Assert($aucItem->endts > $ts, ErrCode::auction_end);
+        $curPrice = $aucItem->currprice;
+        //my_Assert($price >= $curPrice, ErrCode::auction_failprice);
+        my_Assert(ctx()->baseInfo->cash >= $aucItem->currprice, ErrCode::notenough_cash_msg);
+        
+        #扣除竞价--钻石
+        ctx()->base(true)->Consume_Cash($aucItem->currprice);
+        #退回上一人的竞价
+        if ($aucItem->currpeopleid != null) {
+            $contentsList = explode(',', $aucItem->contents);
+            EmailProc::SendRefundAuctionCash($aucItem->zoneid,$aucItem->currpeopleid ,$contentsList[0], 2,$aucItem->currprice-$aucItem->addstep);
+        }
+        # 更新拍品信息
+        $aucItem->currpeopleid = req()->uid;  # 更新拍品信息
+        $aucItem->currpeoplename = ctx()->baseInfo->name;
+        $aucItem->currprice = $aucItem->currprice + $aucItem->addstep;
+        
+        $auchistory = json_decode($aucItem->auchistory);
+        if($auchistory == null){
+            $auchistory = new \stdClass();
+        }
+        $auchistory->$ts = array("uid" => req()->uid, "name" => ctx()->baseInfo->name, "price" => $curPrice);
+        $aucItem->auchistory = addslashes(json_encode($auchistory));
+        self::updateAuctionItem($aucItem);
+        
+        $auctionDic = self::updateAuctionUserItemListCache(); # 更新缓存  
+        
         UserProc::updateUserInfo();                                             # 回写玩家数据
         return Resp::ok(array(
-                    "store" => $user->store,
-                    "auction" => $auctionDic, #拍品
+                    "res"=>"ok",
+                    "cash"=>ctx()->baseInfo->cash,
+                    //"store" => ctx()->store,
+                    "auction" => $auctionDic->data, #拍品
         ));
     }
 
+    /**
+     * 结算
+     * @return string
+     */
     static function TriggerSettlement() {
         $result = self::selectTimeoutAuctionItems();
         if (count($result) > 0) {
             foreach ($result as $aucItem) {
                 //发送流拍邮件
                 $sList = explode(',', $aucItem->contents);
-                EmailProc::SendAuctionItemsStreamingMail(req()->zoneid, req()->uid, $sList[0], $sList[1]);
-
-                //更新数据库信息
-                $aucItem->result = "流拍";
+                $currpeopleid = $aucItem->currpeopleid;
+                $sellerId = $aucItem->sellerid;
+                $zoneid = $aucItem->zoneid;
+                
+                if($currpeopleid != null){//结算拍品
+                    $currprice = $aucItem->currprice;//最后的竞价的钱    
+                    $aucItem->result = "完成";  
+                    //给卖家钻石邮件
+                    EmailProc::SendAuctionCashMail($zoneid, $sellerId, $sList[0], 2, $currprice);
+                    //给买家拍品邮件
+                    EmailProc::SendAuctionItemsMail($zoneid, $currpeopleid, $sList[0], $sList[1]);
+                } else {                    
+                    $aucItem->result = "流拍";                   
+                    EmailProc::SendAuctionItemsStreamingMail($zoneid, $sellerId, $sList[0], $sList[1]);
+                }
+                                              
                 self::updateAuctionItemState($aucItem);
             }
         }
@@ -230,8 +288,8 @@ class AuctionProc {
      */
     static function insertNewUserAuctionItem($aucItem) {
         $paydb = daoInst();
-        $sql = "INSERT INTO `tab_auctionitems` (contents,startprice,buyoutPrice,startts,endts,sellerid,sellername,auchistory,zoneid) VALUES ('%s',%d,%d,%d,%d,'%s','%s','{}',%d)";
-        $query = sprintf($sql, $aucItem->contents, $aucItem->startprice, $aucItem->buyoutPrice, $aucItem->startts, #
+        $sql = "INSERT INTO `tab_auctionitems` (contents,startprice,addstep,buyoutPrice,currprice,startts,endts,sellerid,sellername,auchistory,zoneid) VALUES ('%s',%d,%d,%d,%d,%d,%d,'%s','%s','{}',%d)";
+        $query = sprintf($sql, $aucItem->contents, $aucItem->startprice, $aucItem->addstep, $aucItem->buyoutPrice,$aucItem->currprice, $aucItem->startts, #
                 $aucItem->endts, $aucItem->sellerid, $aucItem->sellername, $aucItem->zoneid);
         $result = $paydb->exec($query);
         return $result;
@@ -349,4 +407,16 @@ class AuctionProc {
         return $result;
     }
 
+    /**
+     * 竞拍信息回存
+     * @param type $aucItem
+     * @return type
+     */
+    static function updateAuctionItem($aucItem) {
+        $sql = "UPDATE `tab_auctionitems` set currpeopleid = '%s',currpeoplename = '%s',currprice='%d',auchistory='%s' where itemid='%d'";
+        $query = sprintf($sql,$aucItem->currpeopleid,$aucItem->currpeoplename,$aucItem->currprice,$aucItem->auchistory,$aucItem->itemid);
+        $paydb = daoInst();
+        $result = $paydb->exec($query);
+        return $result;
+    }
 }

+ 49 - 1
Gameserver/Amfphp/process/EmailProc.php

@@ -390,7 +390,7 @@ class EmailProc {
         $mail = new Ins_Email(null, enum_Mail_Type::SysTemMail, "拍卖邮件", #
                 $name . "拍品取消出售,请点击领取", "$itemid, $num");
         self::InsertMail($zoneid, $uid, $mail);
-    }
+    } 
 
     /**
      * 竞拍成功,钻石邮件
@@ -406,6 +406,54 @@ class EmailProc {
                 "您上架" . $name . "被竞拍成功,请领取钻石", "$cash,$num");
         self::InsertMail($zoneid, $uid, $mail);
     }
+    
+    /**
+     * 竞价被超出
+     * @param type $zoneid
+     * @param type $uid
+     * @param type $itemid
+     * @param type $cash
+     * @param type $num
+     */
+    public static function SendRefundAuctionCash($zoneid, $uid, $itemid,$cash, $num) {
+        $name = GameConfig::item_base_getItem($itemid)->name;
+
+        $mail = new Ins_Email(null, enum_Mail_Type::SysTemMail, "拍卖退款邮件", #
+                $name . "拍品出价已经被超出,系统返还您的出价钻石", "$cash,$num");
+        self::InsertMail($zoneid, $uid, $mail);
+    }
+    
+    /**
+     * 拍品取消出售,竞拍者钻石回退邮件
+     * @param type $zoneid
+     * @param type $uid
+     * @param type $itemid
+     * @param type $cash
+     * @param type $num
+     */
+    public static function SendCantSellAuctionItemsBidCash($zoneid, $uid, $itemid,$cash, $num) {
+        $name = GameConfig::item_base_getItem($itemid)->name;
+
+        $mail = new Ins_Email(null, enum_Mail_Type::SysTemMail, "拍卖退款邮件", #
+                $name . "拍品取消出售,系统返还您的出价钻石", "$cash,$num");
+        self::InsertMail($zoneid, $uid, $mail);
+    }
+    
+    /**
+     * 一口价拍走拍品,竞拍者钻石回退
+     * @param type $zoneid
+     * @param type $uid
+     * @param type $itemid
+     * @param type $cash
+     * @param type $num
+     */
+    public static function SendAuctionItemsBidCashFallback($zoneid, $uid, $itemid,$cash, $num) {
+        $name = GameConfig::item_base_getItem($itemid)->name;
+
+        $mail = new Ins_Email(null, enum_Mail_Type::SysTemMail, "拍卖退款邮件", #
+                $name . "拍品已经被别人拍走,系统返还您的出价钻石", "$cash,$num");
+        self::InsertMail($zoneid, $uid, $mail);
+    }
 
 // </editor-fold>
 //

+ 1 - 1
Gameserver/Amfphp/process/EventProc/CornerSignEventProc.php

@@ -132,7 +132,7 @@ class CornerSignEventProc {
     }
 
     /**
-     * 排行榜--通关奖励状态有变化
+     * 排行榜--通关奖励状态有变化--暂时改成等级榜
      */
     public static function OnRanking_GageReward_new() {
         ctx()->privateState->cornerSignNotifications[] = OperateEventType::Ranking_ClearanceReward;

+ 90 - 12
Gameserver/Amfphp/process/RankProc.php

@@ -28,18 +28,57 @@ class RankProc {
             case CmdCode::rank_getTop1:                                         # 6604 查询top1信息
                 return self::RankGetAllTop1();
 
-            case CmdCode::rank_passgate_getrank:                                # 6605 查询通关榜榜单信息
-                return self::GetPassgateRank();
+            case CmdCode::rank_playerlevel_getrank:                             # 6605 查询通关榜榜单信息
+                return self::getPlayerLevelRankInfo();               
+//            case CmdCode::rank_passgate_getrank:                              # 6605 查询通关榜榜单信息
+//                return self::GetPassgateRank();
             case CmdCode::rank_passgate_drawReward:                             # 6606 领取通关榜突破奖励
                 return self::DrawPassgateReward();
-
             case CmdCode::rank_passgate_breachLog:                              # 6608 查询通关帮突破记录
                 return self::GetPassgateBreachLog();
-
+                
             default:
                 return Resp::err(ErrCode::cmd_err);
         }
     }
+    
+    /**
+     * 获得等级榜信息
+     * @return type
+     */
+    static function getPlayerLevelRankInfo() {     
+        $RowsPerPage = 10;                                                      # 常量:每页数据条数10条
+        $MaxRankId = 100;                                                       # 常量:最大上榜人数.
+        $pageId = req()->paras[0];                                              # 参数:页码, 从零开始.
+
+        $key = self::Game_Rank_playerLevel_zset(req()->zoneid);          # redis key
+        $startid = 0 + $RowsPerPage * ($pageId - 1);                            # 起始id
+        $endId = $startid + $RowsPerPage - 1;                                   # 结束id
+        if ($endId > $MaxRankId) {                                              # 榜单长度
+            $endId = $MaxRankId;
+        }
+        $uids = gMem()->zrevrange($key, $startid, $endId, true);                # 取上榜玩家
+        $userInfos = array();                                                   # 玩家信息
+        foreach ($uids as $uid => $score) {
+            $game = UserProc::getUserGame(req()->zoneid, $uid);                 # 读取玩家信息 
+            $userInfos[] = array(#                                              # 拼装玩家信息
+                'uid' => $uid,
+                'name' => my_null_default($game->baseInfo->name, ""),
+                'level' => my_null_default($game->baseInfo->level, 1),
+                'score' => my_null_default($score, 0),
+                'headImg' => my_null_default($game->baseInfo->headImg, "")
+            );
+        }
+
+        $user_ranking = gMem()->zrevrank($key, req()->uid);                     # 查询玩家排名
+        $user_score = gMem()->zscore($key, req()->uid);                         # 查询积分
+        return Resp::ok(array(#                                                 # 返回值
+                    'rankInfo' => $userInfos,
+                    'ranking' => my_null_default($user_ranking, 100) + 1, #     # 修正下排名(zset中是从零开始的), 如果是null => 榜单之外
+                    'score' => my_null_default($user_score, 0)
+        ));
+        
+    }
 
     /**
      * 查询指定榜单的top1
@@ -175,7 +214,8 @@ class RankProc {
      */
     static function RankGetAllTop1() {
         $key_fPower = MemKey_GameRun::Game_FightPowerRank_zset(req()->zoneid);   # redis key 战力榜
-        $key_passgate = MemKey_GameRun::Game_Rank_passgate_zset(req()->zoneid);  # redis key 通关榜
+        //$key_passgate = MemKey_GameRun::Game_Rank_passgate_zset(req()->zoneid);  # redis key 通关榜
+        $key_passgate = self::Game_Rank_playerLevel_zset(req()->zoneid);
 //        $key_yanling ="";
         $ret = array(
             "FightPower" => self::_RankGetTop1($key_fPower),
@@ -190,14 +230,18 @@ class RankProc {
     // <editor-fold defaultstate="collapsed" desc="  通关帮  ">
 
     /**
-     * [6608]排行榜 - 查询通关榜突破记录
+     * [6608]排行榜 - 查询通关榜突破记录--改成了玩家等级榜
      */
     static function GetPassgateBreachLog() {
-        $key = MemKey_GameRun::Game_Rank_passage_BreachLog_hash(req()->zoneid); # redis key 战力榜突破记录
+        //$key = MemKey_GameRun::Game_Rank_passage_BreachLog_hash(req()->zoneid); # redis key 战力榜突破记录
+        $key = self::Game_Rank_playerlevel_BreachLog_hash(req()->zoneid);  
+        $rankKey = self::Game_Rank_playerLevel_zset(req()->zoneid);
         $kv = gMem()->hgetall($key);
         $ret = array();
         foreach ($kv as $condition => $uid) {
             $game = UserProc::getUserGame(req()->zoneid, $uid);                 # 读取玩家信息
+            $score = gMem()->zscore($rankKey, $uid); 
+            
             $ret[$condition] = array(#                                          # 拼装玩家信息
                 'uid' => $uid,
                 'name' => my_null_default($game->baseInfo->name, ""),
@@ -213,13 +257,14 @@ class RankProc {
     }
 
     /**
-     * [6606] 领取通关榜突破奖励
+     * [6606] 领取通关榜突破奖励--改成了玩家等级榜
      */
     static function DrawPassgateReward() {
         $rewardCondition = req()->paras[0];                                     # 领取奖励的档次条件(战斗力数值)
 
         $privateState = ctx()->privateState;
-        $key = MemKey_GameRun::Game_Rank_passgate_zset(req()->zoneid);          # redis key
+        //$key = MemKey_GameRun::Game_Rank_passgate_zset(req()->zoneid);          # redis key
+        $key = self::Game_Rank_playerLevel_zset(req()->zoneid);
         $no1 = gMem()->zrevrange($key, 0, 0, true);                             # 取第一名信息
         $score = 0;
         foreach ($no1 as $uid => $_score) {                                     #
@@ -234,7 +279,9 @@ class RankProc {
         }
         $privateState->RankPassGateRewardRec[] = $rewardCondition;              # 添加领取记录
 
-        $rewardMo = GameConfig::rankreward_passgate_getItem($rewardCondition);  # 奖励mo
+        //$rewardMo = GameConfig::rankreward_passgate_getItem($rewardCondition);  # 奖励mo
+        $rewardMo = GameConfig::rank_playerlevel_reward_getItem($rewardCondition);
+        
         StoreProc::AddMultiItemInStore($rewardMo->reward, ctx());               # 发放奖励字符串.
         UserProc::updateUserInfo();                                             # 流程结束,回写玩家数据
         return Resp::ok();
@@ -278,11 +325,12 @@ class RankProc {
     }
 
     /**
-     * [6603]查询玩家通关榜排名
+     * [6603]查询玩家通关榜排名--改成了玩家等级榜
      * @param req $req
      */
     static function GetRankingOfUserPassGate($req) {
-        $key = MemKey_GameRun::Game_Rank_passgate_zset($req->zoneid);           # redis key
+        //$key = MemKey_GameRun::Game_Rank_passgate_zset($req->zoneid);         # redis key
+        $key = self::Game_Rank_playerLevel_zset($req->zoneid);                  # redis key
         $ranking = gMem()->zrevrank($key, $req->uid);                           # 查询排名
         $power = gMem()->zscore($key, $req->uid);                               # 查询通关记录
         $ret = array(
@@ -296,6 +344,36 @@ class RankProc {
     //
     // <editor-fold defaultstate="collapsed" desc="  辅助方法  ">
 
+    /**
+     * 更新玩家等级信息
+     * @param type $uid
+     * @param type $level
+     */
+    public static function recordPlayerLevelInfo($uid,$level,$zoneid) {       
+        gMem()->zadd(self::Game_Rank_playerLevel_zset($zoneid), array("$uid" => $level));   
+        
+        $key_log = self::Game_Rank_playerlevel_BreachLog_hash($zoneid); # redis key 等级榜突破记录
+        
+        $mo = GameConfig::rank_playerlevel_reward();
+        foreach ($mo as $condition => $reward) {    # 遍历突破奖励数据
+            if ($level >= $condition && !gMem()->hexists($key_log, $condition)) {  # 判断是否达成突破奖励标准
+                gMem()->hset($key_log, $condition, $uid);                       # 添加突破记录
+                CornerSignEventProc::OnRanking_GageReward_new();
+            }
+        }
+    }
+    
+    public static function Game_Rank_playerLevel_zset($zoneid) {
+        $key_rank = "gamerun-rank-playerLevel-zone$zoneid";
+        return $key_rank;
+    }
+
+    public static function Game_Rank_playerlevel_BreachLog_hash($zoneid) {
+        $key_rank = "gamerun-rank-playerlevel-breaklog-zone$zoneid";
+        return $key_rank;
+    }
+
+
     /**
      * 常量: 最大玩家人数100W(假设单服人数不会超过这个数字)
      */

+ 36 - 36
Gameserver/Amfphp/process/UserProc.php

@@ -57,17 +57,18 @@ class UserProc {
                 Err(ErrCode::cmd_err);
         }
     }
-    
+
     /*
      * 6016 删除角色
      */
-    public static function deleteUserUId(){
+
+    public static function deleteUserUId() {
         $mem = gMem();
-        
+
         $uid = req()->uid;
         $zoneid = req()->zoneid;
         $list = array();
-        
+
         $zoneKey = MemKey_User::Union_PlayedZoneInfo_normal($uid);
         $list[] = $zoneKey;
         $publicKey = MemKey_User::Union_PublicState_hash($uid);
@@ -86,20 +87,20 @@ class UserProc {
         $list[] = $PVP_DefensiveLogKey;
         $SigKey = MemKey_User::Sig($zoneid, $uid);
         $list[] = $SigKey;
-        
+
         $CurIdKey = MemKey_User::Mail_CurId_int($zoneid, $uid);
         $list[] = $CurIdKey;
         $SysRecordKey = MemKey_User::Mail_SysRecord_set($zoneid, $uid);
         $list[] = $SysRecordKey;
         $QueueKey = MemKey_User::Mail_Queue_hash($zoneid, $uid);
         $list[] = $QueueKey;
-        
+
         foreach ($list as $key) {
-            if($mem->exists($key)){
+            if ($mem->exists($key)) {
                 $mem->delete($key);
             }
         }
-        
+
         return Resp::ok();
     }
 
@@ -339,7 +340,7 @@ class UserProc {
     /**
      * 6000 【移动端】 获取分区列表
      */
-    public static function GetZoneList() {        
+    public static function GetZoneList() {
         $defaultZone = new Ins_ZoneInfo(1, 0, "");                             # 新用户默认分区
         $bGetRecommended = false;
         if (count(req()->paras) > 0) {                                           # 是否只拉取推荐分区
@@ -457,9 +458,9 @@ class UserProc {
         }
         return $resp;
     }
-    
-    public static function newFieldSupplement(&$game) {       
-        if(!StlUtil::dictHasProperty($game->store,'storage')){
+
+    public static function newFieldSupplement(&$game) {
+        if (!StlUtil::dictHasProperty($game->store, 'storage')) {
             $key = 1;
             $key2 = 2;
 
@@ -467,8 +468,8 @@ class UserProc {
             $game->store->storage->$key = new Ins_storage();
             $game->store->storage->$key2 = new Ins_storage();
         }
-        
-        if($game->store->storage == null){
+
+        if ($game->store->storage == null) {
             $key = 1;
             $key2 = 2;
 
@@ -476,51 +477,50 @@ class UserProc {
             $game->store->storage->$key = new Ins_storage();
             $game->store->storage->$key2 = new Ins_storage();
         }
-        
-        if(!StlUtil::dictHasProperty($game->store,'battleItem')){
+
+        if (!StlUtil::dictHasProperty($game->store, 'battleItem')) {
             $game->store->battleItem = ObjectInit();
         }
-        
-        if($game->store->battleItem == null){
+
+        if ($game->store->battleItem == null) {
             $game->store->battleItem = ObjectInit();
         }
-        
-        if(!StlUtil::dictHasProperty($game->newMap,'huichengquanRecord')){
+
+        if (!StlUtil::dictHasProperty($game->newMap, 'huichengquanRecord')) {
             $game->newMap->huichengquanRecord = ObjectInit();
         }
-        
-        if(is_array($game->newMap->huichengquanRecord)){
+
+        if (is_array($game->newMap->huichengquanRecord)) {
             $game->newMap->huichengquanRecord = ObjectInit();
         }
-        
+
         $dixiachengId = 503001;
-        if(!StlUtil::dictHasProperty($game->newMap->unlockedFootholds, $dixiachengId)){
+        if (!StlUtil::dictHasProperty($game->newMap->unlockedFootholds, $dixiachengId)) {
             $mo = GameConfig::gate_getItem($dixiachengId);
             $footHold = new Ins_FootHold();
             $footHold->mapId = $mo->gateId;
             $footHold->curMapType = $mo->mapType;
-            $game->newMap->unlockedFootholds->$dixiachengId = $footHold; 
-        }   
-        
+            $game->newMap->unlockedFootholds->$dixiachengId = $footHold;
+        }
+
         foreach ($game->newMap->unlockedFootholds as $mapid => $val) {
-            if($val->mapId != $mapid){
+            if ($val->mapId != $mapid) {
                 $game->newMap->unlockedFootholds->$mapid->mapId = $mapid;
                 break;
             }
         }
-        
-        if(!StlUtil::dictHasProperty($game->newMap, 'curFootholdId')){
+
+        if (!StlUtil::dictHasProperty($game->newMap, 'curFootholdId')) {
             $game->newMap->curFootholdId = $game->newMap->curMapId;
         }
-        
-        if($game->newMap->lastMapId == 0){
+
+        if ($game->newMap->lastMapId == 0) {
             $game->newMap->lastMapId = 503099;
         }
-        
-       if(!StlUtil::dictHasProperty($game->store, 'dailyTask_HandOver')){
+
+        if (!StlUtil::dictHasProperty($game->store, 'dailyTask_HandOver')) {
             $game->store->dailyTask_HandOver = 0;
         }
-                         
     }
 
     /**
@@ -779,7 +779,7 @@ class UserProc {
      *           version 1.0.0 Mysql storagef 1. 分表不做了, 2. 存储过程不用了 3. 先能用再说
      */
     public static function backupUserInfoMongo() {
-        $collectionName = "ylsj2019.userInfoBack";                              # 表名
+        $collectionName = "userInfoBack";                              # 表名
         $key = MemKey_User::Info_hash(req()->zoneid, req()->uid);
         $doc = array('key' => $key, #                                           # 最新文档
             'ts' => TimeUtil::dtCurrent(), #                                    # 更新时间

+ 24 - 2
Gameserver/Amfphp/test.php

@@ -9,10 +9,32 @@ include __DIR__ . '/main.php';
 echoLine("phpver: " . PHP_VERSION . PHP_EOL);
 echoLine("tsDay:" . totalDays());
 
-SelfChecker::CheckAll();
+//SelfChecker::CheckAll();
 //
 //
 //set_time_limit(15);                                                           #  
 //
 
- 
+
+$id = 19463;
+//$id = ftok(__FILE__, 't');
+//$data = now();
+//$shm = new ShmopBlock($id);
+//$shm->write($data);
+//if ($shm->exists()) {
+//    $shm->write("wanggangzero.cn");
+//    echoLine("existing:" . $shm->read());
+//} else {
+//    echoLine("not existing.");
+//    $shm->write($data);
+//}
+//echoLine("reading:" . $shm->read());
+$yac = new \Yac();
+$a = $yac->get("wg");
+if ($a) {
+    echoLine($a);
+} else {
+    $yac->set("wg", "wanggangzero.cn");
+}
+  
+ 

+ 9 - 7
Gameserver/Amfphp/util/MongoUtil.php

@@ -21,6 +21,7 @@ class MongoUtil {
      * @var \MongoDB\Driver\Manager
      */
     private $mc;
+    private $dbPrefix = "";
 
     /**
      * 返回一个新的option构造器,请使用链式写法追加所有option, 最后用GetOption()获取最终的option数组
@@ -36,9 +37,10 @@ class MongoUtil {
      * @param type $connStr
      * @return \MongoDB\Driver\Manager|false
      */
-    public function conn($connStr) {
+    public function conn($connStr, $dbPrefix = "") {
         try {
             $this->mc = new \MongoDB\Driver\Manager($connStr);
+            $this->dbPrefix = $dbPrefix;
             return $this->mc;
         } catch (\Exception $e) {
             Clog::err($e->getMessage());
@@ -47,12 +49,12 @@ class MongoUtil {
     }
 
     /**
-     * 查询
+     * 查询,返回的是光标,也可以用toArray()转换为数组使用
      * @author gwang<wanggangzero@qq.com>
      * @param string $collection 集合
      * @param array $filter 同过滤器语法
      * @param array $options 请利用QueryOptionBuilder()来辅助定制选项
-     * @return \MongoDB\Driver\Cursor|false 
+     * @return \MongoDB\Driver\Cursor|false 访问光标或者false, 可以用foreach来访问Cursor
      */
     public function find($collection, $filter = [], $options = []) {
         if (empty($this->mc)) {
@@ -60,7 +62,7 @@ class MongoUtil {
         }
         try {
             $query = new \MongoDB\Driver\Query($filter, $options);
-            $cursor = $this->mc->executeQuery($collection, $query);
+            $cursor = $this->mc->executeQuery($this->dbPrefix . '.' . $collection, $query);
             return $cursor;
         } catch (\Exception $ex) {
             CLog::err($ex->getMessage());
@@ -85,7 +87,7 @@ class MongoUtil {
             $bulk = new \MongoDB\Driver\BulkWrite();
             $bulk->insert($addArr);
             $writeConcern = new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY, 6000);
-            $result = $this->mc->executeBulkWrite($collection, $bulk, $writeConcern);
+            $result = $this->mc->executeBulkWrite($this->dbPrefix . '.' . $collection, $bulk, $writeConcern);
             if ($result->getInsertedCount()) {
                 return true;
             }
@@ -115,7 +117,7 @@ class MongoUtil {
             $bulk = new \MongoDB\Driver\BulkWrite();
             $bulk->delete($whereArr, $options);
             $writeConcern = new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY, 30000);
-            $result = $conn->executeBulkWrite($collection, $bulk, $writeConcern);
+            $result = $conn->executeBulkWrite($this->dbPrefix . '.' . $collection, $bulk, $writeConcern);
             return $result->getDeletedCount();
         } catch (\Exception $e) {
             CLog::err($e->getMessage());                                        # 记录错误日志
@@ -145,7 +147,7 @@ class MongoUtil {
             $bulk = new \MongoDB\Driver\BulkWrite();
             $bulk->update($whereArr, $newPropertiesArr, $options);
             $writeConcern = new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY, 30000);
-            $result = $conn->executeBulkWrite($collection, $bulk, $writeConcern);
+            $result = $conn->executeBulkWrite($this->dbPrefix . '.' . $collection, $bulk, $writeConcern);
             return $result->getUpsertedCount() + $result->getModifiedCount();
         } catch (\Exception $e) {
             CLog::err($e->getMessage());                                        # 记录错误日志

+ 1 - 1
Gameserver/Amfphp/util/SelfChecker.php

@@ -28,7 +28,7 @@ class SelfChecker {
             "mongodb", #                                                        # mongodb支持 
             "openssl", #                                                        # 用于通讯时的加密、验签;
             "pdo_mysql", #                                                      # mysql
-            "shmop", #                                                          # 九游SDK代码中用到,共享内存操作,还没怎么玩儿过
+//            "shmop", #                                                          # 九游SDK代码中用到,共享内存操作,还没怎么玩儿过
             "sockets", #                                                        # 用于服务器间通讯
             "zlib", #                                                           # 压缩库
         );

+ 76 - 22
patchTTT.diff

@@ -1,9 +1,39 @@
-
+diff --git a/Gameserver/Amfphp/configs/config_and.php b/Gameserver/Amfphp/configs/config_and.php
+index ae066db3..f935aea5 100644
+--- a/Gameserver/Amfphp/configs/config_and.php
++++ b/Gameserver/Amfphp/configs/config_and.php
+@@ -30,7 +30,7 @@ class config_and extends config {
+     protected function _InitOuterNetPaydb() {
+         $this->paydb->host = '172.17.16.5';
+         $this->paydb->port = '3306';
+-        $this->paydb->name = 'ylsj2019_pay_t2';
++        $this->paydb->name = 'ylsj2019_pay_TTT';
+         $this->paydb->user = 'ylsjMTY0LjkyLjE5NC4x';
+         $this->paydb->password = 'wanggang1985';
+     }
+@@ -42,7 +42,7 @@ class config_and extends config {
+         $this->nosql->host = "172.17.16.5";                                       # host/ip
+         $this->nosql->port = 6379;                                              # 端口
+         $this->nosql->pwd = 'wanggang1985';                                     # 密钥
+-        $this->nosql->db = 2;                                                   # db索引
++        $this->nosql->db = 1;                                                   # db索引
+     }
+ 
+     /**
+@@ -50,7 +50,7 @@ class config_and extends config {
+      */
+     protected function _InitOuterMongoDB() {
+         $this->mongodb = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@172.17.16.5:23333/?authSource=ylsj2019";
+-        $this->mongo->db = "ylsj2019_t2";
++        $this->mongo->db = "ylsj2019_TTT";
+         $this->mongo->conn = "mongodb://gwang:wanggang1985@localhost:27017/?authSource=admin";
+     }
+ 
 diff --git a/Gameserver/globals.php b/Gameserver/globals.php
-index 63b43b86..a785d647 100644
+index a785d647..5d8172d8 100644
 --- a/Gameserver/globals.php
 +++ b/Gameserver/globals.php
-@@ -19,7 +19,7 @@ define("PLAT", 'and');  # and, ios, web
+@@ -19,11 +19,11 @@ define("PLAT", 'and');  # and, ios, web
  /**
   * 游戏是否上线
   */
@@ -12,22 +42,46 @@ index 63b43b86..a785d647 100644
  
  /**
   * 控制debug黑框调试输出
--- 
-
-
-diff --git a/Gameserver/Amfphp/util/CRedisUtil.php b/Gameserver/Amfphp/util/CRedisUtil.php
-index 6ceb1794..d1f7ba15 100644
---- a/Gameserver/Amfphp/util/CRedisUtil.php
-+++ b/Gameserver/Amfphp/util/CRedisUtil.php
-@@ -164,7 +164,7 @@ class CRedisUtil {
-      * @param string $db 数据库, 不建议输入参数, 如果是购买云实例只有一个db.
-      * @return \CRedisUtil
-      */
--    public function conn($host, $port, $pwd = "", $db = 0) {
-+    public function conn($host, $port, $pwd = "", $db = 1) {
- //        DebugHelper::print_stack_trace();
-         $this->redis = new \Predis\Client(array(
-             'scheme' => 'tcp',
--- 
-
-
+  */
+ define("DEBUGING", true);
+ 
+-define("SDK_GAME_ONLINE", false);
++define("SDK_GAME_ONLINE", true);
+diff --git a/patchTTT.diff b/patchTTT.diff
+index 86940b0e..e69de29b 100644
+--- a/patchTTT.diff
++++ b/patchTTT.diff
+@@ -1,33 +0,0 @@
+-
+-diff --git a/Gameserver/globals.php b/Gameserver/globals.php
+-index 63b43b86..a785d647 100644
+---- a/Gameserver/globals.php
+-+++ b/Gameserver/globals.php
+-@@ -19,7 +19,7 @@ define("PLAT", 'and');  # and, ios, web
+- /**
+-  * 游戏是否上线
+-  */
+--define("GAME_ONLINE", false);
+-+define("GAME_ONLINE", true);
+- 
+- /**
+-  * 控制debug黑框调试输出
+--- 
+-
+-
+-diff --git a/Gameserver/Amfphp/util/CRedisUtil.php b/Gameserver/Amfphp/util/CRedisUtil.php
+-index 6ceb1794..d1f7ba15 100644
+---- a/Gameserver/Amfphp/util/CRedisUtil.php
+-+++ b/Gameserver/Amfphp/util/CRedisUtil.php
+-@@ -164,7 +164,7 @@ class CRedisUtil {
+-      * @param string $db 数据库, 不建议输入参数, 如果是购买云实例只有一个db.
+-      * @return \CRedisUtil
+-      */
+--    public function conn($host, $port, $pwd = "", $db = 0) {
+-+    public function conn($host, $port, $pwd = "", $db = 1) {
+- //        DebugHelper::print_stack_trace();
+-         $this->redis = new \Predis\Client(array(
+-             'scheme' => 'tcp',
+--- 
+-
+-