Exemplo n.º 1
0
        private async void Init()
        {
            ViewModel.PropertyChanged += (_, e) =>
            {
                if (e.PropertyName == "Fates")
                {
                    var fateNodes = ViewModel.Fates.SelectMany(fateTree => fateTree.Leaves);

                    foreach (var fateNode in fateNodes)
                    {
                        fateNode.IsChecked        = Config.Instance.Watch.Fates.Contains(((ViewModels.FateNode)fateNode).Id);
                        fateNode.PropertyChanged += FateNode_PropertyChanged;
                    }
                }
            };
            Data.Instance.PropertyChanged += Data_PropertyChanged;
            Data.Instance.Init();
            Utils.Log.Handler += Log;
            ffxivPlugin        = await Helper.GetFFXIVPlugin();

            Telemetry.Init();
            Helper.CheckLicenseNotice();

            var network = new NetworkMonitor();

            network.OnException    += LogException;
            network.OnReceiveEvent += Network_onReceiveEvent;

#if DEBUG
            Client.UniversalisProcessor.Log += OnUniversalisLog;
#endif

            ParsePlugin.Init(ffxivPlugin, network);

            if (Config.Instance.Language == null)
            {
                Config.Instance.Language = ParsePlugin.Instance.GetLanguage();
            }

            if (Config.Instance.Region == null)
            {
                Config.Instance.Region = ParsePlugin.Instance.GetRegion();
            }

            ParsePlugin.Instance.Network = network;
            ParsePlugin.Instance.Start();
        }
Exemplo n.º 2
0
        private void NetworkWorker(IActPluginV1 ffxivPlugin)
        {
            parsePlugin = new ParsePlugin(ffxivPlugin);
            var Network = new FFXIVNetworkMonitor();

            Network.onException    += logException;
            Network.onReceiveEvent += (string connection, long epoch, byte[] message) =>
            {
                parsePacket(message, false);
            };
            Network.onSendEvent += (string connection, long epoch, byte[] message) =>
            {
                parsePacket(message, true);
            };;
            parsePlugin.Network = Network;
            parsePlugin.Start();
        }