diff options
| author | Wither OrNot | 2025-09-09 16:23:38 +0000 |
|---|---|---|
| committer | Wither OrNot | 2025-09-09 16:23:38 +0000 |
| commit | cdf85fc40cfacc75c44e7572104e4a79ba3f80b6 (patch) | |
| tree | 45f5bbf6700054764d7fd1b4cf4a9dab99597bfa /LibTSforge/SPP/PKeyConfig.cs | |
| parent | 995e80e4a43341f46ff8cbd6d104e1327b88bde7 (diff) | |
| download | TSforge-cdf85fc40cfacc75c44e7572104e4a79ba3f80b6.zip | |
Diffstat (limited to 'LibTSforge/SPP/PKeyConfig.cs')
| -rw-r--r-- | LibTSforge/SPP/PKeyConfig.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/LibTSforge/SPP/PKeyConfig.cs b/LibTSforge/SPP/PKeyConfig.cs index 83fc981..d64ae1e 100644 --- a/LibTSforge/SPP/PKeyConfig.cs +++ b/LibTSforge/SPP/PKeyConfig.cs @@ -23,7 +23,7 @@ namespace LibTSforge.SPP public bool Contains(int n) { - return Start <= n && End <= n; + return Start <= n && n <= End; } } @@ -153,10 +153,19 @@ namespace LibTSforge.SPP string refActIdStr = configNode.SelectSingleNode("./p:ActConfigId", nsmgr).InnerText; Guid refActId = new Guid(refActIdStr); int group = int.Parse(configNode.SelectSingleNode("./p:RefGroupId", nsmgr).InnerText); - List<KeyRange> keyRanges = ranges[refActIdStr]; + List<KeyRange> keyRanges; + ranges.TryGetValue(refActIdStr, out keyRanges); + + if (keyRanges == null) + { + continue; + } if (keyRanges.Count > 0 && !Products.ContainsKey(refActId)) { + PKeyAlgorithm algorithm; + algorithms.TryGetValue(group, out algorithm); + ProductConfig productConfig = new ProductConfig { GroupId = group, @@ -164,7 +173,7 @@ namespace LibTSforge.SPP Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText, Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText, Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true", - Algorithm = algorithms[group], + Algorithm = algorithm, Ranges = keyRanges, ActivationId = refActId }; |
