mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 10:14:06 +02:00
fix consolecmd encode
This commit is contained in:
parent
c1d023f85c
commit
04d22ea2be
1 changed files with 3 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ impl BitRead<'_, LittleEndian> for ConsoleCmdPacket {
|
|||
let tick = stream.read_int(32)?;
|
||||
let len = stream.read_int::<usize>(32)?;
|
||||
let mut packet_data = stream.read_bits(len * 8)?;
|
||||
let command = packet_data.read_sized(len)?;
|
||||
let command: String = packet_data.read()?;
|
||||
Ok(ConsoleCmdPacket { tick, command })
|
||||
}
|
||||
}
|
||||
|
|
@ -21,9 +21,9 @@ impl BitRead<'_, LittleEndian> for ConsoleCmdPacket {
|
|||
impl BitWrite<LittleEndian> for ConsoleCmdPacket {
|
||||
fn write(&self, stream: &mut bitbuffer::BitWriteStream<LittleEndian>) -> ReadResult<()> {
|
||||
self.tick.write(stream)?;
|
||||
let len = self.command.len() as u32;
|
||||
let len = self.command.len() as u32 + 1;
|
||||
len.write(stream)?;
|
||||
self.command.write_sized(stream, len as usize)?;
|
||||
self.command.write(stream)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue