From 98a7f95e6522fa877180fb82d678238d58d44bd4 Mon Sep 17 00:00:00 2001 From: Slendy Date: Tue, 25 Jun 2024 04:44:03 -0500 Subject: [PATCH] Disable comments on story levels if comments are turned off in config. --- .../Types/Serialization/GameDeveloperSlot.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse/Types/Serialization/GameDeveloperSlot.cs b/ProjectLighthouse/Types/Serialization/GameDeveloperSlot.cs index 3de55ee46..93f8436c9 100644 --- a/ProjectLighthouse/Types/Serialization/GameDeveloperSlot.cs +++ b/ProjectLighthouse/Types/Serialization/GameDeveloperSlot.cs @@ -1,6 +1,8 @@ -using System.Linq; +using System; +using System.Linq; using System.Threading.Tasks; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Types.Entities.Profile; @@ -30,6 +32,13 @@ public class GameDeveloperSlot : SlotBase, INeedsPreparationForSerialization [XmlElement("photoCount")] public int PhotoCount { get; set; } + [XmlElement("commentsEnabled")] + public bool CommentsEnabled + { + get => ServerConfiguration.Instance.UserGeneratedContentLimits.LevelCommentsEnabled; + set => throw new NotSupportedException(); + } + public async Task PrepareSerialization(DatabaseContext database) { if (this.SlotId == 0 || this.InternalSlotId == 0) return;