Fix serialization of plays in slots

This commit is contained in:
jvyden 2022-02-21 20:04:23 -05:00
commit 3bedec5f70
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 22 additions and 8 deletions

View file

@ -142,4 +142,5 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unheart/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Unheart/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unpublish/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Unpublish/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unpushed/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Unpushed/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=yourlbp/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=yourthumb/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/UserDictionary/Words/=yourthumb/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View file

@ -306,21 +306,34 @@ public class Slot
LbpSerializer.StringElement("commentsEnabled", ServerSettings.Instance.LevelCommentsEnabled) + LbpSerializer.StringElement("commentsEnabled", ServerSettings.Instance.LevelCommentsEnabled) +
LbpSerializer.StringElement("reviewCount", this.ReviewCount); LbpSerializer.StringElement("reviewCount", this.ReviewCount);
int yourPlays;
int plays;
int playsComplete;
int playsUnique;
if (gameVersion == GameVersion.LittleBigPlanetVita) if (gameVersion == GameVersion.LittleBigPlanetVita)
{ {
slotData += LbpSerializer.StringElement("yourlbp2PlayCount", yourVisitedStats?.PlaysLBPVita) + yourPlays = yourVisitedStats?.PlaysLBPVita ?? 0;
LbpSerializer.StringElement("lbp2PlayCount", this.PlaysLBPVita) + plays = this.PlaysLBPVita;
LbpSerializer.StringElement("lbp2CompletionCount", this.PlaysLBPVitaComplete) + playsComplete = this.PlaysLBPVitaComplete;
LbpSerializer.StringElement("lbp2UniquePlayCount", this.PlaysLBPVitaUnique); playsUnique = this.PlaysLBPVitaUnique;
} }
else else
{ {
slotData += LbpSerializer.StringElement("yourlbp2PlayCount", yourVisitedStats?.PlaysLBP2) + yourPlays = yourVisitedStats?.PlaysLBP2 ?? 0;
LbpSerializer.StringElement("lbp2PlayCount", this.PlaysLBP2) + plays = this.PlaysLBP2;
LbpSerializer.StringElement("lbp2CompletionCount", this.PlaysLBP2Complete) + playsComplete = this.PlaysLBP2Complete;
LbpSerializer.StringElement("lbp2UniquePlayCount", this.PlaysLBP2Unique); // not actually used ingame, as per above comment playsUnique = this.PlaysLBP2Unique;
} }
slotData += LbpSerializer.StringElement("yourlbp2PlayCount", yourPlays) +
LbpSerializer.StringElement("lbp2PlayCount", plays) +
LbpSerializer.StringElement("playCount", plays) +
LbpSerializer.StringElement("lbp2CompletionCount", playsComplete) +
LbpSerializer.StringElement("completionCount", playsComplete) +
LbpSerializer.StringElement("lbp2UniquePlayCount", playsUnique) + // not actually used ingame, as per above comment
LbpSerializer.StringElement("uniquePlayCount", playsUnique);
return LbpSerializer.TaggedStringElement("slot", slotData, "type", "user"); return LbpSerializer.TaggedStringElement("slot", slotData, "type", "user");
} }
} }