mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
[Protocol] Valve: Reverse: No name players not being added to the list
This commit is contained in:
parent
ab43675ae5
commit
99c87557c2
3 changed files with 21 additions and 26 deletions
|
|
@ -375,28 +375,19 @@ impl ValveProtocol {
|
|||
for _ in 0..count {
|
||||
buffer.move_position_ahead(1); //skip the index byte
|
||||
|
||||
let name = buffer.get_string_utf8()?;
|
||||
let score = buffer.get_u32()?;
|
||||
let duration = buffer.get_f32()?;
|
||||
|
||||
let deaths = match *engine == SteamApp::TS.as_engine() {
|
||||
false => None,
|
||||
true => Some(buffer.get_u32()?)
|
||||
};
|
||||
let money = match *engine == SteamApp::TS.as_engine() {
|
||||
false => None,
|
||||
true => Some(buffer.get_u32()?)
|
||||
};
|
||||
|
||||
if name.len() > 0 {
|
||||
players.push(ServerPlayer {
|
||||
name,
|
||||
score,
|
||||
duration,
|
||||
deaths,
|
||||
money
|
||||
});
|
||||
}
|
||||
players.push(ServerPlayer {
|
||||
name: buffer.get_string_utf8()?,
|
||||
score: buffer.get_u32()?,
|
||||
duration: buffer.get_f32()?,
|
||||
deaths: match *engine == SteamApp::TS.as_engine() {
|
||||
false => None,
|
||||
true => Some(buffer.get_u32()?)
|
||||
},
|
||||
money: match *engine == SteamApp::TS.as_engine() {
|
||||
false => None,
|
||||
true => Some(buffer.get_u32()?)
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Ok(players)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue