Merge branch 'refs/heads/main' into digest-refactor

# Conflicts:
#	ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs
This commit is contained in:
Slendy 2024-07-03 22:16:32 -05:00
commit 0e0a900f67
No known key found for this signature in database
GPG key ID: 7288D68361B91428
86 changed files with 1477 additions and 170 deletions

View file

@ -114,6 +114,9 @@ public class CommentController : GameController
{
GameTokenEntity token = this.GetToken();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
GameComment? comment = await this.DeserializeBody<GameComment>();
if (comment?.Message == null) return this.BadRequest();
@ -154,6 +157,9 @@ public class CommentController : GameController
{
GameTokenEntity token = this.GetToken();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
if ((slotId == 0 || SlotHelper.IsTypeInvalid(slotType)) == (username == null)) return this.BadRequest();
CommentEntity? comment = await this.database.Comments.FirstOrDefaultAsync(c => c.CommentId == commentId);