rewrote the authorisation flow: give more responsability to gameManager and less to gameScene
This commit is contained in:
parent
032facb75f
commit
02c193a262
14 changed files with 244 additions and 170 deletions
14
back/src/Model/RoomIdentifier.ts
Normal file
14
back/src/Model/RoomIdentifier.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
export class RoomIdentifier {
|
||||
public anonymous: boolean;
|
||||
public id:string
|
||||
constructor(roomID: string) {
|
||||
if (roomID.indexOf('_/') === 0) {
|
||||
this.anonymous = true;
|
||||
} else if(roomID.indexOf('@/') === 0) {
|
||||
this.anonymous = false;
|
||||
} else {
|
||||
throw new Error('Incorrect room ID: '+roomID);
|
||||
}
|
||||
this.id = roomID; //todo: extract more data from the id (like room slug, organization name, etc);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue