From: havoc Date: Fri, 12 Nov 2004 22:42:20 +0000 (+0000) Subject: more preparation for DP_SV_BOTCLIENT, removed a number of unneeded netconnection... X-Git-Tag: xonotic-v0.1.0preview~5390 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=8d9b935788e404aa0bcd361a6172ac315cc3b2d6 more preparation for DP_SV_BOTCLIENT, removed a number of unneeded netconnection checks and changed some others to check active, and made player info queries reply "botclient" for clients with no netconnection git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4740 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/netconn.c b/netconn.c index 49ca4dca..a07ce921 100755 --- 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); diff --git a/pr_cmds.c b/pr_cmds.c index c387f7b1..d35fe2f0 100644 --- 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 diff --git a/prvm_cmds.c b/prvm_cmds.c index dbfd5723..40a1646d 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -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); diff --git a/sv_main.c b/sv_main.c index 4dcf5de7..9492f110 100644 --- 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");