mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
Renamed ProtocolRule to ProtocolFormat
This commit is contained in:
parent
304b8340d2
commit
dc0926bab7
4 changed files with 6 additions and 6 deletions
|
|
@ -31,7 +31,7 @@ impl LegacyBV1_8 {
|
|||
let mut pos = 0;
|
||||
|
||||
if get_u8(&buf, &mut pos)? != 0xFF {
|
||||
return Err(GDError::ProtocolRule("Expected 0xFF at the begin of the packet."));
|
||||
return Err(GDError::ProtocolFormat("Expected 0xFF at the begin of the packet."));
|
||||
}
|
||||
|
||||
let length = get_u16_be(&buf, &mut pos)? * 2;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ impl LegacyV1_4 {
|
|||
let mut pos = 0;
|
||||
|
||||
if get_u8(&buf, &mut pos)? != 0xFF {
|
||||
return Err(GDError::ProtocolRule("Expected 0xFF at the begin of the packet."));
|
||||
return Err(GDError::ProtocolFormat("Expected 0xFF at the begin of the packet."));
|
||||
}
|
||||
|
||||
let length = get_u16_be(&buf, &mut pos)? * 2;
|
||||
|
|
|
|||
|
|
@ -81,14 +81,14 @@ impl LegacyV1_6 {
|
|||
let mut pos = 0;
|
||||
|
||||
if get_u8(&buf, &mut pos)? != 0xFF {
|
||||
return Err(GDError::ProtocolRule("Expected a certain byte (0xFF) at the begin of the packet."));
|
||||
return Err(GDError::ProtocolFormat("Expected a certain byte (0xFF) at the begin of the packet."));
|
||||
}
|
||||
|
||||
let length = get_u16_be(&buf, &mut pos)? * 2;
|
||||
error_by_expected_size((length + 3) as usize, buf.len())?;
|
||||
|
||||
if !LegacyV1_6::is_protocol(&buf, &mut pos)? {
|
||||
return Err(GDError::ProtocolRule("Expected certain bytes at the beginning of the packet."));
|
||||
return Err(GDError::ProtocolFormat("Expected certain bytes at the beginning of the packet."));
|
||||
}
|
||||
|
||||
LegacyV1_6::get_response(&buf, &mut pos)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue