From 2ade7f9a4ea60c8e128014683b0d9c88dcdb2561 Mon Sep 17 00:00:00 2001 From: Cain <75994858+cainthebest@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:36:07 +0100 Subject: [PATCH] fix(protocol): clean up addr match in epic --- crates/lib/src/protocols/epic/protocol.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crates/lib/src/protocols/epic/protocol.rs b/crates/lib/src/protocols/epic/protocol.rs index 4a6c6689..58c33f32 100644 --- a/crates/lib/src/protocols/epic/protocol.rs +++ b/crates/lib/src/protocols/epic/protocol.rs @@ -123,19 +123,12 @@ impl EpicProtocol { .get("attributes") .ok_or(PacketBad.context("Expected attributes field missing in sessions."))?; - let address_match = attributes + let full_address_match = attributes .get("ADDRESSBOUND_s") .and_then(Value::as_str) - .map_or(false, |v| { - v == format!("0.0.0.0:{}", port) || v == format!("{}:{}", address, port) - }); + .map_or(false, |v| v == address || v == format!("0.0.0.0:{}", port)); - let port_match = attributes - .get("GAMESERVER_PORT_l") - .and_then(Value::as_u64) - .map_or(false, |v| v == port as u64); - - if address_match && port_match { + if full_address_match { return Ok(session); } }