summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWither OrNot2025-09-09 16:23:38 +0000
committerWither OrNot2025-09-09 16:23:38 +0000
commitcdf85fc40cfacc75c44e7572104e4a79ba3f80b6 (patch)
tree45f5bbf6700054764d7fd1b4cf4a9dab99597bfa
parent995e80e4a43341f46ff8cbd6d104e1327b88bde7 (diff)
downloadTSforge-master.zip
Fix for poorly written pkeyconfigHEAD1.1.1master
-rw-r--r--LibTSforge/SPP/PKeyConfig.cs15
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
};