more preparation for DP_SV_BOTCLIENT, removed a number of unneeded netconnection...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 12 Nov 2004 22:42:20 +0000 (22:42 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 12 Nov 2004 22:42:20 +0000 (22:42 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4740 d7cf8633-e32d-0410-b094-e92efae38249

netconn.c
pr_cmds.c
prvm_cmds.c
sv_main.c

index 49ca4dc..a07ce92 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -1310,7 +1310,7 @@ int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length,
                                                        MSG_WriteLong(&net_message, client->colors);
                                                        MSG_WriteLong(&net_message, (int)client->edict->v->frags);
                                                        MSG_WriteLong(&net_message, (int)(realtime - client->connecttime));
-                                                       MSG_WriteString(&net_message, client->netconnection->address);
+                                                       MSG_WriteString(&net_message, client->netconnection ? client->netconnection->address : "botclient");
                                                        *((int *)net_message.data) = BigLong(NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
                                                        NetConn_Write(mysocket, net_message.data, net_message.cursize, peeraddress);
                                                        SZ_Clear(&net_message);
index c387f7b..d35fe2f 100644 (file)
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -424,8 +424,6 @@ void PF_sprint (void)
        }
 
        client = svs.clients + entnum-1;
-       if (!client->netconnection)
-               return;
        PF_VarString(1, string, sizeof(string));
        MSG_WriteChar(&client->message,svc_print);
        MSG_WriteString(&client->message, string);
@@ -456,8 +454,6 @@ void PF_centerprint (void)
        }
 
        client = svs.clients + entnum-1;
-       if (!client->netconnection)
-               return;
        PF_VarString(1, string, sizeof(string));
        MSG_WriteChar(&client->message,svc_centerprint);
        MSG_WriteString(&client->message, string);
@@ -985,8 +981,8 @@ void PF_stuffcmd (void)
        str = G_STRING(OFS_PARM1);
 
        old = host_client;
-       if ((host_client = svs.clients + entnum-1) && host_client->netconnection)
-               Host_ClientCommands ("%s", str);
+       host_client = svs.clients + entnum-1;
+       Host_ClientCommands ("%s", str);
        host_client = old;
 }
 
@@ -1551,7 +1547,7 @@ void PF_lightstyle (void)
 
        for (j = 0, client = svs.clients;j < svs.maxclients;j++, client++)
        {
-               if (client->netconnection)
+               if (client->active)
                {
                        MSG_WriteChar (&client->message, svc_lightstyle);
                        MSG_WriteChar (&client->message,style);
@@ -3615,7 +3611,7 @@ PF_floor,                                 // #37 float(float v) floor
 PF_ceil,                                       // #38 float(float v) ceil
 NULL,                                          // #39
 PF_checkbottom,                                // #40 float(entity e) checkbottom
-PF_pointcontents               ,       // #41 float(vector v) pointcontents
+PF_pointcontents,                      // #41 float(vector v) pointcontents
 NULL,                                          // #42
 PF_fabs,                                       // #43 float(float f) fabs
 PF_aim,                                                // #44 vector(entity e, float speed) aim
index dbfd572..40a1646 100644 (file)
@@ -392,8 +392,6 @@ void VM_sprint (void)
        }
        
        client = svs.clients + clientnum;
-       if (!client->netconnection)
-               return;
        VM_VarString(1, string, sizeof(string));
        MSG_WriteChar(&client->message,svc_print);
        MSG_WriteString(&client->message, string);
index 4dcf5de..9492f11 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -1719,7 +1719,7 @@ void SV_SpawnServer (const char *server)
 
 // send serverinfo to all connected clients
        for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
-               if (host_client->netconnection)
+               if (host_client->active)
                        SV_SendServerinfo(host_client);
 
        Con_DPrint("Server spawned.\n");