vali 6 years ago
parent
commit
8c0f24114b

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

@@ -117,7 +117,7 @@ class Events
         }
         }
         unset($advertisement);
         unset($advertisement);
 
 
-        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SERVER['REMOTE_ADDR'] . ':' . $_SERVER['REMOTE_PORT']]));
+        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SESSION['remotip'] . ':' . $_SESSION['remotport']]));
     }
     }
 
 
     /**
     /**
@@ -941,7 +941,7 @@ class Events
             echo date("Y-m-d H:i:s") . ' - ' . "客服发生异常退出." . print_r([$client_id, $uid, $group, $uinfo], true) . "\n";
             echo date("Y-m-d H:i:s") . ' - ' . "客服发生异常退出." . print_r([$client_id, $uid, $group, $uinfo], true) . "\n";
             return;
             return;
         }
         }
-        if (isset($_SESSION['kfzdclose']) && $_SESSION['kfzdclose']==1 ){
+        if (isset($_SESSION['kfzdclose']) && $_SESSION['kfzdclose'] == 1) {
             self::$db->update('ws_users')->cols(['token' => uniqid()])->where('id=' . self::getkfid($uid))->query();
             self::$db->update('ws_users')->cols(['token' => uniqid()])->where('id=' . self::getkfid($uid))->query();
         }
         }
 
 

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

@@ -117,7 +117,7 @@ class Events
         }
         }
         unset($advertisement);
         unset($advertisement);
 
 
-        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SERVER['REMOTE_ADDR'] . ':' . $_SERVER['REMOTE_PORT']]));
+        self::$redis->hset(self::WEBSOCKALLUSER, $client_id, json_encode(['time' => date('H:i:s'), 'ip' => $_SESSION['remotip'] . ':' . $_SESSION['remotport']]));
     }
     }
 
 
     /**
     /**
@@ -941,7 +941,7 @@ class Events
             echo date("Y-m-d H:i:s") . ' - ' . "客服发生异常退出." . print_r([$client_id, $uid, $group, $uinfo], true) . "\n";
             echo date("Y-m-d H:i:s") . ' - ' . "客服发生异常退出." . print_r([$client_id, $uid, $group, $uinfo], true) . "\n";
             return;
             return;
         }
         }
-        if (isset($_SESSION['kfzdclose']) && $_SESSION['kfzdclose']==1 ){
+        if (isset($_SESSION['kfzdclose']) && $_SESSION['kfzdclose'] == 1) {
             self::$db->update('ws_users')->cols(['token' => uniqid()])->where('id=' . self::getkfid($uid))->query();
             self::$db->update('ws_users')->cols(['token' => uniqid()])->where('id=' . self::getkfid($uid))->query();
         }
         }