]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 49ca4dca3ba1e2acd62819c4597a65b28798c3c1..a07ce921ca0a1829eeccbd49ebdca239109c7bf3 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 c387f7b15d5b9a48226c853e9e685b43a9c21e86..d35fe2f0f10ffdd1b1262fdf46f5aa85c5cd9425 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 dbfd5723548c62c1cf436de4afe1d9b4a1e45c17..40a1646dd4b22d6e4aa17d887e4da191a9aeb895 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 4dcf5de78900b558c4091dcc20121f73728705d9..9492f110cf057941df7e9da537de631fb4f3f7fa 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");