## Description:

Add missing code that was meant to go in #1347

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
This commit is contained in:
Scott Anderson
2025-07-06 20:30:43 -04:00
committed by GitHub
parent 3a8ff6304a
commit e0936bf8d3
2 changed files with 17 additions and 6 deletions
+17 -2
View File
@@ -2,6 +2,7 @@ import { JWK } from "jose";
import { z } from "zod/v4";
import {
Difficulty,
Duos,
Game,
GameMapType,
GameMode,
@@ -10,9 +11,11 @@ import {
Player,
PlayerInfo,
PlayerType,
Quads,
TerrainType,
TerraNullius,
Tick,
Trios,
UnitInfo,
UnitType,
} from "../game/Game";
@@ -172,8 +175,20 @@ export abstract class DefaultServerConfig implements ServerConfig {
const r = Math.random();
const base = r < 0.3 ? l : r < 0.6 ? m : s;
let p = Math.min(mode === GameMode.Team ? Math.ceil(base * 1.5) : base, l);
if (typeof numPlayerTeams === "number") {
p -= p % numPlayerTeams;
if (numPlayerTeams === undefined) return p;
switch (numPlayerTeams) {
case Duos:
p -= p % 2;
break;
case Trios:
p -= p % 3;
break;
case Quads:
p -= p % 4;
break;
default:
p -= p % numPlayerTeams;
break;
}
return p;
}
-4
View File
@@ -17,10 +17,6 @@ export class DevServerConfig extends DefaultServerConfig {
return 5 * 1000;
}
lobbyMaxPlayers(): number {
return Math.random() < 0.5 ? 2 : 3;
}
samWarheadHittingChance(): number {
return 1;
}