schedule game duration based on time of day

This commit is contained in:
Evan
2025-03-01 21:03:21 -08:00
parent 6496c2b5b7
commit a3ae44ddb1
7 changed files with 70 additions and 33 deletions
+8 -4
View File
@@ -30,11 +30,15 @@ export abstract class DefaultServerConfig implements ServerConfig {
turnIntervalMs(): number {
return 100;
}
gameCreationRate(): number {
return 30 * 1000;
gameCreationRate(highTraffic: boolean): number {
if (highTraffic) {
return 30 * 1000;
} else {
return 60 * 1000;
}
}
lobbyLifetime(): number {
return 1 * 60 * 1000;
lobbyLifetime(highTraffic: boolean): number {
return this.gameCreationRate(highTraffic) * 2;
}
workerIndex(gameID: GameID): number {
return simpleHash(gameID) % this.numWorkers();