| 1299 | } |
| 1300 | |
| 1301 | void 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", |
nothing calls this directly
no test coverage detected