]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
break the net connection AFTER calling ClientDisconnect; this fixes issues with clien...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Apr 2011 19:07:28 +0000 (19:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Apr 2011 19:07:28 +0000 (19:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11047 d7cf8633-e32d-0410-b094-e92efae38249

host.c

diff --git a/host.c b/host.c
index 930eaf5633461f4a599fa61785077fa3ace0eae0..812c2146e60787e13d27640cbeaa53591794b148 100644 (file)
--- a/host.c
+++ b/host.c
@@ -445,7 +445,7 @@ void SV_DropClient(qboolean crash)
 
        if (host_client->netconnection)
        {
-               // free the client (the body stays around)
+               // tell the client to be gone
                if (!crash)
                {
                        // LordHavoc: no opportunity for resending, so use unreliable 3 times
@@ -459,9 +459,6 @@ void SV_DropClient(qboolean crash)
                        NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
                        NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
                }
-               // break the net connection
-               NetConn_Close(host_client->netconnection);
-               host_client->netconnection = NULL;
        }
 
        // call qc ClientDisconnect function
@@ -478,6 +475,13 @@ void SV_DropClient(qboolean crash)
                prog->globals.server->self = saveSelf;
        }
 
+       if (host_client->netconnection)
+       {
+               // break the net connection
+               NetConn_Close(host_client->netconnection);
+               host_client->netconnection = NULL;
+       }
+
        // if a download is active, close it
        if (host_client->download_file)
        {