diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/PublishController.cs index 98f490e2..ecf7a66d 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/PublishController.cs @@ -9,6 +9,7 @@ using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Profiles; +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -35,6 +36,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers User? user = await this.database.UserFromGameRequest(this.Request); if (user == null) return this.StatusCode(403, ""); + if (user.UsedSlots >= ServerSettings.Instance.EntitledSlots) return this.BadRequest(); + Slot? slot = await this.GetSlotFromBody(); if (slot == null) return this.BadRequest(); // if the level cant be parsed then it obviously cant be uploaded @@ -74,6 +77,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers User user = userAndToken.Value.Item1; GameToken gameToken = userAndToken.Value.Item2; + if (user.UsedSlots >= ServerSettings.Instance.EntitledSlots) return this.BadRequest(); + Slot? slot = await this.GetSlotFromBody(); if (slot?.Location == null) return this.BadRequest();