mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-09 07:01:06 +00:00
[Protocol] Add GameSpy 3 support. (#25)
* [Protocol] Gamespy3 initial code * [Protocol] Add rest of challenge solving * [Protocol] Remove unused stuff * [Protocol] Remove adding unused bytes * [Protocol] Clean up code * [Protocol] Make gs3 a struct * [Protocol] Add initial key-value parsing * [Protocol] Manage multiple packets * [Protocol] Split server vars and other vars * Revert "[Protocol] Split server vars and other vars" This reverts commit 9a930aeb68802fcf3d0908a2e031dfea054d37d0. * [Protocol] Proper packet management and initial response struct * [Protocol] Fix players_minimum * [Protocol] Fix server vars to parse only the first packet * [Protocol] Update CHANGELOG.md * [Protocol] Initial player parsing * [Protocol] Split GS one and three * [Protocol] Add common code file * [Protocol] Change static to const * [Protocol] Fix players_online and break on data to map on empty key * [Protocol] Remove unused types and printlns * [Protocol] Add teams parsing * [Protocol] Split key_values and parsing data * [Crate] Update PROTOCOLS.md
This commit is contained in:
parent
1b13d39856
commit
786da81ea5
14 changed files with 459 additions and 36 deletions
|
|
@ -108,6 +108,18 @@ impl Bufferer {
|
|||
Ok(value)
|
||||
}
|
||||
|
||||
pub fn get_string_utf8_optional(&mut self) -> GDResult<String> {
|
||||
match self.get_string_utf8() {
|
||||
Ok(data) => Ok(data),
|
||||
Err(e) => {
|
||||
match e {
|
||||
PacketUnderflow => Ok(String::new()),
|
||||
x => Err(x),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_string_utf8_unended(&mut self) -> GDResult<String> {
|
||||
let sub_buf = self.remaining_data();
|
||||
if sub_buf.is_empty() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue