Allow user to modify their planet

This commit is contained in:
jvyden 2021-10-14 21:26:14 -04:00
parent 7a7c68fc91
commit 115c46ead0
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 10 additions and 0 deletions

1
DatabaseMigrations/6.sql Normal file
View file

@ -0,0 +1 @@
ALTER TABLE Users ADD COLUMN PlanetHash text not null

View file

@ -16,6 +16,7 @@ namespace ProjectLighthouse.Controllers {
}
[HttpPost("filterResources")]
[HttpPost("showNotUploaded")]
public async Task<IActionResult> FilterResources() {
return this.Ok(await new StreamReader(Request.Body).ReadToEndAsync());
}

View file

@ -85,6 +85,10 @@ namespace ProjectLighthouse.Controllers {
user.IconHash = await reader.GetValueAsync();
break;
}
case "planets": {
user.PlanetHash = await reader.GetValueAsync();
break;
}
}
break;
case XmlNodeType.EndElement:

View file

@ -42,6 +42,9 @@ namespace ProjectLighthouse.Types {
public int StaffChallengeGoldCount { get; set; }
public int StaffChallengeSilverCount { get; set; }
public int StaffChallengeBronzeCount { get; set; }
public string PlanetHash { get; set; }
// [NotMapped]
public readonly ClientsConnected ClientsConnected = new();
@ -107,6 +110,7 @@ namespace ProjectLighthouse.Types {
LbpSerializer.StringElement("staffChallengeGoldCount", this.StaffChallengeGoldCount) +
LbpSerializer.StringElement("staffChallengeSilverCount", this.StaffChallengeSilverCount) +
LbpSerializer.StringElement("staffChallengeBronzeCount", this.StaffChallengeBronzeCount) +
LbpSerializer.StringElement("planets", this.PlanetHash) +
LbpSerializer.BlankElement("photos") +
this.ClientsConnected.Serialize();