This commit is contained in:
Scott Anderson
2025-05-13 02:26:03 -04:00
parent a38d3d986f
commit c28fe35b5a
4 changed files with 12 additions and 6 deletions
+5 -5
View File
@@ -61,13 +61,13 @@ export abstract class DefaultServerConfig implements ServerConfig {
);
}
otelEndpoint(): string {
return process.env.OTEL_ENDPOINT;
return process.env.OTEL_ENDPOINT ?? "undefined";
}
otelUsername(): string {
return process.env.OTEL_USERNAME;
return process.env.OTEL_USERNAME ?? "undefined";
}
otelPassword(): string {
return process.env.OTEL_PASSWORD;
return process.env.OTEL_PASSWORD ?? "undefined";
}
region(): string {
if (this.env() === GameEnv.Dev) {
@@ -89,7 +89,7 @@ export abstract class DefaultServerConfig implements ServerConfig {
}
r2Bucket(): string {
return process.env.R2_BUCKET;
return process.env.R2_BUCKET ?? "undefined";
}
adminHeader(): string {
@@ -219,7 +219,7 @@ export class DefaultConfig implements Config {
return this._serverConfig;
}
userSettings(): UserSettings | null {
userSettings(): UserSettings {
return this._userSettings;
}
+3
View File
@@ -55,6 +55,9 @@ export class BotExecution implements Execution {
}
private maybeAttack() {
if (this.behavior === null) {
throw new Error("not initialized");
}
const traitors = this.bot
.neighbors()
.filter((n) => n.isPlayer() && n.isTraitor()) as Player[];
+3
View File
@@ -42,6 +42,8 @@ export function assignTeams(
team = t;
}
if (team === null) continue;
for (const player of clanPlayers) {
if (teamSize < maxTeamSize) {
teamSize++;
@@ -63,6 +65,7 @@ export function assignTeams(
teamSize = p;
team = t;
}
if (team === null) continue;
teamPlayerCount.set(team, teamSize + 1);
result.set(player, team);
}
+1 -1
View File
@@ -19,7 +19,7 @@ import { TestServerConfig } from "./TestServerConfig";
export async function setup(
mapName: string,
_gameConfig: GameConfig = {},
_gameConfig: Partial<GameConfig> = {},
humans: PlayerInfo[] = [],
): Promise<Game> {
// Load the specified map