Commit f3c08a10 by zhangxingmin

push

parent 9bf17c88
...@@ -713,8 +713,16 @@ public class CoWebSocketServer { ...@@ -713,8 +713,16 @@ public class CoWebSocketServer {
// --- 操作5:WebRTC 信令转发(Offer/Answer/ICE) --- // --- 操作5:WebRTC 信令转发(Offer/Answer/ICE) ---
if ("webrtc_offer".equals(action) || "webrtc_answer".equals(action) || "webrtc_ice_candidate".equals(action)) { if ("webrtc_offer".equals(action) || "webrtc_answer".equals(action) || "webrtc_ice_candidate".equals(action)) {
log.info("【WebRTC信令】转发 {} 消息", action); log.info("【WebRTC信令】转发 {} 消息, roomId={}, 发送者={}", action, roomId, userId);
// 只转发给房间内除发送者外的所有人(包括发送者自己?通常不需要给自己) // 打印信令内容摘要
if ("webrtc_offer".equals(action) || "webrtc_answer".equals(action)) {
String sdpType = json.has("sdp") ? json.get("sdp").get("type").asText() : "unknown";
log.info("【WebRTC信令】SDP类型: {}", sdpType);
} else {
String candidate = json.has("candidate") ? json.get("candidate").get("candidate").asText() : "unknown";
log.info("【WebRTC信令】ICE候选: {}", candidate);
}
// 广播给房间内其他人(不包含发送者)
broadcast(roomId, message, session); broadcast(roomId, message, session);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment