3 * =============================================================================
5 * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
34 #include "GameConfigs.h"
35 #include "sm_stringutil.h"
36 #include "sourcemod.h"
37 #include "sourcemm_api.h"
38 #include "HalfLife2.h"
41 #include "MemoryUtils.h"
42 #include "LibrarySys.h"
43 #include "HandleSys.h"
46 #if defined PLATFORM_LINUX
50 GameConfigManager g_GameConfigs;
51 IGameConfig *g_pGameConf = NULL;
52 static char g_Game[256];
53 static char g_GameDesc[256] = {'!', '\0'};
54 static char g_GameName[256] = {'$', '\0'};
57 #define PSTATE_GAMES 1
58 #define PSTATE_GAMEDEFS 2
59 #define PSTATE_GAMEDEFS_OFFSETS 3
60 #define PSTATE_GAMEDEFS_OFFSETS_OFFSET 4
61 #define PSTATE_GAMEDEFS_KEYS 5
62 #define PSTATE_GAMEDEFS_SUPPORTED 6
63 #define PSTATE_GAMEDEFS_SIGNATURES 7
64 #define PSTATE_GAMEDEFS_SIGNATURES_SIG 8
65 #define PSTATE_GAMEDEFS_CRC 9
66 #define PSTATE_GAMEDEFS_CRC_BINARY 10
67 #define PSTATE_GAMEDEFS_CUSTOM 11
69 #if defined PLATFORM_WINDOWS
70 #define PLATFORM_NAME "windows"
71 #define PLATFORM_SERVER_BINARY "server.dll"
72 #elif defined PLATFORM_LINUX
73 #define PLATFORM_NAME "linux"
74 #define PLATFORM_SERVER_BINARY "server_i486.so"
75 #elif defined PLATFORM_APPLE
76 #define PLATFORM_NAME "undef"
77 #define PLATFORM_SERVER_BINARY "undef.dylib"
90 unsigned int s_ServerBinCRC;
91 bool s_ServerBinCRC_Ok = false;
93 static bool DoesGameMatch(const char *value)
95 if (strcmp(value, g_Game) == 0 ||
96 strcmp(value, g_GameDesc) == 0 ||
97 strcmp(value, g_GameName) == 0)
104 static bool DoesEngineMatch(const char *value)
106 #if SOURCE_ENGINE == SE_EPISODEONE
107 if (strcmp(value, "original") == 0)
108 #elif SOURCE_ENGINE == SE_DARKMESSIAH
109 if (strcmp(value, "darkmessiah") == 0)
110 #elif SOURCE_ENGINE == SE_ORANGEBOX
111 if (strcmp(value, "orangebox") == 0)
112 #elif SOURCE_ENGINE == SE_LEFT4DEAD
113 if (strcmp(value, "left4dead") == 0)
115 #error "Unknown engine type"
123 CGameConfig::CGameConfig(const char *file)
125 strncopy(m_File, file, sizeof(m_File));
126 m_pOffsets = sm_trie_create();
127 m_pProps = sm_trie_create();
128 m_pKeys = sm_trie_create();
129 m_pSigs = sm_trie_create();
130 m_pStrings = new BaseStringTable(512);
134 m_CustomHandler = NULL;
137 CGameConfig::~CGameConfig()
139 sm_trie_destroy(m_pOffsets);
140 sm_trie_destroy(m_pProps);
141 sm_trie_destroy(m_pKeys);
142 sm_trie_destroy(m_pSigs);
146 SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *name)
151 return SMCResult_Continue;
154 switch (m_ParseState)
158 if (strcmp(name, "Games") == 0)
160 m_ParseState = PSTATE_GAMES;
168 if (strcmp(name, "*") == 0 ||
169 strcmp(name, "#default") == 0 ||
172 bShouldBeReadingDefault = true;
173 m_ParseState = PSTATE_GAMEDEFS;
174 strncopy(m_Game, name, sizeof(m_Game));
180 case PSTATE_GAMEDEFS:
182 if (strcmp(name, "Offsets") == 0)
184 m_ParseState = PSTATE_GAMEDEFS_OFFSETS;
186 else if (strcmp(name, "Keys") == 0)
188 m_ParseState = PSTATE_GAMEDEFS_KEYS;
190 else if ((strcmp(name, "#supported") == 0) && (strcmp(m_Game, "#default") == 0))
192 m_ParseState = PSTATE_GAMEDEFS_SUPPORTED;
193 /* Ignore this section unless we get a game. */
194 bShouldBeReadingDefault = false;
196 matched_game = false;
198 matched_engine = false;
200 else if (strcmp(name, "Signatures") == 0)
202 m_ParseState = PSTATE_GAMEDEFS_SIGNATURES;
204 else if (strcmp(name, "CRC") == 0)
206 m_ParseState = PSTATE_GAMEDEFS_CRC;
207 bShouldBeReadingDefault = false;
211 ITextListener_SMC **pListen = g_GameConfigs.m_customHandlers.retrieve(name);
216 m_ParseState = PSTATE_GAMEDEFS_CUSTOM;
217 m_CustomHandler = *pListen;
218 m_CustomHandler->ReadSMC_ParseStart();
226 case PSTATE_GAMEDEFS_OFFSETS:
230 strncopy(m_offset, name, sizeof(m_offset));
231 m_ParseState = PSTATE_GAMEDEFS_OFFSETS_OFFSET;
234 case PSTATE_GAMEDEFS_SIGNATURES:
236 strncopy(m_offset, name, sizeof(m_offset));
238 m_ParseState = PSTATE_GAMEDEFS_SIGNATURES_SIG;
241 case PSTATE_GAMEDEFS_CRC:
245 if (strcmp(name, "server") != 0)
247 UTIL_Format(error, sizeof(error), "Unrecognized library \"%s\"", name);
249 else if (!s_ServerBinCRC_Ok)
252 char path[PLATFORM_MAX_PATH];
254 g_SourceMod.BuildPath(Path_Game, path, sizeof(path), "bin/" PLATFORM_SERVER_BINARY);
255 if ((fp = fopen(path, "rb")) == NULL)
257 UTIL_Format(error, sizeof(error), "Could not open binary: %s", path);
262 fseek(fp, 0, SEEK_END);
264 fseek(fp, 0, SEEK_SET);
266 buffer = malloc(size);
267 fread(buffer, size, 1, fp);
268 s_ServerBinCRC = UTIL_CRC32(buffer, size);
270 s_ServerBinCRC_Ok = true;
274 if (error[0] != '\0')
277 g_Logger.LogError("[SM] Error while parsing CRC section for \"%s\" (%s):", m_Game, m_CurFile);
278 g_Logger.LogError("[SM] %s", error);
280 m_ParseState = PSTATE_GAMEDEFS_CRC_BINARY;
284 case PSTATE_GAMEDEFS_CUSTOM:
287 return m_CustomHandler->ReadSMC_NewSection(states, name);
290 /* No sub-sections allowed:
291 case PSTATE_GAMEDEFS_OFFSETS_OFFSET:
292 case PSTATE_GAMEDEFS_KEYS:
293 case PSTATE_GAMEDEFS_SUPPORTED:
294 case PSTATE_GAMEDEFS_SIGNATURES_SIG:
295 case PSTATE_GAMEDEFS_CRC_BINARY:
299 /* If we don't know what we got, start ignoring */
305 return SMCResult_Continue;
308 SMCResult CGameConfig::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
312 return SMCResult_Continue;
315 if (m_ParseState == PSTATE_GAMEDEFS_OFFSETS_OFFSET)
317 if (strcmp(key, "class") == 0)
319 strncopy(m_Class, value, sizeof(m_Class));
320 } else if (strcmp(key, "prop") == 0) {
321 strncopy(m_Prop, value, sizeof(m_Prop));
322 } else if (strcmp(key, PLATFORM_NAME) == 0) {
323 int val = atoi(value);
324 sm_trie_replace(m_pOffsets, m_offset, (void *)val);
326 } else if (m_ParseState == PSTATE_GAMEDEFS_KEYS) {
327 int id = m_pStrings->AddString(value);
328 sm_trie_replace(m_pKeys, key, (void *)id);
329 } else if (m_ParseState == PSTATE_GAMEDEFS_SUPPORTED) {
330 if (strcmp(key, "game") == 0)
333 if (DoesGameMatch(value))
337 if ((!had_engine && matched_game) || (matched_engine && matched_game))
339 bShouldBeReadingDefault = true;
342 else if (strcmp(key, "engine") == 0)
345 if (DoesEngineMatch(value))
347 matched_engine = true;
349 if ((!had_game && matched_engine) || (matched_game && matched_engine))
351 bShouldBeReadingDefault = true;
354 } else if (m_ParseState == PSTATE_GAMEDEFS_SIGNATURES_SIG) {
355 if (strcmp(key, PLATFORM_NAME) == 0)
357 strncopy(s_TempSig.sig, value, sizeof(s_TempSig.sig));
358 } else if (strcmp(key, "library") == 0) {
359 strncopy(s_TempSig.library, value, sizeof(s_TempSig.library));
361 } else if (m_ParseState == PSTATE_GAMEDEFS_CRC_BINARY) {
362 if (strcmp(key, PLATFORM_NAME) == 0
364 && !bShouldBeReadingDefault)
366 unsigned int crc = 0;
367 sscanf(value, "%08X", &crc);
368 if (s_ServerBinCRC == crc)
370 bShouldBeReadingDefault = true;
373 } else if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM) {
374 return m_CustomHandler->ReadSMC_KeyValue(states, key, value);
377 return SMCResult_Continue;
380 SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
385 return SMCResult_Continue;
391 m_CustomHandler->ReadSMC_LeavingSection(states);
392 return SMCResult_Continue;
395 switch (m_ParseState)
399 m_ParseState = PSTATE_NONE;
402 case PSTATE_GAMEDEFS:
404 m_ParseState = PSTATE_GAMES;
407 case PSTATE_GAMEDEFS_CUSTOM:
409 m_ParseState = PSTATE_GAMEDEFS;
410 m_CustomHandler->ReadSMC_ParseEnd(false, false);
413 case PSTATE_GAMEDEFS_KEYS:
414 case PSTATE_GAMEDEFS_OFFSETS:
416 m_ParseState = PSTATE_GAMEDEFS;
419 case PSTATE_GAMEDEFS_OFFSETS_OFFSET:
421 /* Parse the offset... */
422 if (m_Class[0] != '\0'
423 && m_Prop[0] != '\0')
425 SendProp *pProp = g_HL2.FindInSendTable(m_Class, m_Prop);
428 int val = pProp->GetOffset();
429 sm_trie_replace(m_pOffsets, m_offset, (void *)val);
430 sm_trie_replace(m_pProps, m_offset, pProp);
432 /* Check if it's a non-default game and no offsets exist */
433 if (((strcmp(m_Game, "*") != 0) && strcmp(m_Game, "#default") != 0)
434 && (!sm_trie_retrieve(m_pOffsets, m_offset, NULL)))
436 g_Logger.LogError("[SM] Unable to find property %s.%s (file \"%s\") (mod \"%s\")",
444 m_ParseState = PSTATE_GAMEDEFS_OFFSETS;
447 case PSTATE_GAMEDEFS_CRC:
448 case PSTATE_GAMEDEFS_SUPPORTED:
450 if (!bShouldBeReadingDefault)
452 /* If we shouldn't read the rest of this section, set the ignore level. */
454 m_ParseState = PSTATE_GAMES;
456 m_ParseState = PSTATE_GAMEDEFS;
460 case PSTATE_GAMEDEFS_CRC_BINARY:
462 m_ParseState = PSTATE_GAMEDEFS_CRC;
465 case PSTATE_GAMEDEFS_SIGNATURES:
467 m_ParseState = PSTATE_GAMEDEFS;
470 case PSTATE_GAMEDEFS_SIGNATURES_SIG:
472 if (s_TempSig.library[0] == '\0')
475 strncopy(s_TempSig.library, "server", sizeof(s_TempSig.library));
477 void *addrInBase = NULL;
478 if (strcmp(s_TempSig.library, "server") == 0)
480 addrInBase = (void *)g_SMAPI->GetServerFactory(false);
481 } else if (strcmp(s_TempSig.library, "engine") == 0) {
482 addrInBase = (void *)g_SMAPI->GetEngineFactory(false);
484 void *final_addr = NULL;
485 if (addrInBase == NULL)
487 g_Logger.LogError("[SM] Unrecognized library \"%s\" (gameconf \"%s\")",
491 #if defined PLATFORM_LINUX
492 if (s_TempSig.sig[0] == '@')
495 /* GNU only: returns 0 on error, inconsistent! >:[ */
496 if (dladdr(addrInBase, &info) != 0)
498 void *handle = dlopen(info.dli_fname, RTLD_NOW);
501 final_addr = dlsym(handle, &s_TempSig.sig[1]);
504 g_Logger.LogError("[SM] Unable to load library \"%s\" (gameconf \"%s\")",
509 g_Logger.LogError("[SM] Unable to find library \"%s\" in memory (gameconf \"%s\")",
519 /* First, preprocess the signature */
525 length = strlen(s_TempSig.sig);
527 for (size_t i=0; i<length; i++)
529 if (real_bytes >= sizeof(real_sig))
533 real_sig[real_bytes++] = s_TempSig.sig[i];
534 if (s_TempSig.sig[i] == '\\'
535 && s_TempSig.sig[i+1] == 'x')
541 /* Get the hex part */
544 s_byte[0] = s_TempSig.sig[i+2];
545 s_byte[1] = s_TempSig.sig[i+3];
547 /* Read it as an integer */
548 sscanf(s_byte, "%x", &r_byte);
550 real_sig[real_bytes-1] = r_byte;
558 final_addr = g_MemUtils.FindPattern(addrInBase, real_sig, real_bytes);
562 #if defined PLATFORM_LINUX
565 sm_trie_replace(m_pSigs, m_offset, final_addr);
566 m_ParseState = PSTATE_GAMEDEFS_SIGNATURES;
572 return SMCResult_Continue;
575 #define MSTATE_NONE 0
576 #define MSTATE_MAIN 1
577 #define MSTATE_FILE 2
579 class MasterReader : public ITextListener_SMC
582 virtual void ReadSMC_ParseStart()
588 virtual SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name)
592 return SMCResult_Continue;
595 if (state == MSTATE_NONE)
597 if (strcmp(name, "Game Master") == 0)
606 else if (state == MSTATE_MAIN)
608 strncopy(cur_file, name, sizeof(cur_file));
610 matched_engine = false;
612 matched_game = false;
615 else if (state == MSTATE_FILE)
620 return SMCResult_Continue;
623 virtual SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
625 if (ignoreLevel || state != MSTATE_FILE)
627 return SMCResult_Continue;
630 if (strcmp(key, "engine") == 0)
633 if (DoesEngineMatch(value))
635 matched_engine = true;
638 else if (strcmp(key, "game") == 0)
641 if (DoesGameMatch(value))
647 return SMCResult_Continue;
650 virtual SMCResult ReadSMC_LeavingSection(const SMCStates *states)
655 return SMCResult_Continue;
658 if (state == MSTATE_FILE)
660 /* The four success conditions:
662 * 2. Needed game only.
663 * 3. Needed engine only.
664 * 4. Needed both engine and game.
665 * Final result is minimized via k-map.
668 if ((!had_engine && !had_game) ||
669 (!had_engine && (had_game && matched_game)) ||
670 (!had_game && (had_engine && matched_engine)) ||
671 ((had_game && had_engine) && (matched_game && matched_engine)))
673 if ((!had_engine && !had_game) ||
674 (!had_engine && matched_game) ||
675 (!had_game && matched_engine) ||
676 (matched_engine && matched_game))
678 fileList->push_back(cur_file);
682 else if (state == MSTATE_MAIN)
687 return SMCResult_Continue;
690 List<String> *fileList;
692 unsigned int ignoreLevel;
693 char cur_file[PLATFORM_MAX_PATH];
700 static MasterReader master_reader;
702 bool CGameConfig::Reparse(char *error, size_t maxlength)
704 /* Reset cached data */
706 sm_trie_clear(m_pOffsets);
707 sm_trie_clear(m_pProps);
708 sm_trie_clear(m_pKeys);
710 char path[PLATFORM_MAX_PATH];
712 /* See if we can use the extended gamedata format. */
713 g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "gamedata/%s/master.games.txt", m_File);
714 if (!g_LibSys.PathExists(path))
716 /* Nope, use the old mechanism. */
717 UTIL_Format(path, sizeof(path), "%s.txt", m_File);
718 return EnterFile(path, error, maxlength);
721 /* Otherwise, it's time to parse the master. */
723 SMCStates state = {0, 0};
724 List<String> fileList;
725 master_reader.fileList = &fileList;
727 err = textparsers->ParseSMCFile(path, &master_reader, &state, error, maxlength);
728 if (err != SMCError_Okay)
730 const char *msg = textparsers->GetSMCErrorString(err);
732 g_Logger.LogError("[SM] Error parsing master gameconf file \"%s\":", path);
733 g_Logger.LogError("[SM] Error %d on line %d, col %d: %s",
737 msg ? msg : "Unknown error");
741 /* Go through each file we found and parse it. */
742 List<String>::iterator iter;
743 for (iter = fileList.begin(); iter != fileList.end(); iter++)
745 UTIL_Format(path, sizeof(path), "%s/%s", m_File, (*iter).c_str());
746 if (!EnterFile(path, error, maxlength))
752 /* Parse the contents of the 'custom' directory */
753 g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "gamedata/%s/custom", m_File);
754 IDirectory *customDir = g_LibSys.OpenDirectory(path);
761 while (customDir->MoreFiles())
763 if (!customDir->IsEntryFile())
765 customDir->NextEntry();
769 const char *curFile = customDir->GetEntryName();
771 /* Only allow .txt files */
772 int len = strlen(curFile);
773 if (len > 4 && strcmp(&curFile[len-4], ".txt") != 0)
775 customDir->NextEntry();
779 UTIL_Format(path, sizeof(path), "%s/custom/%s", m_File, curFile);
780 if (!EnterFile(path, error, maxlength))
782 g_LibSys.CloseDirectory(customDir);
786 customDir->NextEntry();
789 g_LibSys.CloseDirectory(customDir);
793 bool CGameConfig::EnterFile(const char *file, char *error, size_t maxlength)
796 SMCStates state = {0, 0};
798 g_SourceMod.BuildPath(Path_SM, m_CurFile, sizeof(m_CurFile), "gamedata/%s", file);
800 /* Initialize parse states */
802 bShouldBeReadingDefault = true;
803 m_ParseState = PSTATE_NONE;
805 if ((err=textparsers->ParseSMCFile(m_CurFile, this, &state, error, maxlength))
810 msg = textparsers->GetSMCErrorString(err);
812 g_Logger.LogError("[SM] Error parsing gameconfig file \"%s\":", m_CurFile);
813 g_Logger.LogError("[SM] Error %d on line %d, col %d: %s",
817 msg ? msg : "Unknown error");
819 if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM)
821 //error occurred while parsing a custom section
822 m_CustomHandler->ReadSMC_ParseEnd(true, true);
823 m_CustomHandler = NULL;
833 bool CGameConfig::GetOffset(const char *key, int *value)
837 if (!sm_trie_retrieve(m_pOffsets, key, &obj))
847 const char *CGameConfig::GetKeyValue(const char *key)
850 if (!sm_trie_retrieve(m_pKeys, key, &obj))
854 return m_pStrings->GetString((int)obj);
857 SendProp *CGameConfig::GetSendProp(const char *key)
861 if (!sm_trie_retrieve(m_pProps, key, (void **)&pProp))
869 bool CGameConfig::GetMemSig(const char *key, void **addr)
871 return sm_trie_retrieve(m_pSigs, key, addr);
874 void CGameConfig::IncRefCount()
879 unsigned int CGameConfig::DecRefCount()
885 GameConfigManager::GameConfigManager()
887 m_pLookup = sm_trie_create();
890 GameConfigManager::~GameConfigManager()
892 sm_trie_destroy(m_pLookup);
895 void GameConfigManager::OnSourceModStartup(bool late)
897 LoadGameConfigFile("core.games", &g_pGameConf, NULL, 0);
899 strncopy(g_Game, g_SourceMod.GetGameFolderName(), sizeof(g_Game));
900 strncopy(g_GameDesc + 1, SERVER_CALL(GetGameDescription)(), sizeof(g_GameDesc) - 1);
902 KeyValues *pGameInfo = new KeyValues("GameInfo");
903 if (g_HL2.KVLoadFromFile(pGameInfo, basefilesystem, "gameinfo.txt"))
906 if ((str = pGameInfo->GetString("game", NULL)) != NULL)
908 strncopy(g_GameName + 1, str, sizeof(g_GameName) - 1);
911 pGameInfo->deleteThis();
914 void GameConfigManager::OnSourceModAllInitialized()
916 /* NOW initialize the game file */
917 CGameConfig *pGameConf = (CGameConfig *)g_pGameConf;
920 if (!pGameConf->Reparse(error, sizeof(error)))
925 g_ShareSys.AddInterface(NULL, this);
928 void GameConfigManager::OnSourceModAllShutdown()
930 CloseGameConfigFile(g_pGameConf);
933 bool GameConfigManager::LoadGameConfigFile(const char *file, IGameConfig **_pConfig, char *error, size_t maxlength)
936 /* A crash was detected during last load - We block the gamedata loading so it hopefully won't happen again */
937 if (g_blockGameDataLoad)
939 UTIL_Format(error, maxlength, "GameData loaded blocked due to detected crash");
944 CGameConfig *pConfig;
946 if (sm_trie_retrieve(m_pLookup, file, (void **)&pConfig))
948 pConfig->IncRefCount();
953 pConfig = new CGameConfig(file);
955 /* :HACKHACK: Don't parse the main config file */
957 if (_pConfig != &g_pGameConf)
959 retval = pConfig->Reparse(error, maxlength);
962 m_cfgs.push_back(pConfig);
963 sm_trie_insert(m_pLookup, file, pConfig);
965 pConfig->IncRefCount();
972 void GameConfigManager::CloseGameConfigFile(IGameConfig *cfg)
974 CGameConfig *pConfig = (CGameConfig *)cfg;
976 if (pConfig->DecRefCount() == 0)
978 sm_trie_delete(m_pLookup, pConfig->m_File);
983 extern HandleType_t g_GameConfigsType;
985 IGameConfig *GameConfigManager::ReadHandle(Handle_t hndl, IdentityToken_t *ident, HandleError *err)
987 HandleSecurity sec(ident, g_pCoreIdent);
988 IGameConfig *conf = NULL;
989 HandleError _err = g_HandleSys.ReadHandle(hndl, g_GameConfigsType, &sec, (void **)&conf);
999 void GameConfigManager::AddUserConfigHook(const char *sectionname, ITextListener_SMC *listener)
1001 m_customHandlers.insert(sectionname, listener);
1004 void GameConfigManager::RemoveUserConfigHook(const char *sectionname, ITextListener_SMC *listener)
1006 ITextListener_SMC **pListener = m_customHandlers.retrieve(sectionname);
1008 if (pListener == NULL)
1013 if (*pListener != listener)
1018 m_customHandlers.remove(sectionname);
1023 void GameConfigManager::AcquireLock()
1027 void GameConfigManager::ReleaseLock()