]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
removed hacky network code that tried to make DP work through NAT routers (but infact...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 1 Apr 2002 09:00:29 +0000 (09:00 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 1 Apr 2002 09:00:29 +0000 (09:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1697 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
server.h
sv_main.c
sv_user.c

index 851f591a2a808d69bcef7173bc982948c8b39c52..acba578a25b0a5336607f7001808c64dac45b92b 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -227,13 +227,6 @@ Host should be either "local" or a net address to be passed on
 */
 void CL_EstablishConnection (char *host)
 {
-       sizebuf_t       buf;
-       qbyte   data[128];
-
-       buf.maxsize = 128;
-       buf.cursize = 0;
-       buf.data = data;
-
        if (cls.state == ca_dedicated)
                return;
 
@@ -885,19 +878,6 @@ void CL_SendCmd (void)
        // send the unreliable message
                CL_SendMove (&cmd);
        }
-       else
-       {
-               // LordHavoc: fix for NAT routing of netquake:
-               // bounce back a clc_nop message to the newly allocated server port,
-               // to establish a routing connection for incoming frames,
-               // the server waits for this before sending anything
-               if (realtime > cl.sendnoptime)
-               {
-                       Con_DPrintf("sending clc_nop to get server's attention\n");
-                       cl.sendnoptime = realtime + 3;
-                       MSG_WriteByte(&cls.message, clc_nop);
-               }
-       }
 
        if (cls.demoplayback)
        {
index 68d6ca176babfbbeb8e627b48145e2984726b1b2..8ceabc2bdb86f6229d357171d26a31991cf35fe9 100644 (file)
--- a/server.h
+++ b/server.h
@@ -42,10 +42,10 @@ typedef struct
        double          time;
 
        double          frametime;
-       
+
        int                     lastcheck;                      // used by PF_checkclient
        double          lastchecktime;
-       
+
        char            name[64];                       // map name
        char            modelname[64];          // maps/<name>.bsp, for model_precache[0]
        struct model_s  *worldmodel;
@@ -81,10 +81,6 @@ typedef struct client_s
        qboolean                dropasap;                       // has been told to go to another level
        qboolean                sendsignon;                     // only valid before spawned
 
-       // LordHavoc: to make netquake protocol get through NAT routers, have to wait for client to ack
-       qboolean                waitingforconnect;      // waiting for connect from client (stage 1)
-       qboolean                sendserverinfo;         // send server info in next datagram (stage 2)
-
        double                  last_message;           // reliable messages must be sent
                                                                                // periodically
 
index 737c38fa749e0c5e9fa924e5db21b62e1c04bf8e..fde0d7490b0ba0d08ba7f645366f65fb292eee91 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -333,10 +333,7 @@ void SV_ConnectClient (int clientnum)
                        client->spawn_parms[i] = (&pr_global_struct->parm1)[i];
        }
 
-       // send serverinfo on first nop
-       client->waitingforconnect = true;
-       client->sendsignon = true;
-       client->spawned = false;                // need prespawn, spawn, etc
+       SV_SendServerinfo (client);
 }
 
 
@@ -1348,7 +1345,7 @@ qboolean SV_SendClientDatagram (client_t *client)
        MSG_WriteByte (&msg, svc_time);
        MSG_WriteFloat (&msg, sv.time);
 
-       if (!client->waitingforconnect)
+       if (!client->sendsignon)
        {
                // add the client specific data to the datagram
                SV_WriteClientdataToMessage (client->edict, &msg);
@@ -1451,12 +1448,6 @@ void SV_SendClientMessages (void)
                if (!host_client->active)
                        continue;
 
-               if (host_client->sendserverinfo)
-               {
-                       host_client->sendserverinfo = false;
-                       SV_SendServerinfo (host_client);
-               }
-
                if (host_client->spawned)
                {
                        if (!SV_SendClientDatagram (host_client))
index 27c8ec9fb653c83eb54ebceaab5a68870877846b..deaea53ffd4ab16540ef276694b8bd3e001bc1ff 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -552,12 +552,6 @@ nextmsg:
 
                        cmd = MSG_ReadChar ();
 
-                       if (cmd != -1 && host_client->waitingforconnect)
-                       {
-                               host_client->waitingforconnect = false;
-                               host_client->sendserverinfo = true;
-                       }
-
                        switch (cmd)
                        {
                        case -1: