diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs index 8dec6fee..6468e022 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs @@ -229,6 +229,9 @@ public class PublishController : ControllerBase slot.MaximumPlayers = 4; } + slot.MinimumPlayers = Math.Clamp(slot.MinimumPlayers, 1, 4); + slot.MaximumPlayers = Math.Clamp(slot.MaximumPlayers, 1, 4); + this.database.Entry(oldSlot).CurrentValues.SetValues(slot); await this.database.SaveChangesAsync(); return this.Ok(oldSlot.Serialize(token.GameVersion)); @@ -259,6 +262,9 @@ public class PublishController : ControllerBase slot.MaximumPlayers = 4; } + slot.MinimumPlayers = Math.Clamp(slot.MinimumPlayers, 1, 4); + slot.MaximumPlayers = Math.Clamp(slot.MaximumPlayers, 1, 4); + this.database.Slots.Add(slot); await this.database.SaveChangesAsync();