mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-24 13:11:30 +00:00
- Added SV_Shutdown to Linux signal handler to ensure that clients don't hang when server gets killed, as suggested by Tony J. White
- Added newline to final message sent to clients. - Added check for whether client is running at all before CL_Shutdown runs through.
This commit is contained in:
parent
2583351211
commit
1847c321f0
3 changed files with 6 additions and 1 deletions
|
@ -2564,6 +2564,10 @@ CL_Shutdown
|
||||||
void CL_Shutdown( void ) {
|
void CL_Shutdown( void ) {
|
||||||
static qboolean recursive = qfalse;
|
static qboolean recursive = qfalse;
|
||||||
|
|
||||||
|
// check whether the client is running at all.
|
||||||
|
if(!(com_cl_running && com_cl_running->integer))
|
||||||
|
return;
|
||||||
|
|
||||||
Com_Printf( "----- CL_Shutdown -----\n" );
|
Com_Printf( "----- CL_Shutdown -----\n" );
|
||||||
|
|
||||||
if ( recursive ) {
|
if ( recursive ) {
|
||||||
|
|
|
@ -646,7 +646,7 @@ void SV_FinalMessage( char *message ) {
|
||||||
if (cl->state >= CS_CONNECTED) {
|
if (cl->state >= CS_CONNECTED) {
|
||||||
// don't send a disconnect to a local client
|
// don't send a disconnect to a local client
|
||||||
if ( cl->netchan.remoteAddress.type != NA_LOOPBACK ) {
|
if ( cl->netchan.remoteAddress.type != NA_LOOPBACK ) {
|
||||||
SV_SendServerCommand( cl, "print \"%s\"\n", message );
|
SV_SendServerCommand( cl, "print \"%s\n\"\n", message );
|
||||||
SV_SendServerCommand( cl, "disconnect" );
|
SV_SendServerCommand( cl, "disconnect" );
|
||||||
}
|
}
|
||||||
// force a snapshot to be sent
|
// force a snapshot to be sent
|
||||||
|
|
|
@ -46,6 +46,7 @@ static void signal_handler(int sig) // bk010104 - replace this... (NOTE TTimo hu
|
||||||
// rcg08312005 Agreed: changed to CL_Shutdown... --ryan.
|
// rcg08312005 Agreed: changed to CL_Shutdown... --ryan.
|
||||||
CL_Shutdown();
|
CL_Shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
SV_Shutdown("Signal caught");
|
||||||
Sys_Exit(0); // bk010104 - abstraction NOTE TTimo send a 0 to avoid DOUBLE SIGNAL FAULT
|
Sys_Exit(0); // bk010104 - abstraction NOTE TTimo send a 0 to avoid DOUBLE SIGNAL FAULT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue