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

69 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
e303969606 store last medic target 2025-08-07 23:22:35 +02:00
fbaca025b6 feature gate write support, use hash to compare game event definitions 2025-07-15 16:06:23 +02:00
f7190dca0f clippy fixes 2025-07-13 23:40:28 +02:00
8da61fb3d8 update snapshots 2025-07-12 22:27:36 +02:00
5a7d4e12aa heal target 2025-06-28 23:03:05 +02:00
15046e8744 medigun type, spy class data 2025-06-28 19:15:16 +02:00
1348384ca3 track cart 2025-06-26 20:22:13 +02:00
331a9fe593 project critical 2025-06-26 16:56:52 +02:00
809d2504f5 player condition handling 2025-06-26 00:32:52 +02:00
glyphpoch
624efb6427 Fix saturating overflow in ExtraData parsing
- Fix overflow in ExtraData by casting byte_len to usize before
multiplication. This was previously multiplying a u16 with
saturating_mul and would overflow when the extra data in string
tables reaches a certain size.
- Add test case for parsing large string table to verify correct
stream position after read.
2025-06-02 21:35:42 +01:00
43c9021ba2 update tests 2025-02-19 20:42:56 +01:00
a7a8318083 clippy fixes 2024-04-07 14:56:43 +02:00
217211f2fb show server send messages as chat 2024-03-29 16:26:43 +01:00
07039da23d switch to cargo-insta for snapshot testing 2023-12-21 23:02:41 +01:00
a561cbaf64 clippy fixes 2023-06-03 18:30:30 +02:00
28de17a67c strictly distinguish between server and demo ticks 2022-09-17 15:32:18 +02:00
307a6cf953 gamestate improvements 2022-08-25 23:54:46 +02:00
bae9acdd92 rework baseline prop handling 2022-08-06 15:19:56 +02:00
74ad7d121f pass parser state to handlers 2022-08-05 23:43:15 +02:00
2617d8a611 rename pvs 2022-04-10 18:43:54 +02:00
2l47
eb280c7467 Fix typos in 7 files: cased variants of sigon -> signon 2022-01-27 21:39:58 -06:00
24e83957d5 keep baselineprops seperate and add some tracing 2021-07-29 19:16:24 +02:00
57b207598f more tests 2021-07-23 21:38:57 +02:00
dfd27b87ad use correct test message 2021-07-23 18:51:18 +02:00
3055242fd9 fix tempentities for protocol version 23 2021-07-23 17:30:32 +02:00
185ff6365f handle protocol v23 string tables 2021-07-23 16:55:06 +02:00
431d91ad9a more tests 2021-07-22 22:32:55 +02:00
582285116b more message reencode tests 2021-07-22 22:28:28 +02:00
98b16b8eb9 packetentities is good now 2021-07-22 17:25:22 +02:00
00596f946f adjust tests 2021-07-22 14:58:43 +02:00
07d675a52d gameeventlist reencode tests 2021-07-22 13:27:20 +02:00
bd9d174444 properly reencode unknown game event definitions 2021-07-22 13:26:17 +02:00
875dc7120c more string table tests 2021-07-21 18:50:36 +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
e53aa10d80 saytext2 improvements 2021-07-20 23:02:00 +02:00
7fe9fd0fce dont store table name as string in sendpropdefinition 2021-07-18 20:31:38 +02:00
67a4ca5744 rename data folder 2021-07-11 17:49:25 +02:00
c2fe8eca07 ignore empty text messages 2021-06-03 23:44:43 +02:00
e2a631cef3 fix handling of some saytext2 messages 2021-02-16 17:13:27 +01:00
0a34318c65 normalize prop definitions during flatening 2021-02-13 16:39:11 +01:00
35519d5fce dont stop prop and table name in sendprop 2021-02-13 14:48:55 +01:00
df9a6a138e strongly typed sendpropdefinition 2021-02-13 01:25:03 +01:00
a4ddd586dd borrowed data 2020-12-06 00:55:54 +01:00
acc1584524 cleanup tests 2020-11-30 20:31:30 +01:00
90c5e6c7f9 improved handling of unicode chat messages 2020-02-09 16:40:34 +01:00
fd96ffaf47 fix parsing demos that only set their user info in stringtable updates 2020-02-02 22:36:30 +01:00
2306fa5d17 finish api changes and rawpacketstream 2019-12-22 16:53:47 +01:00
42358f243b parser api wip 2019-12-22 15:47:00 +01:00