diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 9c01f7a080..05c6779e24 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -152,8 +152,9 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay return; } - // Extend reliable traffic timeout - enet_peer_timeout(m_server, 0, PEER_TIMEOUT, PEER_TIMEOUT); + // Update time in milliseconds of no acknoledgment of + // sent packets before a connection is deemed disconnected + enet_peer_timeout(m_server, 0, PEER_TIMEOUT.count(), PEER_TIMEOUT.count()); ENetEvent netEvent; int net = enet_host_service(m_client, &netEvent, 5000); @@ -211,8 +212,9 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay case ENET_EVENT_TYPE_CONNECT: m_server = netEvent.peer; - // Extend reliable traffic timeout - enet_peer_timeout(m_server, 0, PEER_TIMEOUT, PEER_TIMEOUT); + // Update time in milliseconds of no acknoledgment of + // sent packets before a connection is deemed disconnected + enet_peer_timeout(m_server, 0, PEER_TIMEOUT.count(), PEER_TIMEOUT.count()); if (Connect()) { diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 7693cae752..e9b5c271b5 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -402,6 +402,8 @@ ConnectionError NetPlayServer::OnConnect(ENetPeer* incoming_connection, sf::Pack if (StringUTF8CodePointCount(new_player.name) > MAX_NAME_LENGTH) return ConnectionError::NameTooLong; + // Update time in milliseconds of no acknoledgment of + // sent packets before a connection is deemed disconnected enet_peer_timeout(incoming_connection, 0, PEER_TIMEOUT.count(), PEER_TIMEOUT.count()); // force a ping on first netplay loop @@ -2085,6 +2087,10 @@ void NetPlayServer::SendResponse(MessageID message_id, const Client& player) response << MessageID::HostInputAuthority; response << m_host_input_authority; break; + default: + INFO_LOG_FMT(NETPLAY, "Warning! Call to SendResponse() failed to send a packet."); + return; + break; } // no player specified