09-12-netty发送房间确认信息逻辑优化

This commit is contained in:
2025-09-13 15:13:20 +08:00
parent 21aae1f8c0
commit c277e5f80d

View File

@ -425,13 +425,16 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket
if (channelHandlerContexts == null||channelHandlerContexts.isEmpty()){
return;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "5");
jsonObject.put("roomInfo", chatGroup);
for (ChannelHandlerContext channelHandlerContext : channelHandlerContexts) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "5");
jsonObject.put("roomInfo", chatGroup);
sendMessage(channelHandlerContext, String.valueOf(jsonObject));
log.info("发送房间创建确认消息:{}",jsonObject);
}
log.info("发送房间创建确认消息:{}",jsonObject);
}