public static void SyncIniBool(IniFile conf, string section, string key, ref bool bBoolCmd) { int nLoadInteger = conf.ReadInteger(section, key, -1); if (nLoadInteger < 0) { conf.WriteBool(section, key, bBoolCmd); } else { bBoolCmd = conf.ReadBool(section, key, bBoolCmd); } }
public static void LoadConfig() { int LoadInteger; GameFramework.IniFile Conf = new GameFramework.IniFile(g_sConfFileName); if (Conf != null) { g_sDataDBFilePath = Conf.ReadString("DB", "Dir", g_sDataDBFilePath); g_sHumDBFilePath = Conf.ReadString("DB", "HumDir", g_sHumDBFilePath); g_sFeedPath = Conf.ReadString("DB", "FeeDir", g_sFeedPath); g_sBackupPath = Conf.ReadString("DB", "Backup", g_sBackupPath); g_sConnectPath = Conf.ReadString("DB", "ConnectDir", g_sConnectPath); g_sLogPath = Conf.ReadString("DB", "LogDir", g_sLogPath); g_nServerPort = Conf.ReadInteger("Setup", "ServerPort", g_nServerPort); g_sServerAddr = Conf.ReadString("Setup", "ServerAddr", g_sServerAddr); g_nGatePort = Conf.ReadInteger("Setup", "GatePort", g_nGatePort); g_sGateAddr = Conf.ReadString("Setup", "GateAddr", g_sGateAddr); g_sIDServerAddr = Conf.ReadString("Server", "IDSAddr", g_sIDServerAddr); g_nIDServerPort = Conf.ReadInteger("Server", "IDSPort", g_nIDServerPort); g_sServerName = Conf.ReadString("Setup", "ServerName", g_sServerName); g_boDenyChrName = Conf.ReadBool("Setup", "DenyChrName", g_boDenyChrName); g_boMinimize = Conf.ReadBool("Setup", "Minimize", g_boMinimize); g_boDeleteChrName = Conf.ReadBool("Setup", "DeleteChrName", g_boDeleteChrName); g_boRandomNumber = Conf.ReadBool("Setup", "RandomNumber", g_boRandomNumber); // boViewHackMsg := Conf.ReadBool('Setup', 'ViewHackMsg', boViewHackMsg); // // boClearLevel1:=Conf.ReadBool('DBClear','ClearLevel1',boClearLevel1); // boClearLevel2:=Conf.ReadBool('DBClear','ClearLevel2',boClearLevel2); // boClearLevel3:=Conf.ReadBool('DBClear','ClearLevel3',boClearLevel3); // // dwInterval := Conf.ReadInteger('DBClear', 'Interval', dwInterval); // nLevel1 := Conf.ReadInteger('DBClear', 'Level1', nLevel1); // nLevel2 := Conf.ReadInteger('DBClear', 'Level2', nLevel2); // nLevel3 := Conf.ReadInteger('DBClear', 'Level3', nLevel3); // nDay1 := Conf.ReadInteger('DBClear', 'Day1', nDay1); // nDay2 := Conf.ReadInteger('DBClear', 'Day2', nDay2); // nDay3 := Conf.ReadInteger('DBClear', 'Day3', nDay3); // nMonth1 := Conf.ReadInteger('DBClear', 'Month1', nMonth1); // nMonth2 := Conf.ReadInteger('DBClear', 'Month2', nMonth2); // nMonth3 := Conf.ReadInteger('DBClear', 'Month3', nMonth3); LoadInteger = Conf.ReadInteger("Setup", "DynamicIPMode", -1); if (LoadInteger < 0) { Conf.WriteBool("Setup", "DynamicIPMode", g_boDynamicIPMode); } else { g_boDynamicIPMode = LoadInteger == 1; } g_boAutoRefRanking = Conf.ReadBool("Setup", "AutoRefRanking", g_boAutoRefRanking); g_nRankingMinLevel = Conf.ReadInteger("Setup", "RankingMinLevel", g_nRankingMinLevel); g_nRankingMaxLevel = Conf.ReadInteger("Setup", "RankingMaxLevel", g_nRankingMaxLevel); g_nRefRankingHour1 = Conf.ReadInteger("Setup", "RefRankingHour1", g_nRefRankingHour1); g_nRefRankingHour2 = Conf.ReadInteger("Setup", "RefRankingHour2", g_nRefRankingHour2); g_nRefRankingMinute1 = Conf.ReadInteger("Setup", "RefRankingMinute1", g_nRefRankingMinute1); g_nRefRankingMinute2 = Conf.ReadInteger("Setup", "RefRankingMinute2", g_nRefRankingMinute2); g_nAutoRefRankingType = Conf.ReadInteger("Setup", "AutoRefRankingType", g_nAutoRefRankingType); g_boAllowAddChar = Conf.ReadBool("Setup", "AllowAddChar", g_boAllowAddChar); g_boAllowDelChar = Conf.ReadBool("Setup", "AllowDelChar", g_boAllowDelChar); g_boAllowGetBackChar = Conf.ReadBool("Setup", "AllowGetBackChar", g_boAllowGetBackChar); g_nStoreDeleteCharDay = Conf.ReadInteger("Setup", "StoreDeleteCharDay", g_nStoreDeleteCharDay); g_nAllowDelCharCount = Conf.ReadInteger("Setup", "AllowDelCharCount", g_nAllowDelCharCount); } LoadIPTable(); LoadGateID(); LoadServerInfo(); LoadChrNameList("DenyChrName.txt"); LoadAICharNameList("AICharName.txt"); LoadClearMakeIndexList("ClearMakeIndex.txt"); }