#include "nConfig.h"
#include "nNetObject.h"
#include "tConsole.h"
#include "tSysTime.h"
#include <set>
#include <string.h>
Go to the source code of this file.
Typedefs | |
typedef std::set < nConfItemVersionWatcher * > | nStrongWatcherList |
Functions | |
static nStrongWatcherList & | sn_GetStrongWatchers () |
void | sn_StrongWatchersAddRef () |
void | sn_StrongWatchersRelease () |
int | sn_GetCurrentProtocolVersion () |
static char const * | sn_GetVersionString (int version) |
Variables | |
static nDescriptor | transferConfig (60, nConfItemBase::s_GetConfigMessage,"transfer config") |
static nStrongWatcherList * | sn_watchers = 0 |
static int | sn_refcount = 0 |
static char const * | sn_groupName [nConfItemVersionWatcher::Group_Max] |
static char const * | sn_versionString [] |
static nVersion | lastVersion = sn_MyVersion() |
static nConfItemVersionWatcher::Behavior | sn_GroupBehaviors [nConfItemVersionWatcher::Group_Max] |
static tSettingItem < nConfItemVersionWatcher::Behavior > | sn_GroupBehaviorBreaks ("SETTING_LEGACY_BEHAVIOR_BREAKING", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Breaking]) |
static tSettingItem < nConfItemVersionWatcher::Behavior > | sn_GroupBehaviorBumpy ("SETTING_LEGACY_BEHAVIOR_BUMPY", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Bumpy]) |
static tSettingItem < nConfItemVersionWatcher::Behavior > | sn_GroupBehaviorAnnoyance ("SETTING_LEGACY_BEHAVIOR_ANNOYING", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Annoying]) |
static tSettingItem < nConfItemVersionWatcher::Behavior > | sn_GroupBehaviorCheat ("SETTING_LEGACY_BEHAVIOR_CHEATING", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Cheating]) |
static tSettingItem < nConfItemVersionWatcher::Behavior > | sn_GroupBehaviorDisplay ("SETTING_LEGACY_BEHAVIOR_VISUAL", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Visual]) |
typedef std::set< nConfItemVersionWatcher * > nStrongWatcherList |
other | object to copy from | |
other | object to copy from |
Definition at line 340 of file nConfig.cpp.
int sn_GetCurrentProtocolVersion | ( | ) |
Definition at line 463 of file nConfig.cpp.
References sn_versionString.
00464 { 00465 return (sizeof(sn_versionString)/sizeof(char const *)) - 2; 00466 }
static nStrongWatcherList& sn_GetStrongWatchers | ( | ) | [static] |
Definition at line 344 of file nConfig.cpp.
References sn_watchers, and tNEW.
Referenced by nConfItemVersionWatcher::AdaptVersion(), nConfItemVersionWatcher::nConfItemVersionWatcher(), nConfItemVersionWatcher::OnVersionChange(), and nConfItemVersionWatcher::~nConfItemVersionWatcher().
00345 { 00346 if (!sn_watchers) 00347 { 00348 sn_watchers = tNEW(nStrongWatcherList)(); 00349 } 00350 00351 return *sn_watchers; 00352 }
static char const* sn_GetVersionString | ( | int | version | ) | [static] |
Definition at line 468 of file nConfig.cpp.
References sn_versionString, and tVERIFY.
Referenced by nConfItemVersionWatcher::FillTemplateParameters().
00469 { 00470 tVERIFY ( version * sizeof( char * ) < sizeof sn_versionString ); 00471 tVERIFY ( version >= 0 ); 00472 00473 return sn_versionString[ version ]; 00474 }
void sn_StrongWatchersAddRef | ( | ) |
Definition at line 354 of file nConfig.cpp.
References sn_refcount.
Referenced by nConfItemVersionWatcher::nConfItemVersionWatcher().
00355 { 00356 sn_refcount++; 00357 }
void sn_StrongWatchersRelease | ( | ) |
Definition at line 359 of file nConfig.cpp.
References sn_refcount, sn_watchers, and tDESTROY.
Referenced by nConfItemVersionWatcher::~nConfItemVersionWatcher().
00360 { 00361 if ( --sn_refcount <= 0 ) 00362 { 00363 tDESTROY( sn_watchers ); 00364 } 00365 }
nVersion lastVersion = sn_MyVersion() [static] |
version | the version to adapt to the settings |
Definition at line 487 of file nConfig.cpp.
tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorAnnoyance("SETTING_LEGACY_BEHAVIOR_ANNOYING", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Annoying]) [static] |
tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorBreaks("SETTING_LEGACY_BEHAVIOR_BREAKING", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Breaking]) [static] |
tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorBumpy("SETTING_LEGACY_BEHAVIOR_BUMPY", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Bumpy]) [static] |
tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorCheat("SETTING_LEGACY_BEHAVIOR_CHEATING", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Cheating]) [static] |
tSettingItem< nConfItemVersionWatcher::Behavior > sn_GroupBehaviorDisplay("SETTING_LEGACY_BEHAVIOR_VISUAL", sn_GroupBehaviors[nConfItemVersionWatcher::Group_Visual]) [static] |
nConfItemVersionWatcher::Behavior sn_GroupBehaviors[nConfItemVersionWatcher::Group_Max] [static] |
Initial value:
{ Behavior_Block, Behavior_Block, Behavior_Nothing, Behavior_Block, Behavior_Nothing, }
Definition at line 600 of file nConfig.cpp.
Referenced by nConfItemVersionWatcher::GetBehavior().
char const* sn_groupName[nConfItemVersionWatcher::Group_Max] [static] |
Initial value:
{ "Breaking", "Bumpy", "Annoying", "Cheating", "Visual" }
Definition at line 427 of file nConfig.cpp.
Referenced by nConfItemVersionWatcher::FillTemplateParameters().
int sn_refcount = 0 [static] |
Definition at line 342 of file nConfig.cpp.
Referenced by sn_StrongWatchersAddRef(), and sn_StrongWatchersRelease().
char const* sn_versionString[] [static] |
Initial value:
{ "0.2.0", "0.2.0", "0.2.5.0", "0.2.6.0", "0.2.7.1", "0.2.8_beta1", "0.2.8_beta1", "0.2.8_beta2", "0.2.8_beta3", "0.2.8_beta4", "0.2.8.0_rc1", "0.2.8.0", "0.2.8_alpha20060414", "0.2.8.2", "0.2.8.3_alpha", "0.2.8.3_alpha_auth", "0.2.8.3", "0.2.8.4", "0.2.8.5_alpha", "0.2.8.5", "0.3.1", 0 }
Definition at line 437 of file nConfig.cpp.
Referenced by sn_GetCurrentProtocolVersion(), and sn_GetVersionString().
nStrongWatcherList* sn_watchers = 0 [static] |
Definition at line 341 of file nConfig.cpp.
Referenced by sn_GetStrongWatchers(), and sn_StrongWatchersRelease().
nDescriptor transferConfig(60, nConfItemBase::s_GetConfigMessage,"transfer config") [static] |
Referenced by nConfItemBase::SendConfig().