From 47676e38e98ce66f5aaf6af9c707b6a5b03170ae Mon Sep 17 00:00:00 2001 From: Fraser Molyneux Date: Sat, 6 Jan 2024 18:20:42 +0000 Subject: [PATCH] Adding BotEnabled property --- .../Constants/GameServerFilter.cs | 3 ++- .../Models/GameServers/CreateGameServerDto.cs | 3 +++ .../Models/GameServers/EditGameServerDto.cs | 3 +++ .../Models/GameServers/GameServerDto.cs | 3 +++ src/repository-webapi/Controllers/GameServersController.cs | 3 +++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/repository-webapi-abstractions/Constants/GameServerFilter.cs b/src/repository-webapi-abstractions/Constants/GameServerFilter.cs index 53ce1eb7..f5e3f843 100644 --- a/src/repository-webapi-abstractions/Constants/GameServerFilter.cs +++ b/src/repository-webapi-abstractions/Constants/GameServerFilter.cs @@ -4,6 +4,7 @@ public enum GameServerFilter { LiveTrackingEnabled, PortalServerListEnabled, - BannerServerListEnabled + BannerServerListEnabled, + BotEnabled } } diff --git a/src/repository-webapi-abstractions/Models/GameServers/CreateGameServerDto.cs b/src/repository-webapi-abstractions/Models/GameServers/CreateGameServerDto.cs index ac28f4ad..ace5c7b2 100644 --- a/src/repository-webapi-abstractions/Models/GameServers/CreateGameServerDto.cs +++ b/src/repository-webapi-abstractions/Models/GameServers/CreateGameServerDto.cs @@ -50,6 +50,9 @@ public CreateGameServerDto(string title, GameType gameType, string hostname, int [JsonProperty] public string? HtmlBanner { get; set; } + [JsonProperty] + public bool BotEnabled { get; set; } + [JsonProperty] public bool BannerServerListEnabled { get; set; } diff --git a/src/repository-webapi-abstractions/Models/GameServers/EditGameServerDto.cs b/src/repository-webapi-abstractions/Models/GameServers/EditGameServerDto.cs index ad33d78a..b18e22e0 100644 --- a/src/repository-webapi-abstractions/Models/GameServers/EditGameServerDto.cs +++ b/src/repository-webapi-abstractions/Models/GameServers/EditGameServerDto.cs @@ -42,6 +42,9 @@ public EditGameServerDto(Guid gameServerId) [JsonProperty] public string? HtmlBanner { get; set; } + [JsonProperty] + public bool? BotEnabled { get; set; } + [JsonProperty] public bool? BannerServerListEnabled { get; set; } diff --git a/src/repository-webapi-abstractions/Models/GameServers/GameServerDto.cs b/src/repository-webapi-abstractions/Models/GameServers/GameServerDto.cs index 6436154a..27a0c7b9 100644 --- a/src/repository-webapi-abstractions/Models/GameServers/GameServerDto.cs +++ b/src/repository-webapi-abstractions/Models/GameServers/GameServerDto.cs @@ -51,6 +51,9 @@ public class GameServerDto [JsonProperty] public string? HtmlBanner { get; internal set; } + [JsonProperty] + public bool BotEnabled { get; set; } + [JsonProperty] public bool BannerServerListEnabled { get; internal set; } diff --git a/src/repository-webapi/Controllers/GameServersController.cs b/src/repository-webapi/Controllers/GameServersController.cs index d8ed5791..99773111 100644 --- a/src/repository-webapi/Controllers/GameServersController.cs +++ b/src/repository-webapi/Controllers/GameServersController.cs @@ -242,6 +242,9 @@ private IQueryable ApplyFilter(IQueryable query, GameTyp case GameServerFilter.LiveTrackingEnabled: query = query.Where(s => s.LiveTrackingEnabled).AsQueryable(); break; + case GameServerFilter.BotEnabled: + query = query.Where(s => s.BotEnabled).AsQueryable(); + break; } return query;