Esempio n. 1
0
        static public RemoteAction Send(OverlayHost myHost, OverlayEndpoint remoteHost, Node.DisconnectProcessor dp,
                                        MessageType mt, params object[] args)
        {
            RemoteAction ra = new RemoteAction();

            ra.remoteHost = remoteHost;

            bool assigned = false;

            for (int i = 0; i < args.Length; ++i)
            {
                if (args[i].GetType() == typeof(RemoteActionIdInject))
                {
                    args[i]  = ra.Id;       // id is injected at first RemoteActionIdInject argument
                    assigned = true;
                    break;
                }
            }

            if (!assigned)
            {
                List <object> lst = new List <object>();
                lst.Add(ra.Id);             // or in front if there isn't one
                lst.AddRange(args);
                args = lst.ToArray();
            }

            if (dp != null)
            {
                myHost.TryConnectAsync(remoteHost, dp);
            }
            myHost.SendMessage(remoteHost, mt, args);

            return(ra);
        }
Esempio n. 2
0
 private void ToolTipBeacon_Loaded(object sender, RoutedEventArgs e)
 {
     showTimer.Tick     += ShowTimer_Tick;
     hideTimer.Tick     += HideTimer_Tick;
     stayOpenTimer.Tick += StayOpenTimer_Tick;
     if (TemplatedParent as FrameworkElement != null && Target == null)
     {
         Target = TemplatedParent as FrameworkElement;
     }
     overlayHost = OverlayHost.GetOverlay();
 }
Esempio n. 3
0
        private Rect GetTargetRect()
        {
            OverlayHost host = OverlayHost.GetOverlay();

            if (host == null || Target == null)
            {
                return(default(Rect));
            }
            Point leftTopCornerPoint = Target.TranslatePoint(new Point(0, 0), host);
            Rect  result             = new Rect(leftTopCornerPoint, new Size(Target.ActualWidth, Target.ActualHeight));

            return(result);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            //Dont.Be.A.Scumbag.And.Remove.This.Warn.warn();
            Console.WriteLine("Xri Client");
            Console.WriteLine("Flare port to C#");
            Console.WriteLine("Xri port to C#");
            Console.WriteLine("Discord: https://discord.gg/t8pp4Vm");

            Process.Start("minecraft://");

            try
            {
                MCM.openGame();
                MCM.openWindowHost();

                CommandHook     cmh   = new CommandHook();
                SDK             sdk   = new SDK();
                FileMan         fm    = new FileMan();
                CategoryHandler ch    = new CategoryHandler();
                TabUiHandler    tuih  = new TabUiHandler();
                ModuleHandler   mh    = new ModuleHandler();
                KeybindHandler  kh    = new KeybindHandler();
                Thread          uiApp = new Thread(() => { OverlayHost ui = new OverlayHost(); Application.Run(ui); });
                if (fm.readConfig())
                {
                    Console.WriteLine("Loaded configurations!");
                }
                else
                {
                    Console.WriteLine("Could not load configurations!");
                }
                uiApp.Start();
                while (true)
                {
                    try
                    {
                        mainLoop.Invoke(null, new EventArgs());
                        Thread.Sleep(threadSleep);
                    }
                    catch (Exception)
                    {
                    }
                }
            } catch (Exception ex)
            {
                Console.WriteLine("Message: " + ex.Message);
                Console.WriteLine("Stacktrace: " + ex.StackTrace);
                MessageBox.Show("Xri crashed! Check the console for error details. Click 'Ok' to quit.");
            }
        }
Esempio n. 5
0
        private void HideToolTip()
        {
            StopTimers();
            if (tooltipPresenter == null)
            {
                return;
            }
            OverlayHost overlay = OverlayHost.GetOverlay();

            if (overlay != null)
            {
                overlay.HideContent(GetToolTipContent(Target));
                overlayHost.OwnerWindow.Deactivated += OwnerWindow_Deactivated;
            }
            tooltipPresenter.MouseLeftButtonDown -= OverlayControl_MouseLeftButtonDown;
            tooltipPresenter = null;
        }
