World_PrintAreaStats(&sv.world, "server");
}
-static qbool SV_CanSave(void)
-{
- prvm_prog_t *prog = SVVM_prog;
- if(SV_IsLocalServer() == 1)
- {
- // singleplayer checks
- if ((svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag)))
- {
- Con_Print("Can't savegame with a dead player\n");
- return false;
- }
-
- if(host.hook.CL_Intermission && host.hook.CL_Intermission())
- {
- Con_Print("Can't save in intermission.\n");
- return false;
- }
- }
- else
- Con_Print(CON_WARN "Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
- return true;
-
-}
-
static void SV_ServerOptions (void)
{
int i;
Cvar_RegisterVariable (&sv_writepicture_quality);
SV_InitOperatorCommands();
- host.hook.SV_CanSave = SV_CanSave;
+ host.hook.SV_Shutdown = SV_Shutdown;
sv_mempool = Mem_AllocPool("server", 0, NULL);
Sys_MakeProcessNice();
else
{
+ SCR_SetLoadingSplash(NULL); // clear splash
SCR_BeginLoadingPlaque(false);
S_StopAllSounds();
}
prvm_prog_t *prog = SVVM_prog;
int i;
- Con_DPrintf("SV_Shutdown\n");
+ SV_LockThreadMutex();
if (!sv.active)
- return;
+ goto end;
+
+ Con_DPrintf("SV_Shutdown\n");
NetConn_Heartbeat(2);
NetConn_Heartbeat(2);
//
memset(&sv, 0, sizeof(sv));
memset(svs.clients, 0, svs.maxclients*sizeof(client_t));
-
- cl.islocalgame = false;
+end:
+ SV_UnlockThreadMutex();
}
/////////////////////////////////////////////////////