bugfix
This commit is contained in:
parent
bc1b52d5de
commit
938b6fa850
@ -77,11 +77,16 @@ bricks.Signaling = class {
|
|||||||
this.sessionhandlers[sessiontype] = handler;
|
this.sessionhandlers[sessiontype] = handler;
|
||||||
}
|
}
|
||||||
async recvdata_handler(data){
|
async recvdata_handler(data){
|
||||||
if (data.type == 'login'){
|
if (data.type == 'online'){
|
||||||
this.peers[data.msgfrom.id] = data.msgfrom;
|
data.online.forEach(p => {
|
||||||
|
var d = self.peers[p.id];
|
||||||
|
if (!d) d = {};
|
||||||
|
d = bricks.extend(d, p);
|
||||||
|
self.peers[p.id] = d;
|
||||||
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data.type == 'logout'){
|
if (data.type == 'new_session'){
|
||||||
var peers = {};
|
var peers = {};
|
||||||
Object.keys(this.peers).forEach(k =>{
|
Object.keys(this.peers).forEach(k =>{
|
||||||
if (k != data.msgfrom.id){
|
if (k != data.msgfrom.id){
|
||||||
|
Loading…
Reference in New Issue
Block a user