NetPlay: Make the enet interrupts work

Otherwise, it would work but any async sending would be delayed by 4ms or
wait until the next packet was received.

Also increase the client timeout to 250ms, since enet_host_service is now
really interrupted.
This commit is contained in:
mathieui 2015-03-14 15:19:18 +01:00
commit e0ef8fc03f
5 changed files with 21 additions and 2 deletions

View file

@ -301,7 +301,8 @@ void TraversalClient::Reset()
int ENET_CALLBACK TraversalClient::InterceptCallback(ENetHost* host, ENetEvent* event)
{
auto traversalClient = g_TraversalClient.get();
if (traversalClient->TestPacket(host->receivedData, host->receivedDataLength, &host->receivedAddress))
if (traversalClient->TestPacket(host->receivedData, host->receivedDataLength, &host->receivedAddress)
|| (host->receivedDataLength == 1 && host->receivedData[0] == 0))
{
event->type = (ENetEventType)42;
return 1;