mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
fix truncated demos during reencode
This commit is contained in:
parent
b67942ac74
commit
10429c6d29
3 changed files with 65 additions and 12 deletions
|
|
@ -6,8 +6,8 @@ use crate::ReadResult;
|
|||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, BitWrite, PartialEq, Serialize, Deserialize, Clone)]
|
||||
pub struct ConVar {
|
||||
key: String,
|
||||
value: String,
|
||||
pub key: String,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
impl<E: Endianness> BitRead<'_, E> for ConVar {
|
||||
|
|
@ -25,9 +25,9 @@ impl<E: Endianness> BitRead<'_, E> for ConVar {
|
|||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, BitRead, PartialEq, Serialize, Deserialize, Clone)]
|
||||
pub struct SetConVarMessage {
|
||||
length: u8,
|
||||
pub length: u8,
|
||||
#[size = "length"]
|
||||
vars: Vec<ConVar>,
|
||||
pub vars: Vec<ConVar>,
|
||||
}
|
||||
|
||||
impl<E: Endianness> BitWrite<E> for SetConVarMessage {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ impl<'a> RawPacketStream<'a> {
|
|||
Ok(Some(packet))
|
||||
}
|
||||
Ok(packet) => Ok(Some(packet)),
|
||||
Err(ParseError::ReadError(BitError::NotEnoughData { .. })) if false => {
|
||||
Err(ParseError::ReadError(BitError::NotEnoughData { .. })) => {
|
||||
self.ended = true;
|
||||
self.incomplete = true;
|
||||
Ok(None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue