Skip to content

Fix china version cause bug at Tools.VersionAsInt. #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions UnityLauncherPro/Tools.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Win32;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -481,7 +481,8 @@ public static bool VersionIsAlpha(string version)

public static bool VersionIsChinese(string version)
{
return version.Contains("c1");
// return version.Contains("c1");
return Regex.IsMatch(version, "c\\d+");
}

// open release notes page in browser
Expand Down Expand Up @@ -642,7 +643,8 @@ public static int VersionAsInt(string version)
// remove a,b,f,p
cleanVersion = cleanVersion.Replace("a", ".");
cleanVersion = cleanVersion.Replace("b", ".");
cleanVersion = cleanVersion.Replace("c1", "");
// cleanVersion = cleanVersion.Replace("c1", "");
cleanVersion = Regex.Replace(cleanVersion, "c\\d+", "");
cleanVersion = cleanVersion.Replace("f", ".");
cleanVersion = cleanVersion.Replace("p", ".");

Expand Down