Parcourir la source

merge from t2

王刚 il y a 2 ans
Parent
commit
bbb9e804c8

+ 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 '删除账号成功';
     }
-   
+
 }

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

@@ -49,6 +49,7 @@ class config_and extends config {
      * 外网MongoDB
      */
     protected function _InitOuterMongoDB() {
+
 //        $this->mongodb = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@172.17.16.5:23333/?authSource=ylsj2019";
         $this->mongo->db = "ylsj2019_TTT";
         $this->mongo->conn = "mongodb://ylsjMTY0LjkyLjE5NC4x:wanggang1985@172.17.16.5:23333/?authSource=ylsj2019";

+ 1 - 1
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()
 

+ 20 - 4
Gameserver/Amfphp/test.php

@@ -14,8 +14,24 @@ echoLine("tsDay:" . totalDays());
 //set_time_limit(15);                                                           # 设置执行超时时间
 //
 
-
-foreach (gMongo()->find("c1") as $d) {
-    var_dump($d);
+$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");
 }
-var_dump(gMongo()->find("c1")->toArray());
+  

+ 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", #                                                           # 压缩库
         );