Aufwärmphase vor mp_warmup_end als beendet markieren
CS2 sendet Match_Start sofort nach mp_warmup_end, oft bevor die RCON-Antwort da ist. Bei fehlgeschlagenem Befehl wird die Markierung zurückgenommen.
This commit is contained in:
1 parent
263c7e7b7c
commit
ea2207899f
2 files changed
+5
-3
No files matched your search
@@ -322,13 +322,15 @@ export class ServerManager {
|
||||
const row = this.row(viewer.matchId);
|
||||
if (row?.status !== 'configured') throw new HttpError(409, 'Der Server ist noch nicht konfiguriert', 'wrong_state');
|
||||
if (!this.adapter.sendCommands) throw new HttpError(501, 'Dieser Adapter unterstützt keine Befehle', 'unsupported');
|
||||
// Vor dem Befehl markieren: CS2 schickt Match_Start sofort nach mp_warmup_end, oft bevor RCON antwortet.
|
||||
this.service.markWarmupEnded(viewer.matchId, true);
|
||||
try {
|
||||
await this.adapter.sendCommands(JSON.parse(row.handle), ['mp_warmup_pausetimer 0', 'mp_warmup_end']);
|
||||
} catch (err) {
|
||||
this.service.markWarmupEnded(viewer.matchId, false);
|
||||
throw new HttpError(502, `Befehl konnte nicht gesendet werden: ${err.message}`, 'server_error');
|
||||
}
|
||||
this.service.log(viewer.matchId, 'server', this.adapter.simulated ? 'Aufwärmphase beendet (simuliert)' : 'Aufwärmphase beendet – Match startet');
|
||||
this.service.markWarmupEnded(viewer.matchId);
|
||||
if (this.adapter.simulated) this.startDemoSimulation(viewer.matchId);
|
||||
this.service.changed(viewer.matchId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user