<commit_before>using System;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using log4net;
using Nini.Config;
using OpenSim;
using OpenSim.Framework;
using Aurora.Framework;

namespace OpenSim.CoreApplicationPlugins
{
    public class UpdaterPlugin : IApplicationPlugin
    {
        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public void Initialize(ISimulationBase openSim)
        {
            try
            {
                //Check whether this is enabled
                IConfig updateConfig = openSim.ConfigSource.Configs["Update"];
                if (updateConfig == null)
                    return;

                if (!updateConfig.GetBoolean("Enabled", false))
                    return;
                
                m_log.Info("[AURORAUPDATOR]: Checking for updates...");

                float CurrentVersion = float.Parse(openSim.Version.Split(' ')[1]);
                float LastestVersionToBlock = updateConfig.GetFloat("LatestRelease", 0);

                string WebSite = updateConfig.GetString("URLToCheckForUpdates", "http://auroraserver.ath.cx:8080/updater.xml");
                //Pull the xml from the website
                string XmlData = Utilities.ReadExternalWebsite(WebSite);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(XmlData);

                XmlNodeList parts = doc.GetElementsByTagName("Updater");
                XmlNode UpdaterNode = parts[0];

                //[0] - Minimum supported release #
                //[1] - Minimum supported release date
                //[2] - Newest version #
                //[3] - Date released
                //[4] - Release notes
                //[5] - Download link

                //Read the newest version [2] and see if it is higher than the current version and less than the version the user last told us to block
                if (float.Parse(UpdaterNode.ChildNodes[2].InnerText) > CurrentVersion && LastestVersionToBlock < float.Parse(UpdaterNode.ChildNodes[2].InnerText))
                {
                    //Ask if they would like to update
                    DialogResult result = MessageBox.Show("Aurora Update",
                        "A new version of Aurora has been released, version " +
                        UpdaterNode.ChildNodes[2].InnerText +
                        " released " + UpdaterNode.ChildNodes[3].InnerText +<commit_msg>Bit of cleanup in the UpdaterModule.<commit_after>using System;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using log4net;
using Nini.Config;
using OpenSim;
using OpenSim.Framework;
using Aurora.Framework;

namespace OpenSim.CoreApplicationPlugins
{
    public class UpdaterPlugin : IApplicationPlugin
    {
        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        private string m_urlToCheckForUpdates = "http://grid.aurora-sim.org/updates.xml";

        public void Initialize(ISimulationBase openSim)
        {
            try
            {
                //Check whether this is enabled
                IConfig updateConfig = openSim.ConfigSource.Configs["Update"];
                if (updateConfig == null)
                    return;

                if (!updateConfig.GetBoolean("Enabled", false))
                    return;
                
                m_log.Info("[AURORAUPDATOR]: Checking for updates...");

                float CurrentVersion = float.Parse(openSim.Version.Split(' ')[1]);
                float LastestVersionToBlock = updateConfig.GetFloat("LatestRelease", 0);

                string WebSite = updateConfig.GetString("URLToCheckForUpdates", m_urlToCheckForUpdates);
                //Pull the xml from the website
                string XmlData = Utilities.ReadExternalWebsite(WebSite);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(XmlData);

                XmlNodeList parts = doc.GetElementsByTagName("Updater");
                XmlNode UpdaterNode = parts[0];

                //[0] - Minimum supported release #
                //[1] - Minimum supported release date
                //[2] - Newest version #
                //[3] - Date released
                //[4] - Release notes
                //[5] - Download link

                //Read the newest version [2] and see if it is higher than the current version and less than the version the user last told us to block
                if (float.Parse(UpdaterNode.ChildNodes[2].InnerText) > CurrentVersion && LastestVersionToBlock < float.Parse(UpdaterNode.ChildNodes[2].InnerText))
                {
                    //Ask if they would like to update
                    DialogResult result = MessageBox.Show("Aurora Update",
                        "A new version of Aurora has been released, version " +
                        UpdaterNode.ChildNodes[2].InnerText +
                        " released " + UpdaterNode.ChildNodes[3].InnerText +
{'fraction_non_alphanumeric': 0.08795227097767513, 'fraction_numerical': 0.006543494996150885, 'mean_word_length': 1.9245920090039392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055529', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1259, 'n_words': 347}