*/
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;
// 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)
{
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;
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
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);
}
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);
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))
cmd = MSG_ReadChar ();
- if (cmd != -1 && host_client->waitingforconnect)
- {
- host_client->waitingforconnect = false;
- host_client->sendserverinfo = true;
- }
-
switch (cmd)
{
case -1: