From 14154faaf858f426e2ea613ea7eaa3e87719ce44 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sat, 14 May 2022 17:28:08 -0400 Subject: [PATCH] Split GameAPI and Website into their own projects --- .run/Lighthouse API.run.xml | 23 +++++ .run/Lighthouse Game API.run.xml | 23 +++++ .run/Lighthouse.run.xml | 22 +++++ .../ClientConfigurationController.cs | 4 +- .../Controllers}/CommentController.cs | 7 +- .../Controllers}/DeveloperController.cs | 2 +- .../Controllers}/FriendsController.cs | 6 +- .../Controllers}/LoginController.cs | 6 +- .../Matching/EnterLevelController.cs | 5 +- .../Controllers}/Matching/MatchController.cs | 7 +- .../Controllers}/MessageController.cs | 4 +- .../Controllers}/ReportController.cs | 8 +- .../Resources/PhotosController.cs | 7 +- .../Resources/ResourcesController.cs | 5 +- .../Slots/CollectionController.cs | 5 +- .../Controllers}/Slots/LevelTagsController.cs | 3 +- .../Controllers}/Slots/ListController.cs | 6 +- .../Controllers}/Slots/PublishController.cs | 6 +- .../Controllers}/Slots/ReviewController.cs | 28 +++---- .../Controllers}/Slots/ScoreController.cs | 17 ++-- .../Controllers}/Slots/SearchController.cs | 6 +- .../Controllers}/Slots/SlotsController.cs | 6 +- .../Controllers}/StatisticsController.cs | 3 +- .../Controllers}/StoreController.cs | 2 +- .../Controllers}/UserController.cs | 34 ++++---- .../Program.cs | 8 +- .../ProjectLighthouse.GameAPI.csproj | 40 +++++++++ .../appsettings.Development.json | 8 ++ ProjectLighthouse.GameAPI/appsettings.json | 9 ++ .../Admin/AdminPanelController.cs | 2 +- .../Admin/AdminReportController.cs | 5 +- .../Controllers}/Admin/AdminSlotController.cs | 3 +- .../Controllers}/Admin/AdminUserController.cs | 3 +- .../Debug/RoomVisualizerController.cs | 5 +- .../ExternalAuth/AuthenticationController.cs | 5 +- .../ExternalAuth/AutoApprovalController.cs | 3 +- .../Controllers}/SlotPageController.cs | 3 +- .../Controllers}/UserPageController.cs | 3 +- .../Pages/Admin/AdminBanUserPage.cshtml | 2 +- .../Pages/Admin/AdminBanUserPage.cshtml.cs | 6 +- .../Pages/Admin/AdminPanelPage.cshtml | 2 +- .../Pages/Admin/AdminPanelPage.cshtml.cs | 6 +- .../Pages/Admin/AdminPanelUsersPage.cshtml | 2 +- .../Pages/Admin/AdminPanelUsersPage.cshtml.cs | 7 +- .../Admin/AdminSetGrantedSlotsPage.cshtml | 2 +- .../Admin/AdminSetGrantedSlotsPage.cshtml.cs | 5 +- .../CompleteEmailVerificationPage.cshtml | 2 +- .../CompleteEmailVerificationPage.cshtml.cs | 5 +- .../Pages/Debug/FilterTestPage.cshtml | 2 +- .../Pages/Debug/FilterTestPage.cshtml.cs | 4 +- .../Pages/Debug/RoomVisualizerPage.cshtml | 2 +- .../Pages/Debug/RoomVisualizerPage.cshtml.cs | 4 +- .../Pages/Debug/VersionInfoPage.cshtml | 2 +- .../Pages/Debug/VersionInfoPage.cshtml.cs | 4 +- .../ExternalAuth/AuthenticationPage.cshtml | 2 +- .../ExternalAuth/AuthenticationPage.cshtml.cs | 6 +- .../ManageUserApprovedIpAddressesPage.cshtml | 2 +- ...anageUserApprovedIpAddressesPage.cshtml.cs | 7 +- .../Pages/LandingPage.cshtml | 2 +- .../Pages/LandingPage.cshtml.cs | 7 +- .../Pages/Layouts/BaseLayout.cshtml | 2 +- .../Pages/Layouts/BaseLayout.cshtml.cs | 3 +- .../Pages/LoginForm.cshtml | 2 +- .../Pages/LoginForm.cshtml.cs | 9 +- .../Pages/LogoutPage.cshtml | 2 +- .../Pages/LogoutPage.cshtml.cs | 5 +- .../AdminPanelStatisticPartial.cshtml | 0 .../AdminSetGrantedSlotsFormPartial.cshtml | 0 .../Pages/Partials/CaptchaPartial.cshtml | 0 .../Pages/Partials/CommentsPartial.cshtml | 3 +- .../Pages/Partials/PhotoPartial.cshtml | 0 .../Pages/Partials/SlotCardPartial.cshtml | 0 .../Pages/Partials/UserCardPartial.cshtml | 0 .../Pages/PasswordResetPage.cshtml | 2 +- .../Pages/PasswordResetPage.cshtml.cs | 5 +- .../Pages/PasswordResetRequiredPage.cshtml | 2 +- .../Pages/PasswordResetRequiredPage.cshtml.cs | 4 +- .../Pages/PhotosPage.cshtml | 2 +- .../Pages/PhotosPage.cshtml.cs | 8 +- .../Pages/RegisterForm.cshtml | 2 +- .../Pages/RegisterForm.cshtml.cs | 7 +- .../Pages/ReportsPage.cshtml | 2 +- .../Pages/ReportsPage.cshtml.cs | 8 +- .../Pages/SendVerificationEmailPage.cshtml | 2 +- .../Pages/SendVerificationEmailPage.cshtml.cs | 6 +- .../Pages/SetEmailForm.cshtml | 2 +- .../Pages/SetEmailForm.cshtml.cs | 7 +- .../Pages/SlotPage.cshtml | 2 +- .../Pages/SlotPage.cshtml.cs | 7 +- .../Pages/SlotsPage.cshtml | 2 +- .../Pages/SlotsPage.cshtml.cs | 11 +-- .../Pages/UserPage.cshtml | 2 +- .../Pages/UserPage.cshtml.cs | 7 +- .../Pages/UsersPage.cshtml | 4 +- .../Pages/UsersPage.cshtml.cs | 8 +- ProjectLighthouse.Website/Program.cs | 38 +++++++++ .../ProjectLighthouse.Website.csproj | 79 ++++++++++++++++++ .../Startup/WebsiteStartup.cs | 61 ++++++++++++++ .../StaticFiles/android-chrome-192x192.png | Bin .../StaticFiles/android-chrome-512x512.png | Bin .../StaticFiles/apple-touch-icon.png | Bin .../StaticFiles/assets/slotCardOverlay.png | Bin .../StaticFiles/browserconfig.xml | 0 .../StaticFiles/css/styles.css | 0 .../StaticFiles/favicon-16x16.png | Bin .../StaticFiles/favicon-32x32.png | Bin .../StaticFiles/favicon.ico | Bin .../StaticFiles/mstile-150x150.png | Bin .../StaticFiles/safari-pinned-tab.svg | 0 .../StaticFiles/site.webmanifest | 0 .../appsettings.Development.json | 8 ++ ProjectLighthouse.Website/appsettings.json | 9 ++ ProjectLighthouse.sln | 12 +++ ProjectLighthouse/Helpers/ResourceHelper.cs | 2 +- ProjectLighthouse/ProjectLighthouse.csproj | 2 +- ProjectLighthouse/Startup/GameApiStartup.cs | 7 -- 116 files changed, 484 insertions(+), 287 deletions(-) create mode 100644 .run/Lighthouse API.run.xml create mode 100644 .run/Lighthouse Game API.run.xml create mode 100644 .run/Lighthouse.run.xml rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/ClientConfigurationController.cs (97%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/CommentController.cs (96%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/DeveloperController.cs (79%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/FriendsController.cs (95%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/LoginController.cs (97%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Matching/EnterLevelController.cs (96%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Matching/MatchController.cs (96%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/MessageController.cs (97%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/ReportController.cs (87%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Resources/PhotosController.cs (97%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Resources/ResourcesController.cs (96%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/CollectionController.cs (96%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/LevelTagsController.cs (87%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/ListController.cs (97%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/PublishController.cs (98%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/ReviewController.cs (94%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/ScoreController.cs (95%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/SearchController.cs (92%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/Slots/SlotsController.cs (98%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/StatisticsController.cs (92%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/StoreController.cs (80%) rename {ProjectLighthouse/Controllers/GameApi => ProjectLighthouse.GameAPI/Controllers}/UserController.cs (92%) rename {ProjectLighthouse => ProjectLighthouse.GameAPI}/Program.cs (80%) create mode 100644 ProjectLighthouse.GameAPI/ProjectLighthouse.GameAPI.csproj create mode 100644 ProjectLighthouse.GameAPI/appsettings.Development.json create mode 100644 ProjectLighthouse.GameAPI/appsettings.json rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/Admin/AdminPanelController.cs (81%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/Admin/AdminReportController.cs (94%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/Admin/AdminSlotController.cs (95%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/Admin/AdminUserController.cs (91%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/Debug/RoomVisualizerController.cs (89%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/ExternalAuth/AuthenticationController.cs (95%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/ExternalAuth/AutoApprovalController.cs (95%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/SlotPageController.cs (97%) rename {ProjectLighthouse/Controllers/Website => ProjectLighthouse.Website/Controllers}/UserPageController.cs (96%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminBanUserPage.cshtml (88%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminBanUserPage.cshtml.cs (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminPanelPage.cshtml (97%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminPanelPage.cshtml.cs (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminPanelUsersPage.cshtml (92%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminPanelUsersPage.cshtml.cs (79%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminSetGrantedSlotsPage.cshtml (75%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs (90%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/CompleteEmailVerificationPage.cshtml (88%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/CompleteEmailVerificationPage.cshtml.cs (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Debug/FilterTestPage.cshtml (87%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Debug/FilterTestPage.cshtml.cs (82%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Debug/RoomVisualizerPage.cshtml (97%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Debug/RoomVisualizerPage.cshtml.cs (80%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Debug/VersionInfoPage.cshtml (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Debug/VersionInfoPage.cshtml.cs (67%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/ExternalAuth/AuthenticationPage.cshtml (96%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/ExternalAuth/AuthenticationPage.cshtml.cs (86%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml (86%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs (78%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/LandingPage.cshtml (95%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/LandingPage.cshtml.cs (88%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Layouts/BaseLayout.cshtml (99%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Layouts/BaseLayout.cshtml.cs (92%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/LoginForm.cshtml (96%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/LoginForm.cshtml.cs (94%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/LogoutPage.cshtml (82%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/LogoutPage.cshtml.cs (82%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/AdminPanelStatisticPartial.cshtml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/AdminSetGrantedSlotsFormPartial.cshtml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/CaptchaPartial.cshtml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/CommentsPartial.cshtml (98%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/PhotoPartial.cshtml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/SlotCardPartial.cshtml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/Partials/UserCardPartial.cshtml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/PasswordResetPage.cshtml (96%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/PasswordResetPage.cshtml.cs (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/PasswordResetRequiredPage.cshtml (79%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/PasswordResetRequiredPage.cshtml.cs (83%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/PhotosPage.cshtml (94%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/PhotosPage.cshtml.cs (89%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/RegisterForm.cshtml (98%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/RegisterForm.cshtml.cs (94%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/ReportsPage.cshtml (99%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/ReportsPage.cshtml.cs (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SendVerificationEmailPage.cshtml (85%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SendVerificationEmailPage.cshtml.cs (93%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SetEmailForm.cshtml (94%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SetEmailForm.cshtml.cs (93%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SlotPage.cshtml (99%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SlotPage.cshtml.cs (92%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SlotsPage.cshtml (96%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/SlotsPage.cshtml.cs (92%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/UserPage.cshtml (98%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/UserPage.cshtml.cs (91%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/UsersPage.cshtml (93%) rename {ProjectLighthouse => ProjectLighthouse.Website}/Pages/UsersPage.cshtml.cs (88%) create mode 100644 ProjectLighthouse.Website/Program.cs create mode 100644 ProjectLighthouse.Website/ProjectLighthouse.Website.csproj create mode 100644 ProjectLighthouse.Website/Startup/WebsiteStartup.cs rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/android-chrome-192x192.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/android-chrome-512x512.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/apple-touch-icon.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/assets/slotCardOverlay.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/browserconfig.xml (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/css/styles.css (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/favicon-16x16.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/favicon-32x32.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/favicon.ico (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/mstile-150x150.png (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/safari-pinned-tab.svg (100%) rename {ProjectLighthouse => ProjectLighthouse.Website}/StaticFiles/site.webmanifest (100%) create mode 100644 ProjectLighthouse.Website/appsettings.Development.json create mode 100644 ProjectLighthouse.Website/appsettings.json diff --git a/.run/Lighthouse API.run.xml b/.run/Lighthouse API.run.xml new file mode 100644 index 00000000..6e12972b --- /dev/null +++ b/.run/Lighthouse API.run.xml @@ -0,0 +1,23 @@ + + + + \ No newline at end of file diff --git a/.run/Lighthouse Game API.run.xml b/.run/Lighthouse Game API.run.xml new file mode 100644 index 00000000..10b4891c --- /dev/null +++ b/.run/Lighthouse Game API.run.xml @@ -0,0 +1,23 @@ + + + + \ No newline at end of file diff --git a/.run/Lighthouse.run.xml b/.run/Lighthouse.run.xml new file mode 100644 index 00000000..5f9e9b4b --- /dev/null +++ b/.run/Lighthouse.run.xml @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/ProjectLighthouse/Controllers/GameApi/ClientConfigurationController.cs b/ProjectLighthouse.GameAPI/Controllers/ClientConfigurationController.cs similarity index 97% rename from ProjectLighthouse/Controllers/GameApi/ClientConfigurationController.cs rename to ProjectLighthouse.GameAPI/Controllers/ClientConfigurationController.cs index fb0f59e4..bf94786a 100644 --- a/ProjectLighthouse/Controllers/GameApi/ClientConfigurationController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/ClientConfigurationController.cs @@ -1,12 +1,10 @@ #nullable enable using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/CommentController.cs b/ProjectLighthouse.GameAPI/Controllers/CommentController.cs similarity index 96% rename from ProjectLighthouse/Controllers/GameApi/CommentController.cs rename to ProjectLighthouse.GameAPI/Controllers/CommentController.cs index 13bce479..3cbbb260 100644 --- a/ProjectLighthouse/Controllers/GameApi/CommentController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/CommentController.cs @@ -1,9 +1,4 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; @@ -13,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/DeveloperController.cs b/ProjectLighthouse.GameAPI/Controllers/DeveloperController.cs similarity index 79% rename from ProjectLighthouse/Controllers/GameApi/DeveloperController.cs rename to ProjectLighthouse.GameAPI/Controllers/DeveloperController.cs index a12cdb00..46d950d7 100644 --- a/ProjectLighthouse/Controllers/GameApi/DeveloperController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/DeveloperController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/FriendsController.cs b/ProjectLighthouse.GameAPI/Controllers/FriendsController.cs similarity index 95% rename from ProjectLighthouse/Controllers/GameApi/FriendsController.cs rename to ProjectLighthouse.GameAPI/Controllers/FriendsController.cs index f2a1159f..688dcf0b 100644 --- a/ProjectLighthouse/Controllers/GameApi/FriendsController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/FriendsController.cs @@ -1,8 +1,4 @@ #nullable enable -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; @@ -11,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/LoginController.cs b/ProjectLighthouse.GameAPI/Controllers/LoginController.cs similarity index 97% rename from ProjectLighthouse/Controllers/GameApi/LoginController.cs rename to ProjectLighthouse.GameAPI/Controllers/LoginController.cs index 97fc8093..7d285d59 100644 --- a/ProjectLighthouse/Controllers/GameApi/LoginController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/LoginController.cs @@ -1,8 +1,5 @@ #nullable enable -using System.IO; -using System.Linq; using System.Net; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Types; @@ -10,9 +7,8 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using LBPUnion.ProjectLighthouse.Types.Tickets; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using IOFile = System.IO.File; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/login")] diff --git a/ProjectLighthouse/Controllers/GameApi/Matching/EnterLevelController.cs b/ProjectLighthouse.GameAPI/Controllers/Matching/EnterLevelController.cs similarity index 96% rename from ProjectLighthouse/Controllers/GameApi/Matching/EnterLevelController.cs rename to ProjectLighthouse.GameAPI/Controllers/Matching/EnterLevelController.cs index 824f2b5d..35d5f1f9 100644 --- a/ProjectLighthouse/Controllers/GameApi/Matching/EnterLevelController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Matching/EnterLevelController.cs @@ -1,13 +1,10 @@ #nullable enable -using System; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Matching; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/Matching/MatchController.cs b/ProjectLighthouse.GameAPI/Controllers/Matching/MatchController.cs similarity index 96% rename from ProjectLighthouse/Controllers/GameApi/Matching/MatchController.cs rename to ProjectLighthouse.GameAPI/Controllers/Matching/MatchController.cs index 6dd4bd68..3cfd9f85 100644 --- a/ProjectLighthouse/Controllers/GameApi/Matching/MatchController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Matching/MatchController.cs @@ -1,10 +1,5 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Text.Json; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers.Extensions; using LBPUnion.ProjectLighthouse.Logging; @@ -13,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Match; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Matching; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/MessageController.cs b/ProjectLighthouse.GameAPI/Controllers/MessageController.cs similarity index 97% rename from ProjectLighthouse/Controllers/GameApi/MessageController.cs rename to ProjectLighthouse.GameAPI/Controllers/MessageController.cs index 3ed72850..27a4771b 100644 --- a/ProjectLighthouse/Controllers/GameApi/MessageController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/MessageController.cs @@ -1,13 +1,11 @@ #nullable enable -using System.IO; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/ReportController.cs b/ProjectLighthouse.GameAPI/Controllers/ReportController.cs similarity index 87% rename from ProjectLighthouse/Controllers/GameApi/ReportController.cs rename to ProjectLighthouse.GameAPI/Controllers/ReportController.cs index d3808a19..17557b39 100644 --- a/ProjectLighthouse/Controllers/GameApi/ReportController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/ReportController.cs @@ -1,14 +1,12 @@ #nullable enable -using System.IO; using System.Text.Json; -using System.Threading.Tasks; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Reports; using Microsoft.AspNetCore.Mvc; -using LBPUnion.ProjectLighthouse.Helpers; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] @@ -32,7 +30,7 @@ public class ReportController : ControllerBase string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync(); XmlSerializer serializer = new(typeof(GriefReport)); - GriefReport? report = (GriefReport?) serializer.Deserialize(new StringReader(bodyString)); + GriefReport? report = (GriefReport?)serializer.Deserialize(new StringReader(bodyString)); if (report == null) return this.BadRequest(); diff --git a/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs b/ProjectLighthouse.GameAPI/Controllers/Resources/PhotosController.cs similarity index 97% rename from ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs rename to ProjectLighthouse.GameAPI/Controllers/Resources/PhotosController.cs index 0425d2d6..f3b1cb06 100644 --- a/ProjectLighthouse/Controllers/GameApi/Resources/PhotosController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Resources/PhotosController.cs @@ -1,9 +1,4 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using Discord; using LBPUnion.ProjectLighthouse.Helpers; @@ -14,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Resources; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/Resources/ResourcesController.cs b/ProjectLighthouse.GameAPI/Controllers/Resources/ResourcesController.cs similarity index 96% rename from ProjectLighthouse/Controllers/GameApi/Resources/ResourcesController.cs rename to ProjectLighthouse.GameAPI/Controllers/Resources/ResourcesController.cs index 1afd41f7..c50b5885 100644 --- a/ProjectLighthouse/Controllers/GameApi/Resources/ResourcesController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Resources/ResourcesController.cs @@ -1,7 +1,4 @@ #nullable enable -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; @@ -11,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Files; using Microsoft.AspNetCore.Mvc; using IOFile = System.IO.File; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Resources; [ApiController] [Produces("text/xml")] diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/CollectionController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/CollectionController.cs similarity index 96% rename from ProjectLighthouse/Controllers/GameApi/Slots/CollectionController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/CollectionController.cs index 7531a69d..58e8b611 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/CollectionController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/CollectionController.cs @@ -1,7 +1,4 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Serialization; @@ -10,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Categories; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/LevelTagsController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/LevelTagsController.cs similarity index 87% rename from ProjectLighthouse/Controllers/GameApi/Slots/LevelTagsController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/LevelTagsController.cs index 99943993..5861dbe6 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/LevelTagsController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/LevelTagsController.cs @@ -1,8 +1,7 @@ -using System; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/tags")] diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/ListController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/ListController.cs similarity index 97% rename from ProjectLighthouse/Controllers/GameApi/Slots/ListController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/ListController.cs index e51c56b7..51cf477c 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/ListController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/ListController.cs @@ -1,15 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/PublishController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/PublishController.cs similarity index 98% rename from ProjectLighthouse/Controllers/GameApi/Slots/PublishController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/PublishController.cs index 1c8852e9..fb301f06 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/PublishController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/PublishController.cs @@ -1,8 +1,4 @@ #nullable enable -using System; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; @@ -14,7 +10,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/ReviewController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/ReviewController.cs similarity index 94% rename from ProjectLighthouse/Controllers/GameApi/Slots/ReviewController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/ReviewController.cs index ab074769..3916073a 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/ReviewController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/ReviewController.cs @@ -1,9 +1,4 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers.Extensions; @@ -14,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Reviews; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] @@ -167,18 +162,17 @@ public class ReviewController : ControllerBase List reviewList = reviews.ToList(); - string inner = reviewList - .Aggregate - ( - string.Empty, - (current, review) => - { - if (review == null) return current; + string inner = reviewList.Aggregate + ( + string.Empty, + (current, review) => + { + if (review == null) return current; - RatedReview? yourThumb = this.database.RatedReviews.FirstOrDefault(r => r.ReviewId == review.ReviewId && r.UserId == user.UserId); - return current + review.Serialize(null, yourThumb); - } - ); + RatedReview? yourThumb = this.database.RatedReviews.FirstOrDefault(r => r.ReviewId == review.ReviewId && r.UserId == user.UserId); + return current + review.Serialize(null, yourThumb); + } + ); string response = LbpSerializer.TaggedStringElement ( "reviews", diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/ScoreController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/ScoreController.cs similarity index 95% rename from ProjectLighthouse/Controllers/GameApi/Slots/ScoreController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/ScoreController.cs index 4db9d290..a32fe5ab 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/ScoreController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/ScoreController.cs @@ -1,10 +1,5 @@ #nullable enable -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; @@ -12,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] @@ -108,7 +103,15 @@ public class ScoreController : ControllerBase } [SuppressMessage("ReSharper", "PossibleMultipleEnumeration")] - private string getScores(int slotId, int type, User user, int pageStart = -1, int pageSize = 5, string rootName = "scores") + private string getScores + ( + int slotId, + int type, + User user, + int pageStart = -1, + int pageSize = 5, + string rootName = "scores" + ) { // This is hella ugly but it technically assigns the proper rank to a score // var needed for Anonymous type returned from SELECT diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/SearchController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/SearchController.cs similarity index 92% rename from ProjectLighthouse/Controllers/GameApi/Slots/SearchController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/SearchController.cs index 425f59b0..179707db 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/SearchController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/SearchController.cs @@ -1,15 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/Slots/SlotsController.cs b/ProjectLighthouse.GameAPI/Controllers/Slots/SlotsController.cs similarity index 98% rename from ProjectLighthouse/Controllers/GameApi/Slots/SlotsController.cs rename to ProjectLighthouse.GameAPI/Controllers/Slots/SlotsController.cs index cac415e7..a6f5a8f5 100644 --- a/ProjectLighthouse/Controllers/GameApi/Slots/SlotsController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/Slots/SlotsController.cs @@ -1,8 +1,4 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers.Extensions; using LBPUnion.ProjectLighthouse.Serialization; @@ -13,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/StatisticsController.cs b/ProjectLighthouse.GameAPI/Controllers/StatisticsController.cs similarity index 92% rename from ProjectLighthouse/Controllers/GameApi/StatisticsController.cs rename to ProjectLighthouse.GameAPI/Controllers/StatisticsController.cs index 6c29615c..d7f66a93 100644 --- a/ProjectLighthouse/Controllers/GameApi/StatisticsController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/StatisticsController.cs @@ -1,9 +1,8 @@ -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/StoreController.cs b/ProjectLighthouse.GameAPI/Controllers/StoreController.cs similarity index 80% rename from ProjectLighthouse/Controllers/GameApi/StoreController.cs rename to ProjectLighthouse.GameAPI/Controllers/StoreController.cs index 053dbf06..92ab63ab 100644 --- a/ProjectLighthouse/Controllers/GameApi/StoreController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/StoreController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] diff --git a/ProjectLighthouse/Controllers/GameApi/UserController.cs b/ProjectLighthouse.GameAPI/Controllers/UserController.cs similarity index 92% rename from ProjectLighthouse/Controllers/GameApi/UserController.cs rename to ProjectLighthouse.GameAPI/Controllers/UserController.cs index a45419c1..70c2315f 100644 --- a/ProjectLighthouse/Controllers/GameApi/UserController.cs +++ b/ProjectLighthouse.GameAPI/Controllers/UserController.cs @@ -1,10 +1,5 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Text.Json; -using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; @@ -13,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.GameApi; +namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers; [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] @@ -37,12 +32,17 @@ public class UserController : ControllerBase { // use an anonymous type to only fetch certain columns var partialUser = await this.database.Users.Where(u => u.Username == username) - .Select(u => new - { - u.Username, - u.IconHash, - }).FirstOrDefaultAsync(); + .Select + ( + u => new + { + u.Username, + u.IconHash, + } + ) + .FirstOrDefaultAsync(); if (partialUser == null) return null; + string user = LbpSerializer.TaggedStringElement("npHandle", partialUser.Username, "icon", partialUser.IconHash); return LbpSerializer.TaggedStringElement("user", user, "type", "user"); } @@ -84,13 +84,12 @@ public class UserController : ControllerBase User user = userAndToken.Value.Item1; GameToken gameToken = userAndToken.Value.Item2; - this.Request.Body.Position = 0; string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync(); // xml hack so we can use one class to deserialize different root names string rootElement = bodyString.Contains("updateUser") ? "updateUser" : "user"; XmlSerializer serializer = new(typeof(UserUpdate), new XmlRootAttribute(rootElement)); - UserUpdate? update = (UserUpdate?) serializer.Deserialize(new StringReader(bodyString)); + UserUpdate? update = (UserUpdate?)serializer.Deserialize(new StringReader(bodyString)); if (update == null) return this.BadRequest(); @@ -103,11 +102,14 @@ public class UserController : ControllerBase user.Biography = update.Biography; } - foreach (string? resource in new[] {update.IconHash, update.YayHash, update.MehHash, update.BooHash, update.PlanetHash,}) + foreach (string? resource in new[] + { + update.IconHash, update.YayHash, update.MehHash, update.BooHash, update.PlanetHash, + }) { if (resource != null && !FileHelper.ResourceExists(resource)) return this.BadRequest(); } - + if (update.IconHash != null) user.IconHash = update.IconHash; if (update.YayHash != null) user.YayHash = update.YayHash; @@ -181,4 +183,4 @@ public class UserController : ControllerBase return this.Ok("[{\"StatusCode\":200}]"); } -} +} \ No newline at end of file diff --git a/ProjectLighthouse/Program.cs b/ProjectLighthouse.GameAPI/Program.cs similarity index 80% rename from ProjectLighthouse/Program.cs rename to ProjectLighthouse.GameAPI/Program.cs index c32955ea..e3b97417 100644 --- a/ProjectLighthouse/Program.cs +++ b/ProjectLighthouse.GameAPI/Program.cs @@ -1,15 +1,10 @@ -#nullable enable using LBPUnion.ProjectLighthouse.Logging.Loggers.AspNet; using LBPUnion.ProjectLighthouse.Startup; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -namespace LBPUnion.ProjectLighthouse; +namespace LBPUnion.ProjectLighthouse.GameAPI; public static class Program { @@ -27,7 +22,6 @@ public static class Program webBuilder => { webBuilder.UseStartup(); - webBuilder.UseWebRoot("StaticFiles"); webBuilder.UseUrls(ServerConfiguration.Instance.GameApiListenUrl); } ) diff --git a/ProjectLighthouse.GameAPI/ProjectLighthouse.GameAPI.csproj b/ProjectLighthouse.GameAPI/ProjectLighthouse.GameAPI.csproj new file mode 100644 index 00000000..b132f367 --- /dev/null +++ b/ProjectLighthouse.GameAPI/ProjectLighthouse.GameAPI.csproj @@ -0,0 +1,40 @@ + + + + net6.0 + enable + enable + LBPUnion.ProjectLighthouse.GameAPI + LBPUnion.ProjectLighthouse.GameAPI + + + + + + + + + + Always + + + + Always + + + + Always + + + + Always + + + + + + + + + + diff --git a/ProjectLighthouse.GameAPI/appsettings.Development.json b/ProjectLighthouse.GameAPI/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/ProjectLighthouse.GameAPI/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/ProjectLighthouse.GameAPI/appsettings.json b/ProjectLighthouse.GameAPI/appsettings.json new file mode 100644 index 00000000..10f68b8c --- /dev/null +++ b/ProjectLighthouse.GameAPI/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/ProjectLighthouse/Controllers/Website/Admin/AdminPanelController.cs b/ProjectLighthouse.Website/Controllers/Admin/AdminPanelController.cs similarity index 81% rename from ProjectLighthouse/Controllers/Website/Admin/AdminPanelController.cs rename to ProjectLighthouse.Website/Controllers/Admin/AdminPanelController.cs index d736fd44..6ab1ba75 100644 --- a/ProjectLighthouse/Controllers/Website/Admin/AdminPanelController.cs +++ b/ProjectLighthouse.Website/Controllers/Admin/AdminPanelController.cs @@ -1,7 +1,7 @@ #nullable enable using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin; [ApiController] [Route("/admin")] diff --git a/ProjectLighthouse/Controllers/Website/Admin/AdminReportController.cs b/ProjectLighthouse.Website/Controllers/Admin/AdminReportController.cs similarity index 94% rename from ProjectLighthouse/Controllers/Website/Admin/AdminReportController.cs rename to ProjectLighthouse.Website/Controllers/Admin/AdminReportController.cs index 3568d169..9864a2e3 100644 --- a/ProjectLighthouse/Controllers/Website/Admin/AdminReportController.cs +++ b/ProjectLighthouse.Website/Controllers/Admin/AdminReportController.cs @@ -1,13 +1,10 @@ #nullable enable -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Reports; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin; [ApiController] [Route("admin/report/{id:int}")] diff --git a/ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs b/ProjectLighthouse.Website/Controllers/Admin/AdminSlotController.cs similarity index 95% rename from ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs rename to ProjectLighthouse.Website/Controllers/Admin/AdminSlotController.cs index 080f6ff9..ab426bad 100644 --- a/ProjectLighthouse/Controllers/Website/Admin/AdminSlotController.cs +++ b/ProjectLighthouse.Website/Controllers/Admin/AdminSlotController.cs @@ -1,11 +1,10 @@ #nullable enable -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin; [ApiController] [Route("admin/slot/{id:int}")] diff --git a/ProjectLighthouse/Controllers/Website/Admin/AdminUserController.cs b/ProjectLighthouse.Website/Controllers/Admin/AdminUserController.cs similarity index 91% rename from ProjectLighthouse/Controllers/Website/Admin/AdminUserController.cs rename to ProjectLighthouse.Website/Controllers/Admin/AdminUserController.cs index 629996ca..d4a54416 100644 --- a/ProjectLighthouse/Controllers/Website/Admin/AdminUserController.cs +++ b/ProjectLighthouse.Website/Controllers/Admin/AdminUserController.cs @@ -1,10 +1,9 @@ #nullable enable -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin; [ApiController] [Route("admin/user/{id:int}")] diff --git a/ProjectLighthouse/Controllers/Website/Debug/RoomVisualizerController.cs b/ProjectLighthouse.Website/Controllers/Debug/RoomVisualizerController.cs similarity index 89% rename from ProjectLighthouse/Controllers/Website/Debug/RoomVisualizerController.cs rename to ProjectLighthouse.Website/Controllers/Debug/RoomVisualizerController.cs index cc690c93..5305ddc9 100644 --- a/ProjectLighthouse/Controllers/Website/Debug/RoomVisualizerController.cs +++ b/ProjectLighthouse.Website/Controllers/Debug/RoomVisualizerController.cs @@ -1,12 +1,9 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.Debug; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.Debug; [ApiController] [Route("debug/roomVisualizer")] diff --git a/ProjectLighthouse/Controllers/Website/ExternalAuth/AuthenticationController.cs b/ProjectLighthouse.Website/Controllers/ExternalAuth/AuthenticationController.cs similarity index 95% rename from ProjectLighthouse/Controllers/Website/ExternalAuth/AuthenticationController.cs rename to ProjectLighthouse.Website/Controllers/ExternalAuth/AuthenticationController.cs index a33b7ca6..50c08fed 100644 --- a/ProjectLighthouse/Controllers/Website/ExternalAuth/AuthenticationController.cs +++ b/ProjectLighthouse.Website/Controllers/ExternalAuth/AuthenticationController.cs @@ -1,13 +1,10 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.ExternalAuth; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.ExternalAuth; [ApiController] [Route("/authentication")] diff --git a/ProjectLighthouse/Controllers/Website/ExternalAuth/AutoApprovalController.cs b/ProjectLighthouse.Website/Controllers/ExternalAuth/AutoApprovalController.cs similarity index 95% rename from ProjectLighthouse/Controllers/Website/ExternalAuth/AutoApprovalController.cs rename to ProjectLighthouse.Website/Controllers/ExternalAuth/AutoApprovalController.cs index 4d889285..9dcc8640 100644 --- a/ProjectLighthouse/Controllers/Website/ExternalAuth/AutoApprovalController.cs +++ b/ProjectLighthouse.Website/Controllers/ExternalAuth/AutoApprovalController.cs @@ -1,10 +1,9 @@ #nullable enable -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website.ExternalAuth; +namespace LBPUnion.ProjectLighthouse.Website.Controllers.ExternalAuth; [ApiController] [Route("/authentication")] diff --git a/ProjectLighthouse/Controllers/Website/SlotPageController.cs b/ProjectLighthouse.Website/Controllers/SlotPageController.cs similarity index 97% rename from ProjectLighthouse/Controllers/Website/SlotPageController.cs rename to ProjectLighthouse.Website/Controllers/SlotPageController.cs index d3fddc25..e4aa2a92 100644 --- a/ProjectLighthouse/Controllers/Website/SlotPageController.cs +++ b/ProjectLighthouse.Website/Controllers/SlotPageController.cs @@ -1,5 +1,4 @@ #nullable enable -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Types; @@ -12,7 +11,7 @@ using Microsoft.EntityFrameworkCore; // TODO: Clean up this file // - jvyden -namespace LBPUnion.ProjectLighthouse.Controllers.Website; +namespace LBPUnion.ProjectLighthouse.Website.Controllers; [ApiController] [Route("slot/{id:int}")] diff --git a/ProjectLighthouse/Controllers/Website/UserPageController.cs b/ProjectLighthouse.Website/Controllers/UserPageController.cs similarity index 96% rename from ProjectLighthouse/Controllers/Website/UserPageController.cs rename to ProjectLighthouse.Website/Controllers/UserPageController.cs index 107f1eed..42dff1e0 100644 --- a/ProjectLighthouse/Controllers/Website/UserPageController.cs +++ b/ProjectLighthouse.Website/Controllers/UserPageController.cs @@ -1,12 +1,11 @@ #nullable enable -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Controllers.Website; +namespace LBPUnion.ProjectLighthouse.Website.Controllers; [ApiController] [Route("user/{id:int}")] diff --git a/ProjectLighthouse/Pages/Admin/AdminBanUserPage.cshtml b/ProjectLighthouse.Website/Pages/Admin/AdminBanUserPage.cshtml similarity index 88% rename from ProjectLighthouse/Pages/Admin/AdminBanUserPage.cshtml rename to ProjectLighthouse.Website/Pages/Admin/AdminBanUserPage.cshtml index 2fd9e27a..2f44a443 100644 --- a/ProjectLighthouse/Pages/Admin/AdminBanUserPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Admin/AdminBanUserPage.cshtml @@ -1,5 +1,5 @@ @page "/admin/user/{id:int}/ban" -@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminBanUserPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminBanUserPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Admin/AdminBanUserPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Admin/AdminBanUserPage.cshtml.cs similarity index 91% rename from ProjectLighthouse/Pages/Admin/AdminBanUserPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Admin/AdminBanUserPage.cshtml.cs index 3fb07d38..e96d5016 100644 --- a/ProjectLighthouse/Pages/Admin/AdminBanUserPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Admin/AdminBanUserPage.cshtml.cs @@ -1,12 +1,10 @@ #nullable enable -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin; public class AdminBanUserPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Admin/AdminPanelPage.cshtml b/ProjectLighthouse.Website/Pages/Admin/AdminPanelPage.cshtml similarity index 97% rename from ProjectLighthouse/Pages/Admin/AdminPanelPage.cshtml rename to ProjectLighthouse.Website/Pages/Admin/AdminPanelPage.cshtml index 58440e43..9a96104c 100644 --- a/ProjectLighthouse/Pages/Admin/AdminPanelPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Admin/AdminPanelPage.cshtml @@ -3,7 +3,7 @@ @using LBPUnion.ProjectLighthouse.Helpers.Extensions @using LBPUnion.ProjectLighthouse.Maintenance @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminPanelPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminPanelPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Admin/AdminPanelPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Admin/AdminPanelPage.cshtml.cs similarity index 91% rename from ProjectLighthouse/Pages/Admin/AdminPanelPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Admin/AdminPanelPage.cshtml.cs index d78bdb33..5e5353c9 100644 --- a/ProjectLighthouse/Pages/Admin/AdminPanelPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Admin/AdminPanelPage.cshtml.cs @@ -1,13 +1,11 @@ #nullable enable -using System.Collections.Generic; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Maintenance; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin; public class AdminPanelPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Admin/AdminPanelUsersPage.cshtml b/ProjectLighthouse.Website/Pages/Admin/AdminPanelUsersPage.cshtml similarity index 92% rename from ProjectLighthouse/Pages/Admin/AdminPanelUsersPage.cshtml rename to ProjectLighthouse.Website/Pages/Admin/AdminPanelUsersPage.cshtml index 92822597..37837420 100644 --- a/ProjectLighthouse/Pages/Admin/AdminPanelUsersPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Admin/AdminPanelUsersPage.cshtml @@ -1,6 +1,6 @@ @page "/admin/users" @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminPanelUsersPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminPanelUsersPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Admin/AdminPanelUsersPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Admin/AdminPanelUsersPage.cshtml.cs similarity index 79% rename from ProjectLighthouse/Pages/Admin/AdminPanelUsersPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Admin/AdminPanelUsersPage.cshtml.cs index f955956f..7fd259a0 100644 --- a/ProjectLighthouse/Pages/Admin/AdminPanelUsersPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Admin/AdminPanelUsersPage.cshtml.cs @@ -1,13 +1,10 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin; public class AdminPanelUsersPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Admin/AdminSetGrantedSlotsPage.cshtml b/ProjectLighthouse.Website/Pages/Admin/AdminSetGrantedSlotsPage.cshtml similarity index 75% rename from ProjectLighthouse/Pages/Admin/AdminSetGrantedSlotsPage.cshtml rename to ProjectLighthouse.Website/Pages/Admin/AdminSetGrantedSlotsPage.cshtml index b9644d4f..e7a1d02f 100644 --- a/ProjectLighthouse/Pages/Admin/AdminSetGrantedSlotsPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Admin/AdminSetGrantedSlotsPage.cshtml @@ -1,5 +1,5 @@ @page "/admin/user/{id:int}/setGrantedSlots" -@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminSetGrantedSlotsPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminSetGrantedSlotsPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs similarity index 90% rename from ProjectLighthouse/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs index 8dce5e64..5a542a4d 100644 --- a/ProjectLighthouse/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Admin/AdminSetGrantedSlotsPage.cshtml.cs @@ -1,11 +1,10 @@ #nullable enable -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages.Admin; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin; public class AdminSetGrantedSlotsPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/CompleteEmailVerificationPage.cshtml b/ProjectLighthouse.Website/Pages/CompleteEmailVerificationPage.cshtml similarity index 88% rename from ProjectLighthouse/Pages/CompleteEmailVerificationPage.cshtml rename to ProjectLighthouse.Website/Pages/CompleteEmailVerificationPage.cshtml index ea15de22..43a52c36 100644 --- a/ProjectLighthouse/Pages/CompleteEmailVerificationPage.cshtml +++ b/ProjectLighthouse.Website/Pages/CompleteEmailVerificationPage.cshtml @@ -1,5 +1,5 @@ @page "/verifyEmail" -@model LBPUnion.ProjectLighthouse.Pages.CompleteEmailVerificationPage +@model LBPUnion.ProjectLighthouse.Website.Pages.CompleteEmailVerificationPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/CompleteEmailVerificationPage.cshtml.cs b/ProjectLighthouse.Website/Pages/CompleteEmailVerificationPage.cshtml.cs similarity index 91% rename from ProjectLighthouse/Pages/CompleteEmailVerificationPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/CompleteEmailVerificationPage.cshtml.cs index c5934fad..e587e206 100644 --- a/ProjectLighthouse/Pages/CompleteEmailVerificationPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/CompleteEmailVerificationPage.cshtml.cs @@ -1,13 +1,12 @@ #nullable enable -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Profiles.Email; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class CompleteEmailVerificationPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml b/ProjectLighthouse.Website/Pages/Debug/FilterTestPage.cshtml similarity index 87% rename from ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml rename to ProjectLighthouse.Website/Pages/Debug/FilterTestPage.cshtml index d648c178..61965353 100644 --- a/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Debug/FilterTestPage.cshtml @@ -1,5 +1,5 @@ @page "/debug/filter" -@model LBPUnion.ProjectLighthouse.Pages.Debug.FilterTestPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Debug.FilterTestPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Debug/FilterTestPage.cshtml.cs similarity index 82% rename from ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Debug/FilterTestPage.cshtml.cs index 84b5c2ec..bad1f3ac 100644 --- a/ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Debug/FilterTestPage.cshtml.cs @@ -1,9 +1,9 @@ #nullable enable using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Pages.Layouts; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages.Debug; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Debug; public class FilterTestPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml b/ProjectLighthouse.Website/Pages/Debug/RoomVisualizerPage.cshtml similarity index 97% rename from ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml rename to ProjectLighthouse.Website/Pages/Debug/RoomVisualizerPage.cshtml index 9b5e0a3c..77e4c14a 100644 --- a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Debug/RoomVisualizerPage.cshtml @@ -2,7 +2,7 @@ @using LBPUnion.ProjectLighthouse.Helpers @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Match -@model LBPUnion.ProjectLighthouse.Pages.Debug.RoomVisualizerPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Debug.RoomVisualizerPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Debug/RoomVisualizerPage.cshtml.cs similarity index 80% rename from ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Debug/RoomVisualizerPage.cshtml.cs index c0a47d65..f2cdd161 100644 --- a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Debug/RoomVisualizerPage.cshtml.cs @@ -1,12 +1,12 @@ #nullable enable -using LBPUnion.ProjectLighthouse.Pages.Layouts; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; #if !DEBUG using LBPUnion.ProjectLighthouse.Types; #endif -namespace LBPUnion.ProjectLighthouse.Pages.Debug; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Debug; public class RoomVisualizerPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Debug/VersionInfoPage.cshtml b/ProjectLighthouse.Website/Pages/Debug/VersionInfoPage.cshtml similarity index 91% rename from ProjectLighthouse/Pages/Debug/VersionInfoPage.cshtml rename to ProjectLighthouse.Website/Pages/Debug/VersionInfoPage.cshtml index 4bd4cb77..be959635 100644 --- a/ProjectLighthouse/Pages/Debug/VersionInfoPage.cshtml +++ b/ProjectLighthouse.Website/Pages/Debug/VersionInfoPage.cshtml @@ -1,6 +1,6 @@ @page "/debug/version" @using LBPUnion.ProjectLighthouse.Helpers -@model LBPUnion.ProjectLighthouse.Pages.Debug.VersionInfoPage +@model LBPUnion.ProjectLighthouse.Website.Pages.Debug.VersionInfoPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/Debug/VersionInfoPage.cshtml.cs b/ProjectLighthouse.Website/Pages/Debug/VersionInfoPage.cshtml.cs similarity index 67% rename from ProjectLighthouse/Pages/Debug/VersionInfoPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/Debug/VersionInfoPage.cshtml.cs index 97b865b9..08333a4b 100644 --- a/ProjectLighthouse/Pages/Debug/VersionInfoPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Debug/VersionInfoPage.cshtml.cs @@ -1,8 +1,8 @@ using JetBrains.Annotations; -using LBPUnion.ProjectLighthouse.Pages.Layouts; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages.Debug; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Debug; public class VersionInfoPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/ExternalAuth/AuthenticationPage.cshtml b/ProjectLighthouse.Website/Pages/ExternalAuth/AuthenticationPage.cshtml similarity index 96% rename from ProjectLighthouse/Pages/ExternalAuth/AuthenticationPage.cshtml rename to ProjectLighthouse.Website/Pages/ExternalAuth/AuthenticationPage.cshtml index d5a56773..7d7d5b51 100644 --- a/ProjectLighthouse/Pages/ExternalAuth/AuthenticationPage.cshtml +++ b/ProjectLighthouse.Website/Pages/ExternalAuth/AuthenticationPage.cshtml @@ -1,6 +1,6 @@ @page "/authentication" @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.AuthenticationPage +@model LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth.AuthenticationPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/ExternalAuth/AuthenticationPage.cshtml.cs b/ProjectLighthouse.Website/Pages/ExternalAuth/AuthenticationPage.cshtml.cs similarity index 86% rename from ProjectLighthouse/Pages/ExternalAuth/AuthenticationPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/ExternalAuth/AuthenticationPage.cshtml.cs index 04276a88..3197a423 100644 --- a/ProjectLighthouse/Pages/ExternalAuth/AuthenticationPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/ExternalAuth/AuthenticationPage.cshtml.cs @@ -1,14 +1,12 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; using System.Net; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth; +namespace LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth; public class AuthenticationPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml b/ProjectLighthouse.Website/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml similarity index 86% rename from ProjectLighthouse/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml rename to ProjectLighthouse.Website/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml index dde2fa8a..6d84792c 100644 --- a/ProjectLighthouse/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml +++ b/ProjectLighthouse.Website/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml @@ -1,6 +1,6 @@ @page "/authentication/autoApprovals" @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.ManageUserApprovedIpAddressesPage +@model LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth.ManageUserApprovedIpAddressesPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs b/ProjectLighthouse.Website/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs similarity index 78% rename from ProjectLighthouse/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs index ff58bd98..13d12355 100644 --- a/ProjectLighthouse/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/ExternalAuth/ManageUserApprovedIpAddressesPage.cshtml.cs @@ -1,13 +1,10 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth; +namespace LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth; public class ManageUserApprovedIpAddressesPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/LandingPage.cshtml b/ProjectLighthouse.Website/Pages/LandingPage.cshtml similarity index 95% rename from ProjectLighthouse/Pages/LandingPage.cshtml rename to ProjectLighthouse.Website/Pages/LandingPage.cshtml index 19bbc0e6..52e4d841 100644 --- a/ProjectLighthouse/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Website/Pages/LandingPage.cshtml @@ -1,7 +1,7 @@ @page "/" @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Settings -@model LBPUnion.ProjectLighthouse.Pages.LandingPage +@model LBPUnion.ProjectLighthouse.Website.Pages.LandingPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Website/Pages/LandingPage.cshtml.cs similarity index 88% rename from ProjectLighthouse/Pages/LandingPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/LandingPage.cshtml.cs index 5bc14fb4..65079ebd 100644 --- a/ProjectLighthouse/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/LandingPage.cshtml.cs @@ -1,15 +1,12 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class LandingPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse.Website/Pages/Layouts/BaseLayout.cshtml similarity index 99% rename from ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml rename to ProjectLighthouse.Website/Pages/Layouts/BaseLayout.cshtml index 0b83e680..f911527b 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse.Website/Pages/Layouts/BaseLayout.cshtml @@ -2,7 +2,7 @@ @using LBPUnion.ProjectLighthouse.Helpers.Extensions @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Settings -@model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout +@model LBPUnion.ProjectLighthouse.Website.Pages.Layouts.BaseLayout @{ if (Model!.User == null) diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse.Website/Pages/Layouts/BaseLayout.cshtml.cs similarity index 92% rename from ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs rename to ProjectLighthouse.Website/Pages/Layouts/BaseLayout.cshtml.cs index 58056e32..ac6853fe 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/Layouts/BaseLayout.cshtml.cs @@ -1,9 +1,8 @@ #nullable enable -using System.Collections.Generic; using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc.RazorPages; -namespace LBPUnion.ProjectLighthouse.Pages.Layouts; +namespace LBPUnion.ProjectLighthouse.Website.Pages.Layouts; public class BaseLayout : PageModel { diff --git a/ProjectLighthouse/Pages/LoginForm.cshtml b/ProjectLighthouse.Website/Pages/LoginForm.cshtml similarity index 96% rename from ProjectLighthouse/Pages/LoginForm.cshtml rename to ProjectLighthouse.Website/Pages/LoginForm.cshtml index 74594112..be68339b 100644 --- a/ProjectLighthouse/Pages/LoginForm.cshtml +++ b/ProjectLighthouse.Website/Pages/LoginForm.cshtml @@ -1,6 +1,6 @@ @page "/login" @using LBPUnion.ProjectLighthouse.Types.Settings -@model LBPUnion.ProjectLighthouse.Pages.LoginForm +@model LBPUnion.ProjectLighthouse.Website.Pages.LoginForm @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/LoginForm.cshtml.cs b/ProjectLighthouse.Website/Pages/LoginForm.cshtml.cs similarity index 94% rename from ProjectLighthouse/Pages/LoginForm.cshtml.cs rename to ProjectLighthouse.Website/Pages/LoginForm.cshtml.cs index d0503841..959d8a66 100644 --- a/ProjectLighthouse/Pages/LoginForm.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/LoginForm.cshtml.cs @@ -1,19 +1,16 @@ #nullable enable -using System; -using System.Threading.Tasks; using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers.Extensions; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Profiles.Email; using LBPUnion.ProjectLighthouse.Types.Settings; -using Microsoft.AspNetCore.Http; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class LoginForm : BaseLayout { @@ -37,7 +34,7 @@ public class LoginForm : BaseLayout return this.Page(); } - if (!await Request.CheckCaptchaValidity()) + if (!await this.Request.CheckCaptchaValidity()) { this.Error = "You must complete the captcha correctly."; return this.Page(); diff --git a/ProjectLighthouse/Pages/LogoutPage.cshtml b/ProjectLighthouse.Website/Pages/LogoutPage.cshtml similarity index 82% rename from ProjectLighthouse/Pages/LogoutPage.cshtml rename to ProjectLighthouse.Website/Pages/LogoutPage.cshtml index 589ed4f5..5e460ed7 100644 --- a/ProjectLighthouse/Pages/LogoutPage.cshtml +++ b/ProjectLighthouse.Website/Pages/LogoutPage.cshtml @@ -1,5 +1,5 @@ @page "/logout" -@model LBPUnion.ProjectLighthouse.Pages.LogoutPage +@model LBPUnion.ProjectLighthouse.Website.Pages.LogoutPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/LogoutPage.cshtml.cs b/ProjectLighthouse.Website/Pages/LogoutPage.cshtml.cs similarity index 82% rename from ProjectLighthouse/Pages/LogoutPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/LogoutPage.cshtml.cs index ad8dd64c..86666eb9 100644 --- a/ProjectLighthouse/Pages/LogoutPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/LogoutPage.cshtml.cs @@ -1,10 +1,9 @@ #nullable enable -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class LogoutPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/Partials/AdminPanelStatisticPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/AdminPanelStatisticPartial.cshtml similarity index 100% rename from ProjectLighthouse/Pages/Partials/AdminPanelStatisticPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/AdminPanelStatisticPartial.cshtml diff --git a/ProjectLighthouse/Pages/Partials/AdminSetGrantedSlotsFormPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/AdminSetGrantedSlotsFormPartial.cshtml similarity index 100% rename from ProjectLighthouse/Pages/Partials/AdminSetGrantedSlotsFormPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/AdminSetGrantedSlotsFormPartial.cshtml diff --git a/ProjectLighthouse/Pages/Partials/CaptchaPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/CaptchaPartial.cshtml similarity index 100% rename from ProjectLighthouse/Pages/Partials/CaptchaPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/CaptchaPartial.cshtml diff --git a/ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/CommentsPartial.cshtml similarity index 98% rename from ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/CommentsPartial.cshtml index 35df6b8f..dfa9bc3c 100644 --- a/ProjectLighthouse/Pages/Partials/CommentsPartial.cshtml +++ b/ProjectLighthouse.Website/Pages/Partials/CommentsPartial.cshtml @@ -1,5 +1,4 @@ -@using System.IO -@using System.Web +@using System.Web @using LBPUnion.ProjectLighthouse.Types.Profiles

Comments

diff --git a/ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/PhotoPartial.cshtml similarity index 100% rename from ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/PhotoPartial.cshtml diff --git a/ProjectLighthouse/Pages/Partials/SlotCardPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/SlotCardPartial.cshtml similarity index 100% rename from ProjectLighthouse/Pages/Partials/SlotCardPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/SlotCardPartial.cshtml diff --git a/ProjectLighthouse/Pages/Partials/UserCardPartial.cshtml b/ProjectLighthouse.Website/Pages/Partials/UserCardPartial.cshtml similarity index 100% rename from ProjectLighthouse/Pages/Partials/UserCardPartial.cshtml rename to ProjectLighthouse.Website/Pages/Partials/UserCardPartial.cshtml diff --git a/ProjectLighthouse/Pages/PasswordResetPage.cshtml b/ProjectLighthouse.Website/Pages/PasswordResetPage.cshtml similarity index 96% rename from ProjectLighthouse/Pages/PasswordResetPage.cshtml rename to ProjectLighthouse.Website/Pages/PasswordResetPage.cshtml index c6e0f631..00a27cb8 100644 --- a/ProjectLighthouse/Pages/PasswordResetPage.cshtml +++ b/ProjectLighthouse.Website/Pages/PasswordResetPage.cshtml @@ -1,5 +1,5 @@ @page "/passwordReset" -@model LBPUnion.ProjectLighthouse.Pages.PasswordResetPage +@model LBPUnion.ProjectLighthouse.Website.Pages.PasswordResetPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/PasswordResetPage.cshtml.cs b/ProjectLighthouse.Website/Pages/PasswordResetPage.cshtml.cs similarity index 91% rename from ProjectLighthouse/Pages/PasswordResetPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/PasswordResetPage.cshtml.cs index 796f978d..2cc46d12 100644 --- a/ProjectLighthouse/Pages/PasswordResetPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/PasswordResetPage.cshtml.cs @@ -1,12 +1,11 @@ #nullable enable -using System.Threading.Tasks; using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class PasswordResetPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/PasswordResetRequiredPage.cshtml b/ProjectLighthouse.Website/Pages/PasswordResetRequiredPage.cshtml similarity index 79% rename from ProjectLighthouse/Pages/PasswordResetRequiredPage.cshtml rename to ProjectLighthouse.Website/Pages/PasswordResetRequiredPage.cshtml index afe20489..85f5090d 100644 --- a/ProjectLighthouse/Pages/PasswordResetRequiredPage.cshtml +++ b/ProjectLighthouse.Website/Pages/PasswordResetRequiredPage.cshtml @@ -1,5 +1,5 @@ @page "/passwordResetRequired" -@model LBPUnion.ProjectLighthouse.Pages.PasswordResetRequiredPage +@model LBPUnion.ProjectLighthouse.Website.Pages.PasswordResetRequiredPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/PasswordResetRequiredPage.cshtml.cs b/ProjectLighthouse.Website/Pages/PasswordResetRequiredPage.cshtml.cs similarity index 83% rename from ProjectLighthouse/Pages/PasswordResetRequiredPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/PasswordResetRequiredPage.cshtml.cs index a7a0998a..5f55129d 100644 --- a/ProjectLighthouse/Pages/PasswordResetRequiredPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/PasswordResetRequiredPage.cshtml.cs @@ -1,9 +1,9 @@ #nullable enable -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class PasswordResetRequiredPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/PhotosPage.cshtml b/ProjectLighthouse.Website/Pages/PhotosPage.cshtml similarity index 94% rename from ProjectLighthouse/Pages/PhotosPage.cshtml rename to ProjectLighthouse.Website/Pages/PhotosPage.cshtml index cf46f3bf..63413c4f 100644 --- a/ProjectLighthouse/Pages/PhotosPage.cshtml +++ b/ProjectLighthouse.Website/Pages/PhotosPage.cshtml @@ -1,6 +1,6 @@ @page "/photos/{pageNumber:int}" @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.PhotosPage +@model LBPUnion.ProjectLighthouse.Website.Pages.PhotosPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/PhotosPage.cshtml.cs b/ProjectLighthouse.Website/Pages/PhotosPage.cshtml.cs similarity index 89% rename from ProjectLighthouse/Pages/PhotosPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/PhotosPage.cshtml.cs index b35b0b6e..b19b19b7 100644 --- a/ProjectLighthouse/Pages/PhotosPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/PhotosPage.cshtml.cs @@ -1,15 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class PhotosPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/RegisterForm.cshtml b/ProjectLighthouse.Website/Pages/RegisterForm.cshtml similarity index 98% rename from ProjectLighthouse/Pages/RegisterForm.cshtml rename to ProjectLighthouse.Website/Pages/RegisterForm.cshtml index a0d25fd8..9e6c007b 100644 --- a/ProjectLighthouse/Pages/RegisterForm.cshtml +++ b/ProjectLighthouse.Website/Pages/RegisterForm.cshtml @@ -1,6 +1,6 @@ @page "/register" @using LBPUnion.ProjectLighthouse.Types.Settings -@model LBPUnion.ProjectLighthouse.Pages.RegisterForm +@model LBPUnion.ProjectLighthouse.Website.Pages.RegisterForm @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/RegisterForm.cshtml.cs b/ProjectLighthouse.Website/Pages/RegisterForm.cshtml.cs similarity index 94% rename from ProjectLighthouse/Pages/RegisterForm.cshtml.cs rename to ProjectLighthouse.Website/Pages/RegisterForm.cshtml.cs index e09bf791..047f89df 100644 --- a/ProjectLighthouse/Pages/RegisterForm.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/RegisterForm.cshtml.cs @@ -1,15 +1,14 @@ using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; using JetBrains.Annotations; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers.Extensions; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class RegisterForm : BaseLayout { @@ -61,7 +60,7 @@ public class RegisterForm : BaseLayout return this.Page(); } - if (!await Request.CheckCaptchaValidity()) + if (!await this.Request.CheckCaptchaValidity()) { this.Error = "You must complete the captcha correctly."; return this.Page(); diff --git a/ProjectLighthouse/Pages/ReportsPage.cshtml b/ProjectLighthouse.Website/Pages/ReportsPage.cshtml similarity index 99% rename from ProjectLighthouse/Pages/ReportsPage.cshtml rename to ProjectLighthouse.Website/Pages/ReportsPage.cshtml index bd8ea8f4..7641c65c 100644 --- a/ProjectLighthouse/Pages/ReportsPage.cshtml +++ b/ProjectLighthouse.Website/Pages/ReportsPage.cshtml @@ -1,6 +1,6 @@ @page "/admin/reports/{pageNumber:int}" @using LBPUnion.ProjectLighthouse.Types.Reports -@model LBPUnion.ProjectLighthouse.Pages.ReportsPage +@model LBPUnion.ProjectLighthouse.Website.Pages.ReportsPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/ReportsPage.cshtml.cs b/ProjectLighthouse.Website/Pages/ReportsPage.cshtml.cs similarity index 91% rename from ProjectLighthouse/Pages/ReportsPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/ReportsPage.cshtml.cs index 265dcec3..db2de9b6 100644 --- a/ProjectLighthouse/Pages/ReportsPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/ReportsPage.cshtml.cs @@ -1,17 +1,13 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using System.Text.Json; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Reports; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class ReportsPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/SendVerificationEmailPage.cshtml b/ProjectLighthouse.Website/Pages/SendVerificationEmailPage.cshtml similarity index 85% rename from ProjectLighthouse/Pages/SendVerificationEmailPage.cshtml rename to ProjectLighthouse.Website/Pages/SendVerificationEmailPage.cshtml index f50b713a..2b7cc56f 100644 --- a/ProjectLighthouse/Pages/SendVerificationEmailPage.cshtml +++ b/ProjectLighthouse.Website/Pages/SendVerificationEmailPage.cshtml @@ -1,5 +1,5 @@ @page "/login/sendVerificationEmail" -@model LBPUnion.ProjectLighthouse.Pages.SendVerificationEmailPage +@model LBPUnion.ProjectLighthouse.Website.Pages.SendVerificationEmailPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/SendVerificationEmailPage.cshtml.cs b/ProjectLighthouse.Website/Pages/SendVerificationEmailPage.cshtml.cs similarity index 93% rename from ProjectLighthouse/Pages/SendVerificationEmailPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/SendVerificationEmailPage.cshtml.cs index cd86d62d..e04ffa2d 100644 --- a/ProjectLighthouse/Pages/SendVerificationEmailPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/SendVerificationEmailPage.cshtml.cs @@ -1,14 +1,12 @@ #nullable enable -using System; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Profiles.Email; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class SendVerificationEmailPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/SetEmailForm.cshtml b/ProjectLighthouse.Website/Pages/SetEmailForm.cshtml similarity index 94% rename from ProjectLighthouse/Pages/SetEmailForm.cshtml rename to ProjectLighthouse.Website/Pages/SetEmailForm.cshtml index 407438ae..827a0a35 100644 --- a/ProjectLighthouse/Pages/SetEmailForm.cshtml +++ b/ProjectLighthouse.Website/Pages/SetEmailForm.cshtml @@ -1,6 +1,6 @@ @page "/login/setEmail" @using LBPUnion.ProjectLighthouse.Types.Settings -@model LBPUnion.ProjectLighthouse.Pages.SetEmailForm +@model LBPUnion.ProjectLighthouse.Website.Pages.SetEmailForm @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/SetEmailForm.cshtml.cs b/ProjectLighthouse.Website/Pages/SetEmailForm.cshtml.cs similarity index 93% rename from ProjectLighthouse/Pages/SetEmailForm.cshtml.cs rename to ProjectLighthouse.Website/Pages/SetEmailForm.cshtml.cs index fb4d7ee2..a4ce0611 100644 --- a/ProjectLighthouse/Pages/SetEmailForm.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/SetEmailForm.cshtml.cs @@ -1,17 +1,14 @@ #nullable enable -using System; -using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Profiles.Email; using LBPUnion.ProjectLighthouse.Types.Settings; -using Microsoft.AspNetCore.Http; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class SetEmailForm : BaseLayout { diff --git a/ProjectLighthouse/Pages/SlotPage.cshtml b/ProjectLighthouse.Website/Pages/SlotPage.cshtml similarity index 99% rename from ProjectLighthouse/Pages/SlotPage.cshtml rename to ProjectLighthouse.Website/Pages/SlotPage.cshtml index 397d9fb5..be8efd2a 100644 --- a/ProjectLighthouse/Pages/SlotPage.cshtml +++ b/ProjectLighthouse.Website/Pages/SlotPage.cshtml @@ -4,7 +4,7 @@ @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Reviews @using LBPUnion.ProjectLighthouse.Types.Settings -@model LBPUnion.ProjectLighthouse.Pages.SlotPage +@model LBPUnion.ProjectLighthouse.Website.Pages.SlotPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/SlotPage.cshtml.cs b/ProjectLighthouse.Website/Pages/SlotPage.cshtml.cs similarity index 92% rename from ProjectLighthouse/Pages/SlotPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/SlotPage.cshtml.cs index 01a70915..83e2ac91 100644 --- a/ProjectLighthouse/Pages/SlotPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/SlotPage.cshtml.cs @@ -1,17 +1,14 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Profiles; using LBPUnion.ProjectLighthouse.Types.Reviews; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class SlotPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/SlotsPage.cshtml b/ProjectLighthouse.Website/Pages/SlotsPage.cshtml similarity index 96% rename from ProjectLighthouse/Pages/SlotsPage.cshtml rename to ProjectLighthouse.Website/Pages/SlotsPage.cshtml index 610838ea..dc62cd72 100644 --- a/ProjectLighthouse/Pages/SlotsPage.cshtml +++ b/ProjectLighthouse.Website/Pages/SlotsPage.cshtml @@ -1,7 +1,7 @@ @page "/slots/{pageNumber:int}" @using LBPUnion.ProjectLighthouse.Helpers.Extensions @using LBPUnion.ProjectLighthouse.Types.Levels -@model LBPUnion.ProjectLighthouse.Pages.SlotsPage +@model LBPUnion.ProjectLighthouse.Website.Pages.SlotsPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/SlotsPage.cshtml.cs b/ProjectLighthouse.Website/Pages/SlotsPage.cshtml.cs similarity index 92% rename from ProjectLighthouse/Pages/SlotsPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/SlotsPage.cshtml.cs index 5de0a35a..0cb72568 100644 --- a/ProjectLighthouse/Pages/SlotsPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/SlotsPage.cshtml.cs @@ -1,17 +1,13 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class SlotsPage : BaseLayout { @@ -41,7 +37,8 @@ public class SlotsPage : BaseLayout if (part.Contains("by:")) { targetAuthor = part.Replace("by:", ""); - } else if (part.Contains("game:")) + } + else if (part.Contains("game:")) { if (part.Contains('1')) targetGame = GameVersion.LittleBigPlanet1; else if (part.Contains('2')) targetGame = GameVersion.LittleBigPlanet2; diff --git a/ProjectLighthouse/Pages/UserPage.cshtml b/ProjectLighthouse.Website/Pages/UserPage.cshtml similarity index 98% rename from ProjectLighthouse/Pages/UserPage.cshtml rename to ProjectLighthouse.Website/Pages/UserPage.cshtml index 2ef24243..319aca8f 100644 --- a/ProjectLighthouse/Pages/UserPage.cshtml +++ b/ProjectLighthouse.Website/Pages/UserPage.cshtml @@ -2,7 +2,7 @@ @using System.Web @using LBPUnion.ProjectLighthouse.Helpers.Extensions @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.UserPage +@model LBPUnion.ProjectLighthouse.Website.Pages.UserPage @{ Layout = "Layouts/BaseLayout"; diff --git a/ProjectLighthouse/Pages/UserPage.cshtml.cs b/ProjectLighthouse.Website/Pages/UserPage.cshtml.cs similarity index 91% rename from ProjectLighthouse/Pages/UserPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/UserPage.cshtml.cs index 4d1c913c..dbc2bec7 100644 --- a/ProjectLighthouse/Pages/UserPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/UserPage.cshtml.cs @@ -1,15 +1,12 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Profiles; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class UserPage : BaseLayout { diff --git a/ProjectLighthouse/Pages/UsersPage.cshtml b/ProjectLighthouse.Website/Pages/UsersPage.cshtml similarity index 93% rename from ProjectLighthouse/Pages/UsersPage.cshtml rename to ProjectLighthouse.Website/Pages/UsersPage.cshtml index ea6ae9ec..d92cc89c 100644 --- a/ProjectLighthouse/Pages/UsersPage.cshtml +++ b/ProjectLighthouse.Website/Pages/UsersPage.cshtml @@ -1,7 +1,7 @@ @page "/users/{pageNumber:int}" @using LBPUnion.ProjectLighthouse.Helpers.Extensions @using LBPUnion.ProjectLighthouse.Types -@model LBPUnion.ProjectLighthouse.Pages.UsersPage +@model LBPUnion.ProjectLighthouse.Website.Pages.UsersPage @{ Layout = "Layouts/BaseLayout"; @@ -9,7 +9,7 @@ }

There are @Model.UserCount total users.

- +
diff --git a/ProjectLighthouse/Pages/UsersPage.cshtml.cs b/ProjectLighthouse.Website/Pages/UsersPage.cshtml.cs similarity index 88% rename from ProjectLighthouse/Pages/UsersPage.cshtml.cs rename to ProjectLighthouse.Website/Pages/UsersPage.cshtml.cs index 637df312..c00aa8f1 100644 --- a/ProjectLighthouse/Pages/UsersPage.cshtml.cs +++ b/ProjectLighthouse.Website/Pages/UsersPage.cshtml.cs @@ -1,15 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LBPUnion.ProjectLighthouse.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Pages.Layouts; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Pages; +namespace LBPUnion.ProjectLighthouse.Website.Pages; public class UsersPage : BaseLayout { diff --git a/ProjectLighthouse.Website/Program.cs b/ProjectLighthouse.Website/Program.cs new file mode 100644 index 00000000..11843f92 --- /dev/null +++ b/ProjectLighthouse.Website/Program.cs @@ -0,0 +1,38 @@ +#nullable enable +using LBPUnion.ProjectLighthouse.Logging.Loggers.AspNet; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Website.Startup; +using Microsoft.Extensions.DependencyInjection.Extensions; + +namespace LBPUnion.ProjectLighthouse.Website; + +public static class Program +{ + public static void Main(string[] args) + { + StartupTasks.Run(args, ServerType.Website); + + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + => Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults + ( + webBuilder => + { + webBuilder.UseStartup(); + webBuilder.UseWebRoot("StaticFiles"); + webBuilder.UseUrls(ServerConfiguration.Instance.WebsiteListenUrl); + } + ) + .ConfigureLogging + ( + logging => + { + logging.ClearProviders(); + logging.Services.TryAddEnumerable(ServiceDescriptor.Singleton()); + } + ); +} \ No newline at end of file diff --git a/ProjectLighthouse.Website/ProjectLighthouse.Website.csproj b/ProjectLighthouse.Website/ProjectLighthouse.Website.csproj new file mode 100644 index 00000000..47069f07 --- /dev/null +++ b/ProjectLighthouse.Website/ProjectLighthouse.Website.csproj @@ -0,0 +1,79 @@ + + + + net6.0 + enable + enable + LBPUnion.ProjectLighthouse.Website + LBPUnion.ProjectLighthouse.Website + + + + + + + + + + Always + + + + Always + + + + Always + + + + Always + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ProjectLighthouse.Website/Startup/WebsiteStartup.cs b/ProjectLighthouse.Website/Startup/WebsiteStartup.cs new file mode 100644 index 00000000..a8d62f95 --- /dev/null +++ b/ProjectLighthouse.Website/Startup/WebsiteStartup.cs @@ -0,0 +1,61 @@ +using LBPUnion.ProjectLighthouse.Startup; +using LBPUnion.ProjectLighthouse.Startup.Middlewares; +using Microsoft.AspNetCore.HttpOverrides; + +namespace LBPUnion.ProjectLighthouse.Website.Startup; + +public sealed class WebsiteStartup +{ + public WebsiteStartup(IConfiguration configuration) + { + this.Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddControllers(); + #if DEBUG + services.AddRazorPages().WithRazorPagesAtContentRoot().AddRazorRuntimeCompilation(); + #else + services.AddRazorPages().WithRazorPagesAtContentRoot(); + #endif + + services.AddDbContext(); + + services.Configure + ( + options => + { + options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; + } + ); + + #if DEBUG + services.AddSingleton(); + #else + services.AddSingleton(); + #endif + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + #if DEBUG + app.UseDeveloperExceptionPage(); + #endif + + app.UseForwardedHeaders(); + + app.UseMiddleware(); + + app.UseRouting(); + + app.UseStaticFiles(); + + app.UseEndpoints(endpoints => endpoints.MapControllers()); + app.UseEndpoints(endpoints => endpoints.MapRazorPages()); + } +} \ No newline at end of file diff --git a/ProjectLighthouse/StaticFiles/android-chrome-192x192.png b/ProjectLighthouse.Website/StaticFiles/android-chrome-192x192.png similarity index 100% rename from ProjectLighthouse/StaticFiles/android-chrome-192x192.png rename to ProjectLighthouse.Website/StaticFiles/android-chrome-192x192.png diff --git a/ProjectLighthouse/StaticFiles/android-chrome-512x512.png b/ProjectLighthouse.Website/StaticFiles/android-chrome-512x512.png similarity index 100% rename from ProjectLighthouse/StaticFiles/android-chrome-512x512.png rename to ProjectLighthouse.Website/StaticFiles/android-chrome-512x512.png diff --git a/ProjectLighthouse/StaticFiles/apple-touch-icon.png b/ProjectLighthouse.Website/StaticFiles/apple-touch-icon.png similarity index 100% rename from ProjectLighthouse/StaticFiles/apple-touch-icon.png rename to ProjectLighthouse.Website/StaticFiles/apple-touch-icon.png diff --git a/ProjectLighthouse/StaticFiles/assets/slotCardOverlay.png b/ProjectLighthouse.Website/StaticFiles/assets/slotCardOverlay.png similarity index 100% rename from ProjectLighthouse/StaticFiles/assets/slotCardOverlay.png rename to ProjectLighthouse.Website/StaticFiles/assets/slotCardOverlay.png diff --git a/ProjectLighthouse/StaticFiles/browserconfig.xml b/ProjectLighthouse.Website/StaticFiles/browserconfig.xml similarity index 100% rename from ProjectLighthouse/StaticFiles/browserconfig.xml rename to ProjectLighthouse.Website/StaticFiles/browserconfig.xml diff --git a/ProjectLighthouse/StaticFiles/css/styles.css b/ProjectLighthouse.Website/StaticFiles/css/styles.css similarity index 100% rename from ProjectLighthouse/StaticFiles/css/styles.css rename to ProjectLighthouse.Website/StaticFiles/css/styles.css diff --git a/ProjectLighthouse/StaticFiles/favicon-16x16.png b/ProjectLighthouse.Website/StaticFiles/favicon-16x16.png similarity index 100% rename from ProjectLighthouse/StaticFiles/favicon-16x16.png rename to ProjectLighthouse.Website/StaticFiles/favicon-16x16.png diff --git a/ProjectLighthouse/StaticFiles/favicon-32x32.png b/ProjectLighthouse.Website/StaticFiles/favicon-32x32.png similarity index 100% rename from ProjectLighthouse/StaticFiles/favicon-32x32.png rename to ProjectLighthouse.Website/StaticFiles/favicon-32x32.png diff --git a/ProjectLighthouse/StaticFiles/favicon.ico b/ProjectLighthouse.Website/StaticFiles/favicon.ico similarity index 100% rename from ProjectLighthouse/StaticFiles/favicon.ico rename to ProjectLighthouse.Website/StaticFiles/favicon.ico diff --git a/ProjectLighthouse/StaticFiles/mstile-150x150.png b/ProjectLighthouse.Website/StaticFiles/mstile-150x150.png similarity index 100% rename from ProjectLighthouse/StaticFiles/mstile-150x150.png rename to ProjectLighthouse.Website/StaticFiles/mstile-150x150.png diff --git a/ProjectLighthouse/StaticFiles/safari-pinned-tab.svg b/ProjectLighthouse.Website/StaticFiles/safari-pinned-tab.svg similarity index 100% rename from ProjectLighthouse/StaticFiles/safari-pinned-tab.svg rename to ProjectLighthouse.Website/StaticFiles/safari-pinned-tab.svg diff --git a/ProjectLighthouse/StaticFiles/site.webmanifest b/ProjectLighthouse.Website/StaticFiles/site.webmanifest similarity index 100% rename from ProjectLighthouse/StaticFiles/site.webmanifest rename to ProjectLighthouse.Website/StaticFiles/site.webmanifest diff --git a/ProjectLighthouse.Website/appsettings.Development.json b/ProjectLighthouse.Website/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/ProjectLighthouse.Website/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/ProjectLighthouse.Website/appsettings.json b/ProjectLighthouse.Website/appsettings.json new file mode 100644 index 00000000..10f68b8c --- /dev/null +++ b/ProjectLighthouse.Website/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/ProjectLighthouse.sln b/ProjectLighthouse.sln index 77c99a07..d463a4f8 100644 --- a/ProjectLighthouse.sln +++ b/ProjectLighthouse.sln @@ -12,6 +12,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Tests.Web EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.API", "ProjectLighthouse.API\ProjectLighthouse.API.csproj", "{5593825E-F5C9-467F-9125-3E3249CFEEAB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.GameAPI", "ProjectLighthouse.GameAPI\ProjectLighthouse.GameAPI.csproj", "{0CD7F64B-7827-4AC9-B7D8-CE371D505544}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLighthouse.Website", "ProjectLighthouse.Website\ProjectLighthouse.Website.csproj", "{FA9AEA06-D6B5-4E68-8370-DB9188108635}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -35,6 +39,14 @@ Global {5593825E-F5C9-467F-9125-3E3249CFEEAB}.Debug|Any CPU.Build.0 = Debug|Any CPU {5593825E-F5C9-467F-9125-3E3249CFEEAB}.Release|Any CPU.ActiveCfg = Release|Any CPU {5593825E-F5C9-467F-9125-3E3249CFEEAB}.Release|Any CPU.Build.0 = Release|Any CPU + {0CD7F64B-7827-4AC9-B7D8-CE371D505544}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CD7F64B-7827-4AC9-B7D8-CE371D505544}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CD7F64B-7827-4AC9-B7D8-CE371D505544}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CD7F64B-7827-4AC9-B7D8-CE371D505544}.Release|Any CPU.Build.0 = Release|Any CPU + {FA9AEA06-D6B5-4E68-8370-DB9188108635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA9AEA06-D6B5-4E68-8370-DB9188108635}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA9AEA06-D6B5-4E68-8370-DB9188108635}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA9AEA06-D6B5-4E68-8370-DB9188108635}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {AFC74569-B289-4ACC-B21C-313A3A62C017} = {D360C08E-EA47-43AC-A566-FDF413442980} diff --git a/ProjectLighthouse/Helpers/ResourceHelper.cs b/ProjectLighthouse/Helpers/ResourceHelper.cs index 77a88378..ccfa6621 100644 --- a/ProjectLighthouse/Helpers/ResourceHelper.cs +++ b/ProjectLighthouse/Helpers/ResourceHelper.cs @@ -7,7 +7,7 @@ public static class ResourceHelper { public static string readManifestFile(string fileName) { - using Stream stream = typeof(Program).Assembly.GetManifestResourceStream($"{typeof(Program).Namespace}.{fileName}"); + using Stream stream = typeof(Database).Assembly.GetManifestResourceStream($"{typeof(Database).Namespace}.{fileName}"); using StreamReader reader = new(stream ?? throw new Exception("The assembly or manifest resource is null.")); return reader.ReadToEnd().Trim(); diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index c59ea7c0..73fcd251 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -4,6 +4,7 @@ net6.0 LBPUnion.ProjectLighthouse LBPUnion.ProjectLighthouse + Library @@ -13,7 +14,6 @@ - all diff --git a/ProjectLighthouse/Startup/GameApiStartup.cs b/ProjectLighthouse/Startup/GameApiStartup.cs index a3951e36..d83bd968 100644 --- a/ProjectLighthouse/Startup/GameApiStartup.cs +++ b/ProjectLighthouse/Startup/GameApiStartup.cs @@ -32,11 +32,6 @@ public class GameApiStartup public void ConfigureServices(IServiceCollection services) { services.AddControllers(); - #if DEBUG - services.AddRazorPages().WithRazorPagesAtContentRoot().AddRazorRuntimeCompilation(); - #else - services.AddRazorPages().WithRazorPagesAtContentRoot(); - #endif services.AddMvc ( @@ -194,8 +189,6 @@ public class GameApiStartup app.UseRouting(); - app.UseStaticFiles(); - app.UseEndpoints(endpoints => endpoints.MapControllers()); app.UseEndpoints(endpoints => endpoints.MapRazorPages()); }