private void DnsRadio_CheckedChanged(object sender, EventArgs e)
        {
            // If we arent selected, return
            if (!DnsRadio.Checked)
            {
                return;
            }

            SelectedMode     = RedirectMode.DnsServer;
            descTextBox.Text = "This option is for advanced users that have setup a DNS server on their machine to automatically redirect "
                               + "Gamespy services to a configured Ip address.";
        }
        private void IcsRadio_CheckedChanged(object sender, EventArgs e)
        {
            // If we arent selected, return
            if (!IcsRadio.Checked)
            {
                return;
            }

            SelectedMode     = RedirectMode.HostsIcsFile;
            descTextBox.Text = "Enabling this option will create and use the hosts.ics file. This is a better option "
                               + "then using the system HOSTS file because Battlefield 2 will not check the hosts.ics file  for gamespy redirects";
        }
        private void HostsRadio_CheckedChanged(object sender, EventArgs e)
        {
            // If we arent selected, return
            if (!HostsRadio.Checked)
            {
                return;
            }

            SelectedMode     = RedirectMode.HostsFile;
            descTextBox.Text = "By enabling this option, this program will attempt to store the Gamespy redirects inside the system HOSTS file. "
                               + "Battlefield 2 will check the hosts file for Gamespy redirects, so we must also remove READ permissions to prevent this. "
                               + "This option should be used as a last resort, since removing READ permissions from the HOSTS file can cause Windows DNS server "
                               + "to undo the gamespy redirects when it refreshes itself.";
        }
Пример #4
0
        /// <summary>
        /// Sets a new Redirect method. Using this method removes any previous redirects
        /// </summary>
        /// <param name="Mode">The new redirect mode</param>
        /// <returns></returns>
        public static bool SetRedirectMode(RedirectMode Mode)
        {
            // If not change is made, return
            if (Mode == RedirectMethod)
            {
                return(false);
            }

            // Remove old redirects first
            if (RedirectsEnabled)
            {
                RemoveRedirects();
            }

            // Set new method
            RedirectMethod = Mode;

            // Save config
            Program.Config.RedirectMode = Mode;
            Program.Config.Save();
            return(true);
        }
        private void DnsRadio_CheckedChanged(object sender, EventArgs e)
        {
            // If we arent selected, return
            if (!DnsRadio.Checked) return;

            SelectedMode = RedirectMode.DnsServer;
            descTextBox.Text = "This option is for advanced users that have setup a DNS server on their machine to automatically redirect "
                + "Gamespy services to a configured Ip address.";
        }
        private void HostsRadio_CheckedChanged(object sender, EventArgs e)
        {
            // If we arent selected, return
            if (!HostsRadio.Checked) return;

            SelectedMode = RedirectMode.HostsFile;
            descTextBox.Text = "By enabling this option, this program will attempt to store the Gamespy redirects inside the system HOSTS file. "
                + "Battlefield 2 will check the hosts file for Gamespy redirects, so we must also remove READ permissions to prevent this. "
                + "This option should be used as a last resort, since removing READ permissions from the HOSTS file can cause Windows DNS server "
                + "to undo the gamespy redirects when it refreshes itself.";
        }
        private void IcsRadio_CheckedChanged(object sender, EventArgs e)
        {
            // If we arent selected, return
            if (!IcsRadio.Checked) return;

            SelectedMode = RedirectMode.HostsIcsFile;
            descTextBox.Text = "Enabling this option will create and use the hosts.ics file. This is a better option "
                + "then using the system HOSTS file because Battlefield 2 will not check the hosts.ics file  for gamespy redirects";
        }
Пример #8
0
        /// <summary>
        /// Sets a new Redirect method. Using this method removes any previous redirects
        /// </summary>
        /// <param name="Mode">The new redirect mode</param>
        /// <returns></returns>
        public static bool SetRedirectMode(RedirectMode Mode)
        {
            // If not change is made, return
            if (Mode == RedirectMethod) return false;

            // Remove old redirects first
            if (RedirectsEnabled) RemoveRedirects();

            // Set new method
            RedirectMethod = Mode;

            // Save config
            Program.Config.RedirectMode = Mode;
            Program.Config.Save();
            return true;
        }
Пример #9
0
 private static SettingsWithPreferences CreateResponse(string url = ConfigurationBase.BaseUrlGlobal, RedirectMode redirectMode = RedirectMode.No, bool withSettings = true)
 {
     return(new SettingsWithPreferences
     {
         Preferences = new Preferences
         {
             Url = url,
             RedirectMode = redirectMode
         },
         Settings = withSettings ? new Dictionary <string, Setting> {
             { "myKey", new Setting {
                   RawValue = "foo", SettingType = SettingTypeEnum.String
               } }
         } : null
     });
 }