]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - netconn.c
Several changes to the SFX lock code in the sound engine, mainly to make sure SFXs...
[xonotic/darkplaces.git] / netconn.c
index 49ca4dca3ba1e2acd62819c4597a65b28798c3c1..e3fe3123a17369ce93d596ff566e8c3e24db504d 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -989,7 +989,6 @@ static void NetConn_BuildChallengeString(char *buffer, int bufferlength)
        buffer[i] = 0;
 }
 
-extern void SV_ConnectClient(int clientnum, netconn_t *netconnection);
 int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length, lhnetaddress_t *peeraddress)
 {
        int i, n, ret, clientnum, responselength, best;
@@ -1310,7 +1309,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);
@@ -1358,7 +1357,6 @@ int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length,
                {
                        if (host_client->netconnection && host_client->netconnection->mysocket == mysocket && !LHNETADDRESS_Compare(&host_client->netconnection->peeraddress, peeraddress))
                        {
-                               sv_player = host_client->edict;
                                if ((ret = NetConn_ReceivedMessage(host_client->netconnection, data, length)) == 2)
                                        SV_ReadClientMessage();
                                return ret;
@@ -1383,7 +1381,6 @@ void NetConn_ServerFrame(void)
                if (host_client->netconnection && realtime > host_client->netconnection->timeout && LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
                {
                        Con_Printf("Client \"%s\" connection timed out\n", host_client->name);
-                       sv_player = host_client->edict;
                        SV_DropClient(false);
                }
        }