diff --git a/CHANGELOG.md b/CHANGELOG.md index 6189f8f..2e79fe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ Games: - [Just Cause 2: Multiplayer](https://store.steampowered.com/app/259080/Just_Cause_2_Multiplayer_Mod/) support. ### Breaking... +Protocols: +- Quake 2: Renamed the players frags field to score to be more inline with the other protocols. + Crate: - Fixed crate's `rust-version`, it is now `1.60.0` (was `1.56.1`) diff --git a/src/protocols/quake/two.rs b/src/protocols/quake/two.rs index 6342ee6..aadcf12 100644 --- a/src/protocols/quake/two.rs +++ b/src/protocols/quake/two.rs @@ -14,7 +14,7 @@ use super::QuakePlayerType; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct Player { - pub frags: i16, + pub score: i32, pub ping: u16, pub name: String, pub address: Option, @@ -30,7 +30,8 @@ impl CommonPlayer for Player { fn as_original(&self) -> GenericPlayer { GenericPlayer::QuakeTwo(self) } fn name(&self) -> &str { &self.name } - // TODO: Maybe frags is score? + + fn score(&self) -> Option { Some(self.score.into()) } } pub(crate) struct QuakeTwo; @@ -43,7 +44,7 @@ impl QuakeClient for QuakeTwo { fn parse_player_string(mut data: Iter<&str>) -> GDResult { Ok(Player { - frags: match data.next() { + score: match data.next() { None => Err(GDError::PacketBad)?, Some(v) => v.parse().map_err(|_| GDError::PacketBad)?, },