#include "tList.h"
#include "tString.h"
#include "tLinkedList.h"
#include "tException.h"
#include "tLocale.h"
#include "tConsole.h"
#include <iostream>
#include <ctype.h>
#include <string>
#include <deque>
#include <map>
Go to the source code of this file.
Classes | |
class | tCurrentAccessLevel |
class managing the current access level More... | |
class | tConfItemBase |
class | tAccessLevelSetter |
just to do some work in static initializers, to modify default access levels: More... | |
struct | tTypeToConfig< T > |
type modifying class mapping types in memory to types to stream More... | |
class | tAbortLoading |
exception to be thrown when the current script should be aborted More... | |
class | tConfItem< T > |
class | tSettingItem< T > |
class | tConfItemLine |
class | tConfItemFunc |
Defines | |
#define | tCONFIG_AS(TYPE, STREAM) |
macro declaring that type TYPE should be converted to type STREAM before | |
#define | tCONFIG_ENUM(TYPE) tCONFIG_AS( TYPE, int ) |
macro for configuration enums: convert them to int. | |
Typedefs | |
typedef void | CONF_FUNC (std::istream &s) |
Enumerations | |
enum | tAccessLevel { tAccessLevel_Owner = 0, tAccessLevel_Admin = 1, tAccessLevel_Moderator = 2, tAccessLevel_3 = 3, tAccessLevel_4 = 4, tAccessLevel_5 = 5, tAccessLevel_6 = 6, tAccessLevel_TeamLeader = 7, tAccessLevel_TeamMember = 8, tAccessLevel_9 = 9, tAccessLevel_10 = 10, tAccessLevel_11 = 11, tAccessLevel_Local = 12, tAccessLevel_13 = 13, tAccessLevel_14 = 14, tAccessLevel_Remote = 15, tAccessLevel_DefaultAuthenticated = 15, tAccessLevel_FallenFromGrace = 16, tAccessLevel_Shunned = 17, tAccessLevel_18 = 18, tAccessLevel_Authenticated = 19, tAccessLevel_Program = 20, tAccessLevel_21 = 21, tAccessLevel_22 = 22, tAccessLevel_23 = 23, tAccessLevel_24 = 24, tAccessLevel_25 = 25, tAccessLevel_Default = 20 } |
access levels for admin interfaces; lower numeric values are better More... | |
Functions | |
tCONFIG_ENUM (tAccessLevel) | |
void | st_Include (tString const &file, bool reportError=true) |
void | st_LoadConfig () |
void | st_SaveConfig () |
Variables | |
bool | st_FirstUse |
#define tCONFIG_AS | ( | TYPE, | |||
STREAM | ) |
Value:
template<> struct tTypeToConfig< TYPE > \ { \ typedef STREAM TOSTREAM; \ typedef int * DUMMYREQUIRED; \ } \
Definition at line 197 of file tConfiguration.h.
#define tCONFIG_ENUM | ( | TYPE | ) | tCONFIG_AS( TYPE, int ) |
macro for configuration enums: convert them to int.
Definition at line 205 of file tConfiguration.h.
typedef void CONF_FUNC(std::istream &s) |
Definition at line 352 of file tConfiguration.h.
enum tAccessLevel |
access levels for admin interfaces; lower numeric values are better
Definition at line 45 of file tConfiguration.h.
00046 { 00047 tAccessLevel_Owner = 0, // the server owner 00048 tAccessLevel_Admin = 1, // one of his admins 00049 tAccessLevel_Moderator = 2, // one of the moderators 00050 tAccessLevel_3 = 3, // reserved 00051 tAccessLevel_4 = 4, // reserved 00052 tAccessLevel_5 = 5, // reserved 00053 tAccessLevel_6 = 6, // reserved 00054 tAccessLevel_TeamLeader = 7, // a team leader 00055 tAccessLevel_TeamMember = 8, // a team member 00056 tAccessLevel_9 = 9, // reserved 00057 tAccessLevel_10 = 10, // reserved 00058 tAccessLevel_11 = 11, // reserved 00059 tAccessLevel_Local = 12, // user with a local account 00060 tAccessLevel_13 = 13, // reserved 00061 tAccessLevel_14 = 14, // reserved 00062 tAccessLevel_Remote = 15, // user with remote account 00063 tAccessLevel_DefaultAuthenticated = 15, // default access level for authenticated users 00064 tAccessLevel_FallenFromGrace = 16, // authenticated, but not liked 00065 tAccessLevel_Shunned = 17, // authenticated, but disliked 00066 tAccessLevel_18 = 18, // reserved 00067 tAccessLevel_Authenticated = 19,// any authenticated player 00068 tAccessLevel_Program = 20, // a regular player 00069 tAccessLevel_21 = 21, // reserved 00070 tAccessLevel_22 = 22, // reserved 00071 tAccessLevel_23 = 23, // reserved 00072 tAccessLevel_24 = 24, // reserved 00073 tAccessLevel_25 = 25, // reserved 00074 tAccessLevel_Default = 20 00075 };
void st_Include | ( | tString const & | file, | |
bool | reportError = true | |||
) |
Definition at line 916 of file tConfiguration.cpp.
References con, tDirectories::Config(), tPath::IsValidPath(), Load(), and tDirectories::Var().
Referenced by Include().
00917 { 00918 // refuse to load illegal paths 00919 if( !tPath::IsValidPath( file ) ) 00920 return; 00921 00922 if ( !Load( tDirectories::Var(), file ) ) 00923 { 00924 if (!Load( tDirectories::Config(), file ) && reportError ) 00925 { 00926 con << tOutput( "$config_include_not_found", file ); 00927 } 00928 } 00929 }
void st_LoadConfig | ( | ) |
Definition at line 839 of file tConfiguration.cpp.
References st_LoadConfig().
00840 { 00841 st_LoadConfig( false ); 00842 }
void st_SaveConfig | ( | ) |
Definition at line 818 of file tConfiguration.cpp.
References con, tConfItemBase::SaveAll(), and tDirectories::Var().
Referenced by filter(), main(), SDLMain::quit:, se_DeletePasswords(), se_SoundInit(), sr_ExitDisplay(), sr_InitDisplay(), st_DoHandleSigHup(), and SDLApplication::terminate:.
00819 { 00820 // don't save while playing back 00821 if ( st_settingsFromRecording ) 00822 { 00823 return; 00824 } 00825 00826 std::ofstream s; 00827 if ( tDirectories::Var().Open( s, st_userConfigs[0], std::ios::out, true ) ) 00828 { 00829 tConfItemBase::SaveAll(s); 00830 } 00831 else 00832 { 00833 tOutput o("$config_file_write_error"); 00834 con << o; 00835 std::cerr << o; 00836 } 00837 }
tCONFIG_ENUM | ( | tAccessLevel | ) |
bool st_FirstUse |