[*] 日常优化
This commit is contained in:
@@ -864,6 +864,9 @@ class Taoyao extends RemoteClient {
|
||||
case "session::resume":
|
||||
me.defaultSessionResume(message);
|
||||
break;
|
||||
case "room::broadcast":
|
||||
me.defaultRoomBroadcast(message);
|
||||
break;
|
||||
case "room::client::list":
|
||||
me.defaultRoomClientList(message);
|
||||
break;
|
||||
@@ -2240,6 +2243,40 @@ class Taoyao extends RemoteClient {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间广播信令
|
||||
*
|
||||
* @param {*} message 信令消息
|
||||
*/
|
||||
defaultRoomBroadcast(message) {
|
||||
console.debug("房间广播", message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间广播信令
|
||||
*
|
||||
* @param {*} message 信令消息
|
||||
*/
|
||||
roomBroadcast(message) {
|
||||
this.push(protocol.buildMessage("room::broadcast", {
|
||||
roomId : this.roomId,
|
||||
...message
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} clientId 终端ID
|
||||
*
|
||||
* @returns 终端所有ID
|
||||
*/
|
||||
async roomClientListId(clientId) {
|
||||
const response = await this.request(protocol.buildMessage("room::client::list::id", {
|
||||
roomId : this.roomId,
|
||||
clientId: clientId
|
||||
}));
|
||||
return response.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间终端列表信令
|
||||
*
|
||||
@@ -2257,22 +2294,6 @@ class Taoyao extends RemoteClient {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} clientId 终端ID
|
||||
*
|
||||
* @returns 终端所有ID
|
||||
*/
|
||||
async roomClientListId(clientId) {
|
||||
const me = this;
|
||||
const response = await me.request(
|
||||
protocol.buildMessage("room::client::list::id", {
|
||||
roomId : me.roomId,
|
||||
clientId: clientId
|
||||
})
|
||||
);
|
||||
return response.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭房间信令
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user