1
1
forked from 0ad/0ad

enet backward-compatibility fix, refs #2854. Patch by texane, fixes #3863.

This was SVN commit r17960.
This commit is contained in:
elexis 2016-03-27 23:27:37 +00:00
parent 373107898c
commit d3255168b9
2 changed files with 4 additions and 0 deletions

View File

@ -494,8 +494,10 @@ bool CNetServerWorker::RunStep()
CNetServerSession* session = new CNetServerSession(*this, event.peer);
// Prevent the local client of the host from timing out too quickly
#if (ENET_VERSION >= ENET_VERSION_CREATE(1, 3, 4))
if (session->GetIPAddress() == "127.0.0.1")
enet_peer_timeout(event.peer, 0, MAXIMUM_HOST_TIMEOUT, MAXIMUM_HOST_TIMEOUT);
#endif
m_Sessions.push_back(session);

View File

@ -76,8 +76,10 @@ bool CNetClientSession::Connect(u16 port, const CStr& server)
m_Server = peer;
// Prevent the local client of the host from timing out too quickly.
#if (ENET_VERSION >= ENET_VERSION_CREATE(1, 3, 4))
if (GetIPAddress() == "127.0.0.1")
enet_peer_timeout(peer, 1, MAXIMUM_HOST_TIMEOUT, MAXIMUM_HOST_TIMEOUT);
#endif
m_Stats = new CNetStatsTable(m_Server);
if (CProfileViewer::IsInitialised())