Echte Logdatei durch anonymisierte Fassung ersetzen

Die Testdatei enthielt Spielernamen und SteamID eines echten Accounts.
Sie ist jetzt durch eine Kopie mit Platzhaltern ersetzt, der Parser-Test
prüft weiterhin echte CS2-Logzeilen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SPP UserandClaude Opus 5.5 committed 2026-10-29 07:38:38 +01:00
1 parent 11ccbf01a1
commit 5383008c8e
3 files changed
+87 -3

No files matched your search

+1 -1
View File
@@ -311,7 +311,7 @@ Beim Konfigurieren setzt CS2 Mapveto auf dem Server `log on` und `logaddress_add
- Stream-Seite
- **Nach dem Spielende:** Ist die Serie noch offen, lädt CS2 Mapveto nach `SERIES_AUTO_ADVANCE_SECONDS` (Standard 30) die nächste Map. Ist sie entschieden (z. B. 2:0 im Best of 3), wird das Match abgeschlossen und der Server freigegeben. Mit `-1` geht beides nur manuell.
- **Voraussetzung:** Der CS2-Server muss `LOG_RECEIVER_URL` erreichen, im LAN z. B. `http://192.168.178.31:3000`. Ob Daten ankommen, zeigt das Serverpanel des Organisators. Mit `LOG_DEBUG=true` gibt das Backend alle empfangenen Zeilen aus.
- **Geprüft:** mit echten Logzeilen eines CS2-Servers (Wingman), siehe `server/test/fixtures/echte-logs-wingman.log`.
- **Geprüft:** mit echten Logzeilen eines CS2-Servers (Wingman), anonymisiert in `server/test/fixtures/wingman-anonym.log`.
Zwei Eigenheiten von CS2 berücksichtigt der Parser:
- CS2 sendet `Match_Start` schon beim Laden der Map. Gezählt wird erst, nachdem der Organisator „Aufwärmphase beenden“ geklickt hat.
+84
View File
@@ -0,0 +1,84 @@
10/25/2026 - 18:06:44.021 - rcon from "192.168.178.31:54420": command "status"
10/25/2026 - 18:06:48.883 - "Spieler1<0><[U:1:1000001]><>" entered the game
10/25/2026 - 18:07:05.771 - "Spieler1<0><[U:1:1000001]>" switched from team <Unassigned> to <CT>
10/25/2026 - 18:07:18.570 - "Spieler1<0><[U:1:1000001]><CT>" [1331 132 138] killed "Sarge<10><BOT><TERRORIST>" [1410 322 128] with "usp_silencer" (headshot)
10/25/2026 - 18:07:52.100 - rcon from "192.168.178.31:61554": command "mp_warmup_pausetimer 0"
10/25/2026 - 18:07:52.381 - rcon from "192.168.178.31:61554": command "mp_warmup_end"
10/25/2026 - 18:07:52.396 - Starting Freeze period
10/25/2026 - 18:07:52.396 - JSON_BEGIN{
10/25/2026 - 18:07:52.396 - "name": "round_stats",
10/25/2026 - 18:07:52.396 - "round_number" : "1",
10/25/2026 - 18:07:52.396 - "map" : "de_inferno",
10/25/2026 - 18:07:52.396 - }}JSON_END
10/25/2026 - 18:07:52.396 - World triggered "Match_Start" on "de_inferno"
10/25/2026 - 18:07:52.396 - Team playing "CT": MaxLAN Blau
10/25/2026 - 18:07:52.396 - Team playing "TERRORIST": MaxLAN Rot
10/25/2026 - 18:07:52.396 - "Darryl<12><BOT><TERRORIST>" triggered "Got_The_Bomb"
10/25/2026 - 18:07:52.396 - MatchStatus: Team playing "CT": MaxLAN Blau
10/25/2026 - 18:07:52.396 - MatchStatus: Team playing "TERRORIST": MaxLAN Rot
10/25/2026 - 18:07:52.396 - MatchStatus: Score: 0:0 on map "de_inferno" RoundsPlayed: 0
10/25/2026 - 18:08:01.869 - World triggered "Round_Start"
10/25/2026 - 18:08:24.463 - "Darryl<12><BOT><TERRORIST>" triggered "Planted_The_Bomb" at bombsite A
10/25/2026 - 18:08:30.541 - "Darryl<12><BOT><TERRORIST>" [2059 398 160] killed "Maximus<11><BOT><CT>" [2356 255 126] with "glock"
10/25/2026 - 18:08:30.541 - Team "TERRORIST" triggered "SFUI_Notice_Terrorists_Win" (CT "0") (T "1")
10/25/2026 - 18:08:30.541 - Team "CT" scored "0" with "3" players
10/25/2026 - 18:08:30.541 - Team "TERRORIST" scored "1" with "2" players
10/25/2026 - 18:08:30.541 - MatchStatus: Team playing "CT": MaxLAN Blau
10/25/2026 - 18:08:30.541 - MatchStatus: Team playing "TERRORIST": MaxLAN Rot
10/25/2026 - 18:08:30.541 - MatchStatus: Score: 0:1 on map "de_inferno" RoundsPlayed: 1
10/25/2026 - 18:08:30.541 - World triggered "Round_End"
10/25/2026 - 18:08:33.541 - Starting Freeze period
10/25/2026 - 18:08:33.541 - MatchStatus: Team playing "CT": MaxLAN Blau
10/25/2026 - 18:08:33.541 - MatchStatus: Team playing "TERRORIST": MaxLAN Rot
10/25/2026 - 18:08:33.541 - MatchStatus: Score: 0:1 on map "de_inferno" RoundsPlayed: 1
10/25/2026 - 18:08:36.543 - World triggered "Round_Start"
10/25/2026 - 18:09:08.839 - "Spieler1<0><[U:1:1000001]><CT>" [2254 1009 159] killed "Sarge<10><BOT><TERRORIST>" [2287 352 132] with "famas" (headshot)
10/25/2026 - 18:09:08.839 - Team "CT" triggered "SFUI_Notice_CTs_Win" (CT "1") (T "1")
10/25/2026 - 18:09:08.839 - Team "CT" scored "1" with "3" players
10/25/2026 - 18:09:08.839 - Team "TERRORIST" scored "1" with "3" players
10/25/2026 - 18:09:08.839 - MatchStatus: Team playing "CT": MaxLAN Blau
10/25/2026 - 18:09:08.839 - MatchStatus: Team playing "TERRORIST": MaxLAN Rot
10/25/2026 - 18:09:08.839 - MatchStatus: Score: 1:1 on map "de_inferno" RoundsPlayed: 2
10/25/2026 - 18:09:08.839 - World triggered "Round_End"
10/25/2026 - 18:09:17.339 - "Spieler1<0><[U:1:1000001]>" switched from team <CT> to <TERRORIST>
10/25/2026 - 18:09:17.339 - "Sarge<10><BOT>" switched from team <TERRORIST> to <CT>
10/25/2026 - 18:09:17.339 - Starting Freeze period
10/25/2026 - 18:09:17.339 - "Spieler1<0><[U:1:1000001]><TERRORIST>" triggered "Got_The_Bomb"
10/25/2026 - 18:09:17.339 - MatchStatus: Team playing "CT": MaxLAN Blau
10/25/2026 - 18:09:17.339 - MatchStatus: Team playing "TERRORIST": MaxLAN Rot
10/25/2026 - 18:09:17.339 - MatchStatus: Score: 1:1 on map "de_inferno" RoundsPlayed: 2
10/25/2026 - 18:09:26.841 - World triggered "Round_Start"
10/25/2026 - 18:09:35.935 - "Spieler1<0><[U:1:1000001]><TERRORIST>" [1167 474 111] killed "Darryl<12><BOT><CT>" [1326 435 129] with "deagle" (headshot)
10/25/2026 - 18:09:35.935 - Team "TERRORIST" triggered "SFUI_Notice_Terrorists_Win" (CT "1") (T "2")
10/25/2026 - 18:09:35.935 - Team "CT" scored "1" with "3" players
10/25/2026 - 18:09:35.935 - Team "TERRORIST" scored "2" with "4" players
10/25/2026 - 18:09:35.935 - MatchStatus: Team playing "CT": MaxLAN Rot
10/25/2026 - 18:09:35.935 - MatchStatus: Team playing "TERRORIST": MaxLAN Blau
10/25/2026 - 18:09:35.935 - MatchStatus: Score: 1:2 on map "de_inferno" RoundsPlayed: 3
10/25/2026 - 18:09:35.935 - World triggered "Round_End"
10/25/2026 - 18:09:38.935 - Starting Freeze period
10/25/2026 - 18:09:38.935 - MatchStatus: Team playing "CT": MaxLAN Rot
10/25/2026 - 18:09:38.935 - MatchStatus: Team playing "TERRORIST": MaxLAN Blau
10/25/2026 - 18:09:38.935 - MatchStatus: Score: 1:2 on map "de_inferno" RoundsPlayed: 3
10/25/2026 - 18:09:41.936 - World triggered "Round_Start"
10/25/2026 - 18:09:59.311 - "Spieler1<0><[U:1:1000001]><TERRORIST>" [1364 124 132] killed "Sarge<10><BOT><CT>" [1746 -51 135] with "ak47"
10/25/2026 - 18:09:59.311 - Team "TERRORIST" triggered "SFUI_Notice_Terrorists_Win" (CT "1") (T "3")
10/25/2026 - 18:09:59.311 - Team "CT" scored "1" with "5" players
10/25/2026 - 18:09:59.311 - Team "TERRORIST" scored "3" with "2" players
10/25/2026 - 18:09:59.311 - MatchStatus: Team playing "CT": MaxLAN Rot
10/25/2026 - 18:09:59.311 - MatchStatus: Team playing "TERRORIST": MaxLAN Blau
10/25/2026 - 18:09:59.311 - MatchStatus: Score: 1:3 on map "de_inferno" RoundsPlayed: 4
10/25/2026 - 18:09:59.311 - World triggered "Round_End"
10/25/2026 - 18:09:59.311 - ACCOLADE, FINAL: {killreward}, Spieler1<0>, VALUE: 1800.000000, POS: 1, SCORE: 70.000000
10/25/2026 - 18:09:59.311 - MatchStatus: Team playing "CT": MaxLAN Rot
10/25/2026 - 18:09:59.311 - MatchStatus: Team playing "TERRORIST": MaxLAN Blau
10/25/2026 - 18:09:59.311 - MatchStatus: Score: 1:3 on map "de_inferno" RoundsPlayed: 4
10/25/2026 - 18:09:59.311 - Game Over: scrimcomp2v2 de_inferno score 1:3 after 3 min
10/25/2026 - 18:10:24.326 - World triggered "Match_Start" on "de_inferno"
10/25/2026 - 18:10:24.326 - Team playing "CT": MaxLAN Rot
10/25/2026 - 18:10:24.326 - Team playing "TERRORIST": MaxLAN Blau
10/25/2026 - 18:10:24.326 - MatchStatus: Score: 0:0 on map "de_inferno" RoundsPlayed: -1
10/25/2026 - 18:10:26.336 - World triggered "Warmup_Start"
10/25/2026 - 18:10:31.304 - World triggered "Game_Commencing"
10/25/2026 - 18:10:31.304 - World triggered "Match_Start" on "de_inferno"
10/25/2026 - 18:10:33.293 - World triggered "Warmup_Start"
+2 -2
View File
@@ -60,8 +60,8 @@ test('Seitenzuordnung nach dem Rundenende hat Vorrang, veraltete Zeilen zu Runde
assert.deepEqual(s.rounds.map((r) => r.winner), ['A', 'B']);
});
test('Echte Logzeilen eines CS2-Servers (Wingman, 4 Runden, Halbzeit nach 2)', () => {
const lines = fs.readFileSync(path.join(here, 'fixtures', 'echte-logs-wingman.log'), 'utf8').split(/\r?\n/).filter(Boolean);
test('Echte, anonymisierte Logzeilen eines CS2-Servers (Wingman, 4 Runden, Halbzeit nach 2)', () => {
const lines = fs.readFileSync(path.join(here, 'fixtures', 'wingman-anonym.log'), 'utf8').split(/\r?\n/).filter(Boolean);
const warmupEnd = lines.findIndex((l) => l.includes('command "mp_warmup_end"'));
const ctx = { teamNames: { A: 'MaxLAN Blau', B: 'MaxLAN Rot' }, maxRounds: 4, overtimeRounds: 6 };