Skip to content

Commit

Permalink
Disable comments on story levels if comments are turned off in config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Slendy committed Jun 25, 2024
1 parent 541172b commit 98a7f95
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ProjectLighthouse/Types/Serialization/GameDeveloperSlot.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 98a7f95

Please sign in to comment.