vali 6 năm trước cách đây
mục cha
commit
a72767f582

+ 5 - 1
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -241,7 +241,7 @@ class Events
      */
     public static function onMessage($client_id, $message)
     {
-        if ($message == '{"type":"ping"}') {
+        if ($message == '{"type":"ping"}' || $message == '{"message_type":"ping"}' ) {
             Gateway::sendToCurrentClient('{"type":"pong"}');
             return;
         } else {
@@ -620,6 +620,7 @@ class Events
                     'system' => Gateway::get_os(),
                     'ip' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '',
                     'group' => $message['group'],
+                    'intime' => time(),
                     'client_id' => $client_id
                 ];
 
@@ -667,6 +668,8 @@ class Events
     {
         $isKefuoff = isset($_SESSION['iskefu']) ? $_SESSION['iskefu'] : 0;
         $uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : false;
+        echo "下线:$uid  - $client_id - $isKefuoff \n";
+
         if (empty($uid)) {
             return;
         }
@@ -1085,6 +1088,7 @@ class Events
                 'system' => $res['data']['3']['system'],
                 'browse' => $res['data']['3']['browse'],
                 'status' => 1,
+                'intime'=>$res['data']['3']['intime'],
                 'end_time' => 0
             ];
             $hisSession = self::$db->select('*')->from('ws_service_log')->where('user_id=:user_id and kf_id=:kf_id and group_id=:group_id and status in (1,3)')->bindValues(array('user_id' => $res['data']['3']['id'], 'kf_id' => intval(ltrim($res['data']['0'], 'KF')), 'group_id' => $group))->row();