Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10350 from Techjar/netplay-longer-timeout
Core/NetPlay: Extend enet peer timeout
  • Loading branch information
lioncash committed Jan 6, 2022
2 parents c524850 + 600c816 commit c0fada6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/Core/Core/NetPlayClient.cpp
Expand Up @@ -150,6 +150,9 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay
return;
}

// Extend reliable traffic timeout
enet_peer_timeout(m_server, 0, 30000, 30000);

ENetEvent netEvent;
int net = enet_host_service(m_client, &netEvent, 5000);
if (net > 0 && netEvent.type == ENET_EVENT_TYPE_CONNECT)
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/Core/NetPlayServer.cpp
Expand Up @@ -415,6 +415,9 @@ ConnectionError NetPlayServer::OnConnect(ENetPeer* socket, sf::Packet& rpac)
if (StringUTF8CodePointCount(player.name) > MAX_NAME_LENGTH)
return ConnectionError::NameTooLong;

// Extend reliable traffic timeout
enet_peer_timeout(socket, 0, 30000, 30000);

// cause pings to be updated
m_update_pings = true;

Expand Down

0 comments on commit c0fada6

Please sign in to comment.