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

55 commits

Author SHA1 Message Date
6cfd4990a6 clippy fixes 2026-08-31 23:07:45 +02:00
Peter
56f0856441 Write protocol dependent lengths when encoding
CreateStringTable and TempEntities both read their payload length as a fixed
width field on protocol 23 and older and as a var int after that, but the
encoders always write the var int. Reencoding an older demo therefore hands
the game a length it can't read: string tables come back as "bogus substring
index", and any packet carrying temp entities is malformed from there on,
taking whatever messages follow it in that packet with it.

The threshold and both widths are taken from the read paths a few lines up in
these same two files rather than worked out separately, so the two sides can't
drift: > 23, with 20 bits for CreateStringTable and 17 for TempEntities. The
engine agrees, for what it's worth - netmessages.cpp reads both of these under
> PROTOCOL_VERSION_23 at NET_MAX_PAYLOAD_BITS_V23 + 3 and
NET_MAX_PAYLOAD_BITS_V23 respectively, and that constant is 17.

serverinfo and prefetch already branch on the protocol on both sides, these
two were the only ones that didn't.

On a protocol 15 demo that was 28909 of 92518 reencoded packets failing to
parse back; on test_data/protocol23.dem, 13220 of 43327. Both are zero now,
so protocol23.dem can join the reencode round trip test. Protocol 24 output
is unchanged, byte for byte.
2026-08-31 11:58:21 +01:00
fbaca025b6 feature gate write support, use hash to compare game event definitions 2025-07-15 16:06:23 +02:00
b9d311f16f no need to allocate for 4 byte magic 2025-07-13 23:40:28 +02:00
1d71aa8ba6 remove some slice indexing 2024-04-07 16:48:19 +02:00
e0ec7db236 proper baseline index type 2024-04-07 16:48:19 +02:00
a561cbaf64 clippy fixes 2023-06-03 18:30:30 +02:00
a7a46384ce additional hardening against mallformed demos 2022-12-13 22:06:07 +01:00
Mark Blum
7d5edd9de8 Applied a number of clippy suggestions 2021-08-27 02:34:51 -04:00
099c2d33b9 packet clone 2021-07-27 22:53:18 +02:00
93b51bff70 schemars 2021-07-25 17:26:53 +02:00
43b7270fcd wip 2021-07-25 17:04:50 +02:00
03f8b8a424 add serde support for packets 2021-07-25 15:09:36 +02:00
522b282962 remove the need for full reserve 2021-07-24 16:05:23 +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
3c128e54c8 always use updatestringtable code path 2021-07-22 22:28:57 +02:00
d4a92c04bb better varint 2021-07-22 17:24:45 +02:00
a6ba0c20ec string table history while writing 2021-07-21 18:13:27 +02:00
4843fe0600 packetentities write? 2021-07-20 13:52:47 +02:00
62026515d7 string table messages write 2021-07-19 18:00:14 +02:00
34533a9608 write TempEntitiesMessage 2021-07-18 21:41:06 +02:00
5573ec5db2 clippy fixes 2021-07-17 15:37:15 +02:00
bb79d269d8 add some sanity checks to compressed and decompressed size for snap encoded string tables 2021-05-23 14:09:28 +02:00
4d87f5b279 prevent panic on invalid compressed stringtable size
fixes #2
2021-05-22 17:35:27 +02:00
1258827b54 update dependencies 2021-02-12 23:21:27 +01:00
Tails8521
b7e6db1f4f made DemoTicker cloneable 2021-01-11 20:46:58 +01:00
e5e54de65d make parserstate static 2020-12-06 20:55:02 +01:00
25f24b63f6 remove the need to allocate all messages in a packet 2020-12-06 19:30:54 +01:00
9f0acad361 cow stringtable 2020-12-06 17:42:15 +01:00
a4ddd586dd borrowed data 2020-12-06 00:55:54 +01:00
c0117de169 adjust to bitbuffer rename 2020-02-13 00:02:43 +01:00
3caadadb3b harden against dos with crafted input by limiting reserved vec/map size 2020-01-19 22:13:12 +01:00
e412399309 fix panic in log_base2 in malformed demos 2020-01-19 21:15:03 +01:00
11c7fb507f clippy fixes 2019-12-15 14:41:45 +01:00
4cf1e92657 optimize packet/message format a bit 2019-10-11 22:07:36 +02:00
8d6ef8e2fb some error cleanup 2019-10-05 13:12:25 +02:00
77180520ef some error refactoring 2019-08-23 12:32:26 +02:00
1b9befd165 remove the need to clone text entries 2019-08-12 14:19:07 +02:00
a9c76eb27c minor cleanup 2019-08-12 12:46:26 +02:00
8442c5e385 minor cleanup 2019-08-11 13:25:47 +02:00
e005f35f73 improved error handling 2019-08-10 23:01:33 +02:00
ff18680a02 sendprop decoding 2019-08-10 22:57:07 +02:00
128bf1ceb2 skip messages we dont care about 2019-03-17 18:44:33 +01:00
9f622385ca cleanup 2019-03-06 22:20:51 +01:00
3783eb5d9e remove the need to keep the full stringtables in state 2019-03-06 17:15:42 +01:00
a24dc3ada2 remove old dependencies 2019-03-05 22:11:41 +01:00
713ab0de42 track rounds 2019-03-04 21:03:04 +01:00
6a47c91636 track spawns 2019-03-04 20:56:12 +01:00
f335dc2163 read createstringtable entries as list directly 2019-03-04 17:45:51 +01:00