added Host_ShutdownServer call near every CL_Disconnect call, for consistency
CL_Disconnect and Host_ShutdownServer now report their calls as dprints (previously they were entirely silent)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4081
d7cf8633-e32d-0410-b094-
e92efae38249
// disconnect from server
CL_Disconnect ();
+ Host_ShutdownServer (false);
// update networking ports (this is mainly just needed at startup)
NetConn_ClientFrame();
{
Con_Print("CL_SendMove: lost server connection\n");
CL_Disconnect();
+ Host_ShutdownServer(false);
}
}
if (cls.state == ca_dedicated)
return;
+ Con_DPrintf("CL_Disconnect\n");
+
// stop sounds (especially looping!)
S_StopAllSounds (true);
SZ_Clear(&cls.message);
NetConn_Close(cls.netcon);
cls.netcon = NULL;
- // if running a local server, shut it down
- if (sv.active)
- {
- // prevent this code from executing again during Host_ShutdownServer
- cls.state = ca_disconnected;
- Host_ShutdownServer(false);
- }
}
cls.state = ca_disconnected;
va_end (argptr);
Con_DPrintf("Host_EndGame: %s\n",string);
- if (sv.active)
- Host_ShutdownServer (false);
+ Host_ShutdownServer (false);
if (cls.state == ca_dedicated)
Sys_Error ("Host_EndGame: %s\n",string); // dedicated servers exit
PRVM_ProcessError();
- if (sv.active)
- Host_ShutdownServer (false);
+ Host_ShutdownServer (false);
if (cls.state == ca_dedicated)
Sys_Error ("Host_Error: %s\n",hosterrorstring2); // dedicated servers exit
if (!sv.active)
return;
+ Con_DPrintf("Host_ShutdownServer\n");
+
// print out where the crash happened, if it was caused by QC
PR_Crash();
- sv.active = false;
-
-// stop all client sounds immediately
- CL_Disconnect();
-
NetConn_Heartbeat(2);
NetConn_Heartbeat(2);
NetConn_CloseServerPorts();
+ sv.active = false;
+
//
// clear structures
//
if (!cls.demoplayback)
return;
CL_Disconnect ();
+ Host_ShutdownServer (false);
}
static void MaxPlayers_f(void)
{
Con_Print("Connection timed out\n");
CL_Disconnect();
+ Host_ShutdownServer (false);
}
for (conn = netconn_list;conn;conn = conn->next)
NetConn_ReSendMessage(conn);