GetValue() public method

public GetValue ( string section, string key, bool defaultValue ) : bool
section string
key string
defaultValue bool
return bool
Esempio n. 1
0
        public static void Load(string name)
        {
            var conf = new IniReader(string.Format("config/{0}.ini", name));

            IP   = IPAddress.Parse(conf.GetValue("listen", "ip", ""));
            Port = conf.GetValue("listen", "port", 0);

            MasterIP   = conf.GetValue("master", "ip", "localhost");
            MasterPort = conf.GetValue("master", "port", 0);
        }
Esempio n. 2
0
        public static void LoadMasterServer(int server)
        {
            var conf    = new IniReader("conf/Master.ini");
            var section = string.Format("server{0}db", server);

            serverDBTypes.Add(server, conf.GetValue(section, "type", ""));
            serverDBs.Add(server, conf.GetValue(section, "name", ""));
            serverDBIPs.Add(server, conf.GetValue(section, "ip", ""));
            serverDBUsers.Add(server, conf.GetValue(section, "user", ""));
            serverDBPasses.Add(server, conf.GetValue(section, "password", ""));
        }
Esempio n. 3
0
        public static void Load()
        {
            var conf = new IniReader("conf/Login.ini");

            IP   = IPAddress.Parse(conf.GetValue("listen", "ip", ""));
            Port = conf.GetValue("listen", "port", 0);

            ClientVersion       = conf.GetValue("client", "client_version", 0);
            NormalMagicKey      = conf.GetValue("client", "magic_key", 0);
            IgnoreClientVersion = conf.GetValue("client", "ignore_client_version", 0);

            CashURL       = conf.GetValue("url", "cash", "http://localhost/cashshop/?v1=");
            CashChargeURL = conf.GetValue("url", "cash_charge", "http://localhost/cashshop/?v1=");
            GuildURL      = conf.GetValue("url", "guild", "http://localhost/guild/?EncVal=");

            MasterIP   = conf.GetValue("master", "ip", "localhost");
            MasterPort = conf.GetValue("master", "port", 0);
        }
Esempio n. 4
0
        public static void Load(string name)
        {
            var conf = new IniReader(string.Format("conf/{0}.ini", name));

            channelLog    = Convert.ToBoolean(conf.GetValue("debug", "use", 0));
            channelLogLvl = conf.GetValue("debug", "level", 0);

            channelIp   = IPAddress.Parse(conf.GetValue("listen", "ip", "127.0.0.1"));
            channelPort = conf.GetValue("listen", "port", 0);
            channelType = conf.GetValue("channel", "type", 0);
            maxPlayers  = conf.GetValue("channel", "max_players", 0);

            masterIP   = conf.GetValue("master", "ip", "localhost");
            masterPort = conf.GetValue("master", "port", 0);
        }
Esempio n. 5
0
        public static void Load()
        {
            var conf = new IniReader("conf/Master.ini");

            masterLog    = Convert.ToBoolean(conf.GetValue("debug", "use", 0));
            masterLogLvl = conf.GetValue("debug", "level", 0);

            masterIP   = IPAddress.Parse(conf.GetValue("listen", "ip", "127.0.0.1"));
            masterPort = conf.GetValue("listen", "port", 9001);

            loginDBType = conf.GetValue("logindb", "type", "");
            loginDB     = conf.GetValue("logindb", "name", "");
            loginDBIP   = conf.GetValue("logindb", "ip", "");
            loginDBUser = conf.GetValue("logindb", "user", "");
            loginDBPass = conf.GetValue("logindb", "password", "");

            serverDBs      = new Dictionary <int, string>();
            serverDBIPs    = new Dictionary <int, string>();
            serverDBUsers  = new Dictionary <int, string>();
            serverDBPasses = new Dictionary <int, string>();
            serverDBTypes  = new Dictionary <int, string>();
        }
