From 17c8a5e49c3e8ae26d85cbdd78da4736e4a1ba4f Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 30 Apr 2023 11:11:33 +0200 Subject: [PATCH] Add const getter for 'CNetChan::remote_address' Return as const reference. --- r5dev/engine/net_chan.cpp | 8 ++++++++ r5dev/engine/net_chan.h | 1 + 2 files changed, 9 insertions(+) diff --git a/r5dev/engine/net_chan.cpp b/r5dev/engine/net_chan.cpp index b084b4e1..2a1da999 100644 --- a/r5dev/engine/net_chan.cpp +++ b/r5dev/engine/net_chan.cpp @@ -195,6 +195,14 @@ const bf_write& CNetChan::GetStreamVoice(void) const return this->m_StreamVoice; } +//----------------------------------------------------------------------------- +// Purpose: gets a const reference to remote_address +//----------------------------------------------------------------------------- +const netadr_t& CNetChan::GetRemoteAddress(void) const +{ + return this->remote_address; +} + //----------------------------------------------------------------------------- // Purpose: checks if the reliable stream is overflowed // Output : true if overflowed, false otherwise diff --git a/r5dev/engine/net_chan.h b/r5dev/engine/net_chan.h index 430ffe4d..2983f411 100644 --- a/r5dev/engine/net_chan.h +++ b/r5dev/engine/net_chan.h @@ -102,6 +102,7 @@ public: int GetSocket(void) const; const bf_write& GetStreamVoice(void) const; + const netadr_t& GetRemoteAddress(void) const; bool IsOverflowed(void) const; void Clear(bool bStopProcessing);