Ejemplo n.º 1
0
 new public void SetConfig(DriverSettings settings)
 {
     base.SetConfig(settings);
     _url = settings.Ini.GetSetting("Http", "Url").Trim();
     if (String.IsNullOrWhiteSpace(_url))
         throw new DriverException("URL is empty");
 }
Ejemplo n.º 2
0
 new public void SetConfig(DriverSettings settings)
 {
     base.SetConfig(settings);
     _url = settings.Ini.GetSetting("Http", "Url").Trim();
     if (String.IsNullOrWhiteSpace(_url))
     {
         throw new DriverException("URL is empty");
     }
 }
Ejemplo n.º 3
0
 new public void SetConfig(DriverSettings settings)
 {
     base.SetConfig(settings);
     var f = settings.Ini.GetSetting("File", "Path");
     if (!Path.IsPathRooted(f))
     {
         f = Path.Combine(settings.PluginPath, f);
     }
     if (!System.IO.File.Exists(f))
     {
         throw new DriverException(String.Format("Could not load player list {0}", f));
     }
     var file = new StreamReader(f);
     string line;
     while ((line = file.ReadLine()) != null)
     {
         _list.Add(line.Trim());
     }
     AppConsole.Log(String.Format("PlayerCheck: Loaded {0} GUIDs into list.", _list.Count));
     file.Close();
 }
Ejemplo n.º 4
0
        new public void SetConfig(DriverSettings settings)
        {
            base.SetConfig(settings);
            var f = settings.Ini.GetSetting("File", "Path");

            if (!Path.IsPathRooted(f))
            {
                f = Path.Combine(settings.PluginPath, f);
            }
            if (!System.IO.File.Exists(f))
            {
                throw new DriverException(String.Format("Could not load player list {0}", f));
            }
            var    file = new StreamReader(f);
            string line;

            while ((line = file.ReadLine()) != null)
            {
                _list.Add(line.Trim());
            }
            AppConsole.Log(String.Format("PlayerCheck: Loaded {0} GUIDs into list.", _list.Count));
            file.Close();
        }
Ejemplo n.º 5
0
        public void Init(IApi api, string dllpath)
        {
            _api = api;
            _dllpath = dllpath;
            IniParser _ini;
            try
            {
                _ini = new IniParser(_configPath);
            }
            catch (Exception ex)
            {
                throw new PlayerCheckException(String.Format("Error loading config: {0}", ex.Message));
            }

            _enabled = _ini.GetBoolSetting(Name, "Enabled");
            if (!_enabled)
                throw new PlayerCheckException(String.Format("{0} has been disabled", Name));

            _checkip = _ini.GetBoolSetting(Name, "CheckIP");
            _kickMessage = _ini.GetSetting(Name, "KickMessage");

            if (_ini.GetSetting(Name, "Mode") == "white")
            {
                _mode = Mode.Whitelist;
            }

            var settings = new DriverSettings()
            {
                Api = api,
                Ini = _ini,
                PluginPath = dllpath
            };

            _driver = Base.GetDriver(_ini);
            _driver.SetConfig(settings);
            api.OnBeMessageReceivedEvent += onBEMessageReceivedEvent;
        }
Ejemplo n.º 6
0
 public void SetConfig(DriverSettings settings)
 {
     _settings = settings;
 }
Ejemplo n.º 7
0
 public void SetConfig(DriverSettings settings)
 {
     _settings = settings;
 }