Browse Source

广播消息放开对同一类型客户端限制

shizhongqi 11 months ago
parent
commit
d33e6aa383
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wsClient/room.go

+ 1 - 1
wsClient/room.go

@@ -144,7 +144,7 @@ func (r *Room) run() {
 			online := false
 			// 将消息发送给房间中的所有客户端,但排除发送者自己
 			for client := range r.clientConns {
-				if client != msg.sender && client.userInfo.Type != msg.sender.userInfo.Type { // 高效的指针比较,排除发送者,且排除同一类型的客户端
+				if client != msg.sender { // 高效的指针比较,排除发送者  // && client.userInfo.Type != msg.sender.userInfo.Type -- 排除同一类型的客户端
 					// 将消息发送到每个客户端的接收 channel
 					client.receive <- msg.content // 只发送消息内容,不包含发送者信息
 					online = true