mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: close RCON socket on password hashing failure
Must also be closed here
This commit is contained in:
parent
7f6846a315
commit
4ce38ba725
@ -98,6 +98,15 @@ void CRConServer::Init(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CRConServer::Shutdown(void)
|
||||
{
|
||||
if (!m_bInitialized)
|
||||
{
|
||||
// If we aren't initialized, we shouldn't have any connections at all.
|
||||
Assert(!m_Socket.GetAcceptedSocketCount(), "Accepted connections while RCON server isn't initialized!");
|
||||
Assert(!m_Socket.IsListening(), "Listen socket active while RCON server isn't initialized!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_bInitialized = false;
|
||||
|
||||
const int nConnCount = m_Socket.GetAcceptedSocketCount();
|
||||
@ -178,6 +187,12 @@ bool CRConServer::SetPassword(const char* pszPassword)
|
||||
if (nHashRet != 0)
|
||||
{
|
||||
Error(eDLL_T::SERVER, 0, "SHA-512 algorithm failed on RCON password [%i]\n", nHashRet);
|
||||
|
||||
if (m_Socket.IsListening())
|
||||
{
|
||||
m_Socket.CloseListenSocket();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user