Server-Neustart im laufenden Match: Map wieder laden, volle Leerlauf-Frist ab Start
This commit is contained in:
1 parent
1b3536452c
commit
dfcca1be82
2 files changed
+37
-4
No files matched your search
@@ -392,7 +392,8 @@ export class ServerManager {
|
||||
maybeConfigure(matchId) {
|
||||
const match = this.service.getMatch(matchId);
|
||||
const row = this.row(matchId);
|
||||
if (match.status === 'server_setup' && row?.status === 'ready') {
|
||||
// Auch im laufenden Match: nach einem Neustart des Servers die aktuelle Map samt Passwort wieder laden
|
||||
if (['server_setup', 'live'].includes(match.status) && row?.status === 'ready') {
|
||||
this.configure(matchId).catch((err) => this.logger.error(err));
|
||||
}
|
||||
}
|
||||
@@ -467,7 +468,7 @@ export class ServerManager {
|
||||
await this.provision(matchId);
|
||||
return;
|
||||
}
|
||||
if (row.status === 'config_failed' || (row.status === 'ready' && match.status === 'server_setup')) {
|
||||
if (row.status === 'config_failed' || (row.status === 'ready' && ['server_setup', 'live'].includes(match.status))) {
|
||||
this.service.log(matchId, 'server', 'Organisator wiederholt die Konfiguration');
|
||||
this.configure(matchId).catch((err) => this.logger.error(err));
|
||||
return;
|
||||
@@ -591,11 +592,12 @@ export class ServerManager {
|
||||
continue;
|
||||
}
|
||||
const webActive = this.service.presence(row.match_id).size > 0;
|
||||
let lastUse = match.last_activity_at;
|
||||
// Ein (neu) gestarteter Server zählt als Nutzung, sonst stoppt ein Neustart nach langer Pause sofort wieder
|
||||
let lastUse = Math.max(match.last_activity_at, row.started_at ?? 0);
|
||||
if (row.status === 'configured' && row.player_count !== null) {
|
||||
// Echter Server mit bekannter Spielerzahl: entscheidend ist, ob jemand auf dem Server ist.
|
||||
if (row.player_count > 0) continue;
|
||||
lastUse = Math.max(row.configured_at ?? 0, row.last_player_seen_at ?? 0);
|
||||
lastUse = Math.max(row.configured_at ?? 0, row.last_player_seen_at ?? 0, row.started_at ?? 0);
|
||||
} else if (webActive) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user