Esempio n. 6
0
        private void ShowToolTip()
        {
            string groupName = GetInheritedGroupName(this);

            if (!String.IsNullOrWhiteSpace(groupName) && !IsToolTipsGroupEnabled(groupName))
            {
                return;
            }
            overlayHost = OverlayHost.GetOverlay();
            if (overlayHost != null)
            {
                overlayHost.OwnerWindow.Deactivated += OwnerWindow_Deactivated;
                tooltipPresenter = overlayHost.ShowContent(GetToolTipContent(Target), GetTargetRect(), GetToolTipTemplateKey(Target));
                tooltipPresenter.PlacementPriority = GetPlacementPriority(Target);
                SetAttachedBeacon(tooltipPresenter, this);
                SetBinding(ToolTipHasMouseOverProperty, new Binding {
                    Source = tooltipPresenter, Path = new PropertyPath(IsMouseOverProperty), Mode = BindingMode.OneWay
                });
                tooltipPresenter.MouseLeftButtonDown += OverlayControl_MouseLeftButtonDown;
                hideTimer.Interval = TimeSpan.FromMilliseconds(GetGetHideDelay(Target));
                hideTimer.Start();
            }
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            //Dont.Be.A.Scumbag.And.Remove.This.Warn.warn();
            Console.WriteLine("Flare# Client");
            Console.WriteLine("Flare port to C#");
            Console.WriteLine("Discord: https://discord.gg/Hz3Dxg8");

            Process.Start("minecraft://");

            try
            {
                MCM.openGame();
                MCM.openWindowHost();

                CommandHook     cmh   = new CommandHook();
                FileMan         fm    = new FileMan();
                CategoryHandler ch    = new CategoryHandler();
                ModuleHandler   mh    = new ModuleHandler();
                KeybindHandler  kh    = new KeybindHandler();
                Thread          uiApp = new Thread(() => { OverlayHost ui = new OverlayHost(); Application.Run(ui); });
                if (fm.readConfig())
                {
                    Console.WriteLine("Loaded config!");
                }
                else
                {
                    Console.WriteLine("Could not load config!");
                }
                uiApp.Start();
                if (args != null)
                {
                    if (args.Length > 0)
                    {
                        if (args[0] == "dualThread")
                        {
                            Thread moduleThread = new Thread(() => { while (true)
                                                                     {
                                                                         try { ModuleHandler.registry.tickModuleThread(); Thread.Sleep(1); } catch (Exception) { }
                                                                     }
                                                             });
                            moduleThread.Start();
                        }
                    }
                }
                while (true)
                {
                    try
                    {
                        mainLoop.Invoke(null, new EventArgs());
                        if (limitCpu)
                        {
                            Thread.Sleep(1);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            } catch (Exception ex)
            {
                Console.WriteLine("Message: " + ex.Message);
                Console.WriteLine("Stacktrace: " + ex.StackTrace);
                MessageBox.Show("Flare crashed! Check the console for error details. Click 'Ok' to quit.");
            }
        }
Esempio n. 8
0
 public static void BroadcastGroup(this OverlayHost host, OverlayHostName name, MessageType mt, params object[] objs)
 {
     host.BroadcastGroup(name, new GameMessage(mt, objs));
 }
Esempio n. 9
0
        //public static void ConnectSendMessage(this OverlayHost host, OverlayEndpoint remote, MessageType mt, params object[] objs)
        //{
        //    host.ConnectSendMessage(remote, new GameMessage(mt, objs));
        //}

        public static void BroadcastGroup(this OverlayHost host, Func <Node, bool> group, MessageType mt, params object[] objs)
        {
            host.BroadcastGroup(group, new GameMessage(mt, objs));
        }
Esempio n. 10
0
 public static void SendMessage(this OverlayHost host, OverlayEndpoint remote, MessageType mt, params object[] objs)
 {
     host.SendMessage(remote, new GameMessage(mt, objs));
 }