wesmiler 2 лет назад
Родитель
Сommit
45cf01a7b1
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      app/Console/Commands/SocketServer.php

+ 6 - 3
app/Console/Commands/SocketServer.php

@@ -288,8 +288,9 @@ class SocketServer extends Command
                     $this->sendMsg($frameId, ['success' => true,'op'=> $op, 'scene'=>$scene, 'message' => '登录成功', 'data' => $data, 't' => time()]);
                     break;
                 case 'gift': // 打赏礼物消息
-                    $this->sendMsg($frameId, ['success' => true,'op'=> $op, 'scene'=>$scene, 'data' => $data, 'message' => '礼物消息', 't' => time()]);
                     $fids =  RedisService::get("chats:bindFds:{$chatKey}");
+                    $fids = array_values($fids);
+                    $fids = array_unique($fids);
                     if($fids){
                         foreach($fids as $fd){
                             $this->sendMsg($fd, ['success' => true,'op'=> $op, 'scene'=>$scene, 'data' => $data, 'message' => '礼物消息', 't' => time()]);
@@ -297,8 +298,9 @@ class SocketServer extends Command
                     }
                     break;
                 case 'live_entry': // 进入直播间消息
-                    $this->sendMsg($frameId, ['success' => true,'op'=> $op, 'scene'=>$scene, 'data' => $data, 'message' => '进入直播间消息', 't' => time()]);
                     $fids =  RedisService::get("chats:bindFds:{$chatKey}");
+                    $fids = array_values($fids);
+                    $fids = array_unique($fids);
                     if($fids){
                         foreach($fids as $fd){
                             $this->sendMsg($fd, ['success' => true,'op'=> $op, 'scene'=>$scene, 'data' => $data, 'message' => '进入直播间消息', 't' => time()]);
@@ -306,8 +308,9 @@ class SocketServer extends Command
                     }
                     break;
                 case 'live_like': // 进入直播间消息
-                    $this->sendMsg($frameId, ['success' => true,'op'=> $op, 'scene'=>$scene, 'data' => $data, 'message' => '点赞消息', 't' => time()]);
                     $fids =  RedisService::get("chats:bindFds:{$chatKey}");
+                    $fids = array_values($fids);
+                    $fids = array_unique($fids);
                     if($fids){
                         foreach($fids as $fd){
                             $this->sendMsg($fd, ['success' => true,'op'=> $op, 'scene'=>$scene, 'data' => $data, 'message' => '点赞消息', 't' => time()]);