Merge pull request #1313 from LostDragonist/origin_fix2

More fixes to Origin game detection
This commit is contained in:
Timothy Baldridge 2021-02-10 20:22:56 -07:00 committed by GitHub
commit 7c8c413105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -79,6 +79,7 @@ namespace Wabbajack.Common
// to get these ids, split the numbers from the letters in file names found in // to get these ids, split the numbers from the letters in file names found in
// C:\ProgramData\Origin\LocalContent\{game name)\*.mfst // C:\ProgramData\Origin\LocalContent\{game name)\*.mfst
// So for DA:O this is "DR208591800.mfst" -> "DR:208591800" // So for DA:O this is "DR208591800.mfst" -> "DR:208591800"
// EAPlay games may have @subscription appended to the file name
public List<string> OriginIDs { get; set; } = new(); public List<string> OriginIDs { get; set; } = new();
public List<string> EpicGameStoreIDs { get; internal set; } = new List<string>(); public List<string> EpicGameStoreIDs { get; internal set; } = new List<string>();

View File

@ -15,7 +15,7 @@ namespace Wabbajack.Common.StoreHandlers
public override StoreType Type { get; internal set; } = StoreType.Origin; public override StoreType Type { get; internal set; } = StoreType.Origin;
private static Regex SplitRegex = new Regex("[0-9]+"); private static Regex SplitRegex = new Regex("(.*)([0-9]+)(@subscription)?", RegexOptions.RightToLeft);
public override bool Init() public override bool Init()
{ {
try try
@ -30,8 +30,8 @@ namespace Wabbajack.Common.StoreHandlers
{ {
var result = SplitRegex.Match(f); var result = SplitRegex.Match(f);
if (result == null) return default; if (result == null) return default;
var a = f.Substring(0, result.Index); var a = result.Groups[1];
var b = f.Substring(result.Index); var b = result.Groups[2];
return a + ":" + b; return a + ":" + b;
}) })
.Where(t => t != default) .Where(t => t != default)