// stop demo loop in case this fails
CL_Disconnect();
+ // make sure the client ports are open before attempting to connect
+ NetConn_UpdateSockets();
+
// run a network frame
//NetConn_ClientFrame();SV_VM_Begin();NetConn_ServerFrame();SV_VM_End();
}
}
-static void NetConn_UpdateServerStuff(void);
void NetConn_OpenServerPorts(int opennetports)
{
int port;
NetConn_CloseServerPorts();
- NetConn_UpdateServerStuff();
+ NetConn_UpdateSockets();
port = bound(0, sv_netport.integer, 65535);
if (port == 0)
port = 26000;
static int clientport = -1;
static int clientport2 = -1;
static int hostport = -1;
-static void NetConn_UpdateServerStuff(void)
+void NetConn_UpdateSockets(void)
{
if (cls.state != ca_dedicated)
{
int i, length;
lhnetaddress_t peeraddress;
netconn_t *conn;
- NetConn_UpdateServerStuff();
+ NetConn_UpdateSockets();
if (cls.connect_trying && cls.connect_nextsendtime < realtime)
{
if (cls.connect_remainingtries == 0)
int i, length;
lhnetaddress_t peeraddress;
netconn_t *conn;
- NetConn_UpdateServerStuff();
+ NetConn_UpdateSockets();
for (i = 0;i < sv_numsockets;i++)
while (sv_sockets[i] && (length = NetConn_Read(sv_sockets[i], readbuffer, sizeof(readbuffer), &peeraddress)) > 0)
NetConn_ServerParsePacket(sv_sockets[i], readbuffer, length, &peeraddress);
void NetConn_OpenClientPorts(void);
void NetConn_CloseServerPorts(void);
void NetConn_OpenServerPorts(int opennetports);
+void NetConn_UpdateSockets(void);
lhnetsocket_t *NetConn_ChooseClientSocketForAddress(lhnetaddress_t *address);
lhnetsocket_t *NetConn_ChooseServerSocketForAddress(lhnetaddress_t *address);
void NetConn_Init(void);