mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
CNetChan: Getters improvements
* Allow for requesting address base only. * Added new getter 'GetPort'.
This commit is contained in:
parent
78a86fed6a
commit
4ec8e67d9b
@ -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()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user