Пример #1
0
        public Configuration()
        {
            Console.WriteLine("Load All Configuration...");
            Console.WriteLine("-------------------------------------------");

            Database = new DatabaseStruct(
                _DBCfg.GetString("db.mongo.url"),
                _DBCfg.GetString("db.mongo.name")
                );
            Log.Info("Loaded Database Configuration");

            Network = new NetworkStruct(
                _NWCfg.GetString("public.ip"),
                _NWCfg.GetString("private.ip"),
                _NWCfg.GetInt("private.port"),
                _NWCfg.GetString("login.ip"),
                _NWCfg.GetInt("login.port")
                );
            Log.Info("Loaded Network Configuration");

            Setting = new SettingStruct(
                _STCfg.GetInt("server.id"),
                _STCfg.GetString("server.name"),
                _STCfg.GetBoolean("server.Akey"),
                _STCfg.GetBoolean("debuging"),
                _STCfg.GetInt("rate.exp"),
                _STCfg.GetInt("rate.money"),
                _STCfg.GetInt("rate.sp")
                );
            Log.Info("Loaded Setting Configuration");

            Console.WriteLine("\n-------------------------------------------\n");

            Console.WriteLine("Load Channels Configuration...");
            Console.WriteLine("-------------------------------------------");
            for (int i = 0; i < 10; i++)
            {
                int id      = (i + 1);
                var cConfig = _CNSource.Configs["channel" + id];
                if (cConfig == null)
                {
                    continue;
                }

                Channels.Add(new ChannelStruct(
                                 id,
                                 cConfig.GetString("channel.name"),
                                 cConfig.GetInt("channel.port"),
                                 cConfig.GetInt("channel.type"),
                                 cConfig.GetInt("channel.max")
                                 ));

                Log.Info("Channel: {0} Loaded", id);
            }
            Console.WriteLine("\n-------------------------------------------\n");
        }
Пример #2
0
        public Configuration()
        {
            Console.WriteLine("Load All Configuration...");
            Console.WriteLine("-------------------------------------------");

            Database = new DatabaseStruct(
                _DBCfg.GetString("db.mongo.url"),
                _DBCfg.GetString("db.mongo.name")
            );
            Log.Info("Loaded Database Configuration");

            Network = new NetworkStruct(
                _NWCfg.GetString("public.ip"),
                _NWCfg.GetString("private.ip"),
                _NWCfg.GetInt("private.port"),
                _NWCfg.GetString("login.ip"),
                _NWCfg.GetInt("login.port")
            );
            Log.Info("Loaded Network Configuration");

            Setting = new SettingStruct(
                _STCfg.GetInt("server.id"),
                _STCfg.GetString("server.name"),
                _STCfg.GetBoolean("server.Akey"),
                _STCfg.GetBoolean("debuging"),
                _STCfg.GetInt("rate.exp"),
                _STCfg.GetInt("rate.money"),
                _STCfg.GetInt("rate.sp")
            );
            Log.Info("Loaded Setting Configuration");

            Console.WriteLine("\n-------------------------------------------\n");

            Console.WriteLine("Load Channels Configuration...");
            Console.WriteLine("-------------------------------------------");
            for(int i = 0; i < 10; i++)
            {
                int id = (i + 1);
                var cConfig = _CNSource.Configs["channel" + id];
                if (cConfig == null)
                    continue;

                Channels.Add(new ChannelStruct(
                    id,
                    cConfig.GetString("channel.name"),
                    cConfig.GetInt("channel.port"),
                    cConfig.GetInt("channel.type"),
                    cConfig.GetInt("channel.max")
                ));

                Log.Info("Channel: {0} Loaded", id);
            }
            Console.WriteLine("\n-------------------------------------------\n");
        }