Make user serialize fully

This commit is contained in:
jvyden 2021-10-06 02:28:42 -04:00
parent ceac914475
commit 61a30c260b
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 31 additions and 3 deletions

View file

@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=lolcatftw/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View file

@ -18,6 +18,9 @@ namespace ProjectLighthouse {
public int PhotosWithMeCount { get; set; }
public bool CommentsEnabled { get; set; }
public Location Location { get; set; }
public int FavouriteSlotCount { get; set; }
public int FavouriteUserCount { get; set; }
public int lolcatftwCount { get; set; }
public string Pins { get; set; }
public int StaffChallengeGoldCount { get; set; }
public int StaffChallengeSilverCount { get; set; }
@ -40,8 +43,11 @@ namespace ProjectLighthouse {
private string SerializeSlots() {
string slots = string.Empty;
foreach(string slotType in slotTypes) {
foreach(string s in slotTypes) {
string slotType = s; // vars in foreach are immutable, define helper var
slots += LbpSerializer.GetStringElement(slotType + "UsedSlots", UsedSlots);
if(slotType == "lbp1") slotType = "";
slots += LbpSerializer.GetStringElement(slotType + "EntitledSlots", EntitledSlots);
// ReSharper disable once StringLiteralTypo
slots += LbpSerializer.GetStringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0);
@ -55,8 +61,29 @@ namespace ProjectLighthouse {
public string Serialize() {
string user = LbpSerializer.GetTaggedStringElement("npHandle", Username, "icon", IconHash) +
LbpSerializer.GetStringElement("game", Game) +
this.SerializeSlots() +
LbpSerializer.GetStringElement("game", Game);
LbpSerializer.GetStringElement("lists", Lists) +
LbpSerializer.GetStringElement("lists_quota", ListsQuota) +
LbpSerializer.GetStringElement("heartCount", HeartCount) +
LbpSerializer.GetStringElement("yay2", YayHash) +
LbpSerializer.GetStringElement("boo2", BooHash) +
LbpSerializer.GetStringElement("biography", Biography) +
LbpSerializer.GetStringElement("reviewCount", ReviewCount) +
LbpSerializer.GetStringElement("commentCount", CommentCount) +
LbpSerializer.GetStringElement("photosByMeCount", PhotosByMeCount) +
LbpSerializer.GetStringElement("photosWithMeCount", PhotosWithMeCount) +
LbpSerializer.GetStringElement("commentsEnabled", CommentsEnabled) +
Location.Serialize() +
LbpSerializer.GetStringElement("favouriteSlotCount", FavouriteSlotCount) +
LbpSerializer.GetStringElement("favouriteUserCount", FavouriteUserCount) +
LbpSerializer.GetStringElement("lolcatftwCount", lolcatftwCount) +
LbpSerializer.GetStringElement("pins", Pins) +
LbpSerializer.GetStringElement("staffChallengeGoldCount", StaffChallengeGoldCount) +
LbpSerializer.GetStringElement("staffChallengeSilverCount", StaffChallengeSilverCount) +
LbpSerializer.GetStringElement("staffChallengeBronzeCount", StaffChallengeBronzeCount) +
LbpSerializer.GetStringElement("photos", "") +
this.ClientsConnected.Serialize();
return LbpSerializer.GetTaggedStringElement("user", user, "type", "user");
}