From fbad40bb9bd111bb1f7256d8156f4b70450860b7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 18 Jan 2024 17:50:24 +0900 Subject: [PATCH] wip --- packages/backend/src/core/GlobalEventService.ts | 2 +- packages/backend/src/core/ReversiService.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/core/GlobalEventService.ts b/packages/backend/src/core/GlobalEventService.ts index 9e44b2c10f..b9b44b45b1 100644 --- a/packages/backend/src/core/GlobalEventService.ts +++ b/packages/backend/src/core/GlobalEventService.ts @@ -165,7 +165,7 @@ export interface ReversiEventTypes { game: Packed<'ReversiGame'>; }; invited: { - game: Packed<'ReversiGame'>; + game: Packed<'ReversiMatching'>; }; } diff --git a/packages/backend/src/core/ReversiService.ts b/packages/backend/src/core/ReversiService.ts index adaf3fbaff..8542da68f9 100644 --- a/packages/backend/src/core/ReversiService.ts +++ b/packages/backend/src/core/ReversiService.ts @@ -89,10 +89,6 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { const packed = await this.reversiGameEntityService.pack(game, { id: exist.parentId }); this.globalEventService.publishReversiStream(exist.parentId, 'matched', { game: packed }); - const other = await this.reversiMatchingsRepository.countBy({ - childId: me.id, - }); - return game; } else { const child = targetUser; @@ -168,9 +164,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { } function getRandomMap() { - const mapCount = Object.entries(maps).length; + const mapCount = Object.entries(Reversi.maps).length; const rnd = Math.floor(Math.random() * mapCount); - return Object.values(maps)[rnd].data; + return Object.values(Reversi.maps)[rnd].data; } const map = freshGame.map != null ? freshGame.map : getRandomMap();