Skip to content

Commit 43189bc

Browse files
committed
Fix wrong handling of find server
1 parent bf6563f commit 43189bc

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

src/gameserver/command/FindGameServer/find-game-server.handler.ts

+2-39
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import {
1414
import { GetUserInfoQuery } from 'gateway/queries/GetUserInfo/get-user-info.query';
1515
import { GetUserInfoQueryResult } from 'gateway/queries/GetUserInfo/get-user-info-query.result';
1616
import { MatchEntity } from 'gameserver/model/match.entity';
17-
import { MatchmakingMode } from 'gateway/shared-types/matchmaking-mode';
18-
import { Dota_GameMode } from 'gateway/shared-types/dota-game-mode';
1917
import { MatchmakingModeMappingEntity } from 'gameserver/model/matchmaking-mode-mapping.entity';
20-
import { Dota_Map } from 'gateway/shared-types/dota-map';
2118
import { GamePreparedEvent } from 'gameserver/event/game-prepared.event';
2219
import { ConfigService } from '@nestjs/config';
2320

@@ -63,40 +60,6 @@ export class FindGameServerHandler
6360
await this.submitQueueTask(m.id, gsInfo);
6461
}
6562

66-
private async getMapForMatchMode(mode: MatchmakingMode): Promise<Dota_Map> {
67-
const mapping = await this.matchmakingModeMappingEntityRepository.findOne({
68-
where: {
69-
lobbyType: mode,
70-
},
71-
});
72-
73-
if (!mapping) {
74-
this.logger.error(
75-
`No mapping found for lobby type ${mode}! Returning all pick`,
76-
);
77-
return Dota_Map.DOTA;
78-
}
79-
return mapping.dotaMap;
80-
}
81-
82-
private async getGameModeForMatchMode(
83-
mode: MatchmakingMode,
84-
): Promise<Dota_GameMode> {
85-
const mapping = await this.matchmakingModeMappingEntityRepository.findOne({
86-
where: {
87-
lobbyType: mode,
88-
},
89-
});
90-
91-
if (!mapping) {
92-
this.logger.error(
93-
`No mapping found for lobby type ${mode}! Returning all pick`,
94-
);
95-
return Dota_GameMode.ALLPICK;
96-
}
97-
return mapping.dotaGameMode;
98-
}
99-
10063
private async extendMatchInfo(
10164
matchInfo: GamePreparedEvent,
10265
): Promise<GSMatchInfo> {
@@ -117,8 +80,8 @@ export class FindGameServerHandler
11780

11881
return new GSMatchInfo(
11982
matchInfo.mode,
120-
await this.getMapForMatchMode(matchInfo.mode),
121-
await this.getGameModeForMatchMode(matchInfo.mode),
83+
matchInfo.map,
84+
matchInfo.gameMode,
12285
matchInfo.roomId,
12386
players,
12487
matchInfo.version,

0 commit comments

Comments
 (0)