mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: rcon code readability improvement
Remove the else statement since it will always be else there.
This commit is contained in:
parent
02d0ba918c
commit
df8d920eea
@ -382,37 +382,36 @@ void CRConServer::Authenticate(const cl_rcon::request& request, CConnectedNetCon
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else // Authorize.
|
|
||||||
|
// Authorize.
|
||||||
|
if (Comparator(request.requestmsg()))
|
||||||
{
|
{
|
||||||
if (Comparator(request.requestmsg()))
|
data.m_bAuthorized = true;
|
||||||
|
if (++m_nAuthConnections >= sv_rcon_maxconnections.GetInt())
|
||||||
{
|
{
|
||||||
data.m_bAuthorized = true;
|
m_Socket.CloseListenSocket();
|
||||||
if (++m_nAuthConnections >= sv_rcon_maxconnections.GetInt())
|
CloseNonAuthConnection();
|
||||||
{
|
|
||||||
m_Socket.CloseListenSocket();
|
|
||||||
CloseNonAuthConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* pSendLogs = (!sv_rcon_sendlogs.GetBool() || data.m_bInputOnly) ? "0" : "1";
|
|
||||||
|
|
||||||
SendEncode(data.m_hSocket, s_AuthMessage, pSendLogs,
|
|
||||||
sv_rcon::response_t::SERVERDATA_RESPONSE_AUTH, static_cast<int>(eDLL_T::NETCON));
|
|
||||||
}
|
}
|
||||||
else // Bad password.
|
|
||||||
|
const char* pSendLogs = (!sv_rcon_sendlogs.GetBool() || data.m_bInputOnly) ? "0" : "1";
|
||||||
|
|
||||||
|
SendEncode(data.m_hSocket, s_AuthMessage, pSendLogs,
|
||||||
|
sv_rcon::response_t::SERVERDATA_RESPONSE_AUTH, static_cast<int>(eDLL_T::NETCON));
|
||||||
|
}
|
||||||
|
else // Bad password.
|
||||||
|
{
|
||||||
|
const netadr_t& netAdr = m_Socket.GetAcceptedSocketAddress(m_nConnIndex);
|
||||||
|
if (sv_rcon_debug.GetBool())
|
||||||
{
|
{
|
||||||
const netadr_t& netAdr = m_Socket.GetAcceptedSocketAddress(m_nConnIndex);
|
Msg(eDLL_T::SERVER, "Bad RCON password attempt from '%s'\n", netAdr.ToString());
|
||||||
if (sv_rcon_debug.GetBool())
|
|
||||||
{
|
|
||||||
Msg(eDLL_T::SERVER, "Bad RCON password attempt from '%s'\n", netAdr.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
SendEncode(data.m_hSocket, s_WrongPwMessage, "",
|
|
||||||
sv_rcon::response_t::SERVERDATA_RESPONSE_AUTH, static_cast<int>(eDLL_T::NETCON));
|
|
||||||
|
|
||||||
data.m_bAuthorized = false;
|
|
||||||
data.m_bValidated = false;
|
|
||||||
data.m_nFailedAttempts++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendEncode(data.m_hSocket, s_WrongPwMessage, "",
|
||||||
|
sv_rcon::response_t::SERVERDATA_RESPONSE_AUTH, static_cast<int>(eDLL_T::NETCON));
|
||||||
|
|
||||||
|
data.m_bAuthorized = false;
|
||||||
|
data.m_bValidated = false;
|
||||||
|
data.m_nFailedAttempts++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user