Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11381 from skyfloogle/traversal-fix-1
Netplay: Fix traversal connections occasionally not working
  • Loading branch information
delroth committed Jan 17, 2023
2 parents 4fc6488 + c689e9c commit 1cd11b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/Core/Core/NetPlayClient.cpp
Expand Up @@ -248,7 +248,12 @@ bool NetPlayClient::Connect()
sf::Packet rpac;
// TODO: make this not hang
ENetEvent netEvent;
if (enet_host_service(m_client, &netEvent, 5000) > 0 && netEvent.type == ENET_EVENT_TYPE_RECEIVE)
int net;
while ((net = enet_host_service(m_client, &netEvent, 5000)) > 0 && netEvent.type == 42)
{
// ignore packets from traversal server
}
if (net > 0 && netEvent.type == ENET_EVENT_TYPE_RECEIVE)
{
rpac.append(netEvent.packet->data, netEvent.packet->dataLength);
enet_packet_destroy(netEvent.packet);
Expand Down

0 comments on commit 1cd11b8

Please sign in to comment.