Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Logger.Clear();
            Logger.Log("Starting...");
            _settings = Settings.Load();
            Logger.Log("Settings loaded");
            _classIcons = new ClassIcons(_basicTeraData.ResourceDirectory + @"class-icons\", 36);

            _hotKeyManager = new HotKeyManager();
            _pasteStatsHotKey = new GlobalHotKey(_hotKeyManager);
            _pasteStatsHotKey.Pressed += PasteStatsMenuItem_Click;
            _resetHotKey = new GlobalHotKey(_hotKeyManager);
            _resetHotKey.Pressed += ResetButton_Click;

            _teraSniffer = new TeraSniffer(_basicTeraData.Servers);
            _teraSniffer.MessageReceived += message => InvokeAction(() => HandleMessageReceived(message));
            _teraSniffer.NewConnection += server => InvokeAction(() => HandleNewConnection(server));
            _teraSniffer.Warning += LogWarning;
            if (_settings.BufferSize != null)
            {
                Logger.Log(string.Format("Setting buffer size to {0}B", FormatHelpers.Invariant.FormatValue(_settings.BufferSize)));
                _teraSniffer.BufferSize = _settings.BufferSize.Value;
            }
            SettingsChanged();

            StartSniffing();
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            _classIcons  = new ClassIcons(BasicTeraData.ResourceDirectory + @"class-icons\", 36);
            _teraSniffer = new TeraSniffer(BasicTeraData.Servers);
            _teraSniffer.MessageReceived += message => InvokeAction(() => HandleMessageReceived(message));
            _teraSniffer.NewConnection   += server => InvokeAction(() => HandleNewConnection(server));

            _teraSniffer.Enabled = true;
            UpdateSettingsUi();
        }
Ejemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Logger.Log("Form created");
            _settings = Settings.Load();
            Logger.Log("Settings loaded");
            _classIcons                = new ClassIcons(_basicTeraData.ResourceDirectory + @"class-icons\", 36);
            _toolTip.ShowAlways        = true;
            _hotKeyManager             = new HotKeyManager();
            _pasteStatsHotKey          = new GlobalHotKey(_hotKeyManager);
            _pasteStatsHotKey.Pressed += PasteStatsMenuItem_Click;
            _resetHotKey               = new GlobalHotKey(_hotKeyManager);
            _resetHotKey.Pressed      += ResetButton_Click;

            _teraSniffer = new TeraSniffer(_basicTeraData.Servers, _settings.UseRaw);
            _teraSniffer.MessageReceived += message => InvokeAction(() => HandleMessageReceived(message));
            _teraSniffer.NewConnection   += server => InvokeAction(() => HandleNewConnection(server));
            _teraSniffer.Warning         += LogWarning;
            _teraSniffer.BufferSize       = _settings.BufferSize;
            Logger.Log(string.Format("Setting buffer size to {0}B", FormatHelpers.Invariant.FormatValue(_settings.BufferSize) ?? "Default"));
            SettingsChanged();

            StartSniffing();
        }
Ejemplo n.º 4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Logger.Clear();
            Logger.Log("Starting...");
            _settings = Settings.Load();
            Logger.Log("Settings loaded");
            _classIcons = new ClassIcons(_basicTeraData.ResourceDirectory + @"class-icons\", 36);

            _hotKeyManager             = new HotKeyManager();
            _pasteStatsHotKey          = new GlobalHotKey(_hotKeyManager);
            _pasteStatsHotKey.Pressed += PasteStatsMenuItem_Click;
            _resetHotKey          = new GlobalHotKey(_hotKeyManager);
            _resetHotKey.Pressed += ResetButton_Click;

            _teraSniffer = new TeraSniffer(_basicTeraData.Servers);
            _teraSniffer.MessageReceived += message => InvokeAction(() => HandleMessageReceived(message));
            _teraSniffer.NewConnection   += server => InvokeAction(() => HandleNewConnection(server));

            SettingsChanged();

            Logger.Log("Starting sniffing...");
            _teraSniffer.Enabled = true;
            Logger.Log("Sniffing started");
        }
Ejemplo n.º 5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            _classIcons = new ClassIcons(BasicTeraData.ResourceDirectory + @"class-icons\", 36);
            _teraSniffer = new TeraSniffer(BasicTeraData.Servers);
            _teraSniffer.MessageReceived += message => InvokeAction(() => HandleMessageReceived(message));
            _teraSniffer.NewConnection += server => InvokeAction(() => HandleNewConnection(server));

            _teraSniffer.Enabled = true;
            UpdateSettingsUi();
        }