1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Game-neutral parsing infrastructure for Valve Source 2 demo files.
//!
//! The core crate owns the game-independent PBDEMS2 container, bit encodings,
//! flattened serializers, entity state, string tables, and coordinate helpers.
//! Game crates provide their generated protobuf types and select an entity
//! decoding dialect.
//!
//! The [`guide`] module explains the shared file structure, packet framing,
//! serializers, string tables, entities, adapter boundary, and playback flow.
//!
//! # Example
//!
//! Walk the outer command stream, decompressing each body in turn:
//!
//! ```no_run
//! use pbdems2::demo::Demo;
//!
//! let bytes = std::fs::read("match.dem")?;
//! let demo = Demo::new(&bytes)?;
//!
//! let mut body = Vec::new();
//! for frame in demo.commands() {
//! let frame = frame?;
//! frame.decode_body(&mut body)?;
//! println!("tick {}, command {}", frame.header().tick, frame.header().cmd);
//! }
//! # Ok::<(), pbdems2::Error>(())
//! ```
//!
//! Reading entity state needs a game crate's generated protobuf types:
//! implement [`DemoAdapter`] to convert them into the neutral types in
//! [`entity`], then drive it with [`DemoParser`].
pub use Entity;
pub use ;
pub use DecodeLimits;
pub use MappedDemo;
pub use ;
pub use ;