Stage 253
This commit is contained in:
		
							parent
							
								
									85590b9cfa
								
							
						
					
					
						commit
						5d1a19a94a
					
				| 
						 | 
				
			
			@ -21,13 +21,12 @@ export default class Room extends EventTarget
 | 
			
		|||
    public mwse : MWSE;
 | 
			
		||||
    public options! : IRoomOptions;
 | 
			
		||||
    public roomId? : string;
 | 
			
		||||
 | 
			
		||||
    public accessType? : "public"|"private";
 | 
			
		||||
    public description? : string;
 | 
			
		||||
    public joinType? : "free"|"invite"|"password"|"lock";
 | 
			
		||||
    public name? : string;
 | 
			
		||||
    public owner? : string;
 | 
			
		||||
    public peers? : Map<string,Peer>;
 | 
			
		||||
    public peers : Map<string,Peer> = new Map();
 | 
			
		||||
    public ifexistsJoin : boolean = false;
 | 
			
		||||
 | 
			
		||||
    constructor(wsts:MWSE){
 | 
			
		||||
| 
						 | 
				
			
			@ -107,13 +106,19 @@ export default class Room extends EventTarget
 | 
			
		|||
            type:'room-peers',
 | 
			
		||||
            roomId: this.roomId
 | 
			
		||||
        }) as {type:"success"|"fail", peers: string[]};
 | 
			
		||||
 | 
			
		||||
        let cup : Peer[] = [];
 | 
			
		||||
        
 | 
			
		||||
        if(type == 'fail')
 | 
			
		||||
        {
 | 
			
		||||
            throw new Error("Cant using peers on room")
 | 
			
		||||
        }else if(type == 'success'){
 | 
			
		||||
            for (const peer of peers) {
 | 
			
		||||
                this.mwse.peer(peer);
 | 
			
		||||
            for (const peerid of peers) {
 | 
			
		||||
                let peer = this.mwse.peer(peerid);
 | 
			
		||||
                cup.push(peer);
 | 
			
		||||
                this.peers.set(peerid, peer);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        };
 | 
			
		||||
        return cup;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
		Reference in New Issue