src/engine/eLagCompensation.cpp File Reference

#include "eLagCompensation.h"
#include "tSysTime.h"
#include "nNetwork.h"
#include "nConfig.h"

Include dependency graph for eLagCompensation.cpp:

Go to the source code of this file.

Classes

class  nClientLag
 lag tracker on client More...
class  nServerLag
 lag tracker on server More...

Functions

static void se_receiveLagMessage (nMessage &m)
static void login_callback ()

Variables

static REAL se_maxLagSpeedup = .2
static REAL se_lagSlowDecayTime = 30.0
static REAL se_lagFastDecayTime = 5.0
static REAL se_lagSlowWeight = .2f
static REAL se_lagFastWeight = 1.0f
static tSettingItem< REALse_maxLagSpeedupConf ("LAG_MAX_SPEEDUP_TIMER", se_maxLagSpeedup)
static tSettingItem< REALse_lagSlowDecayTimeConf ("LAG_SLOW_TIME", se_lagSlowDecayTime)
static tSettingItem< REALse_lagFastDecayTimeConf ("LAG_FAST_TIME", se_lagFastDecayTime)
static tSettingItem< REALse_lagSlowWeightConf ("LAG_SLOW_WEIGHT", se_lagSlowWeight)
static tSettingItem< REALse_lagFastWeightConf ("LAG_FAST_WEIGHT", se_lagFastWeight)
static nClientLag se_clientLag
static nDescriptor se_receiveLagMessageDescriptor (240, se_receiveLagMessage,"lag message")
static REAL se_lagCredit = .5f
static REAL se_lagCreditSingle = .1f
static REAL se_lagCreditSweetSpot = .5f
static REAL se_lagCreditTime = 600.0f
static tSettingItem< REALse_lagCreditConf ("LAG_CREDIT", se_lagCredit)
static tSettingItem< REALse_lagCreditSingleConf ("LAG_CREDIT_SINGLE", se_lagCreditSingle)
static tSettingItem< REALse_lagCreditSweetSpotConf ("LAG_SWEET_SPOT", se_lagCreditSweetSpot)
static tSettingItem< REALse_lagCreditTimeConf ("LAG_CREDIT_TIME", se_lagCreditTime)
static REAL se_lagThreshold = 0.0f
static tSettingItem< REALse_lagThresholdConf ("LAG_THRESHOLD", se_lagThreshold)
static nVersionFeature se_clientLagCompensation (14)
nServerLag se_serverLag [MAXCLIENTS+1]
static nCallbackLoginLogout nlc & login_callback
static REAL se_lagOffsetClient = 0.0f
static REAL se_lagOffsetServer = 0.0f
static tSettingItem< REALse_lagOffsetClientConf ("LAG_OFFSET_CLIENT", se_lagOffsetClient)
static nSettingItem< REALse_lagOffsetServerConf ("LAG_OFFSET_SERVER", se_lagOffsetServer)


Function Documentation

static void login_callback (  )  [static]

Definition at line 325 of file eLagCompensation.cpp.

References MAXCLIENTS, nSERVER, nServerLag::Reset(), nServerLag::SetClient(), sn_GetNetState(), and nCallbackLoginLogout::User().

00325                             {
00326     int user = nCallbackLoginLogout::User();
00327     if ( sn_GetNetState() != nSERVER || user == 0 || user > MAXCLIENTS )
00328         return;
00329 
00330     se_serverLag[user].Reset();
00331     se_serverLag[user].SetClient(user);
00332 }

Here is the call graph for this function:

static void se_receiveLagMessage ( nMessage m  )  [static]

Definition at line 114 of file eLagCompensation.cpp.

References nCLIENT, REAL, nClientLag::ReportLag(), sn_GetNetState(), and weight.

00115 {
00116     if ( sn_GetNetState() != nCLIENT )
00117         return;
00118 
00119     REAL lag;
00120     m >> lag;
00121 
00122     REAL weight;
00123     m >> weight;
00124 
00125     se_clientLag.ReportLag( lag, weight );
00126 }

Here is the call graph for this function:


Variable Documentation

nCallbackLoginLogout nlc& login_callback [static]

Definition at line 333 of file eLagCompensation.cpp.

nClientLag se_clientLag [static]

