Beispiel #1
0
 constructor(private _socket: Socket) {        
     // Join the rooms lobby to allow the player to create or join a game. 
     this._socket.connect();
     this.roomChannel = this._socket.channel("room:lobby", {});
     this.roomChannel.join();
 }    
Beispiel #2
0
 changeRoomChannel(id: any, name: any) {
     // Once a game has been created or selected, leave the lobby and join the room.
     this.roomChannel = this._socket.channel("room:" + id, { name: name });
     this.roomChannel.join();
 }