public void FirewallWrapper_IsFirewallApplicationConfiguredTest()
        {
            var sut = new FirewallWrapper();

            var result = sut.IsFirewallApplicationConfigured("Machina Test");

            Assert.IsTrue(result);
            Assert.AreEqual(0, TestInfrastructure.Listener.Messages.Count);
        }
        private void OnLoad(object sender, EventArgs e)
        {
            var thisFilename = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            var appName      = "FFXIV Collect Helper";
            var fw           = new FirewallWrapper();

            if (!fw.IsFirewallDisabled() && !fw.IsFirewallApplicationConfigured(appName))
            {
                fw.AddFirewallApplicationEntry(appName, thisFilename);
            }

            monitor.PlayerSetupInfoReceived = OnPlayerSetupInfoReceived;
            monitor.Start();
        }
Exemple #3
0
        public bool ValidateNetworkAccess()
        {
            if (Sockets == null || !Sockets.Any())
            {
                return(false);
            }
            try
            {
                var firewallWrapper = new FirewallWrapper();
                if (firewallWrapper.IsFirewallDisabled())
                {
                    return(true);
                }

                firewallWrapper.AddFirewallApplicationEntry();

                if (firewallWrapper.IsFirewallApplicationConfigured())
                {
                    if (firewallWrapper.IsFirewallRuleConfigured())
                    {
                        return(true);
                    }
                }
                var num = (int)MessageBox.Show("Unable to access network data due to Windows Firewall.  Please disable, or add a TCP rule for FFXIVAPP.Client.");
                return(false);
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("800706D9"))
                {
                    MessageBox.Show("Cannot determine Windows Firewall Status.");
                    return(true);
                }
                MessageBox.Show("Error validating firewall: " + ex.Message);
                return(false);
            }
        }
Exemple #4
0
        public bool ValidateNetworkAccess()
        {
            if (Sockets == null || !Sockets.Any())
            {
                return false;
            }
            try
            {
                var firewallWrapper = new FirewallWrapper();
                if (firewallWrapper.IsFirewallDisabled())
                {
                    return true;
                }

                firewallWrapper.AddFirewallApplicationEntry();

                if (firewallWrapper.IsFirewallApplicationConfigured())
                {
                    if (firewallWrapper.IsFirewallRuleConfigured())
                    {
                        return true;
                    }
                }
                var num = (int) MessageBox.Show("Unable to access network data due to Windows Firewall.  Please disable, or add a TCP rule for FFXIVAPP.Client.");
                return false;
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("800706D9"))
                {
                    MessageBox.Show("Cannot determine Windows Firewall Status.");
                    return true;
                }
                MessageBox.Show("Error validating firewall: " + ex.Message);
                return false;
            }
        }