From e6d2ecddf7defdf779ada589f08950cd6c7006f9 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Mon, 1 Apr 2002 09:00:29 +0000 Subject: [PATCH] removed hacky network code that tried to make DP work through NAT routers (but infact just broke everything, sigh) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1697 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 20 -------------------- server.h | 8 ++------ sv_main.c | 13 ++----------- sv_user.c | 6 ------ 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/cl_main.c b/cl_main.c index 851f591a..acba578a 100644 --- 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) { diff --git a/server.h b/server.h index 68d6ca17..8ceabc2b 100644 --- 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/.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 diff --git a/sv_main.c b/sv_main.c index 737c38fa..fde0d749 100644 --- 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)) diff --git a/sv_user.c b/sv_user.c index 27c8ec9f..deaea53f 100644 --- 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: -- 2.39.2