RConServer: remove extraneous copy

CSocketCreator::GetAcceptedSocketAddress() returns a reference.
This commit is contained in:
Kawe Mazidjatari 2024-01-01 20:09:32 +01:00
parent 52b84fc3b7
commit a27f1b7fc9

View File

@ -341,7 +341,7 @@ void CRConServer::Authenticate(const cl_rcon::request& request, CConnectedNetCon
}
else // Bad password.
{
const netadr_t netAdr = m_Socket.GetAcceptedSocketAddress(m_nConnIndex);
const netadr_t& netAdr = m_Socket.GetAcceptedSocketAddress(m_nConnIndex);
if (sv_rcon_debug->GetBool())
{
Msg(eDLL_T::SERVER, "Bad RCON password attempt from '%s'\n", netAdr.ToString());
@ -509,7 +509,7 @@ bool CRConServer::CheckForBan(CConnectedNetConsoleData& data)
return false;
}
const netadr_t netAdr = m_Socket.GetAcceptedSocketAddress(m_nConnIndex);
const netadr_t& netAdr = m_Socket.GetAcceptedSocketAddress(m_nConnIndex);
const char* szNetAdr = netAdr.ToString(true);
if (m_BannedList.size() >= RCON_MAX_BANNEDLIST_SIZE)
@ -581,7 +581,7 @@ void CRConServer::Disconnect(const int nIndex, const char* szReason) // NETMGR
if (data.m_bAuthorized)
{
// Inform server owner when authenticated connection has been closed.
netadr_t netAdr = m_Socket.GetAcceptedSocketAddress(nIndex);
const netadr_t& netAdr = m_Socket.GetAcceptedSocketAddress(nIndex);
if (!szReason)
{
szReason = "unknown reason";