core/TimerSys.cpp
changeset 1371 d207f0e17532
parent 1330 ab94316bb52b
child 1407 bb6516a50eea
     1.1 --- a/core/TimerSys.cpp	Sun Aug 26 18:29:02 2007 +0000
     1.2 +++ b/core/TimerSys.cpp	Sun Aug 26 18:41:57 2007 +0000
     1.3 @@ -29,11 +29,25 @@
     1.4   * Version: $Id$
     1.5   */
     1.6  
     1.7 +#include <time.h>
     1.8  #include "TimerSys.h"
     1.9 +#include "sourcemm_api.h"
    1.10  
    1.11  TimerSystem g_Timers;
    1.12  TickInfo g_SimTicks;
    1.13  
    1.14 +ConVar sm_time_adjustment("sm_time_adjustment", "0", 0, "Adjusts the server time in seconds");
    1.15 +
    1.16 +time_t GetAdjustedTime(time_t *buf)
    1.17 +{
    1.18 +	time_t val = time(NULL) + sm_time_adjustment.GetInt();
    1.19 +	if (buf)
    1.20 +	{
    1.21 +		*buf = val;
    1.22 +	}
    1.23 +	return val;
    1.24 +}
    1.25 +
    1.26  inline float GetSimulatedTime()
    1.27  {
    1.28  	if (g_SimTicks.ticking)