diff --git a/r5dev/engine/net_chan.cpp b/r5dev/engine/net_chan.cpp index 59fef3a9..b084b4e1 100644 --- a/r5dev/engine/net_chan.cpp +++ b/r5dev/engine/net_chan.cpp @@ -28,9 +28,18 @@ const char* CNetChan::GetName(void) const // Purpose: gets the netchannel address // Output : const char* //----------------------------------------------------------------------------- -const char* CNetChan::GetAddress(void) const +const char* CNetChan::GetAddress(bool onlyBase) const { - return this->remote_address.ToString(); + return this->remote_address.ToString(onlyBase); +} + +//----------------------------------------------------------------------------- +// Purpose: gets the netchannel port in host byte order +// Output : int +//----------------------------------------------------------------------------- +int CNetChan::GetPort(void) const +{ + return int(ntohs(this->remote_address.GetPort())); } //----------------------------------------------------------------------------- diff --git a/r5dev/engine/net_chan.h b/r5dev/engine/net_chan.h index ea110911..430ffe4d 100644 --- a/r5dev/engine/net_chan.h +++ b/r5dev/engine/net_chan.h @@ -81,7 +81,8 @@ class CNetChan { public: const char* GetName(void) const; - const char* GetAddress(void) const; + const char* GetAddress(bool onlyBase = false) const; + int GetPort(void) const; int GetDataRate(void) const; int GetBufferSize(void) const;