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>()
|
const gameStore = new Map<string, Game>()
|
||||||
|
|
||||||
matchmaker.onPlayersPaired = (userKey1: string, userKey2: string) => {
|
matchmaker.onPlayersPaired = (userKey1: string, userKey2: string) => {
|
||||||
|
console.log('onPlayersPaired');
|
||||||
const game = createGame(userKey1, userKey2)
|
const game = createGame(userKey1, userKey2)
|
||||||
gameStore.set(userKey1, game)
|
gameStore.set(userKey1, game)
|
||||||
gameStore.set(userKey2, game)
|
gameStore.set(userKey2, game)
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export class MatchMaker {
|
|||||||
public onPlayersPaired!: (userKey1: string, userKey2: string) => void
|
public onPlayersPaired!: (userKey1: string, userKey2: string) => void
|
||||||
|
|
||||||
public find(userKey : string) : void{
|
public find(userKey : string) : void{
|
||||||
if(this.waitingUserKey == userKey) return;
|
if(this.waitingUserKey === userKey) return;
|
||||||
if(this.waitingUserKey){
|
if(this.waitingUserKey){
|
||||||
const user1 = this.waitingUserKey as string
|
const user1 = this.waitingUserKey as string
|
||||||
this.waitingUserKey = undefined
|
this.waitingUserKey = undefined
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user