fix : matchmaker issue
This commit is contained in:
parent
ca829741e5
commit
4605e27d81
@ -49,6 +49,7 @@ rtmt.listenMessage(channel_new_game, (userKey: string, message: Object) => {
|
||||
const gameStore = new Map<string, Game>()
|
||||
|
||||
matchmaker.onPlayersPaired = (userKey1: string, userKey2: string) => {
|
||||
console.log('onPlayersPaired');
|
||||
const game = createGame(userKey1, userKey2)
|
||||
gameStore.set(userKey1, game)
|
||||
gameStore.set(userKey2, game)
|
||||
|
||||
@ -6,7 +6,7 @@ export class MatchMaker {
|
||||
public onPlayersPaired!: (userKey1: string, userKey2: string) => void
|
||||
|
||||
public find(userKey : string) : void{
|
||||
if(this.waitingUserKey == userKey) return;
|
||||
if(this.waitingUserKey === userKey) return;
|
||||
if(this.waitingUserKey){
|
||||
const user1 = this.waitingUserKey as string
|
||||
this.waitingUserKey = undefined
|
||||
|
||||
Loading…
Reference in New Issue
Block a user