Esempio n. 6
0
        public static void Load()
        {
            var conf = new IniReader("conf/Master.ini");

            IP          = conf.GetValue("listen", "ip", "0.0.0.0");
            LoginDBType = conf.GetValue("logindb", "type", "");
            LoginDB     = conf.GetValue("logindb", "name", "");
            LoginDBIP   = conf.GetValue("logindb", "ip", "");
            LoginDBUser = conf.GetValue("logindb", "user", "");
            LoginDBPass = conf.GetValue("logindb", "password", "");

            ServerDBs      = new Dictionary <int, string>();
            ServerDBIPs    = new Dictionary <int, string>();
            ServerDBUsers  = new Dictionary <int, string>();
            ServerDBPasses = new Dictionary <int, string>();
            ServerDBTypes  = new Dictionary <int, string>();
        }
Esempio n. 7
0
        public Configuration()
        {
            if (!File.Exists("conf/Login.ini"))
            {
                Log.Warning("Configuration file not found! Loading default values...");
            }

            var conf = new IniReader("conf/Login.ini");

            ListenIp   = IPAddress.Parse(conf.GetValue("listen", "ip", "127.0.0.1"));
            ListenPort = conf.GetValue("listen", "port", 38101);

            Debug    = conf.GetValue("server", "debug", false);
            LogLevel = Byte.Parse(conf.GetValue("server", "log_level", "0"));
            MaxUsers = UInt16.Parse(conf.GetValue("server", "max_users", "64"));

            ClientVersion = conf.GetValue("client", "client_version", 0);
            MagicKey      = conf.GetValue("client", "magic_key", 0);

            WhiteList = conf.GetValue("whitelist", "enabled", false);
            var whiteIps = conf.GetValue("whitelist", "whitelist", "");

            WhiteIps = whiteIps.Split(';');

            Cash       = conf.GetValue("url", "cash", "http://localhost/cashshop/?v1=");
            CashCharge = conf.GetValue("url", "cash_charge", "http://localhost/cashshop/?v1=");
            GuildBoard = conf.GetValue("url", "guild", "http://127.0.0.1/guild/?EncVal=");  // deprecated

            MasterIp   = IPAddress.Parse(conf.GetValue("master", "ip", "127.0.0.1"));
            MasterPort = conf.GetValue("master", "port", 9001);
        }
Esempio n. 8
0
            static Config()
            {
                ConfigPath = "data/Config.ini";
                conf       = new IniReader(ConfigPath);
                IP         = IPAddress.Parse(conf.GetValue("Common", "ServerIp", "0"));

                //Master Server
                MasterIP    = IPAddress.Parse(conf.GetValue("Master", "MasterIp", "127.0.0.1"));
                MasterPort  = conf.GetValue("Master", "MasterPort", 0);
                LoginDB     = conf.GetValue("logindb", "name", "");
                LoginDBIP   = conf.GetValue("logindb", "ip", "");
                LoginDBUser = conf.GetValue("logindb", "user", "");
                LoginDBPass = conf.GetValue("logindb", "password", "");
                LoginDBType = conf.GetValue("logindb", "type", "");

                //Login Server
                LoginIP             = IPAddress.Parse(conf.GetValue("Login", "LoginIP", "127.0.0.1"));
                LoginPort           = conf.GetValue("Login", "LoginPort", 0);
                ClientVersion       = conf.GetValue("Login", "client_version", 0);
                NormalMagicKey      = conf.GetValue("Login", "magic_key", 0);
                IgnoreClientVersion = conf.GetValue("Login", "ignore_client_version", 0);
                CashURL             = conf.GetValue("Login", "cash", "http://localhost/cashshop/?v1=");
                CashChargeURL       = conf.GetValue("Login", "cash_charge", "http://localhost/cashshop/?v1=");
                GuildURL            = conf.GetValue("Login", "guild", "http://localhost/guild/?EncVal=");

                //Channel Server
                /* Currently Unnecessary as values added are not loaded but set by server */

                //Chat Server
                ChatPort = conf.GetValue("Chat", "ChatPort", 0);
            }