enhance(reversi): tweak reversi

This commit is contained in:
syuilo 2024-01-20 21:23:33 +09:00
parent 7d57487026
commit fcd7ffe956
6 changed files with 79 additions and 13 deletions

View file

@ -181,8 +181,8 @@ export interface ReversiGameEventTypes {
value: any;
};
log: Reversi.Serializer.Log & { id: string | null };
syncState: {
crc32: string;
heatbeat: {
userId: MiUser['id'];
};
started: {
game: Packed<'ReversiGameDetailed'>;

View file

@ -405,6 +405,11 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
return this.reversiGamesRepository.findOneBy({ id });
}
@bindThis
public async heatbeat(game: MiReversiGame, user: MiUser) {
this.globalEventService.publishReversiGameStream(game.id, 'heatbeat', { userId: user.id });
}
@bindThis
public dispose(): void {
}