Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            emClient = new ViGEmClient();             // Manages emulated XInput

            foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                // Get local BT host MAC
                if (nic.NetworkInterfaceType != NetworkInterfaceType.FastEthernetFx && nic.NetworkInterfaceType != NetworkInterfaceType.Wireless80211)
                {
                    if (nic.Name.Split()[0] == "Bluetooth")
                    {
                        btMAC = nic.GetPhysicalAddress();
                    }
                }
            }

            JoyconManager mgr = new JoyconManager();

            mgr.Awake();
            mgr.Start();

            server = new UdpServer(mgr.j);

            server.Start(IPAddress.Parse(ConfigurationSettings.AppSettings["IP"]), Int32.Parse(ConfigurationSettings.AppSettings["Port"]));
            HighResTimer timer = new HighResTimer(pollsPerSecond, new HighResTimer.ActionDelegate(mgr.Update));

            timer.Start();

            Console.Write("Press enter to quit.");
            Console.ReadLine();

            server.Stop();
            timer.Stop();
            mgr.OnApplicationQuit();
        }
Ejemplo n.º 2
0
        public static void Stop()
        {
            if (Program.useHidHide)
            {
                try {
                    HidHide.whitelistApplications(new List <string>(), false);
                } catch (Exception /*e*/) {
                    form.console.AppendText("Unable to purge whitelist.\r\n");
                }

                try {
                    HidHide.setStatus(false);
                } catch (Exception /*e*/) {
                    form.console.AppendText("Unable to disable HidHide.\r\n");
                }

                if (Boolean.Parse(ConfigurationManager.AppSettings["PurgeAffectedDevices"]))
                {
                    try {
                        HidHide.blacklistDevices(new List <string>(), false);
                    } catch (Exception /*e*/) {
                        form.console.AppendText("Unable to purge blacklisted devices.\r\n");
                    }
                }
            }

            keyboard.Dispose(); mouse.Dispose();
            server.Stop();
            mgr.OnApplicationQuit();
        }
Ejemplo n.º 3
0
        public static void Stop()
        {
            try {
                HttpWebResponse response = (HttpWebResponse)WebRequest.Create(@"http://localhost:26762/api/v1/hidguardian/whitelist/remove/" + pid).GetResponse();
            } catch (Exception e) {
                form.AppendTextBox("Unable to remove program from whitelist.");
            }

            server.Stop();
            timer.Stop();
            mgr.OnApplicationQuit();
        }
Ejemplo n.º 4
0
        public static void Stop()
        {
            try {
                HttpWebResponse response = (HttpWebResponse)WebRequest.Create(@"http://localhost:26762/api/v1/hidguardian/whitelist/remove/" + pid).GetResponse();                 // add BetterJoyForCemu to allowed processes
            } catch (Exception e) {
                form.console.Text += "Unable to remove program from whitelist.\r\n";
            }

            server.Stop();
            timer.Stop();
            mgr.OnApplicationQuit();
        }
Ejemplo n.º 5
0
        public static void Stop()
        {
            try {
                HttpWebResponse response = (HttpWebResponse)WebRequest.Create(@"http://*****:*****@"http://localhost:26762/api/v1/hidguardian/affected/purge/").GetResponse();
                } catch { }
            }

            server.Stop();
            timer.Stop();
            mgr.OnApplicationQuit();

            form.console.Text += "";
        }
Ejemplo n.º 6
0
        public static void Stop()
        {
            if (Program.useHIDG)
            {
                try {
                    HttpWebResponse response = (HttpWebResponse)WebRequest.Create(@"http://*****:*****@"http://localhost:26762/api/v1/hidguardian/affected/purge/").GetResponse();
                } catch { }
            }

            keyboard.Dispose(); mouse.Dispose();
            server.Stop();
            mgr.OnApplicationQuit();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
            {
                // Get local BT host MAC
                if (nic.NetworkInterfaceType != NetworkInterfaceType.FastEthernetFx && nic.NetworkInterfaceType != NetworkInterfaceType.Wireless80211)
                {
                    if (nic.Name.Split()[0] == "Bluetooth")
                    {
                        btMAC = nic.GetPhysicalAddress();
                    }
                }
            }

            JoyconManager mgr = new JoyconManager();

            mgr.Awake();
            mgr.Start();

            server = new UdpServer(mgr.j);

            //updateThread = new Thread(new ThreadStart(mgr.Update));
            //updateThread.Start();

            server.Start(26760);
            HighResTimer timer = new HighResTimer(pollsPerSecond, new HighResTimer.ActionDelegate(mgr.Update));

            timer.Start();

            Console.Write("Press enter to quit.");
            Console.ReadLine();

            server.Stop();
            timer.Stop();
            mgr.OnApplicationQuit();
        }