Browse Source

补充dns检查和网络请求检查.

gwang 4 years ago
parent
commit
f231c2f75d

+ 1 - 1
Gameserver/Amfphp/config.php

@@ -52,7 +52,7 @@ abstract class config {
      * 初始化内网paydb的设置
      */
     private function _InitIntranetPaydb() {
-        $this->paydb->host = '192.168.10.86';
+        $this->paydb->host = '192.168.10.16';
         $this->paydb->port = '3306';
         $this->paydb->name = 'ylsj2019_pay';
         $this->paydb->user = 'gwang';

+ 4 - 1
Gameserver/Amfphp/test.php

@@ -4,7 +4,9 @@ namespace loyalsoft;
 
 include __DIR__ . '/main.php';
 echoLine("phpver: " . PHP_VERSION . PHP_EOL);
+SelfChecker::CheckAll();
 
+//
 //set_time_limit(15);                                                           # 设置执行超时时间
 //
 //require_once ROOTDIR . '/Util/OpenSSLVerify.php';                             # Ps. 这个文件和类名没有对应关系.
@@ -12,4 +14,5 @@ echoLine("phpver: " . PHP_VERSION . PHP_EOL);
 //$tableName = "test-20201123";
 //var_dump(daoInst()->tableExist($tableName));
 
-SelfChecker::CheckConfig();
+
+

+ 25 - 0
Gameserver/Amfphp/util/SelfChecker.php

@@ -9,6 +9,14 @@ namespace loyalsoft;
  */
 class SelfChecker {
 
+    public static function CheckAll() {
+//        self:: checkkPHPVersion();
+//        self::checkModules();
+        self::CheckDNS();
+        self::CheckNetRead();
+        self::CheckConfig();
+    }
+
     /**
      * 检查模块是否加载
      * @param string[] $arr 要检查的模块名称
@@ -55,6 +63,23 @@ class SelfChecker {
         echoLine("Upload path Settings: " . "本框架暂未涉及.");
     }
 
+    /**
+     * DNS检查
+     * @param type $url
+     */
+    public static function CheckDNS($url = 'qq.com') {
+        echoLine("DNS check $url is " . (checkdnsrr($url, "A") ? "ok!" : "failed!"));
+    }
+
+    public static function CheckNetRead($url = 'qq.com') {
+        $ret = HttpUtil::makeRequest($url, array());
+        if ($ret["result"]) {
+            echoLine("Request to $url ok!");
+        } else {
+            echoLine("Net Request Failed!:" . $ret['msg']);
+        }
+    }
+
     /**
      * 测试NoSql连接,以及读写性能
      */

+ 10 - 10
Gameserver/nbproject/private/private.xml

@@ -12,17 +12,17 @@
     </editor-bookmarks>
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
         <group>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/DebugHelper.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/configs/config_and.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/CRedisUtil.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/Services/TestServer.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/SelfChecker.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/UserProc.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/Services/AppServer.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/configs/GameConfig.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/config.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/test.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/TimeUtil.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/OpenSSLVerify.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/HttpUtil.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Docs/DecodePetconf.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/index.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Docs/sendMemKeys.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Docs/EncodePetconf.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/AutoLoad.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/JsonUtil.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Docs/SendData.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/main.php</file>
         </group>
     </open-files>
 </project-private>