X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=host.c;h=7233970b719aaa728dcc2493a4f23c36fcb702f1;hb=322c9a90b31ede335eabe8c2f52030b3f41db9ad;hp=9fcc9cf88191fff150a48a57c1620d6f93f1ff0c;hpb=0adef4094a65ecad05e90653f32068817e76a861;p=xonotic%2Fdarkplaces.git diff --git a/host.c b/host.c index 9fcc9cf8..7233970b 100644 --- a/host.c +++ b/host.c @@ -461,6 +461,8 @@ void SV_DropClient (qboolean crash) MSG_WriteByte (&client->message, host_client - svs.clients); MSG_WriteByte (&client->message, 0); } + + NET_Heartbeat (1); } /* @@ -488,6 +490,9 @@ void Host_ShutdownServer(qboolean crash) // stop all client sounds immediately CL_Disconnect (); + NET_Heartbeat (2); + NET_Heartbeat (2); + // flush any pending messages - like the score!!! start = Sys_DoubleTime(); do @@ -682,6 +687,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); } @@ -722,6 +730,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 @@ -876,42 +887,29 @@ void Host_Init (void) if (cls.state != ca_dedicated) { - VID_InitCvars(); - Gamma_Init(); - Palette_Init(); - -#ifndef _WIN32 // on non win32, mouse comes before video for security reasons - IN_Init (); -#endif + VID_Shared_Init(); VID_Init(); - if (!VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, vid_bitsperpixel.integer)) - { - if (vid_fullscreen.integer) - { - if (!VID_Mode(true, 640, 480, 16)) - if (!VID_Mode(false, 640, 480, 16)) - Sys_Error("Video modes failed\n"); - } - else - Sys_Error("Requested windowed video mode failed\n"); - } Render_Init(); S_Init (); CDAudio_Init (); CL_Init (); -#ifdef _WIN32 // on non win32, mouse comes before video for security reasons - IN_Init (); -#endif } Cbuf_InsertText ("exec quake.rc\n"); + Cbuf_Execute (); + Cbuf_Execute (); + Cbuf_Execute (); + Cbuf_Execute (); host_initialized = true; - Sys_Printf ("========Quake Initialized=========\n"); + Con_Printf ("========Quake Initialized=========\n"); + + if (cls.state != ca_dedicated) + VID_Open(); } @@ -939,7 +937,6 @@ void Host_Shutdown(void) CDAudio_Shutdown (); NET_Shutdown (); S_Shutdown(); - IN_Shutdown (); if (cls.state != ca_dedicated) {