X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=host.c;h=e196fe79ce167f064ccf6bd00be6b6a1edd7b90b;hb=d7c6a4d737c8f59bab92b37e0039882aa88a6dc8;hp=fa3c4911894d04441ef096a3a94bc59a5d31ab11;hpb=0acfd66b9cd2e309f1b383309cd26cc2aa4fa4c7;p=xonotic%2Fdarkplaces.git diff --git a/host.c b/host.c index fa3c4911..e196fe79 100644 --- a/host.c +++ b/host.c @@ -1,5 +1,6 @@ /* Copyright (C) 1996-1997 Id Software, Inc. +Copyright (C) 2000-2021 DarkPlaces contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -37,7 +38,7 @@ Memory is cleared / released when a server or client begins, not when they end. */ -host_t host; +host_static_t host; // pretend frames take this amount of time (in seconds), 0 = realtime cvar_t host_framerate = {CF_CLIENT | CF_SERVER, "host_framerate","0", "locks frame timing to this value in seconds, 0.05 is 20fps for example, note that this can easily run too fast, use cl_maxfps if you want to limit your framerate instead, or sys_ticrate to limit server speed"}; @@ -127,9 +128,8 @@ void Host_Error (const char *error, ...) Cvar_SetValueQuick(&csqc_progcrc, -1); Cvar_SetValueQuick(&csqc_progsize, -1); - SV_LockThreadMutex(); - SV_Shutdown (); - SV_UnlockThreadMutex(); + if(host.hook.SV_Shutdown) + host.hook.SV_Shutdown(); if (cls.state == ca_dedicated) Sys_Error ("Host_Error: %s",hosterrorstring2); // dedicated servers exit @@ -374,7 +374,7 @@ static void Host_Init (void) host.hook.Disconnect = NULL; host.hook.ToggleMenu = NULL; host.hook.CL_Intermission = NULL; - host.hook.SV_CanSave = NULL; + host.hook.SV_Shutdown = NULL; host.state = host_init; @@ -587,9 +587,8 @@ void Host_Shutdown(void) SV_StopThread(); // shut down local server if active - SV_LockThreadMutex(); - SV_Shutdown (); - SV_UnlockThreadMutex(); + if(host.hook.SV_Shutdown) + host.hook.SV_Shutdown(); // AK shutdown PRVM // AK hmm, no PRVM_Shutdown(); yet @@ -684,7 +683,7 @@ static inline void Host_Sleep(double time) else Sys_Sleep((int)time); delta = Sys_DirtyTime() - time0; - if (delta < 0 || delta >= 1800) + if (delta < 0 || delta >= 1800) delta = 0; host.sleeptime += delta; // R_TimeReport("sleep");