]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
renamed NetConn_UpdateServerStuff to NetConn_UpdateSockets and made it non-static...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Feb 2006 18:21:16 +0000 (18:21 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Feb 2006 18:21:16 +0000 (18:21 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5972 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
netconn.c
netconn.h

index 765e92bf43fa9c738f4a42f5dba6ff402d0c81e3..8c2cda210191febd9dcc204e2521fddf6b94678c 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -353,6 +353,9 @@ void CL_EstablishConnection(const char *host)
        // 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();
 
index de4d467d3a48f54f763b100cb5eeb0a082f7863f..1915da7abbea27372e364559223803f0d20ddac0 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -691,12 +691,11 @@ void NetConn_OpenServerPort(const char *addressstring, int defaultport)
        }
 }
 
-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;
@@ -779,7 +778,7 @@ void NetConn_Close(netconn_t *conn)
 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)
        {
@@ -1291,7 +1290,7 @@ void NetConn_ClientFrame(void)
        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)
@@ -1829,7 +1828,7 @@ void NetConn_ServerFrame(void)
        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);
index b8247a1932b442921a985c1c6412ef7a7a7f4b8d..512b506d54d58f1baf48575b1b3c66967bcdd2c1 100755 (executable)
--- a/netconn.h
+++ b/netconn.h
@@ -301,6 +301,7 @@ void NetConn_CloseClientPorts(void);
 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);