X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=host.c;h=455d0bef1088d87f9d932d504fbb6b398a5a1c9c;hb=ce7388dfed07cfe65f8e407da5d328d002f80c21;hp=55aa68689643ba31d70ee1446be235d2517afd5b;hpb=55ed30ad15c72f52aea124389b9997745d4dbf02;p=xonotic%2Fdarkplaces.git diff --git a/host.c b/host.c index 55aa6868..455d0bef 100644 --- a/host.c +++ b/host.c @@ -133,11 +133,17 @@ This shuts down both the client and server ================ */ char hosterrorstring[4096]; +extern char sv_spawnmap[MAX_QPATH]; +extern char sv_loadgame[MAX_OSPATH]; void Host_Error (const char *error, ...) { va_list argptr; static qboolean inerror = false; + // make sure we don't get in a loading loop + sv_loadgame[0] = 0; + sv_spawnmap[0] = 0; + // LordHavoc: if first frame has not been shown, or currently shutting // down, do Sys_Error instead if (!host_loopactive || host_shuttingdown) @@ -164,6 +170,8 @@ void Host_Error (const char *error, ...) va_end (argptr); Con_Printf ("Host_Error: %s\n",hosterrorstring); + CL_Parse_DumpPacket(); + PR_Crash(); if (sv.active) @@ -175,6 +183,9 @@ void Host_Error (const char *error, ...) CL_Disconnect (); cls.demonum = -1; + // unload any partially loaded models + Mod_ClearErrorModels(); + inerror = false; longjmp (host_abortserver, 1); @@ -462,7 +473,7 @@ void SV_DropClient (qboolean crash) MSG_WriteByte (&client->message, 0); } - NET_Heartbeat (); + NET_Heartbeat (1); } /* @@ -490,8 +501,8 @@ void Host_ShutdownServer(qboolean crash) // stop all client sounds immediately CL_Disconnect (); - NET_Heartbeat (); - NET_Heartbeat (); + NET_Heartbeat (2); + NET_Heartbeat (2); // flush any pending messages - like the score!!! start = Sys_DoubleTime(); @@ -687,6 +698,9 @@ void Host_ServerFrame (void) // send all messages to the clients SV_SendClientMessages (); + +// send an heartbeat if enough time has passed since the last one + NET_Heartbeat (0); } @@ -727,6 +741,9 @@ void _Host_Frame (float time) // process console commands Cbuf_Execute (); + // LordHavoc: map and load are delayed until video is initialized + Host_PerformSpawnServerAndLoadGame(); + NET_Poll(); // if running the server locally, make intentions now