From cf37aa308be5aa2d9c976162d22bb2ea14bfe9a4 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 6 Oct 2021 02:40:25 -0400 Subject: [PATCH] fix LBP1 slot serialization --- ProjectLighthouse.sln.DotSettings | 1 + ProjectLighthouse/Types/User.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ProjectLighthouse.sln.DotSettings b/ProjectLighthouse.sln.DotSettings index 1c039f54..619794f7 100644 --- a/ProjectLighthouse.sln.DotSettings +++ b/ProjectLighthouse.sln.DotSettings @@ -1,3 +1,4 @@  True + True True \ No newline at end of file diff --git a/ProjectLighthouse/Types/User.cs b/ProjectLighthouse/Types/User.cs index aa391c1e..c9c845f6 100644 --- a/ProjectLighthouse/Types/User.cs +++ b/ProjectLighthouse/Types/User.cs @@ -33,7 +33,7 @@ namespace ProjectLighthouse.Types { public int FreeSlots => EntitledSlots - this.UsedSlots; private static string[] slotTypes = { - "lbp1", +// "lbp1", "lbp2", "lbp3", "crossControl" @@ -41,12 +41,13 @@ namespace ProjectLighthouse.Types { private string SerializeSlots() { string slots = string.Empty; - - foreach(string s in slotTypes) { - string slotType = s; // vars in foreach are immutable, define helper var - + + slots += LbpSerializer.StringElement("lbp1UsedSlots", this.UsedSlots); + slots += LbpSerializer.StringElement("entitledSlots", EntitledSlots); + slots += LbpSerializer.StringElement("freeSlots", this.FreeSlots); + + foreach(string slotType in slotTypes) { slots += LbpSerializer.StringElement(slotType + "UsedSlots", this.UsedSlots); - if(slotType == "lbp1") slotType = ""; slots += LbpSerializer.StringElement(slotType + "EntitledSlots", EntitledSlots); // ReSharper disable once StringLiteralTypo slots += LbpSerializer.StringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0);