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

Function SaveGlobalConfig

src/Config.cpp:536–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536void SaveGlobalConfig()
537{
538 Info(Config, "saving global config to: %s", fs_path_ascii(GetConfigFile()));
539 FILE *cfg = fs_open(GetConfigFile(), FS_WRITE);
540 if (cfg == nullptr)
541 {
542 return;
543 }
544
545 fprintf(cfg, "AcctID=%s\n", g_Config.Login.c_str());
546 if (g_Config.SavePassword)
547 {
548 fprintf(cfg, "AcctPassword=%s\n", g_Config.Password.c_str());
549 fprintf(cfg, "RememberAcctPW=yes\n");
550 }
551 else
552 {
553 fprintf(cfg, "AcctPassword=\n");
554 fprintf(cfg, "RememberAcctPW=no\n");
555 }
556
557 fprintf(cfg, "AutoLogin=%s\n", (g_Config.AutoLogin ? "yes" : "no"));
558 fprintf(cfg, "TheAbyss=%s\n", (g_Config.TheAbyss ? "yes" : "no"));
559 fprintf(cfg, "Asmut=%s\n", (g_Config.Asmut ? "yes" : "no"));
560
561 if (s_Mark.ClientFlag)
562 {
563 fprintf(cfg, "ClientType=%s\n", GetClientTypeString(g_Config.ClientFlag));
564 }
565 if (s_Mark.UseVerdata)
566 {
567 fprintf(cfg, "UseVerdata=%s\n", (g_Config.UseVerdata ? "yes" : "no"));
568 }
569
570 if (!g_Config.LocaleOverride.empty())
571 {
572 fprintf(cfg, "Language=%s\n", g_Config.LocaleOverride.c_str());
573 }
574
575 fprintf(cfg, "Crypt=%s\n", (g_Config.UseCrypt ? "yes" : "no"));
576 if (g_Config.ClientKeysSet)
577 {
578 fprintf(
579 cfg,
580 "Keys=0x%08x,0x%08x,0x%08x,0x%04x\n",
581 g_Config.Key1,
582 g_Config.Key2,
583 g_Config.Key3,
584 g_Config.Seed);
585 }
586
587 if (!fs_path_equal(g_App.m_UOPath, g_App.m_ExePath))
588 {
589 fprintf(cfg, "CustomPath=%s\n", fs_path_ascii(g_App.m_UOPath));
590 }
591
592 if (!g_Config.ServerAddress.empty())
593 {

Callers 1

UninstallMethod · 0.85

Calls 8

fs_path_asciiFunction · 0.85
GetConfigFileFunction · 0.85
fs_openFunction · 0.85
GetClientTypeStringFunction · 0.85
fs_path_equalFunction · 0.85
fs_closeFunction · 0.85
c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected