MCPcopy Create free account
hub / github.com/crossuo/crossuo / LoadLocalConfig

Method LoadLocalConfig

src/CrossUO.cpp:1301–1412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1299}
1300
1301void CGame::LoadLocalConfig(int serial, astr_t characterName)
1302{
1303 if (g_ConfigLoaded)
1304 {
1305 return;
1306 }
1307
1308 g_CheckContainerStackTimer = g_Ticks + 30000;
1309
1310 char buf[FS_MAX_PATH] = { 0 };
1311 CServer *server = g_ServerList.GetSelectedServer();
1312 const astr_t &acct = g_MainScreen.m_Account->GetTextA();
1313 if (server != nullptr)
1314 {
1315 sprintf_s(
1316 buf, "desktop/%s/%s/0x%08X", acct.c_str(), FixServerName(server->Name).c_str(), serial);
1317 }
1318 else
1319 {
1320 sprintf_s(buf, "desktop/%s/0x%08X", acct.c_str(), serial);
1321 }
1322
1323 if (!g_ConfigManager.Load(g_App.FilePath("%s/%s", buf, "options.cfg")))
1324 {
1325 // DEPRECATE: 1.0.6
1326 if (!g_ConfigManager.Load(g_App.ExeFilePath("%s/%s", buf, "options.cfg")))
1327 {
1328 g_ConfigManager.Init();
1329 if (g_GameState >= GS_GAME)
1330 {
1331 g_GameWindow.MaximizeWindow();
1332 }
1333 }
1334 }
1335
1336 if (!g_SkillGroupManager.Load(g_App.FilePath("skills.xuo")))
1337 {
1338 // DEPRECATE: 1.0.6
1339 if (!g_SkillGroupManager.Load(g_App.ExeFilePath("skills.xuo")))
1340 {
1341 g_SkillGroupManager.Load(g_App.ExeFilePath("skills.cuo"));
1342 }
1343 }
1344
1345 auto macros_xuo1 = g_App.FilePath("%s/%s", buf, "macros.xuo");
1346 // DEPRECATE: 1.0.6
1347 auto macros_xuo2 = g_App.ExeFilePath("%s/%s", buf, "macros.xuo");
1348 auto macros_cuo = g_App.ExeFilePath("%s/%s", buf, "macros.cuo");
1349 auto macros_xuo = fs_path_exists(macros_xuo1) ? macros_xuo1 : macros_xuo2;
1350 auto macros_data = fs_path_exists(macros_xuo) ? macros_xuo : macros_cuo;
1351 if (!g_MacroManager.Load(macros_data, g_App.UOFilesPath("macros.txt")))
1352 {
1353 char buf2[FS_MAX_PATH] = { 0 };
1354 if (server != nullptr)
1355 {
1356 sprintf_s(
1357 buf2,
1358 "desktop/%s/%s/%s",

Callers

nothing calls this directly

Calls 15

fs_path_existsFunction · 0.85
ContainerPositionResetFunction · 0.85
GetSelectedServerMethod · 0.80
c_strMethod · 0.80
FilePathMethod · 0.80
ExeFilePathMethod · 0.80
MaximizeWindowMethod · 0.80
UOFilesPathMethod · 0.80
GetConsoleNeedEnterMethod · 0.80
GetMusicVolumeMethod · 0.80
GetSoundMethod · 0.80
GetMusicMethod · 0.80

Tested by

no test coverage detected