From 941aa6829bf55a02dec83434a2c3279b3fc54780 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sat, 16 Oct 2021 19:21:22 -0400 Subject: [PATCH 1/3] Fix DbConnectionString getter --- ProjectLighthouse/Types/ServerSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse/Types/ServerSettings.cs b/ProjectLighthouse/Types/ServerSettings.cs index bde98a9c..d1e5f71f 100644 --- a/ProjectLighthouse/Types/ServerSettings.cs +++ b/ProjectLighthouse/Types/ServerSettings.cs @@ -16,7 +16,7 @@ namespace ProjectLighthouse.Types { public static string DbConnectionString { get { if(dbConnectionString == null) { - return dbConnectionString = Environment.GetEnvironmentVariable("") ?? ""; + return dbConnectionString = Environment.GetEnvironmentVariable("LIGHTHOUSE_DB_CONNECTION_STRING") ?? ""; } return dbConnectionString; } From 562b93dfeec71e9f4f888ef6f2da16aa9571ea6e Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 17 Oct 2021 00:28:17 -0400 Subject: [PATCH 2/3] Level loading now works --- ProjectLighthouse/Types/Slot.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ProjectLighthouse/Types/Slot.cs b/ProjectLighthouse/Types/Slot.cs index eb090eab..64e5c01c 100644 --- a/ProjectLighthouse/Types/Slot.cs +++ b/ProjectLighthouse/Types/Slot.cs @@ -85,6 +85,7 @@ namespace ProjectLighthouse.Types { LbpSerializer.StringElement("npHandle", Creator.Username) + LbpSerializer.StringElement("description", Description) + LbpSerializer.StringElement("icon", IconHash) + + LbpSerializer.StringElement("rootLevel", RootLevel) + LbpSerializer.StringElement("resource", Resource) + LbpSerializer.StringElement("location", Location.Serialize()) + LbpSerializer.StringElement("initiallyLocked", InitiallyLocked) + From c4497566e85d63f0cb9ba9bf0b65d22c2b7b8b71 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 17 Oct 2021 01:15:01 -0400 Subject: [PATCH 3/3] Fix level uploading --- ProjectLighthouse/Controllers/PublishController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/PublishController.cs index dd1fae0b..f94e4292 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/PublishController.cs @@ -25,7 +25,9 @@ namespace ProjectLighthouse.Controllers { Slot slot = await this.GetSlotFromBody(); if(slot == null) return this.BadRequest(); // if the level cant be parsed then it obviously cant be uploaded - return this.Ok(LbpSerializer.TaggedStringElement("slot", "", "type", "user")); + string resource = LbpSerializer.StringElement("resource", slot.Resource); + + return this.Ok(LbpSerializer.TaggedStringElement("slot", resource, "type", "user")); } /// @@ -56,7 +58,9 @@ namespace ProjectLighthouse.Controllers { [HttpPost("unpublish/{id:int}")] public async Task Unpublish(int id) { - Slot slot = await database.Slots.FirstOrDefaultAsync(s => s.SlotId == id); + Slot slot = await database.Slots + .Include(s => s.Location) + .FirstOrDefaultAsync(s => s.SlotId == id); database.Locations.Remove(slot.Location); database.Slots.Remove(slot);