public override bool IsCurrent()
        {
            if (isCurrent != null)
            {
                return(isCurrent.Value);
            }

            try
            {
                GithubVersionHelper helper         = new GithubVersionHelper("iamwyza/HollowKnightRandomizerTracker");
                Version             currentVersion = new Version(GetVersion());

                Version newVersion = new Version(helper.GetVersion());
                LogDebug($"Comparing Versions: {newVersion} > {currentVersion}");
                isCurrent = newVersion.CompareTo(currentVersion) <= 0;

                return(isCurrent.Value);
            }
            catch (Exception ex)
            {
                LogError("Couldn't check version" + ex);
            }

            return(true);
        }
Exemplo n.º 2
0
 public override bool IsCurrent()
 {
     try
     {
         GithubVersionHelper helper = new GithubVersionHelper("seanpr96/DebugMod");
         Log("Github = " + helper.GetVersion());
         return(helper.GetVersion() == GetVersion());
     }
     catch (Exception)
     {
         return(true);
     }
 }
Exemplo n.º 3
0
 public override bool IsCurrent()
 {
     try
     {
         GithubVersionHelper helper = new GithubVersionHelper("MyEyes/RandomizerMod");
         Log("Github = " + helper.GetVersion());
         return(GetVersion().StartsWith(helper.GetVersion()));
     }
     catch (Exception)
     {
         return(true);
     }
 }
        /// <summary>
        /// Checks to see if the mod is up to date from a github release, if a new release is in github, return false.  There will be a message in the UI noting that the mod is out of date.
        /// </summary>
        /// <remarks>This is an entirely optional function.  You can not override this method if you don't use github or want to use version checking.</remarks>
        /// <returns></returns>
        public override bool IsCurrent()
        {
            try
            {
                //This should be your repository's name.
                GithubVersionHelper helper = new GithubVersionHelper("username/ExampleMod3");

                //This assumes you're using Semantic Versioning (ex: 1.2.3.4).  If you use another versioning system, you'll have to implement your own logic to determine if this is new.
                Version currentVersion = new Version(GetVersion());

                Version newVersion = new Version(helper.GetVersion());
                LogDebug($"Comparing Versions: {newVersion} > {currentVersion}");
                return(newVersion.CompareTo(currentVersion) < 0);
            }
            catch (Exception ex)
            {
                LogError("Couldn't check version" + ex);
            }

            return(true);
        }