private void HandleNewConnection(Server server)
        {
            Text = string.Format("Damage Meter connected to {0}", server.Name);
            _server = server;
            _teraData = _basicTeraData.DataForRegion(server.Region);
            _entityTracker = new EntityTracker(_teraData.NpcDatabase);
            _playerTracker = new PlayerTracker(_entityTracker);
            _damageTracker = new DamageTracker();
            _messageFactory = new MessageFactory(_teraData.OpCodeNamer);

            Logger.Log(Text);
        }
        private void OpenPacketLogMenuItem_Click(object sender, EventArgs e)
        {
            if (OpenPacketLogFileDialog.ShowDialog() != DialogResult.OK)
                return;

            _teraSniffer.Enabled = false;

            var log = new PacketLogFile(OpenPacketLogFileDialog.FileName);

            var server = new Server(string.Format("[{0}] Packet Log", log.Header.Region), log.Header.Region ?? "EU", null);
            HandleNewConnection(server);

            foreach (var message in log.Messages)
            {
                HandleMessageReceived(message);
            }
        }
Exemple #3
0
 private void HandleNewConnection(Server server)
 {
     Server = server;
     _messageFactory = new MessageFactory();
     ResetDamageTracker();
     DamageTracker = DamageTracker ?? new DamageTracker
     {
         OnlyBosses = OnlyBosses,
         IgnoreOneshots = IgnoreOneshots
     };
     _needInit = true;
     Logger.Info($"Connected to server {server.Name}.");
 }
        private void HandleNewConnection(Server server)
        {
            Server = server;
            _teraData = BasicTeraData.DataForRegion(server.Region);

            _entityTracker = new EntityTracker();
            _playerTracker = new PlayerTracker(_entityTracker);
            _messageFactory = new MessageFactory(_teraData.OpCodeNamer);

            Reset(null);
            DamageTracker = DamageTracker ?? new DamageTracker();

            Logger.Info($"Connected to server {server.Name}.");
        }
 protected virtual void HandleNewConnection(Server server)
 {
     Server = server;
     MessageFactory = new MessageFactory();
     NeedInit = true;
     Connected?.Invoke(server.Name);
 }
 protected virtual void OnNewConnection(Server server)
 {
     var handler = NewConnection;
     if (handler != null) handler(server);
 }
 private void newConnection(Server server)
 {
     mainWindow.SetText("New connection to " + server.Name);
 }
 protected virtual void OnNewConnection(Server server)
 {
     var handler = NewConnection;
     handler?.Invoke(server);
 }
        private void OpenPacketLogMenuItem_Click(object sender, EventArgs e)
        {
            if (OpenPacketLogFileDialog.ShowDialog() != DialogResult.OK)
                return;

            _teraSniffer.Enabled = false;
            var server = new Server("Packet Log", "EU", null);
            HandleNewConnection(server);
            foreach (var message in PacketLogReader.ReadMessages(OpenPacketLogFileDialog.FileName))
            {
                HandleMessageReceived(message);
            }
        }
 private void HandleNewConnection(Server server)
 {
     Text = $"Damage Meter connected to {server.Name}";
     _server = server;
     _teraData = BasicTeraData.DataForRegion(server.Region);
     _entityRegistry = new EntityTracker();
     _playerTracker = new PlayerTracker(_entityRegistry);
     _damageTracker = new DamageTracker(_entityRegistry, _playerTracker, _teraData.SkillDatabase);
     _messageFactory = new MessageFactory(_teraData.OpCodeNamer);
 }
 void _teraSniffer_NewConnection(Server server)
 {
     InvokeAction(() =>
         {
             var header = new LogHeader { Region = server.Region };
             _logWriter = new PacketLogWriter(string.Format("{0}.TeraLog", DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture)), header);
             ConnectionList.Items.Clear();
             ConnectionList.Items.Add(string.Format("New connection to {0}started...", server.Name));
             _teraData = _basicTeraData.DataForRegion(server.Region);
         });
 }