Admin: Pausenanzeige, Live-Stand und passender Umschalter
Pausierte Matches zeigen ein Badge und den Knopf Fortsetzen. Laufende Matches zeigen Map, Stand und Runde. Der Pausenzustand wird gespeichert und bei Mapwechsel oder Serverstopp zurückgesetzt.
This commit is contained in:
1 parent
c4debd3014
commit
9f34777d10
5 files changed
+25
-5
No files matched your search
@@ -128,4 +128,6 @@ function migrate(db) {
|
||||
for (const [name, type] of add) {
|
||||
if (!seriesColumns.has(name)) db.exec(`ALTER TABLE series_maps ADD COLUMN ${name} ${type}`);
|
||||
}
|
||||
const serverColumns = columns('servers');
|
||||
if (!serverColumns.has('paused')) db.exec('ALTER TABLE servers ADD COLUMN paused INTEGER NOT NULL DEFAULT 0');
|
||||
}
|
||||
@@ -944,6 +944,7 @@ export class MatchService extends EventEmitter {
|
||||
status: row.status,
|
||||
message: row.message,
|
||||
playerCount: row.player_count,
|
||||
paused: !!row.paused,
|
||||
attempts: row.attempts,
|
||||
updatedAt: row.updated_at,
|
||||
idleTimeoutMinutes: this.config.idleTimeoutMinutes,
|
||||
|
||||
@@ -308,7 +308,8 @@ export class ServerManager {
|
||||
if (!seriesMap) throw new HttpError(409, 'Das Veto ist noch nicht abgeschlossen', 'veto_pending');
|
||||
|
||||
const mapName = pool.maps.find((m) => m.id === seriesMap.map)?.name ?? seriesMap.map;
|
||||
this.update(matchId, { status: 'configuring', message: `Lade Map ${seriesMap.number}: ${mapName}` });
|
||||
// Ein Mapwechsel beendet die Pause, CS2 lädt die Map neu
|
||||
this.update(matchId, { status: 'configuring', paused: 0, message: `Lade Map ${seriesMap.number}: ${mapName}` });
|
||||
this.service.log(matchId, 'server', `Konfiguration für Map ${seriesMap.number} (${mapName}) gestartet`);
|
||||
|
||||
const plan = buildMapCommands({
|
||||
@@ -418,8 +419,8 @@ export class ServerManager {
|
||||
} catch (err) {
|
||||
throw new HttpError(502, `Befehl konnte nicht gesendet werden: ${err.message}`, 'server_error');
|
||||
}
|
||||
this.update(viewer.matchId, { paused: paused ? 1 : 0 });
|
||||
this.service.log(viewer.matchId, 'server', paused ? 'Match pausiert (Admin)' : 'Match fortgesetzt (Admin)');
|
||||
this.service.changed(viewer.matchId);
|
||||
}
|
||||
|
||||
/** Demo-Modus: simuliert einen Matchverlauf, indem echte CS2-Logzeilen erzeugt und ausgewertet werden. */
|
||||
@@ -463,7 +464,7 @@ export class ServerManager {
|
||||
const row = this.row(matchId);
|
||||
if (!row || row.status === 'stopped') return;
|
||||
if (row.handle) await this.safeStop(row);
|
||||
this.update(matchId, { status: 'stopped', stopped_at: Date.now(), message: reason, player_count: null });
|
||||
this.update(matchId, { status: 'stopped', stopped_at: Date.now(), message: reason, player_count: null, paused: 0 });
|
||||
this.service.log(matchId, 'server', `Server gestoppt: ${reason}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user