Fixed bug causing RCON server socket to only listen on IPv6

Ip address must be unspecified (::) to bind sockets properly.
This commit is contained in:
Kawe Mazidjatari 2023-04-16 00:24:06 +02:00
parent cf610b7d6b
commit 2d3f2ba507

View File

@ -46,10 +46,8 @@ void CRConServer::Init(void)
}
}
m_Address.SetFromString(hostip->GetString(), true);
m_Address.SetPort(htons(uint16_t(hostport->GetInt())));
m_Socket.CreateListenSocket(m_Address, false);
m_Address.SetFromString(Format("[%s]:%i", NET_IPV6_UNSPEC, hostport->GetInt()).c_str(), true);
m_Socket.CreateListenSocket(m_Address);
DevMsg(eDLL_T::SERVER, "Remote server access initialized ('%s')\n", m_Address.ToString());
m_bInitialized = true;
@ -96,7 +94,7 @@ void CRConServer::Think(void)
{
if (!m_Socket.IsListening())
{
m_Socket.CreateListenSocket(m_Address, false);
m_Socket.CreateListenSocket(m_Address);
}
}
}