private static bool _fileExists = false;        // does the ini file exists?

        static ConfigManager()
        {
            try
            {
                ConfigFile  = string.Format("{0}/{1}", FileHelpers.AssemblyRoot, "config.ini"); // the config file's location.
                Parser      = new IniConfigSource(ConfigFile);                                  // see if the file exists by trying to parse it.
                _fileExists = true;
            }
            catch (Exception)
            {
                Parser      = new IniConfigSource(); // initiate a new .ini source.
                _fileExists = false;
                SysCons.LogWarn("Cannot loading settings file \"config.ini\", will be using default settings.");
            }
            finally
            {
                // adds aliases so we can use On and Off directives in ini files.
                Parser.Alias.AddAlias("On", true);
                Parser.Alias.AddAlias("Off", false);
            }

            Parser.ExpandKeyValues();
        }
Beispiel #2
0
 public static void LogPacketData(Packet pkt)
 {
     SysCons.LogWarn("Recv Packet({0}) Len({1}) Enc({2}) Opcode({3})", PacketDefinitions.getPacketName(pkt.Opcode), pkt.Lenght, pkt.Encrypt, pkt.Opcode);
     SysCons.SavePacket(pkt);
 }