From fd2e5636df50a6476caa8d598825bb929f9e7ce7 Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 31 Jan 2022 22:35:51 -0500 Subject: [PATCH] Tidy up controllers --- .../ClientConfigurationController.cs | 2 +- .../{ => GameApi}/CommentController.cs | 2 +- .../{ => GameApi}/DeveloperController.cs | 2 +- .../{ => GameApi}/FriendsController.cs | 2 +- .../{ => GameApi}/LoginController.cs | 2 +- .../Matching}/EnterLevelController.cs | 2 +- .../{ => GameApi/Matching}/MatchController.cs | 2 +- .../{ => GameApi}/MessageController.cs | 26 +++++++++---------- .../Resources}/PhotosController.cs | 2 +- .../Resources}/ResourcesController.cs | 2 +- .../Slots}/CollectionController.cs | 2 +- .../Slots}/LevelTagsController.cs | 2 +- .../{ => GameApi/Slots}/ListController.cs | 2 +- .../{ => GameApi/Slots}/PublishController.cs | 2 +- .../{ => GameApi/Slots}/ReviewController.cs | 2 +- .../{ => GameApi/Slots}/ScoreController.cs | 2 +- .../{ => GameApi/Slots}/SearchController.cs | 2 +- .../{ => GameApi/Slots}/SlotsController.cs | 2 +- .../{ => GameApi}/StatisticsController.cs | 2 +- .../{ => GameApi}/StoreController.cs | 2 +- .../{ => GameApi}/UserController.cs | 2 +- 21 files changed, 33 insertions(+), 33 deletions(-) rename ProjectLighthouse/Controllers/{ => GameApi}/ClientConfigurationController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi}/CommentController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi}/DeveloperController.cs (79%) rename ProjectLighthouse/Controllers/{ => GameApi}/FriendsController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi}/LoginController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi/Matching}/EnterLevelController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi/Matching}/MatchController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi}/MessageController.cs (72%) rename ProjectLighthouse/Controllers/{ => GameApi/Resources}/PhotosController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi/Resources}/ResourcesController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/CollectionController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/LevelTagsController.cs (89%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/ListController.cs (99%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/PublishController.cs (99%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/ReviewController.cs (99%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/ScoreController.cs (98%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/SearchController.cs (96%) rename ProjectLighthouse/Controllers/{ => GameApi/Slots}/SlotsController.cs (99%) rename ProjectLighthouse/Controllers/{ => GameApi}/StatisticsController.cs (95%) rename ProjectLighthouse/Controllers/{ => GameApi}/StoreController.cs (80%) rename ProjectLighthouse/Controllers/{ => GameApi}/UserController.cs (99%) diff --git a/ProjectLighthouse/Controllers/ClientConfigurationController.cs b/ProjectLighthouse/Controllers/GameApi/ClientConfigurationController.cs similarity index 98% rename from ProjectLighthouse/Controllers/ClientConfigurationController.cs rename to ProjectLighthouse/Controllers/GameApi/ClientConfigurationController.cs index 52de611f..ad3d77e4 100644 --- a/ProjectLighthouse/Controllers/ClientConfigurationController.cs +++ b/ProjectLighthouse/Controllers/GameApi/ClientConfigurationController.cs @@ -6,7 +6,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/CommentController.cs b/ProjectLighthouse/Controllers/GameApi/CommentController.cs similarity index 98% rename from ProjectLighthouse/Controllers/CommentController.cs rename to ProjectLighthouse/Controllers/GameApi/CommentController.cs index 0e470ecc..334b7f04 100644 --- a/ProjectLighthouse/Controllers/CommentController.cs +++ b/ProjectLighthouse/Controllers/GameApi/CommentController.cs @@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/DeveloperController.cs b/ProjectLighthouse/Controllers/GameApi/DeveloperController.cs similarity index 79% rename from ProjectLighthouse/Controllers/DeveloperController.cs rename to ProjectLighthouse/Controllers/GameApi/DeveloperController.cs index 80c6881d..a12cdb00 100644 --- a/ProjectLighthouse/Controllers/DeveloperController.cs +++ b/ProjectLighthouse/Controllers/GameApi/DeveloperController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/FriendsController.cs b/ProjectLighthouse/Controllers/GameApi/FriendsController.cs similarity index 98% rename from ProjectLighthouse/Controllers/FriendsController.cs rename to ProjectLighthouse/Controllers/GameApi/FriendsController.cs index 794396c5..6fb6e1dc 100644 --- a/ProjectLighthouse/Controllers/FriendsController.cs +++ b/ProjectLighthouse/Controllers/GameApi/FriendsController.cs @@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/LoginController.cs b/ProjectLighthouse/Controllers/GameApi/LoginController.cs similarity index 98% rename from ProjectLighthouse/Controllers/LoginController.cs rename to ProjectLighthouse/Controllers/GameApi/LoginController.cs index 0cb7246e..739e5322 100644 --- a/ProjectLighthouse/Controllers/LoginController.cs +++ b/ProjectLighthouse/Controllers/GameApi/LoginController.cs @@ -13,7 +13,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using IOFile = System.IO.File; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/login")] diff --git a/ProjectLighthouse/Controllers/EnterLevelController.cs b/ProjectLighthouse/Controllers/GameApi/Matching/EnterLevelController.cs similarity index 98% rename from ProjectLighthouse/Controllers/EnterLevelController.cs rename to ProjectLighthouse/Controllers/GameApi/Matching/EnterLevelController.cs index c5504ff5..824f2b5d 100644 --- a/ProjectLighthouse/Controllers/EnterLevelController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Matching/EnterLevelController.cs @@ -7,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/MatchController.cs b/ProjectLighthouse/Controllers/GameApi/Matching/MatchController.cs similarity index 98% rename from ProjectLighthouse/Controllers/MatchController.cs rename to ProjectLighthouse/Controllers/GameApi/Matching/MatchController.cs index b3a78d79..7ba10605 100644 --- a/ProjectLighthouse/Controllers/MatchController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Matching/MatchController.cs @@ -14,7 +14,7 @@ using LBPUnion.ProjectLighthouse.Types.Match; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/MessageController.cs b/ProjectLighthouse/Controllers/GameApi/MessageController.cs similarity index 72% rename from ProjectLighthouse/Controllers/MessageController.cs rename to ProjectLighthouse/Controllers/GameApi/MessageController.cs index 46fd4520..6a5d653b 100644 --- a/ProjectLighthouse/Controllers/MessageController.cs +++ b/ProjectLighthouse/Controllers/GameApi/MessageController.cs @@ -8,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] @@ -38,13 +38,13 @@ public class MessageController : ControllerBase User? user = await this.database.UserFromGameRequest(this.Request); if (user == null) return this.StatusCode(403, ""); #else - (User, GameToken)? userAndToken = await this.database.UserAndGameTokenFromRequest(this.Request); + (User, GameToken)? userAndToken = await this.database.UserAndGameTokenFromRequest(this.Request); - if (userAndToken == null) return this.StatusCode(403, ""); + if (userAndToken == null) return this.StatusCode(403, ""); - // ReSharper disable once PossibleInvalidOperationException - User user = userAndToken.Value.Item1; - GameToken gameToken = userAndToken.Value.Item2; + // ReSharper disable once PossibleInvalidOperationException + User user = userAndToken.Value.Item1; + GameToken gameToken = userAndToken.Value.Item2; #endif string announceText = ServerSettings.Instance.AnnounceText; @@ -56,13 +56,13 @@ public class MessageController : ControllerBase ( announceText + #if DEBUG - "\n\n---DEBUG INFO---\n" + - $"user.UserId: {user.UserId}\n" + - $"token.Approved: {gameToken.Approved}\n" + - $"token.Used: {gameToken.Used}\n" + - $"token.UserLocation: {gameToken.UserLocation}\n" + - $"token.GameVersion: {gameToken.GameVersion}\n" + - "---DEBUG INFO---" + + "\n\n---DEBUG INFO---\n" + + $"user.UserId: {user.UserId}\n" + + $"token.Approved: {gameToken.Approved}\n" + + $"token.Used: {gameToken.Used}\n" + + $"token.UserLocation: {gameToken.UserLocation}\n" + + $"token.GameVersion: {gameToken.GameVersion}\n" + + "---DEBUG INFO---" + #endif "\n" ); diff --git a/ProjectLighthouse/Controllers/PhotosController.cs b/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs similarity index 98% rename from ProjectLighthouse/Controllers/PhotosController.cs rename to ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs index 850de160..c035c732 100644 --- a/ProjectLighthouse/Controllers/PhotosController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs @@ -15,7 +15,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/ResourcesController.cs b/ProjectLighthouse/Controllers/GameApi/Resources/ResourcesController.cs similarity index 98% rename from ProjectLighthouse/Controllers/ResourcesController.cs rename to ProjectLighthouse/Controllers/GameApi/Resources/ResourcesController.cs index f9ff9346..4339799d 100644 --- a/ProjectLighthouse/Controllers/ResourcesController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Resources/ResourcesController.cs @@ -12,7 +12,7 @@ using LBPUnion.ProjectLighthouse.Types.Files; using Microsoft.AspNetCore.Mvc; using IOFile = System.IO.File; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources; [ApiController] [Produces("text/xml")] diff --git a/ProjectLighthouse/Controllers/CollectionController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/CollectionController.cs similarity index 98% rename from ProjectLighthouse/Controllers/CollectionController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/CollectionController.cs index 4925d80d..bcf0f382 100644 --- a/ProjectLighthouse/Controllers/CollectionController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/CollectionController.cs @@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Categories; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/LevelTagsController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/LevelTagsController.cs similarity index 89% rename from ProjectLighthouse/Controllers/LevelTagsController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/LevelTagsController.cs index 7c5370fa..99943993 100644 --- a/ProjectLighthouse/Controllers/LevelTagsController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/LevelTagsController.cs @@ -2,7 +2,7 @@ using System; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/tags")] diff --git a/ProjectLighthouse/Controllers/ListController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/ListController.cs similarity index 99% rename from ProjectLighthouse/Controllers/ListController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/ListController.cs index 289b2d83..d7afe176 100644 --- a/ProjectLighthouse/Controllers/ListController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/ListController.cs @@ -9,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/PublishController.cs similarity index 99% rename from ProjectLighthouse/Controllers/PublishController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/PublishController.cs index ab004c2d..ce4d8639 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/PublishController.cs @@ -13,7 +13,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/ReviewController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/ReviewController.cs similarity index 99% rename from ProjectLighthouse/Controllers/ReviewController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/ReviewController.cs index bf741e27..2cf42605 100644 --- a/ProjectLighthouse/Controllers/ReviewController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/ReviewController.cs @@ -13,7 +13,7 @@ using LBPUnion.ProjectLighthouse.Types.Reviews; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/ScoreController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/ScoreController.cs similarity index 98% rename from ProjectLighthouse/Controllers/ScoreController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/ScoreController.cs index 8f521fc5..ad36a321 100644 --- a/ProjectLighthouse/Controllers/ScoreController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/ScoreController.cs @@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/SearchController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/SearchController.cs similarity index 96% rename from ProjectLighthouse/Controllers/SearchController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/SearchController.cs index 62e80e51..f99e2322 100644 --- a/ProjectLighthouse/Controllers/SearchController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/SearchController.cs @@ -7,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/GameApi/Slots/SlotsController.cs similarity index 99% rename from ProjectLighthouse/Controllers/SlotsController.cs rename to ProjectLighthouse/Controllers/GameApi/Slots/SlotsController.cs index b5b69ae8..539b4282 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/GameApi/Slots/SlotsController.cs @@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/StatisticsController.cs b/ProjectLighthouse/Controllers/GameApi/StatisticsController.cs similarity index 95% rename from ProjectLighthouse/Controllers/StatisticsController.cs rename to ProjectLighthouse/Controllers/GameApi/StatisticsController.cs index d6cbee75..c0686443 100644 --- a/ProjectLighthouse/Controllers/StatisticsController.cs +++ b/ProjectLighthouse/Controllers/GameApi/StatisticsController.cs @@ -3,7 +3,7 @@ using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/StoreController.cs b/ProjectLighthouse/Controllers/GameApi/StoreController.cs similarity index 80% rename from ProjectLighthouse/Controllers/StoreController.cs rename to ProjectLighthouse/Controllers/GameApi/StoreController.cs index 614f5c11..053dbf06 100644 --- a/ProjectLighthouse/Controllers/StoreController.cs +++ b/ProjectLighthouse/Controllers/GameApi/StoreController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/UserController.cs b/ProjectLighthouse/Controllers/GameApi/UserController.cs similarity index 99% rename from ProjectLighthouse/Controllers/UserController.cs rename to ProjectLighthouse/Controllers/GameApi/UserController.cs index 4cd47c08..2b788c86 100644 --- a/ProjectLighthouse/Controllers/UserController.cs +++ b/ProjectLighthouse/Controllers/GameApi/UserController.cs @@ -12,7 +12,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers; +namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")]