From 84ebeb80659c6b5fec420df5e56c0ec359eb016e Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Tue, 27 Jun 2023 00:58:38 +0300 Subject: [PATCH] [Protocol] Add optional address field to quake 2 player --- CHANGELOG.md | 1 + src/protocols/quake/two.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 205b5f8..6189f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Who knows what the future holds... ### Changes: Protocols: - GameSpy 2 support. +- Quake 2: Added Optional address field to Player. Generic query: - Added generic queries (by [@Douile](https://github.com/Douile)) which come with a common struct for the response fields. diff --git a/src/protocols/quake/two.rs b/src/protocols/quake/two.rs index fc2576f..6342ee6 100644 --- a/src/protocols/quake/two.rs +++ b/src/protocols/quake/two.rs @@ -17,6 +17,7 @@ pub struct Player { pub frags: i16, pub ping: u16, pub name: String, + pub address: Option, } impl QuakePlayerType for Player { @@ -54,6 +55,10 @@ impl QuakeClient for QuakeTwo { None => Err(GDError::PacketBad)?, Some(v) => remove_wrapping_quotes(v).to_string(), }, + address: match data.next() { + None => None, + Some(v) => Some(remove_wrapping_quotes(v).to_string()), + }, }) } }