Definition at line 112 of file eLagCompensation.cpp.

nVersionFeature se_clientLagCompensation(14) [static]

Referenced by nServerLag::Report(), and eTimer::WriteSync().

REAL se_lagCredit = .5f [static]

Definition at line 131 of file eLagCompensation.cpp.

Referenced by nServerLag::Balance(), and nServerLag::Credit().

tSettingItem< REAL > se_lagCreditConf("LAG_CREDIT", se_lagCredit) [static]

REAL se_lagCreditSingle = .1f [static]

Definition at line 134 of file eLagCompensation.cpp.

Referenced by eLag::Credit(), nServerLag::Report(), and nServerLag::TakeCredit().

tSettingItem< REAL > se_lagCreditSingleConf("LAG_CREDIT_SINGLE", se_lagCreditSingle) [static]

REAL se_lagCreditSweetSpot = .5f [static]

Definition at line 137 of file eLagCompensation.cpp.

Referenced by nServerLag::Balance(), nServerLag::Report(), and nServerLag::Reset().

tSettingItem< REAL > se_lagCreditSweetSpotConf("LAG_SWEET_SPOT", se_lagCreditSweetSpot) [static]

REAL se_lagCreditTime = 600.0f [static]

Definition at line 140 of file eLagCompensation.cpp.

Referenced by nServerLag::TakeCredit().

tSettingItem< REAL > se_lagCreditTimeConf("LAG_CREDIT_TIME", se_lagCreditTime) [static]

REAL se_lagFastDecayTime = 5.0 [static]

Definition at line 43 of file eLagCompensation.cpp.

Referenced by nClientLag::Timestep().

tSettingItem< REAL > se_lagFastDecayTimeConf("LAG_FAST_TIME", se_lagFastDecayTime) [static]

REAL se_lagFastWeight = 1.0f [static]

Definition at line 45 of file eLagCompensation.cpp.

Referenced by nClientLag::ReportLag().

tSettingItem< REAL > se_lagFastWeightConf("LAG_FAST_WEIGHT", se_lagFastWeight) [static]

REAL se_lagOffsetClient = 0.0f [static]

Definition at line 338 of file eLagCompensation.cpp.

Referenced by eLag::Current().

tSettingItem< REAL > se_lagOffsetClientConf("LAG_OFFSET_CLIENT", se_lagOffsetClient) [static]

REAL se_lagOffsetServer = 0.0f [static]

Definition at line 339 of file eLagCompensation.cpp.

Referenced by eLag::Current().

nSettingItem< REAL > se_lagOffsetServerConf("LAG_OFFSET_SERVER", se_lagOffsetServer) [static]

REAL se_lagSlowDecayTime = 30.0 [static]

Definition at line 42 of file eLagCompensation.cpp.

Referenced by nClientLag::Timestep().

tSettingItem< REAL > se_lagSlowDecayTimeConf("LAG_SLOW_TIME", se_lagSlowDecayTime) [static]

REAL se_lagSlowWeight = .2f [static]

Definition at line 44 of file eLagCompensation.cpp.

Referenced by nClientLag::ReportLag().

tSettingItem< REAL > se_lagSlowWeightConf("LAG_SLOW_WEIGHT", se_lagSlowWeight) [static]

REAL se_lagThreshold = 0.0f [static]

Definition at line 148 of file eLagCompensation.cpp.

Referenced by nServerLag::TakeCredit(), and eLag::Threshold().

tSettingItem< REAL > se_lagThresholdConf("LAG_THRESHOLD", se_lagThreshold) [static]

REAL se_maxLagSpeedup = .2 [static]

Definition at line 41 of file eLagCompensation.cpp.

Referenced by nClientLag::Timestep().

tSettingItem< REAL > se_maxLagSpeedupConf("LAG_MAX_SPEEDUP_TIMER", se_maxLagSpeedup) [static]

nDescriptor se_receiveLagMessageDescriptor(240, se_receiveLagMessage,"lag message") [static]

Referenced by nServerLag::Report().

nServerLag se_serverLag[MAXCLIENTS+1]

Definition at line 292 of file eLagCompensation.cpp.


Generated on Sat Mar 15 22:57:25 2008 for Armagetron Advanced by  doxygen 1.5.4