================
*/
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)
va_end (argptr);
Con_Printf ("Host_Error: %s\n",hosterrorstring);
+ CL_Parse_DumpPacket();
+
PR_Crash();
if (sv.active)
CL_Disconnect ();
cls.demonum = -1;
+ // unload any partially loaded models
+ Mod_ClearErrorModels();
+
inerror = false;
longjmp (host_abortserver, 1);
*/
void Host_WriteConfiguration (void)
{
- QFile *f;
+ qfile_t *f;
// dedicated servers initialize the host but don't parse and set the
// config.cfg cvars
if (host_initialized && cls.state != ca_dedicated)
{
- f = Qopen (va("%s/config.cfg",com_gamedir), "w");
+ f = FS_Open ("config.cfg", "w", false);
if (!f)
{
Con_Printf ("Couldn't write config.cfg.\n");
Key_WriteBindings (f);
Cvar_WriteVariables (f);
- Qclose (f);
+ FS_Close (f);
}
}
MSG_WriteByte (&client->message, 0);
}
- NET_Heartbeat ();
+ NET_Heartbeat (1);
}
/*
// 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();
// send all messages to the clients
SV_SendClientMessages ();
+
+// send an heartbeat if enough time has passed since the last one
+ NET_Heartbeat (0);
}
// 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
CDAudio_Update();
- // LordHavoc: map and load are delayed until video is initialized
- Host_PerformSpawnServerAndLoadGame();
-
if (host_speeds.integer)
{
pass1 = (time1 - time3)*1000000;
time1 = Sys_DoubleTime ();
_Host_Frame (time);
- time2 = Sys_DoubleTime ();
-
+ time2 = Sys_DoubleTime ();
+
timetotal += time2 - time1;
timecount++;
-
+
if (timecount < 1000)
return;
//============================================================================
void Render_Init(void);
-void QuakeIO_Init(void);
/*
====================
Memory_Init_Commands();
R_Modules_Init();
Cbuf_Init ();
- QuakeIO_Init ();
V_Init ();
COM_Init ();
Host_InitLocal ();
if (cls.state != ca_dedicated)
{
- Gamma_Init();
Palette_Init();
VID_Shared_Init();
VID_Init();
Cbuf_Execute ();
host_initialized = true;
-
- Con_Printf ("========Quake Initialized=========\n");
+
+ Con_Printf ("========Quake Initialized=========\n");
if (cls.state != ca_dedicated)
VID_Open();
void Host_Shutdown(void)
{
static qboolean isdown = false;
-
+
if (isdown)
{
- printf ("recursive shutdown\n");
+ Con_Printf ("recursive shutdown\n");
return;
}
isdown = true;
- Host_WriteConfiguration ();
+ Host_WriteConfiguration ();
CDAudio_Shutdown ();
NET_Shutdown ();