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 defined PLATFORM_WINDOWS
96 if (strcasecmp(value, g_Game) == 0 ||
98 if (strcmp(value, g_Game) == 0 ||
100 strcmp(value, g_GameDesc) == 0 ||
101 strcmp(value, g_GameName) == 0)
108 static bool DoesEngineMatch(const char *value)
110 #if SOURCE_ENGINE == SE_EPISODEONE
111 if (strcmp(value, "original") == 0)
112 #elif SOURCE_ENGINE == SE_DARKMESSIAH
113 if (strcmp(value, "darkmessiah") == 0)
114 #elif SOURCE_ENGINE == SE_ORANGEBOX
115 if (strcmp(value, "orangebox") == 0)
116 #elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
117 if (strcmp(value, "orangebox_valve") == 0)
118 #elif SOURCE_ENGINE == SE_LEFT4DEAD
119 if (strcmp(value, "left4dead") == 0)
120 #elif SOURCE_ENGINE == SE_LEFT4DEAD2
121 if (strcmp(value, "left4dead2") == 0)
123 #error "Unknown engine type"
131 CGameConfig::CGameConfig(const char *file)
133 strncopy(m_File, file, sizeof(m_File));
134 m_pOffsets = sm_trie_create();
135 m_pProps = sm_trie_create();
136 m_pKeys = sm_trie_create();
137 m_pSigs = sm_trie_create();
138 m_pStrings = new BaseStringTable(512);
142 m_CustomHandler = NULL;
145 CGameConfig::~CGameConfig()
147 sm_trie_destroy(m_pOffsets);
148 sm_trie_destroy(m_pProps);
149 sm_trie_destroy(m_pKeys);
150 sm_trie_destroy(m_pSigs);
154 SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *name)
159 return SMCResult_Continue;
162 switch (m_ParseState)
166 if (strcmp(name, "Games") == 0)
168 m_ParseState = PSTATE_GAMES;
176 if (strcmp(name, "*") == 0 ||
177 strcmp(name, "#default") == 0 ||
180 bShouldBeReadingDefault = true;
181 m_ParseState = PSTATE_GAMEDEFS;
182 strncopy(m_Game, name, sizeof(m_Game));
188 case PSTATE_GAMEDEFS:
190 if (strcmp(name, "Offsets") == 0)
192 m_ParseState = PSTATE_GAMEDEFS_OFFSETS;
194 else if (strcmp(name, "Keys") == 0)
196 m_ParseState = PSTATE_GAMEDEFS_KEYS;
198 else if ((strcmp(name, "#supported") == 0) && (strcmp(m_Game, "#default") == 0))
200 m_ParseState = PSTATE_GAMEDEFS_SUPPORTED;
201 /* Ignore this section unless we get a game. */
202 bShouldBeReadingDefault = false;
204 matched_game = false;
206 matched_engine = false;
208 else if (strcmp(name, "Signatures") == 0)
210 m_ParseState = PSTATE_GAMEDEFS_SIGNATURES;
212 else if (strcmp(name, "CRC") == 0)
214 m_ParseState = PSTATE_GAMEDEFS_CRC;
215 bShouldBeReadingDefault = false;
219 ITextListener_SMC **pListen = g_GameConfigs.m_customHandlers.retrieve(name);
224 m_ParseState = PSTATE_GAMEDEFS_CUSTOM;
225 m_CustomHandler = *pListen;
226 m_CustomHandler->ReadSMC_ParseStart();
234 case PSTATE_GAMEDEFS_OFFSETS:
238 strncopy(m_offset, name, sizeof(m_offset));
239 m_ParseState = PSTATE_GAMEDEFS_OFFSETS_OFFSET;
242 case PSTATE_GAMEDEFS_SIGNATURES:
244 strncopy(m_offset, name, sizeof(m_offset));
246 m_ParseState = PSTATE_GAMEDEFS_SIGNATURES_SIG;
249 case PSTATE_GAMEDEFS_CRC:
253 if (strcmp(name, "server") != 0)
255 UTIL_Format(error, sizeof(error), "Unrecognized library \"%s\"", name);
257 else if (!s_ServerBinCRC_Ok)
260 char path[PLATFORM_MAX_PATH];
262 g_SourceMod.BuildPath(Path_Game, path, sizeof(path), "bin/" PLATFORM_SERVER_BINARY);
263 if ((fp = fopen(path, "rb")) == NULL)
265 UTIL_Format(error, sizeof(error), "Could not open binary: %s", path);
270 fseek(fp, 0, SEEK_END);
272 fseek(fp, 0, SEEK_SET);
274 buffer = malloc(size);
275 fread(buffer, size, 1, fp);
276 s_ServerBinCRC = UTIL_CRC32(buffer, size);
278 s_ServerBinCRC_Ok = true;
282 if (error[0] != '\0')
285 g_Logger.LogError("[SM] Error while parsing CRC section for \"%s\" (%s):", m_Game, m_CurFile);
286 g_Logger.LogError("[SM] %s", error);
288 m_ParseState = PSTATE_GAMEDEFS_CRC_BINARY;
292 case PSTATE_GAMEDEFS_CUSTOM:
295 return m_CustomHandler->ReadSMC_NewSection(states, name);
298 /* No sub-sections allowed:
299 case PSTATE_GAMEDEFS_OFFSETS_OFFSET:
300 case PSTATE_GAMEDEFS_KEYS:
301 case PSTATE_GAMEDEFS_SUPPORTED:
302 case PSTATE_GAMEDEFS_SIGNATURES_SIG:
303 case PSTATE_GAMEDEFS_CRC_BINARY:
307 /* If we don't know what we got, start ignoring */
313 return SMCResult_Continue;
316 SMCResult CGameConfig::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
320 return SMCResult_Continue;
323 if (m_ParseState == PSTATE_GAMEDEFS_OFFSETS_OFFSET)
325 if (strcmp(key, "class") == 0)
327 strncopy(m_Class, value, sizeof(m_Class));
328 } else if (strcmp(key, "prop") == 0) {
329 strncopy(m_Prop, value, sizeof(m_Prop));
330 } else if (strcmp(key, PLATFORM_NAME) == 0) {
331 int val = atoi(value);
332 sm_trie_replace(m_pOffsets, m_offset, (void *)val);
334 } else if (m_ParseState == PSTATE_GAMEDEFS_KEYS) {
335 int id = m_pStrings->AddString(value);
336 sm_trie_replace(m_pKeys, key, (void *)id);
337 } else if (m_ParseState == PSTATE_GAMEDEFS_SUPPORTED) {
338 if (strcmp(key, "game") == 0)
341 if (DoesGameMatch(value))
345 if ((!had_engine && matched_game) || (matched_engine && matched_game))
347 bShouldBeReadingDefault = true;
350 else if (strcmp(key, "engine") == 0)
353 if (DoesEngineMatch(value))
355 matched_engine = true;
357 if ((!had_game && matched_engine) || (matched_game && matched_engine))
359 bShouldBeReadingDefault = true;
362 } else if (m_ParseState == PSTATE_GAMEDEFS_SIGNATURES_SIG) {
363 if (strcmp(key, PLATFORM_NAME) == 0)
365 strncopy(s_TempSig.sig, value, sizeof(s_TempSig.sig));
366 } else if (strcmp(key, "library") == 0) {
367 strncopy(s_TempSig.library, value, sizeof(s_TempSig.library));
369 } else if (m_ParseState == PSTATE_GAMEDEFS_CRC_BINARY) {
370 if (strcmp(key, PLATFORM_NAME) == 0
372 && !bShouldBeReadingDefault)
374 unsigned int crc = 0;
375 sscanf(value, "%08X", &crc);
376 if (s_ServerBinCRC == crc)
378 bShouldBeReadingDefault = true;
381 } else if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM) {
382 return m_CustomHandler->ReadSMC_KeyValue(states, key, value);
385 return SMCResult_Continue;
388 SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
393 return SMCResult_Continue;
399 m_CustomHandler->ReadSMC_LeavingSection(states);
400 return SMCResult_Continue;
403 switch (m_ParseState)
407 m_ParseState = PSTATE_NONE;
410 case PSTATE_GAMEDEFS:
412 m_ParseState = PSTATE_GAMES;
415 case PSTATE_GAMEDEFS_CUSTOM:
417 m_ParseState = PSTATE_GAMEDEFS;
418 m_CustomHandler->ReadSMC_ParseEnd(false, false);
421 case PSTATE_GAMEDEFS_KEYS:
422 case PSTATE_GAMEDEFS_OFFSETS:
424 m_ParseState = PSTATE_GAMEDEFS;
427 case PSTATE_GAMEDEFS_OFFSETS_OFFSET:
429 /* Parse the offset... */
430 if (m_Class[0] != '\0'
431 && m_Prop[0] != '\0')
433 SendProp *pProp = g_HL2.FindInSendTable(m_Class, m_Prop);
436 int val = pProp->GetOffset();
437 sm_trie_replace(m_pOffsets, m_offset, (void *)val);
438 sm_trie_replace(m_pProps, m_offset, pProp);
440 /* Check if it's a non-default game and no offsets exist */
441 if (((strcmp(m_Game, "*") != 0) && strcmp(m_Game, "#default") != 0)
442 && (!sm_trie_retrieve(m_pOffsets, m_offset, NULL)))
444 g_Logger.LogError("[SM] Unable to find property %s.%s (file \"%s\") (mod \"%s\")",
452 m_ParseState = PSTATE_GAMEDEFS_OFFSETS;
455 case PSTATE_GAMEDEFS_CRC:
456 case PSTATE_GAMEDEFS_SUPPORTED:
458 if (!bShouldBeReadingDefault)
460 /* If we shouldn't read the rest of this section, set the ignore level. */
462 m_ParseState = PSTATE_GAMES;
464 m_ParseState = PSTATE_GAMEDEFS;
468 case PSTATE_GAMEDEFS_CRC_BINARY:
470 m_ParseState = PSTATE_GAMEDEFS_CRC;
473 case PSTATE_GAMEDEFS_SIGNATURES:
475 m_ParseState = PSTATE_GAMEDEFS;
478 case PSTATE_GAMEDEFS_SIGNATURES_SIG:
480 if (s_TempSig.library[0] == '\0')
483 strncopy(s_TempSig.library, "server", sizeof(s_TempSig.library));
485 void *addrInBase = NULL;
486 if (strcmp(s_TempSig.library, "server") == 0)
488 addrInBase = (void *)g_SMAPI->GetServerFactory(false);
489 } else if (strcmp(s_TempSig.library, "engine") == 0) {
490 addrInBase = (void *)g_SMAPI->GetEngineFactory(false);
492 void *final_addr = NULL;
493 if (addrInBase == NULL)
495 g_Logger.LogError("[SM] Unrecognized library \"%s\" (gameconf \"%s\")",
499 #if defined PLATFORM_LINUX
500 if (s_TempSig.sig[0] == '@')
503 /* GNU only: returns 0 on error, inconsistent! >:[ */
504 if (dladdr(addrInBase, &info) != 0)
506 void *handle = dlopen(info.dli_fname, RTLD_NOW);
509 final_addr = dlsym(handle, &s_TempSig.sig[1]);
512 g_Logger.LogError("[SM] Unable to load library \"%s\" (gameconf \"%s\")",
517 g_Logger.LogError("[SM] Unable to find library \"%s\" in memory (gameconf \"%s\")",
527 /* First, preprocess the signature */
528 unsigned char real_sig[511];
533 length = strlen(s_TempSig.sig);
535 real_bytes = UTIL_DecodeHexString(real_sig, sizeof(real_sig), s_TempSig.sig);
539 final_addr = g_MemUtils.FindPattern(addrInBase, (char*)real_sig, real_bytes);
543 #if defined PLATFORM_LINUX
546 sm_trie_replace(m_pSigs, m_offset, final_addr);
547 m_ParseState = PSTATE_GAMEDEFS_SIGNATURES;
553 return SMCResult_Continue;
556 #define MSTATE_NONE 0
557 #define MSTATE_MAIN 1
558 #define MSTATE_FILE 2
560 class MasterReader : public ITextListener_SMC
563 virtual void ReadSMC_ParseStart()
569 virtual SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name)
573 return SMCResult_Continue;
576 if (state == MSTATE_NONE)
578 if (strcmp(name, "Game Master") == 0)
587 else if (state == MSTATE_MAIN)
589 strncopy(cur_file, name, sizeof(cur_file));
591 matched_engine = false;
593 matched_game = false;
596 else if (state == MSTATE_FILE)
601 return SMCResult_Continue;
604 virtual SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
606 if (ignoreLevel || state != MSTATE_FILE)
608 return SMCResult_Continue;
611 if (strcmp(key, "engine") == 0)
614 if (DoesEngineMatch(value))
616 matched_engine = true;
619 else if (strcmp(key, "game") == 0)
622 if (DoesGameMatch(value))
628 return SMCResult_Continue;
631 virtual SMCResult ReadSMC_LeavingSection(const SMCStates *states)
636 return SMCResult_Continue;
639 if (state == MSTATE_FILE)
641 /* The four success conditions:
643 * 2. Needed game only.
644 * 3. Needed engine only.
645 * 4. Needed both engine and game.
646 * Final result is minimized via k-map.
649 if ((!had_engine && !had_game) ||
650 (!had_engine && (had_game && matched_game)) ||
651 (!had_game && (had_engine && matched_engine)) ||
652 ((had_game && had_engine) && (matched_game && matched_engine)))
654 if ((!had_engine && !had_game) ||
655 (!had_engine && matched_game) ||
656 (!had_game && matched_engine) ||
657 (matched_engine && matched_game))
659 fileList->push_back(cur_file);
663 else if (state == MSTATE_MAIN)
668 return SMCResult_Continue;
671 List<String> *fileList;
673 unsigned int ignoreLevel;
674 char cur_file[PLATFORM_MAX_PATH];
681 static MasterReader master_reader;
683 bool CGameConfig::Reparse(char *error, size_t maxlength)
685 /* Reset cached data */
687 sm_trie_clear(m_pOffsets);
688 sm_trie_clear(m_pProps);
689 sm_trie_clear(m_pKeys);
691 char path[PLATFORM_MAX_PATH];
693 /* See if we can use the extended gamedata format. */
694 g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "gamedata/%s/master.games.txt", m_File);
695 if (!g_LibSys.PathExists(path))
697 /* Nope, use the old mechanism. */
698 UTIL_Format(path, sizeof(path), "%s.txt", m_File);
699 return EnterFile(path, error, maxlength);
702 /* Otherwise, it's time to parse the master. */
704 SMCStates state = {0, 0};
705 List<String> fileList;
706 master_reader.fileList = &fileList;
708 err = textparsers->ParseSMCFile(path, &master_reader, &state, error, maxlength);
709 if (err != SMCError_Okay)
711 const char *msg = textparsers->GetSMCErrorString(err);
713 g_Logger.LogError("[SM] Error parsing master gameconf file \"%s\":", path);
714 g_Logger.LogError("[SM] Error %d on line %d, col %d: %s",
718 msg ? msg : "Unknown error");
722 /* Go through each file we found and parse it. */
723 List<String>::iterator iter;
724 for (iter = fileList.begin(); iter != fileList.end(); iter++)
726 UTIL_Format(path, sizeof(path), "%s/%s", m_File, (*iter).c_str());
727 if (!EnterFile(path, error, maxlength))
733 /* Parse the contents of the 'custom' directory */
734 g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "gamedata/%s/custom", m_File);
735 IDirectory *customDir = g_LibSys.OpenDirectory(path);
742 while (customDir->MoreFiles())
744 if (!customDir->IsEntryFile())
746 customDir->NextEntry();
750 const char *curFile = customDir->GetEntryName();
752 /* Only allow .txt files */
753 int len = strlen(curFile);
754 if (len > 4 && strcmp(&curFile[len-4], ".txt") != 0)
756 customDir->NextEntry();
760 UTIL_Format(path, sizeof(path), "%s/custom/%s", m_File, curFile);
761 if (!EnterFile(path, error, maxlength))
763 g_LibSys.CloseDirectory(customDir);
767 customDir->NextEntry();
770 g_LibSys.CloseDirectory(customDir);
774 bool CGameConfig::EnterFile(const char *file, char *error, size_t maxlength)
777 SMCStates state = {0, 0};
779 g_SourceMod.BuildPath(Path_SM, m_CurFile, sizeof(m_CurFile), "gamedata/%s", file);
781 /* Initialize parse states */
783 bShouldBeReadingDefault = true;
784 m_ParseState = PSTATE_NONE;
786 if ((err=textparsers->ParseSMCFile(m_CurFile, this, &state, error, maxlength))
791 msg = textparsers->GetSMCErrorString(err);
793 g_Logger.LogError("[SM] Error parsing gameconfig file \"%s\":", m_CurFile);
794 g_Logger.LogError("[SM] Error %d on line %d, col %d: %s",
798 msg ? msg : "Unknown error");
800 if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM)
802 //error occurred while parsing a custom section
803 m_CustomHandler->ReadSMC_ParseEnd(true, true);
804 m_CustomHandler = NULL;
814 bool CGameConfig::GetOffset(const char *key, int *value)
818 if (!sm_trie_retrieve(m_pOffsets, key, &obj))
828 const char *CGameConfig::GetKeyValue(const char *key)
831 if (!sm_trie_retrieve(m_pKeys, key, &obj))
835 return m_pStrings->GetString((int)obj);
838 SendProp *CGameConfig::GetSendProp(const char *key)
842 if (!sm_trie_retrieve(m_pProps, key, (void **)&pProp))
850 bool CGameConfig::GetMemSig(const char *key, void **addr)
852 return sm_trie_retrieve(m_pSigs, key, addr);
855 void CGameConfig::IncRefCount()
860 unsigned int CGameConfig::DecRefCount()
866 GameConfigManager::GameConfigManager()
868 m_pLookup = sm_trie_create();
871 GameConfigManager::~GameConfigManager()
873 sm_trie_destroy(m_pLookup);
876 void GameConfigManager::OnSourceModStartup(bool late)
878 LoadGameConfigFile("core.games", &g_pGameConf, NULL, 0);
880 strncopy(g_Game, g_SourceMod.GetGameFolderName(), sizeof(g_Game));
881 strncopy(g_GameDesc + 1, SERVER_CALL(GetGameDescription)(), sizeof(g_GameDesc) - 1);
883 KeyValues *pGameInfo = new KeyValues("GameInfo");
884 if (g_HL2.KVLoadFromFile(pGameInfo, basefilesystem, "gameinfo.txt"))
887 if ((str = pGameInfo->GetString("game", NULL)) != NULL)
889 strncopy(g_GameName + 1, str, sizeof(g_GameName) - 1);
892 pGameInfo->deleteThis();
895 void GameConfigManager::OnSourceModAllInitialized()
897 /* NOW initialize the game file */
898 CGameConfig *pGameConf = (CGameConfig *)g_pGameConf;
901 if (!pGameConf->Reparse(error, sizeof(error)))
906 g_ShareSys.AddInterface(NULL, this);
909 void GameConfigManager::OnSourceModAllShutdown()
911 CloseGameConfigFile(g_pGameConf);
914 bool GameConfigManager::LoadGameConfigFile(const char *file, IGameConfig **_pConfig, char *error, size_t maxlength)
917 /* A crash was detected during last load - We block the gamedata loading so it hopefully won't happen again */
918 if (g_blockGameDataLoad)
920 UTIL_Format(error, maxlength, "GameData loaded blocked due to detected crash");
925 CGameConfig *pConfig;
927 if (sm_trie_retrieve(m_pLookup, file, (void **)&pConfig))
929 pConfig->IncRefCount();
934 pConfig = new CGameConfig(file);
936 /* :HACKHACK: Don't parse the main config file */
938 if (_pConfig != &g_pGameConf)
940 retval = pConfig->Reparse(error, maxlength);
943 m_cfgs.push_back(pConfig);
944 sm_trie_insert(m_pLookup, file, pConfig);
946 pConfig->IncRefCount();
953 void GameConfigManager::CloseGameConfigFile(IGameConfig *cfg)
955 CGameConfig *pConfig = (CGameConfig *)cfg;
957 if (pConfig->DecRefCount() == 0)
959 sm_trie_delete(m_pLookup, pConfig->m_File);
964 extern HandleType_t g_GameConfigsType;
966 IGameConfig *GameConfigManager::ReadHandle(Handle_t hndl, IdentityToken_t *ident, HandleError *err)
968 HandleSecurity sec(ident, g_pCoreIdent);
969 IGameConfig *conf = NULL;
970 HandleError _err = g_HandleSys.ReadHandle(hndl, g_GameConfigsType, &sec, (void **)&conf);
980 void GameConfigManager::AddUserConfigHook(const char *sectionname, ITextListener_SMC *listener)
982 m_customHandlers.insert(sectionname, listener);
985 void GameConfigManager::RemoveUserConfigHook(const char *sectionname, ITextListener_SMC *listener)
987 ITextListener_SMC **pListener = m_customHandlers.retrieve(sectionname);
989 if (pListener == NULL)
994 if (*pListener != listener)
999 m_customHandlers.remove(sectionname);
1004 void GameConfigManager::AcquireLock()
1008 void GameConfigManager::ReleaseLock()