This commit is contained in:
yumoqing 2024-10-09 19:37:38 +08:00
parent bc1b52d5de
commit 938b6fa850

View File

@ -77,11 +77,16 @@ bricks.Signaling = class {
this.sessionhandlers[sessiontype] = handler;
}
async recvdata_handler(data){
if (data.type == 'login'){
this.peers[data.msgfrom.id] = data.msgfrom;
if (data.type == 'online'){
data.online.forEach(p => {
var d = self.peers[p.id];
if (!d) d = {};
d = bricks.extend(d, p);
self.peers[p.id] = d;
})
return;
}
if (data.type == 'logout'){
if (data.type == 'new_session'){
var peers = {};
Object.keys(this.peers).forEach(k =>{
if (k != data.msgfrom.id){