diff options
Diffstat (limited to 'NorthstarDedicatedTest/sv_rcon.cpp')
-rw-r--r-- | NorthstarDedicatedTest/sv_rcon.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/sv_rcon.cpp b/NorthstarDedicatedTest/sv_rcon.cpp index 1dcfff32..527e5f5e 100644 --- a/NorthstarDedicatedTest/sv_rcon.cpp +++ b/NorthstarDedicatedTest/sv_rcon.cpp @@ -19,6 +19,15 @@ #include "igameserverdata.h" //----------------------------------------------------------------------------- +// Purpose: destructor +//----------------------------------------------------------------------------- +CRConServer::~CRConServer() +{ + delete m_pNetAdr2; + delete m_pSocket; +} + +//----------------------------------------------------------------------------- // Purpose: NETCON systems init //----------------------------------------------------------------------------- void CRConServer::Init(void) @@ -35,8 +44,8 @@ void CRConServer::Init(void) static ConVar* hostport = g_pCVar->FindVar("hostport"); - m_pAdr2 = new CNetAdr2(CVar_rcon_address->GetString(), hostport->GetString()); - m_pSocket->CreateListenSocket(*m_pAdr2, false); + m_pNetAdr2->SetIPAndPort(CVar_rcon_address->GetString(), hostport->GetString()); + m_pSocket->CreateListenSocket(*m_pNetAdr2, false); m_svPasswordHash = sha256(CVar_rcon_password->GetString()); spdlog::info("Remote server access initialized"); @@ -84,7 +93,7 @@ void CRConServer::Think(void) { if (!m_pSocket->IsListening()) { - m_pSocket->CreateListenSocket(*m_pAdr2, false); + m_pSocket->CreateListenSocket(*m_pNetAdr2, false); } } } |