Send Tables¶
Parses flattened serializers into the schema tree used to decode packet entities and their fields.
See also: Send Tables & Schema
gem.sendtable.parse_send_tables(data: bytes, game_build: int = 0) -> dict[str, Serializer]
¶
Parse a CDemoSendTables payload into a serializer dictionary.
The payload is a varuint32 length prefix followed by a serialized
CSVCMsg_FlattenedSerializer protobuf message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
Raw bytes from a |
required |
game_build
|
int
|
Server build number (from |
0
|
Returns:
| Type | Description |
|---|---|
dict[str, Serializer]
|
Mapping of serializer name → Serializer, containing every entity |
dict[str, Serializer]
|
class schema defined in this replay. |
Source code in src/gem/sendtable.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | |
gem.sendtable.Serializer
dataclass
¶
A named, versioned entity class schema with an ordered list of fields.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Entity class name (e.g. |
version |
int
|
Schema version integer. |
fields |
list[Field]
|
Ordered list of Field objects. |
Source code in src/gem/sendtable.py
gem.sendtable.Field
dataclass
¶
One property of a serializer, with its type and decoder.
Attributes:
| Name | Type | Description |
|---|---|---|
var_name |
str
|
Property name (e.g. |
var_type |
str
|
Raw type string from the send table. |
send_node |
str
|
Network send node path (empty string for root). |
serializer_name |
str
|
Name of the associated sub-serializer, if any. |
serializer_version |
int
|
Version of the associated sub-serializer. |
encoder |
str
|
Encoder hint (e.g. |
encode_flags |
int | None
|
QFD encode flags bitmask. |
bit_count |
int | None
|
QFD / angle bit width. |
low_value |
float | None
|
QFD lower bound. |
high_value |
float | None
|
QFD upper bound. |
parent_name |
str
|
Serializer that owns this field (set for build ≤ 990). |
field_type |
FieldType
|
Parsed FieldType. |
serializer |
Serializer | None
|
Resolved sub-serializer for nested types, or None. |
model |
int
|
One of the FIELD_MODEL_* constants. |
decoder |
FieldDecoder | None
|
Callable for simple / fixed-array fields. |
base_decoder |
FieldDecoder | None
|
Callable for the length prefix of array / table fields. |
child_decoder |
FieldDecoder | None
|
Callable for variable-array elements. |
Source code in src/gem/sendtable.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
set_model(model: int) -> None
¶
Assign the field model and wire up the appropriate decoders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
int
|
One of the FIELD_MODEL_* constants. |
required |
Source code in src/gem/sendtable.py
model_name() -> str
¶
Return a human-readable model name for debugging.
Returns:
| Type | Description |
|---|---|
str
|
One of |
str
|
|
Source code in src/gem/sendtable.py
gem.sendtable.FieldType
dataclass
¶
Parsed representation of a C++ field type string.
Examples::
"uint32" → base_type="uint32"
"CUtlVector< int32 >" → base_type="CUtlVector", generic_type=FieldType("int32")
"CHandle[24]" → base_type="CHandle", count=24
"CBodyComponent*" → base_type="CBodyComponent", pointer=True
Attributes:
| Name | Type | Description |
|---|---|---|
base_type |
str
|
The root type name without generics, pointer, or array. |
generic_type |
FieldType | None
|
The inner type for generic containers, or None. |
pointer |
bool
|
True if the field is a pointer type. |
count |
int
|
Array element count (0 = not an array). |