From 1a231088209e1ef7aeeb9804cfd9113c806bfbcd Mon Sep 17 00:00:00 2001 From: jvyden Date: Fri, 29 Oct 2021 16:46:29 -0400 Subject: [PATCH] Fix north pole bug --- ProjectLighthouse/Controllers/PublishController.cs | 7 +++++-- ProjectLighthouse/Types/Profiles/Location.cs | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/PublishController.cs index 38bdc7e2..0dc6f35c 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/PublishController.cs @@ -65,6 +65,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers { if(oldSlot == null) return this.NotFound(); if(oldSlot.CreatorId != user.UserId) return this.BadRequest(); + oldSlot.Location.X = slot.Location.X; + oldSlot.Location.Y = slot.Location.Y; + slot.CreatorId = oldSlot.CreatorId; slot.LocationId = oldSlot.LocationId; slot.SlotId = oldSlot.SlotId; @@ -77,8 +80,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers { //TODO: parse location in body Location l = new() { - X = 0, - Y = 0, + X = slot.Location.X, + Y = slot.Location.Y, }; this.database.Locations.Add(l); await this.database.SaveChangesAsync(); diff --git a/ProjectLighthouse/Types/Profiles/Location.cs b/ProjectLighthouse/Types/Profiles/Location.cs index cfaefa68..a4a9b20d 100644 --- a/ProjectLighthouse/Types/Profiles/Location.cs +++ b/ProjectLighthouse/Types/Profiles/Location.cs @@ -1,12 +1,19 @@ +using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Serialization; namespace LBPUnion.ProjectLighthouse.Types.Profiles { /// /// The location of a slot on a planet. /// + [XmlRoot("location"), XmlType("location")] public class Location { + [XmlIgnore] public int Id { get; set; } + + [XmlElement("x")] public int X { get; set; } + + [XmlElement("y")] public int Y { get; set; } public string Serialize() {