mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
RCON socket bind improvement
Check 'net_usesocketsforloopback' before binding sockets; allows binding to loopback as well.
This commit is contained in:
parent
90cf742fb5
commit
f97cf6c249
@ -53,8 +53,15 @@ void CRConServer::Init(void)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Already initialized.
|
||||
return;
|
||||
}
|
||||
|
||||
m_Address.SetFromString(Format("[%s]:%i", NET_IPV6_UNSPEC, hostport->GetInt()).c_str(), true);
|
||||
const char* pszAddress = net_usesocketsforloopback->GetBool() ? NET_IPV6_UNSPEC : NET_IPV6_LOOPBACK;
|
||||
|
||||
m_Address.SetFromString(Format("[%s]:%i", pszAddress, hostport->GetInt()).c_str(), true);
|
||||
m_Socket.CreateListenSocket(m_Address);
|
||||
|
||||
DevMsg(eDLL_T::SERVER, "Remote server access initialized ('%s')\n", m_Address.ToString());
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#define NET_IPV4_UNSPEC "0.0.0.0"
|
||||
#define NET_IPV6_UNSPEC "::"
|
||||
#define NET_IPV6_LOOPBACK "::1"
|
||||
|
||||
enum class netadrtype_t
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user