Stage 254
This commit is contained in:
parent
454b820669
commit
a6c23b2d1b
|
@ -28,6 +28,7 @@ export default class Room extends EventTarget
|
||||||
public name? : string;
|
public name? : string;
|
||||||
public owner? : string;
|
public owner? : string;
|
||||||
public peers? : Map<string,Peer>;
|
public peers? : Map<string,Peer>;
|
||||||
|
public ifexistsJoin : boolean = false;
|
||||||
|
|
||||||
constructor(wsts:MWSE){
|
constructor(wsts:MWSE){
|
||||||
super();
|
super();
|
||||||
|
@ -39,15 +40,16 @@ export default class Room extends EventTarget
|
||||||
{
|
{
|
||||||
this.roomId = options;
|
this.roomId = options;
|
||||||
}else{
|
}else{
|
||||||
Object.assign({
|
let defaultOptions = {
|
||||||
joinType: "free",
|
joinType: "free",
|
||||||
ifexistsJoin: true,
|
ifexistsJoin: true,
|
||||||
accessType: "private",
|
accessType: "private",
|
||||||
notifyActionInvite: true,
|
notifyActionInvite: true,
|
||||||
notifyActionJoined: true,
|
notifyActionJoined: true,
|
||||||
notifyActionEjected: true
|
notifyActionEjected: true
|
||||||
},options);
|
};
|
||||||
this.options = options;
|
Object.assign(defaultOptions,options);
|
||||||
|
this.options = defaultOptions as IRoomOptions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +64,7 @@ export default class Room extends EventTarget
|
||||||
});
|
});
|
||||||
if(result.status == 'fail')
|
if(result.status == 'fail')
|
||||||
{
|
{
|
||||||
if(result.message == "ALREADY-EXISTS")
|
if(result.message == "ALREADY-EXISTS" && this.ifexistsJoin)
|
||||||
{
|
{
|
||||||
return this.join();
|
return this.join();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue