[*] 日常优化

This commit is contained in:
acgist
2023-08-31 07:21:15 +08:00
parent af1f53884b
commit 96e50a22db
3 changed files with 38 additions and 34 deletions

View File

@@ -962,7 +962,7 @@ public final class Taoyao implements ITaoyao {
final String roomId = MapUtils.get(body, "roomId");
final Room room = this.rooms.get(roomId);
if(room == null) {
Log.w(Taoyao.class.getSimpleName(), "无效房间:" + roomId);
Log.w(Taoyao.class.getSimpleName(), "房间终端列表(无效房间" + roomId);
return;
}
room.newRemoteClientFromRoomClientList(body);

View File

@@ -2220,7 +2220,6 @@ class Taoyao extends RemoteClient {
}
} else {
me.dataConsumers.forEach(dataConsumer => {
console.info(dataConsumer);
dataConsumer.send(data);
})
}
@@ -2242,19 +2241,6 @@ class Taoyao extends RemoteClient {
}
}
/**
* @param {*} roomId 房间ID
*
* @returns 设备列表
*/
async roomClientList(roomId) {
const me = this;
const response = await me.request(protocol.buildMessage("room::client::list", {
roomId: roomId || me.roomId
}));
return response.body;
}
/**
* 房间广播信令
*
@@ -2289,23 +2275,6 @@ class Taoyao extends RemoteClient {
return response.body;
}
/**
* 房间终端列表信令
*
* @param {*} message 信令消息
*/
defaultRoomClientList(message) {
const me = this;
const { clients } = message.body;
clients.forEach((v) => {
if (v.clientId === me.clientId) {
// 忽略自己
} else {
me.remoteClients.set(v.clientId, new RemoteClient(v));
}
});
}
/**
* 媒体回调
*
@@ -2849,6 +2818,38 @@ class Taoyao extends RemoteClient {
}
}
/**
* 房间终端列表信令
*
* @param {*} roomId 房间ID
*
* @returns 设备列表
*/
async roomClientList(roomId) {
const response = await this.request(protocol.buildMessage("room::client::list", {
roomId: roomId || this.roomId
}));
return response.body;
}
/**
* 房间终端列表信令
*
* @param {*} message 信令消息
*/
defaultRoomClientList(message) {
const {
clients
} = message.body;
clients.forEach(v => {
if (v.clientId === this.clientId) {
// 忽略自己
} else {
this.remoteClients.set(v.clientId, new RemoteClient(v));
}
});
}
/**
* 关闭房间信令
*/
@@ -2870,7 +2871,7 @@ class Taoyao extends RemoteClient {
if (roomId !== this.roomId) {
return;
}
console.info("关闭房间", roomId);
console.debug("关闭房间", roomId);
this.closeRoomMedia();
}

View File

@@ -53,7 +53,10 @@ import com.acgist.taoyao.signal.protocol.ProtocolRoomAdapter;
]
"""
},
flow = "终端=>信令服务->终端"
flow = {
"终端=>信令服务->终端",
"终端=[进入房间]>信令服务->终端",
}
)
public class RoomClientListProtocol extends ProtocolRoomAdapter implements ApplicationListener<RoomEnterEvent> {