+ ? html`
${translateText("ranked_queue.loading_leaderboard")}
`
: this.leaderboard.length === 0
- ? html`
+ ? html`
${translateText("ranked_queue.no_ranked_players")}
`
: html`
@@ -486,13 +613,13 @@ export class RankedQueue extends LitElement {
${this.leaderboard.slice(0, 10).map(
(entry) => html`
#${entry.rank}
@@ -500,15 +627,9 @@ export class RankedQueue extends LitElement {
${entry.username}
-
+
${entry.gamesPlayed}
- ${translateText("ranked_queue.games")} •
- ${entry.wins}${translateText(
- "ranked_queue.wins_short",
- )}
- ${entry.losses}${translateText(
- "ranked_queue.losses_short",
- )}
+ ${translateText("ranked_queue.games")}
@@ -516,7 +637,7 @@ export class RankedQueue extends LitElement {
${entry.currentElo}
-
+
${translateText("ranked_queue.elo")}
@@ -529,7 +650,7 @@ export class RankedQueue extends LitElement {
`
: ""}
-
+
`;
}
}
diff --git a/src/server/MapSelection.ts b/src/server/MapSelection.ts
index 0a7c40ae2..955b20d54 100644
--- a/src/server/MapSelection.ts
+++ b/src/server/MapSelection.ts
@@ -7,6 +7,7 @@ export interface MapSelectionCriteria {
playerCount: number;
gameMode: GameMode;
queueType: "ranked" | "unranked";
+ matchMode?: "ffa" | "team" | "duel" | "duos" | "trios" | "quads";
}
/**
@@ -16,7 +17,11 @@ export interface MapSelectionCriteria {
export function selectMapForRanked(
criteria: MapSelectionCriteria,
): GameMapType {
- const { playerCount, gameMode } = criteria;
+ const { playerCount, gameMode, matchMode } = criteria;
+
+ if (matchMode === "duel") {
+ return GameMapType.Australia;
+ }
// Get maps that can handle this player count
const suitableMaps = getSuitableMaps(playerCount);
diff --git a/src/server/RankedGameConfig.ts b/src/server/RankedGameConfig.ts
index 9a12e3799..48ce769ef 100644
--- a/src/server/RankedGameConfig.ts
+++ b/src/server/RankedGameConfig.ts
@@ -1,15 +1,18 @@
import {
Difficulty,
+ Duos,
GameMapSize,
GameMapType,
GameMode,
GameType,
+ Quads,
+ Trios,
} from "../core/game/Game";
import { GameConfig, TeamCountConfig } from "../core/Schemas";
export interface RankedMatchConfig {
queueType: "ranked" | "unranked";
- gameMode: "ffa" | "team" | "duel";
+ gameMode: "ffa" | "team" | "duel" | "duos" | "trios" | "quads";
playerCount: number;
teamConfig?: TeamCountConfig;
}
@@ -25,11 +28,27 @@ export function buildRankedGameConfig(
): GameConfig {
const { gameMode, playerCount } = matchConfig;
const isDuel = gameMode === "duel";
- const mode = gameMode === "team" ? GameMode.Team : GameMode.FFA;
+ const isFFA = gameMode === "ffa";
+ const isTeamMode =
+ gameMode === "team" ||
+ gameMode === "duos" ||
+ gameMode === "trios" ||
+ gameMode === "quads";
+ const mode = isTeamMode ? GameMode.Team : GameMode.FFA;
+
+ // Determine team configuration based on game mode
+ let teamConfig: TeamCountConfig | undefined = matchConfig.teamConfig;
+ if (gameMode === "duos") {
+ teamConfig = Duos;
+ } else if (gameMode === "trios") {
+ teamConfig = Trios;
+ } else if (gameMode === "quads") {
+ teamConfig = Quads;
+ }
return {
gameMap: map,
- gameMapSize: isDuel ? GameMapSize.Compact : selectMapSize(playerCount),
+ gameMapSize: isDuel ? GameMapSize.Normal : selectMapSize(playerCount),
gameType: GameType.Public,
gameMode: mode,
maxPlayers: playerCount,
@@ -39,21 +58,21 @@ export function buildRankedGameConfig(
disableNPCs: isDuel ? true : false,
// Donation rules
- donateGold: mode === GameMode.Team,
- donateTroops: mode === GameMode.Team,
+ donateGold: isTeamMode,
+ donateTroops: isTeamMode,
// Standard settings
infiniteGold: false,
infiniteTroops: false,
instantBuild: false,
- randomSpawn: true,
+ randomSpawn: isFFA,
maxTimerValue: undefined,
// No disabled units in ranked
disabledUnits: [],
// Team configuration
- playerTeams: matchConfig.teamConfig,
+ playerTeams: teamConfig,
};
}
diff --git a/src/server/Worker.ts b/src/server/Worker.ts
index fd7256e51..2059f0c00 100644
--- a/src/server/Worker.ts
+++ b/src/server/Worker.ts
@@ -82,12 +82,13 @@ export async function startWorker() {
config,
log,
async (gameId, assignment) => {
- // Select map based on player count
+ // Select map based on player count and mode
const selectedMap = selectMapForRanked({
playerCount: assignment.config.playerCount,
gameMode:
assignment.config.gameMode === "ffa" ? GameMode.FFA : GameMode.Team,
queueType: assignment.config.queueType,
+ matchMode: assignment.config.gameMode,
});
// Build full game config