X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=host.c;h=0bafb91ad6076e4d898bd50d1966b92d399afdd5;hb=f7c3669f2d20d7d0951803f40343d75c3f36bc18;hp=5c8cb67ee12e96067327e44454f79d91a4fde621;hpb=849df9f152d51e2bfce34101f058d3afff589225;p=xonotic%2Fdarkplaces.git diff --git a/host.c b/host.c index 5c8cb67e..0bafb91a 100644 --- a/host.c +++ b/host.c @@ -69,6 +69,8 @@ cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000000", "maximum fps cap, if game cvar_t cl_maxidlefps = {CVAR_SAVE, "cl_maxidlefps", "20", "maximum fps cap when the game is not the active window (makes cpu time available to other programs"}; cvar_t developer = {0, "developer","0", "prints additional debugging messages and information (recommended for modders and level designers)"}; +cvar_t developer_loadfile = {0, "developer_loadfile","0", "prints name and size of every file loaded via the FS_LoadFile function (which is almost everything)"}; +cvar_t developer_loading = {0, "developer_loading","0", "prints information about files as they are loaded or unloaded successfully"}; cvar_t developer_entityparsing = {0, "developer_entityparsing", "0", "prints detailed network entities information each time a packet is received"}; cvar_t timestamps = {CVAR_SAVE, "timestamps", "0", "prints timestamps on console messages"}; @@ -217,6 +219,8 @@ static void Host_InitLocal (void) Cvar_RegisterVariable (&cl_maxidlefps); Cvar_RegisterVariable (&developer); + Cvar_RegisterVariable (&developer_loadfile); + Cvar_RegisterVariable (&developer_loading); Cvar_RegisterVariable (&developer_entityparsing); Cvar_RegisterVariable (×tamps); @@ -524,9 +528,6 @@ void Host_ShutdownServer(void) // make sure all the clients know we're disconnecting SV_VM_Begin(); - for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++) - if (host_client->active) - SV_DropClient(false); // server shutdown if(prog->loaded) if(prog->funcoffsets.SV_Shutdown) { @@ -534,6 +535,9 @@ void Host_ShutdownServer(void) prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again PRVM_ExecuteProgram(s,"SV_Shutdown() required"); } + for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++) + if (host_client->active) + SV_DropClient(false); // server shutdown SV_VM_End(); NetConn_CloseServerPorts(); @@ -691,22 +695,15 @@ void Host_Main(void) wait = cl_timer * -1000000.0; else wait = max(cl_timer, sv_timer) * -1000000.0; - if (wait > 100000) - wait = 100000; + wait = bound(0, wait, 100000); - if (!cls.timedemo && wait > 0) + if (!cls.timedemo && wait >= 1) { double time0 = Sys_DoubleTime(); if (sv_checkforpacketsduringsleep.integer) - { - if (wait >= 1) - NetConn_SleepMicroseconds((int)wait); - } + NetConn_SleepMicroseconds((int)wait); else - { - if (wait >= 1000) - Sys_Sleep((int)wait / 1000); - } + Sys_Sleep((int)wait); svs.perf_acc_sleeptime += Sys_DoubleTime() - time0; continue; } @@ -966,8 +963,8 @@ static void Host_Init (void) // COMMANDLINEOPTION: Console: -developer enables warnings and other notices (RECOMMENDED for mod developers) if (COM_CheckParm("-developer")) { - developer.value = developer.integer = 100; - developer.string = "100"; + developer.value = developer.integer = 1; + developer.string = "1"; } if (COM_CheckParm("-developer2")) @@ -1034,7 +1031,7 @@ static void Host_Init (void) if (cls.state != ca_dedicated) { - Con_Printf("Initializing client\n"); + Con_DPrintf("Initializing client\n"); R_Modules_Init(); Palette_Init();