mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 21:04:14 +00:00
fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user