diff --git a/WFDS.Server/Controllers/ActorController.cs b/WFDS.Server/Controllers/ActorController.cs index fbaa46f..4cd6632 100644 --- a/WFDS.Server/Controllers/ActorController.cs +++ b/WFDS.Server/Controllers/ActorController.cs @@ -10,7 +10,7 @@ namespace WFDS.Server.Controllers; [ApiController] [Tags("actor")] [Route("api/v1/actor")] -public class ActorController(IActorManager manager) : Controller +public sealed class ActorController(IActorManager manager) : Controller { [HttpGet("list")] public IActionResult GetActors() diff --git a/WFDS.Server/Controllers/ChalkController.cs b/WFDS.Server/Controllers/ChalkController.cs index bfe8e76..61cd662 100644 --- a/WFDS.Server/Controllers/ChalkController.cs +++ b/WFDS.Server/Controllers/ChalkController.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.Controllers; [ApiController] [Route("api/v1/chalk")] [Tags("chalk")] -public class ChalkController(ICanvasManager canvas) : Controller +public sealed class ChalkController(ICanvasManager canvas) : ControllerBase { [HttpDelete] [SwaggerOperation("clear all chalk")] diff --git a/WFDS.Server/Controllers/EventController.cs b/WFDS.Server/Controllers/EventController.cs index c5dbd33..5268cad 100644 --- a/WFDS.Server/Controllers/EventController.cs +++ b/WFDS.Server/Controllers/EventController.cs @@ -8,7 +8,7 @@ namespace WFDS.Server.Controllers; [ApiController] [Tags("event")] [Route("api/v1/event")] -public class EventController(IActorSpawnManager manager) : Controller +public sealed class EventController(IActorSpawnManager manager) : Controller { [HttpPost("bird")] [SwaggerOperation("spawn ambient bird actor")] diff --git a/WFDS.Server/Controllers/ServerController.cs b/WFDS.Server/Controllers/ServerController.cs index a0b0dc1..fbdf616 100644 --- a/WFDS.Server/Controllers/ServerController.cs +++ b/WFDS.Server/Controllers/ServerController.cs @@ -6,7 +6,7 @@ namespace WFDS.Server.Controllers; [ApiController] [Tags("server")] [Route("api/v1/server")] -public class ServerController(IHostApplicationLifetime lifetime) : Controller +public sealed class ServerController(IHostApplicationLifetime lifetime) : Controller { [HttpGet("status")] public IActionResult GetStatus() diff --git a/WFDS.Server/Controllers/SessionController.cs b/WFDS.Server/Controllers/SessionController.cs index be6d14e..9687c87 100644 --- a/WFDS.Server/Controllers/SessionController.cs +++ b/WFDS.Server/Controllers/SessionController.cs @@ -10,7 +10,7 @@ namespace WFDS.Server.Controllers; [Tags("session")] [Route("api/v1/session")] -public class SessionController(SessionManager manager, LobbyManager lobby) : Controller +public sealed class SessionController(SessionManager manager, LobbyManager lobby) : Controller { [HttpGet("info")] [SwaggerOperation("get lobby info")] diff --git a/WFDS.Server/Core/Chalk/Canvas.cs b/WFDS.Server/Core/Chalk/Canvas.cs index 2bf830a..b83d85e 100644 --- a/WFDS.Server/Core/Chalk/Canvas.cs +++ b/WFDS.Server/Core/Chalk/Canvas.cs @@ -4,7 +4,7 @@ namespace WFDS.Server.Core.Chalk; -public class Canvas +public sealed class Canvas { public long CanvasId { get; init; } private Dictionary<(int, int), long> Data { get; } = []; diff --git a/WFDS.Server/Core/WebExceptionHandler.cs b/WFDS.Server/Core/WebExceptionHandler.cs index d8f3e4d..ed541b5 100644 --- a/WFDS.Server/Core/WebExceptionHandler.cs +++ b/WFDS.Server/Core/WebExceptionHandler.cs @@ -2,14 +2,14 @@ namespace WFDS.Server.Core; -public class WebExceptionHandler : IExceptionHandler +public sealed class WebExceptionHandler : IExceptionHandler { - public async ValueTask TryHandleAsync(HttpContext httpContext, Exception ex, CancellationToken cancellationToken) + public async ValueTask TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken) { httpContext.Response.StatusCode = 500 ; await httpContext.Response.WriteAsJsonAsync(new { - error = ex.Message + error = exception.Message }, cancellationToken); return true; } diff --git a/WFDS.Server/EventHandler/ActorCreateBroadcast.cs b/WFDS.Server/EventHandler/ActorCreateBroadcast.cs index cb8ed92..e47f9bb 100644 --- a/WFDS.Server/EventHandler/ActorCreateBroadcast.cs +++ b/WFDS.Server/EventHandler/ActorCreateBroadcast.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.EventHandler; -public class ActorCreateBroadcast(IActorManager actorManager, SessionManager sessionManager, LobbyManager lobby, SteamManager steam) : GameEventHandler +public sealed class ActorCreateBroadcast(IActorManager actorManager, SessionManager sessionManager, LobbyManager lobby, SteamManager steam) : GameEventHandler { protected override void Handle(ActorCreateEvent e) { diff --git a/WFDS.Server/EventHandler/ActorRemoveBroadcast.cs b/WFDS.Server/EventHandler/ActorRemoveBroadcast.cs index f43f9cb..ada806a 100644 --- a/WFDS.Server/EventHandler/ActorRemoveBroadcast.cs +++ b/WFDS.Server/EventHandler/ActorRemoveBroadcast.cs @@ -6,7 +6,7 @@ namespace WFDS.Server.EventHandler; -public class ActorRemoveBroadcast(SessionManager sessionManager, LobbyManager lobby, SteamManager steam) : GameEventHandler +public sealed class ActorRemoveBroadcast(SessionManager sessionManager, LobbyManager lobby, SteamManager steam) : GameEventHandler { protected override void Handle(ActorRemoveEvent e) { diff --git a/WFDS.Server/EventHandler/AddPlayerToDb.cs b/WFDS.Server/EventHandler/AddPlayerToDb.cs index 58bf1c9..30c2473 100644 --- a/WFDS.Server/EventHandler/AddPlayerToDb.cs +++ b/WFDS.Server/EventHandler/AddPlayerToDb.cs @@ -5,7 +5,7 @@ namespace WFDS.Server.EventHandler; -public class AddPlayerToDb(DatabaseContext dbContext) : GameEventHandler +public sealed class AddPlayerToDb(DatabaseContext dbContext) : GameEventHandler { protected override void Handle(PlayerJoinedEvent e) { diff --git a/WFDS.Server/EventHandler/CleanupLeavePlayerActors.cs b/WFDS.Server/EventHandler/CleanupLeavePlayerActors.cs index 0b86281..64a2dc5 100644 --- a/WFDS.Server/EventHandler/CleanupLeavePlayerActors.cs +++ b/WFDS.Server/EventHandler/CleanupLeavePlayerActors.cs @@ -5,7 +5,7 @@ namespace WFDS.Server.EventHandler; -public class CleanupLeavePlayerActors(ILogger logger, IActorManager actorManager) : GameEventHandler +public sealed class CleanupLeavePlayerActors(ILogger logger, IActorManager actorManager) : GameEventHandler { protected override void Handle(PlayerLeaveEvent e) { diff --git a/WFDS.Server/EventHandler/LoadBanListFromDb.cs b/WFDS.Server/EventHandler/LoadBanListFromDb.cs index d0301a6..4cc694d 100644 --- a/WFDS.Server/EventHandler/LoadBanListFromDb.cs +++ b/WFDS.Server/EventHandler/LoadBanListFromDb.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.EventHandler; -public class LoadBanListFromDb(ILogger logger, DatabaseContext dbContext, SessionManager sessionManager) : GameEventHandler +public sealed class LoadBanListFromDb(ILogger logger, DatabaseContext dbContext, SessionManager sessionManager) : GameEventHandler { protected override void Handle(LobbyCreatedEvent e) { diff --git a/WFDS.Server/EventHandler/PlayerJoinUpdateTitle.cs b/WFDS.Server/EventHandler/PlayerJoinUpdateTitle.cs index ed7715e..b835d5a 100644 --- a/WFDS.Server/EventHandler/PlayerJoinUpdateTitle.cs +++ b/WFDS.Server/EventHandler/PlayerJoinUpdateTitle.cs @@ -5,7 +5,7 @@ namespace WFDS.Server.EventHandler; -public class PlayerJoinUpdateTitle(LobbyManager lobby, SessionManager session) : GameEventHandler +public sealed class PlayerJoinUpdateTitle(LobbyManager lobby, SessionManager session) : GameEventHandler { protected override void Handle(PlayerJoinedEvent e) { diff --git a/WFDS.Server/EventHandler/PlayerLeaveUpdateTitle.cs b/WFDS.Server/EventHandler/PlayerLeaveUpdateTitle.cs index ee51135..c11af09 100644 --- a/WFDS.Server/EventHandler/PlayerLeaveUpdateTitle.cs +++ b/WFDS.Server/EventHandler/PlayerLeaveUpdateTitle.cs @@ -5,7 +5,7 @@ namespace WFDS.Server.EventHandler; -public class PlayerLeaveUpdateTitle(LobbyManager lobby, SessionManager session) : GameEventHandler +public sealed class PlayerLeaveUpdateTitle(LobbyManager lobby, SessionManager session) : GameEventHandler { protected override void Handle(PlayerLeaveEvent e) { diff --git a/WFDS.Server/EventHandler/RainCloudInitializer.cs b/WFDS.Server/EventHandler/RainCloudInitializer.cs index fac35e8..d6b5c20 100644 --- a/WFDS.Server/EventHandler/RainCloudInitializer.cs +++ b/WFDS.Server/EventHandler/RainCloudInitializer.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.EventHandler; -public class RainCloudInitializer(IActorManager actorManager) : GameEventHandler +public sealed class RainCloudInitializer(IActorManager actorManager) : GameEventHandler { protected override void Handle(ActorCreateEvent e) { diff --git a/WFDS.Server/EventHandler/RainCloudMove.cs b/WFDS.Server/EventHandler/RainCloudMove.cs index da626ee..57b40b3 100644 --- a/WFDS.Server/EventHandler/RainCloudMove.cs +++ b/WFDS.Server/EventHandler/RainCloudMove.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.EventHandler; -public class RainCloudMove(IActorManager actorManager) : GameEventHandler +public sealed class RainCloudMove(IActorManager actorManager) : GameEventHandler { protected override void Handle(ActorTickEvent e) { diff --git a/WFDS.Server/EventHandler/RemoveAmbientBirdNearPlayer.cs b/WFDS.Server/EventHandler/RemoveAmbientBirdNearPlayer.cs index be77374..eb3c969 100644 --- a/WFDS.Server/EventHandler/RemoveAmbientBirdNearPlayer.cs +++ b/WFDS.Server/EventHandler/RemoveAmbientBirdNearPlayer.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.EventHandler; -public class RemoveAmbientBirdNearPlayer(ILogger logger, IActorManager actorManager) : GameEventHandler +public sealed class RemoveAmbientBirdNearPlayer(ILogger logger, IActorManager actorManager) : GameEventHandler { protected override void Handle(ActorTickEvent e) { diff --git a/WFDS.Server/EventHandler/RemovePlayerFromBannedPlayers.cs b/WFDS.Server/EventHandler/RemovePlayerFromBannedPlayers.cs index 600ef69..65dcdfa 100644 --- a/WFDS.Server/EventHandler/RemovePlayerFromBannedPlayers.cs +++ b/WFDS.Server/EventHandler/RemovePlayerFromBannedPlayers.cs @@ -5,7 +5,7 @@ namespace WFDS.Server.EventHandler; -public class RemovePlayerFromBannedPlayers(ILogger logger, DatabaseContext dbContext) : GameEventHandler +public sealed class RemovePlayerFromBannedPlayers(ILogger logger, DatabaseContext dbContext) : GameEventHandler { protected override void Handle(PlayerUnBanEvent e) { diff --git a/WFDS.Server/EventHandler/UpdateActorTransform.cs b/WFDS.Server/EventHandler/UpdateActorTransform.cs index fe71949..7c65390 100644 --- a/WFDS.Server/EventHandler/UpdateActorTransform.cs +++ b/WFDS.Server/EventHandler/UpdateActorTransform.cs @@ -4,7 +4,7 @@ namespace WFDS.Server.EventHandler; -public class UpdateActorTransform(IActorManager actorManager) : GameEventHandler +public sealed class UpdateActorTransform(IActorManager actorManager) : GameEventHandler { protected override void Handle(ActorTransformUpdateEvent e) { diff --git a/WFDS.Server/EventHandler/UpdateActorZone.cs b/WFDS.Server/EventHandler/UpdateActorZone.cs index 5a8f391..26d9d14 100644 --- a/WFDS.Server/EventHandler/UpdateActorZone.cs +++ b/WFDS.Server/EventHandler/UpdateActorZone.cs @@ -4,7 +4,7 @@ namespace WFDS.Server.EventHandler; -public class UpdateActorZone(IActorManager actorManager) : GameEventHandler +public sealed class UpdateActorZone(IActorManager actorManager) : GameEventHandler { protected override void Handle(ActorZoneUpdateEvent e) { diff --git a/WFDS.Server/EventHandler/UpdateBannedPlayer.cs b/WFDS.Server/EventHandler/UpdateBannedPlayer.cs index 2e5d835..c3ac2a8 100644 --- a/WFDS.Server/EventHandler/UpdateBannedPlayer.cs +++ b/WFDS.Server/EventHandler/UpdateBannedPlayer.cs @@ -6,7 +6,7 @@ namespace WFDS.Server.EventHandler; -public class UpdateBannedPlayer(DatabaseContext dbContext, ILogger logger) : GameEventHandler +public sealed class UpdateBannedPlayer(DatabaseContext dbContext, ILogger logger) : GameEventHandler { protected override void Handle(PlayerBanEvent e) { diff --git a/WFDS.Server/EventHandler/UpdatePlayerCosmetics.cs b/WFDS.Server/EventHandler/UpdatePlayerCosmetics.cs index 4c09f01..65c0266 100644 --- a/WFDS.Server/EventHandler/UpdatePlayerCosmetics.cs +++ b/WFDS.Server/EventHandler/UpdatePlayerCosmetics.cs @@ -4,7 +4,7 @@ namespace WFDS.Server.EventHandler; -public class UpdatePlayerCosmetics(IActorManager actorManager) : GameEventHandler +public sealed class UpdatePlayerCosmetics(IActorManager actorManager) : GameEventHandler { protected override void Handle(PlayerCosmeticsUpdateEvent e) { diff --git a/WFDS.Server/EventHandler/UpdatePlayerHeldItem.cs b/WFDS.Server/EventHandler/UpdatePlayerHeldItem.cs index 0d43deb..dc52cfb 100644 --- a/WFDS.Server/EventHandler/UpdatePlayerHeldItem.cs +++ b/WFDS.Server/EventHandler/UpdatePlayerHeldItem.cs @@ -4,7 +4,7 @@ namespace WFDS.Server.EventHandler; -public class UpdatePlayerHeldItem(IActorManager actorManager) : GameEventHandler +public sealed class UpdatePlayerHeldItem(IActorManager actorManager) : GameEventHandler { protected override void Handle(PlayerHeldItemUpdateEvent e) { diff --git a/WFDS.Server/PacketHandler/ActorActionHandler.cs b/WFDS.Server/PacketHandler/ActorActionHandler.cs index 4a257dc..673df58 100644 --- a/WFDS.Server/PacketHandler/ActorActionHandler.cs +++ b/WFDS.Server/PacketHandler/ActorActionHandler.cs @@ -12,7 +12,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("actor_action")] -public class ActorActionHandler(ILogger logger, IActorManager actorManager, SteamManager steam) : PacketHandler +public sealed class ActorActionHandler(ILogger logger, IActorManager actorManager, SteamManager steam) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, ActorActionPacket packet) { diff --git a/WFDS.Server/PacketHandler/ActorRequestSendHandler.cs b/WFDS.Server/PacketHandler/ActorRequestSendHandler.cs index 33ffd89..3699663 100644 --- a/WFDS.Server/PacketHandler/ActorRequestSendHandler.cs +++ b/WFDS.Server/PacketHandler/ActorRequestSendHandler.cs @@ -9,7 +9,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("actor_request_send")] -public class ActorRequestSendHandler(ILogger logger, IActorManager actorManager, SessionManager sessionManager) : PacketHandler +public sealed class ActorRequestSendHandler(ILogger logger, IActorManager actorManager, SessionManager sessionManager) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, ActorRequestSendPacket packet) { diff --git a/WFDS.Server/PacketHandler/ActorUpdateHandler.cs b/WFDS.Server/PacketHandler/ActorUpdateHandler.cs index a6f79c0..b0c5464 100644 --- a/WFDS.Server/PacketHandler/ActorUpdateHandler.cs +++ b/WFDS.Server/PacketHandler/ActorUpdateHandler.cs @@ -9,7 +9,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("actor_update")] -public class ActorUpdateHandler(IActorManager actorManager) : PacketHandler +public sealed class ActorUpdateHandler(IActorManager actorManager) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, ActorUpdatePacket packet) { diff --git a/WFDS.Server/PacketHandler/ChalkPacketHandler.cs b/WFDS.Server/PacketHandler/ChalkPacketHandler.cs index 754936c..a7ce307 100644 --- a/WFDS.Server/PacketHandler/ChalkPacketHandler.cs +++ b/WFDS.Server/PacketHandler/ChalkPacketHandler.cs @@ -6,7 +6,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("chalk_packet")] -public class ChalkPacketHandler(ICanvasManager canvas, LobbyManager lobby, SessionManager session) : PacketHandler +public sealed class ChalkPacketHandler(ICanvasManager canvas, LobbyManager lobby, SessionManager session) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, ChalkPacket packet) { diff --git a/WFDS.Server/PacketHandler/HandshakeHandler.cs b/WFDS.Server/PacketHandler/HandshakeHandler.cs index a2fe428..4d5632e 100644 --- a/WFDS.Server/PacketHandler/HandshakeHandler.cs +++ b/WFDS.Server/PacketHandler/HandshakeHandler.cs @@ -6,7 +6,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("handshake")] -public class HandshakeHandler(ILogger logger) : PacketHandler +public sealed class HandshakeHandler(ILogger logger) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, HandshakePacket packet) { diff --git a/WFDS.Server/PacketHandler/InstanceActorHandler.cs b/WFDS.Server/PacketHandler/InstanceActorHandler.cs index f6afc2d..e343a41 100644 --- a/WFDS.Server/PacketHandler/InstanceActorHandler.cs +++ b/WFDS.Server/PacketHandler/InstanceActorHandler.cs @@ -8,7 +8,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("instance_actor")] -public class InstanceActorHandler(ILogger logger, IActorManager actorManager, SessionManager sessionManager) : PacketHandler +public sealed class InstanceActorHandler(ILogger logger, IActorManager actorManager, SessionManager sessionManager) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, InstanceActorPacket packet) { diff --git a/WFDS.Server/PacketHandler/LetterReceivedHandler.cs b/WFDS.Server/PacketHandler/LetterReceivedHandler.cs index 9e0c5ba..6950e4f 100644 --- a/WFDS.Server/PacketHandler/LetterReceivedHandler.cs +++ b/WFDS.Server/PacketHandler/LetterReceivedHandler.cs @@ -8,7 +8,7 @@ namespace WFDS.Server.Handlers; [PacketType("letter_recieved")] -public class LetterReceivedHandler(ILogger logger, SessionManager sessionManager, SteamManager steam) : PacketHandler +public sealed class LetterReceivedHandler(ILogger logger, SessionManager sessionManager, SteamManager steam) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, LetterReceivedPacket packet) { diff --git a/WFDS.Server/PacketHandler/MessageHandler.cs b/WFDS.Server/PacketHandler/MessageHandler.cs index 0c2c6bb..3d92c10 100644 --- a/WFDS.Server/PacketHandler/MessageHandler.cs +++ b/WFDS.Server/PacketHandler/MessageHandler.cs @@ -8,7 +8,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("message")] -public class MessageHandler(ILogger logger) : PacketHandler +public sealed class MessageHandler(ILogger logger) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, MessagePacket packet) { diff --git a/WFDS.Server/PacketHandler/NewPlayerJoinHandler.cs b/WFDS.Server/PacketHandler/NewPlayerJoinHandler.cs index b80e443..9dc0b20 100644 --- a/WFDS.Server/PacketHandler/NewPlayerJoinHandler.cs +++ b/WFDS.Server/PacketHandler/NewPlayerJoinHandler.cs @@ -9,7 +9,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("new_player_join")] -public class NewPlayerJoinHandler(ILogger logger, ICanvasManager canvas, SessionManager session) : PacketHandler +public sealed class NewPlayerJoinHandler(ILogger logger, ICanvasManager canvas, SessionManager session) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, NewPlayerJoinPacket packet) { diff --git a/WFDS.Server/PacketHandler/RequestActorsHandler.cs b/WFDS.Server/PacketHandler/RequestActorsHandler.cs index f1cc7cf..8931251 100644 --- a/WFDS.Server/PacketHandler/RequestActorsHandler.cs +++ b/WFDS.Server/PacketHandler/RequestActorsHandler.cs @@ -8,7 +8,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("request_actors")] -public class RequestActorsHandler(ILogger logger, IActorManager actorManager, SessionManager sessionManager) : PacketHandler +public sealed class RequestActorsHandler(ILogger logger, IActorManager actorManager, SessionManager sessionManager) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, RequestActorsPacket _) { diff --git a/WFDS.Server/PacketHandler/RequestPingHandler.cs b/WFDS.Server/PacketHandler/RequestPingHandler.cs index fdfa191..9e3970b 100644 --- a/WFDS.Server/PacketHandler/RequestPingHandler.cs +++ b/WFDS.Server/PacketHandler/RequestPingHandler.cs @@ -7,7 +7,7 @@ namespace WFDS.Server.PacketHandler; [PacketType("request_ping")] -public class RequestPingHandler(SessionManager sessionManager, SteamManager steam) : PacketHandler +public sealed class RequestPingHandler(SessionManager sessionManager, SteamManager steam) : PacketHandler { protected override void Handle(Session sender, NetChannel channel, RequestPingPacket packet) {