Skip to content

Commit

Permalink
hotfit: sidType 에러 방지 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
glaxyt committed Dec 5, 2024
1 parent f8857bc commit b7c8e11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/server/src/module/game/games/game.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ export class GameGateway implements OnGatewayConnection, OnGatewayDisconnect {
const gameInfo = JSON.parse(await this.redisService.get(`gameId=${pinCode}`));

const sidType = await this.gameService.checkSidType(sid);
if (!sidType) {
return;
}
const key = sidType.type === 'master' ? `master_sid=${sid}` : `participant_sid=${sid}`;

const data = JSON.parse(await this.redisService.get(key));
Expand Down Expand Up @@ -582,6 +585,9 @@ export class GameGateway implements OnGatewayConnection, OnGatewayDisconnect {
async handleMyInfo(client: Socket, payload: any) {
const { sid } = payload;
const sidType = await this.gameService.checkSidType(sid);
if (!sidType) {
return;
}
const key = sidType.type === 'master' ? `master_sid=${sid}` : `participant_sid=${sid}`;

const { nickname, character } = JSON.parse(await this.redisService.get(key));
Expand Down

0 comments on commit b7c8e11

Please sign in to comment.