From 767fa8826694445dfd6ca415c1e344a4cf0fa6a9 Mon Sep 17 00:00:00 2001 From: mfoltz Date: Sat, 14 Sep 2024 19:50:57 -0500 Subject: [PATCH] - will only parse up to the first 3 bonus stats to send to client as was intended originally --- Services/EclipseService.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Services/EclipseService.cs b/Services/EclipseService.cs index 2d828e0..2519c2f 100644 --- a/Services/EclipseService.cs +++ b/Services/EclipseService.cs @@ -141,8 +141,12 @@ public static void SendClientProgress(Entity character, ulong SteamID) if (SteamID.TryGetPlayerBloodStats(out var bloodStats) && bloodStats.TryGetValue(bloodType, out var stats)) { - // need to get a 00 value for each stat and add them together but not literally, just concatenating - if (stats.Count != 0) bonusStats = int.Parse(string.Join("", stats.Select(stat => ((int)stat + 1).ToString("D2")))); + //if (stats.Count != 0) bonusStats = int.Parse(string.Join("", stats.Select(stat => ((int)stat + 1).ToString("D2")))); + var limitedStats = stats.Take(3).Select(stat => ((int)stat + 1).ToString("D2")); + if (limitedStats.Any()) + { + bonusStats = int.Parse(string.Join("", limitedStats)); + } } } else if (bloodType.Equals(BloodType.None)) @@ -180,8 +184,12 @@ public static void SendClientProgress(Entity character, ulong SteamID) if (SteamID.TryGetPlayerWeaponStats(out var weaponStats) && weaponStats.TryGetValue(weaponType, out var stats)) { - // need to get a 00 value for each stat and add them together but not literally, just concatenating - if (stats.Count != 0) bonusStats = int.Parse(string.Join("", stats.Select(stat => ((int)stat + 1).ToString("D2")))); + //if (stats.Count != 0) bonusStats = int.Parse(string.Join("", stats.Select(stat => ((int)stat + 1).ToString("D2")))); + var limitedStats = stats.Take(3).Select(stat => ((int)stat + 1).ToString("D2")); + if (limitedStats.Any()) + { + bonusStats = int.Parse(string.Join("", limitedStats)); + } } } }