Keep gateway sockets open during handshake

This commit is contained in:
Edward Richardson 2014-10-05 19:46:34 +13:00
parent c9d603d1c3
commit 7175374350

View file

@ -110,6 +110,7 @@ const char *neterror (void);
enum enum
{ {
PRE_CONNECT, // Sent from guest to host for initial connection PRE_CONNECT, // Sent from guest to host for initial connection
PRE_KEEPALIVE,
PRE_DISCONNECT, // Sent from guest that aborts the game PRE_DISCONNECT, // Sent from guest that aborts the game
PRE_ALLHERE, // Sent from host to guest when everybody has connected PRE_ALLHERE, // Sent from host to guest when everybody has connected
PRE_CONACK, // Sent from host to guest to acknowledge PRE_CONNECT receipt PRE_CONACK, // Sent from host to guest to acknowledge PRE_CONNECT receipt
@ -548,10 +549,15 @@ bool Host_CheckForConnects (void *userdata)
SendConAck (doomcom.numnodes, numplayers); SendConAck (doomcom.numnodes, numplayers);
} }
break; break;
case PRE_KEEPALIVE:
break;
} }
} }
if (doomcom.numnodes < numplayers) if (doomcom.numnodes < numplayers)
{ {
// Send message to everyone as a keepalive
SendConAck(doomcom.numnodes, numplayers);
return false; return false;
} }
@ -822,6 +828,10 @@ bool Guest_WaitForOthers (void *userdata)
} }
} }
packet.Fake = PRE_FAKE;
packet.Message = PRE_KEEPALIVE;
PreSend(&packet, 2, &sendaddress[1]);
return false; return false;
} }