1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-10-01 08:44:05 +02:00
Commit graph

7 commits

Author SHA1 Message Date
Peter
7c5c596d17 Use the demo's protocol version when reencoding
DemoHandler::default() starts out at protocol 24 and relies on handle_header
to replace that with whatever the demo actually is. Parsing through DemoParser
does this for you, but reencode drives the handler itself and never did, so
every demo got read as protocol 24.

Older protocols put a few fields at different widths, so the message stream
desyncs partway in. RawPacketStream reports that as a truncated demo rather
than an error, which is why nothing complains about it: reencode_demo on
test_data/protocol23.dem writes 1076 bytes, prints a truncation warning and
still exits 0.

The reencode test missed this because protocol23.dem was never in its list,
and because nothing checked the demo had been read to the end. Add a test for
that and the same assert to the existing round trip.

Output for protocol 24 demos is unchanged, byte for byte.
2026-08-31 11:14:15 +01:00
fbaca025b6 feature gate write support, use hash to compare game event definitions 2025-07-15 16:06:23 +02:00
a561cbaf64 clippy fixes 2023-06-03 18:30:30 +02:00
2l47
eb280c7467 Fix typos in 7 files: cased variants of sigon -> signon 2022-01-27 21:39:58 -06:00
185ff6365f handle protocol v23 string tables 2021-07-23 16:55:06 +02:00
966879a138 test header encoding 2021-07-20 23:28:33 +02:00
d3c50f8b4a reencode and reparse tests 2021-07-20 23:20:14 +02:00