vali vor 6 Jahren
Ursprung
Commit
0da6d54bf4

+ 2 - 3
vendor/GatewayWorker_linux/GatewayWorker/Applications/whisper/Events.php

@@ -117,7 +117,7 @@ class Events
         }
         unset($advertisement);
 
-        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SESSION['remotip'] . ':' . $_SESSION['remotport'], 'session' => $_SESSION, 'serv' => $_SERVER]));
+        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SERVER['REMOTE_ADDR'] . ':' . $_SESSION['remotport'], 'session' => $_SESSION, 'serv' => $_SERVER]));
     }
 
     /**
@@ -2056,8 +2056,7 @@ class Events
 
 
 //客服在线状态写组
-    private
-    static function writeLogKfStatus($kf, $status, $flag = 1)
+    private static function writeLogKfStatus($kf, $status, $flag = 1)
     {
         if ($flag == 1) {
             $status = intval($status);

+ 1 - 0
vendor/GatewayWorker_linux/GatewayWorker/Applications/whisper/start_gateway.php

@@ -88,6 +88,7 @@ $gateway->onConnect = function ($connection) {
         }
         $_SESSION['remotip'] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $connection->getRemoteIp();
         $_SESSION['remotport'] = $connection->getRemotePort();
+		$_SERVER['REMOTE_ADDR'] = $_SESSION['remotip'];
 
 
         // 可以在这里判断连接来源是否合法,不合法就关掉连接

+ 2 - 3
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -117,7 +117,7 @@ class Events
         }
         unset($advertisement);
 
-        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SESSION['remotip'] . ':' . $_SESSION['remotport'], 'session' => $_SESSION, 'serv' => $_SERVER]));
+        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SERVER['REMOTE_ADDR'] . ':' . $_SESSION['remotport'], 'session' => $_SESSION, 'serv' => $_SERVER]));
     }
 
     /**
@@ -2056,8 +2056,7 @@ class Events
 
 
 //客服在线状态写组
-    private
-    static function writeLogKfStatus($kf, $status, $flag = 1)
+    private static function writeLogKfStatus($kf, $status, $flag = 1)
     {
         if ($flag == 1) {
             $status = intval($status);

+ 1 - 0
vendor/GatewayWorker_windows/Applications/whisper/start_gateway.php

@@ -87,6 +87,7 @@ $gateway->onConnect = function ($connection) {
         }
         $_SESSION['remotip'] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $connection->getRemoteIp();
         $_SESSION['remotport'] = $connection->getRemotePort();
+        $_SERVER['REMOTE_ADDR'] = $_SESSION['remotip'];
 
 
         // 可以在这里判断连接来源是否合法,不合法就关掉连接