diff --git a/ProjectLighthouse/ApiEndpointController.cs b/ProjectLighthouse.Servers.API/ApiEndpointController.cs similarity index 57% rename from ProjectLighthouse/ApiEndpointController.cs rename to ProjectLighthouse.Servers.API/ApiEndpointController.cs index c42889cb..97423a50 100644 --- a/ProjectLighthouse/ApiEndpointController.cs +++ b/ProjectLighthouse.Servers.API/ApiEndpointController.cs @@ -1,9 +1,9 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; -namespace LBPUnion.ProjectLighthouse; +namespace LBPUnion.ProjectLighthouse.Servers.API; [ApiController] [Route("/api/v1")] [Produces("application/json")] public class ApiEndpointController : ControllerBase -{} \ No newline at end of file +{ } \ No newline at end of file diff --git a/ProjectLighthouse.Servers.API/Controllers/SlotEndpoints.cs b/ProjectLighthouse.Servers.API/Controllers/SlotEndpoints.cs index b3a48c21..1ccfeb34 100644 --- a/ProjectLighthouse.Servers.API/Controllers/SlotEndpoints.cs +++ b/ProjectLighthouse.Servers.API/Controllers/SlotEndpoints.cs @@ -1,8 +1,7 @@ #nullable enable using LBPUnion.ProjectLighthouse.Configuration; -using LBPUnion.ProjectLighthouse.Levels; using LBPUnion.ProjectLighthouse.Servers.API.Responses; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.API/Controllers/StatisticsEndpoints.cs b/ProjectLighthouse.Servers.API/Controllers/StatisticsEndpoints.cs index a72ab4ac..7165849e 100644 --- a/ProjectLighthouse.Servers.API/Controllers/StatisticsEndpoints.cs +++ b/ProjectLighthouse.Servers.API/Controllers/StatisticsEndpoints.cs @@ -1,6 +1,6 @@ using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.PlayerData; using LBPUnion.ProjectLighthouse.Servers.API.Responses; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Mvc; namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers; diff --git a/ProjectLighthouse.Servers.API/Controllers/UserEndpoints.cs b/ProjectLighthouse.Servers.API/Controllers/UserEndpoints.cs index 4ed6439a..c9a3e278 100644 --- a/ProjectLighthouse.Servers.API/Controllers/UserEndpoints.cs +++ b/ProjectLighthouse.Servers.API/Controllers/UserEndpoints.cs @@ -1,12 +1,11 @@ #nullable enable -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; -using LBPUnion.ProjectLighthouse.PlayerData; using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -// ReSharper disable RouteTemplates.ActionRoutePrefixCanBeExtractedToControllerRoute - namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers; /// @@ -79,7 +78,7 @@ public class UserEndpoints : ApiEndpointController string authToken = authHeader[(authHeader.IndexOf(' ') + 1)..]; - APIKey? apiKey = await this.database.APIKeys.FirstOrDefaultAsync(k => k.Key == authToken); + ApiKey? apiKey = await this.database.APIKeys.FirstOrDefaultAsync(k => k.Key == authToken); if (apiKey == null) return this.StatusCode(403, null); if (!string.IsNullOrWhiteSpace(username)) diff --git a/ProjectLighthouse.Servers.API/Program.cs b/ProjectLighthouse.Servers.API/Program.cs index f2cb06d4..e689dc98 100644 --- a/ProjectLighthouse.Servers.API/Program.cs +++ b/ProjectLighthouse.Servers.API/Program.cs @@ -1,7 +1,7 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Logging.Loggers.AspNet; using LBPUnion.ProjectLighthouse.Servers.API.Startup; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Misc; using Microsoft.Extensions.DependencyInjection.Extensions; namespace LBPUnion.ProjectLighthouse.Servers.API; diff --git a/ProjectLighthouse.Servers.API/Responses/MinimalSlot.cs b/ProjectLighthouse.Servers.API/Responses/MinimalSlot.cs index 326b9265..33016135 100644 --- a/ProjectLighthouse.Servers.API/Responses/MinimalSlot.cs +++ b/ProjectLighthouse.Servers.API/Responses/MinimalSlot.cs @@ -1,6 +1,5 @@ -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Users; namespace LBPUnion.ProjectLighthouse.Servers.API.Responses; diff --git a/ProjectLighthouse.Servers.API/SwaggerFilter.cs b/ProjectLighthouse.Servers.API/Startup/SwaggerFilter.cs similarity index 91% rename from ProjectLighthouse.Servers.API/SwaggerFilter.cs rename to ProjectLighthouse.Servers.API/Startup/SwaggerFilter.cs index 1a922717..226e294e 100644 --- a/ProjectLighthouse.Servers.API/SwaggerFilter.cs +++ b/ProjectLighthouse.Servers.API/Startup/SwaggerFilter.cs @@ -1,7 +1,7 @@ using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace LBPUnion.ProjectLighthouse.Servers.API; +namespace LBPUnion.ProjectLighthouse.Servers.API.Startup; /// /// diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/ClientConfigurationController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/ClientConfigurationController.cs index 923d6fac..fac95b30 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/ClientConfigurationController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/ClientConfigurationController.cs @@ -2,11 +2,12 @@ using System.Diagnostics.CodeAnalysis; using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Servers.GameServer.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs index 36d7dc81..b6c3e676 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs @@ -1,12 +1,11 @@ #nullable enable -using LBPUnion.ProjectLighthouse.Administration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs index 6a60ddb6..3ae620f3 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs @@ -1,10 +1,12 @@ #nullable enable using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Servers.GameServer.Types; using LBPUnion.ProjectLighthouse.StorableLists.Stores; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -34,7 +36,7 @@ public class FriendsController : ControllerBase SanitizationHelper.SanitizeStringsInClass(npData); List friends = new(); - foreach (string friendName in npData.Friends) + foreach (string friendName in npData.Friends ?? new List()) { User? friend = await this.database.Users.FirstOrDefaultAsync(u => u.Username == friendName); if (friend == null) continue; @@ -43,7 +45,7 @@ public class FriendsController : ControllerBase } List blockedUsers = new(); - foreach (string blockedUserName in npData.BlockedUsers) + foreach (string blockedUserName in npData.BlockedUsers ?? new List()) { User? blockedUser = await this.database.Users.FirstOrDefaultAsync(u => u.Username == blockedUserName); if (blockedUser == null) continue; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/LoginController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/LoginController.cs index 1fbb4dbe..ac226955 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/LoginController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/LoginController.cs @@ -4,10 +4,11 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.Match.Rooms; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Tickets; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Logging; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/LogoutController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/LogoutController.cs index 3ecfcb6e..e3a9d310 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/LogoutController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/LogoutController.cs @@ -1,10 +1,9 @@ using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Matching/EnterLevelController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Matching/EnterLevelController.cs index cb57e0c5..6698c936 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Matching/EnterLevelController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Matching/EnterLevelController.cs @@ -1,8 +1,10 @@ #nullable enable using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Interaction; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Matching/MatchController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Matching/MatchController.cs index 2cb4d637..98578973 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Matching/MatchController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Matching/MatchController.cs @@ -3,11 +3,12 @@ using System.Text.Json; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.Match; -using LBPUnion.ProjectLighthouse.Match.MatchCommands; -using LBPUnion.ProjectLighthouse.Match.Rooms; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Logging; +using LBPUnion.ProjectLighthouse.Types.Matchmaking; +using LBPUnion.ProjectLighthouse.Types.Matchmaking.MatchCommands; +using LBPUnion.ProjectLighthouse.Types.Matchmaking.Rooms; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs index c6f8f1c8..8b289794 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs @@ -3,8 +3,9 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Logging; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs index e5de5e4b..c8b56b30 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/ReportController.cs @@ -1,11 +1,11 @@ #nullable enable using System.Text.Json; -using LBPUnion.ProjectLighthouse.Administration.Reports; using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Moderation; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Moderation.Reports; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -38,7 +38,7 @@ public class ReportController : ControllerBase report.Bounds = JsonSerializer.Serialize(report.XmlBounds.Rect, typeof(Rectangle)); report.Players = JsonSerializer.Serialize(report.XmlPlayers, typeof(ReportPlayer[])); - report.Timestamp = TimeHelper.UnixTimeMilliseconds(); + report.Timestamp = TimeHelper.TimestampMillis; report.ReportingPlayerId = token.UserId; this.database.Reports.Add(report); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs index 4ef80e9d..02d9cca7 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs @@ -4,11 +4,13 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Logging; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -52,7 +54,7 @@ public class PhotosController : ControllerBase photo.CreatorId = user.UserId; photo.Creator = user; - if (photo.XmlLevelInfo != null) + if (photo.XmlLevelInfo?.RootLevel != null) { bool validLevel = false; PhotoSlot photoSlot = photo.XmlLevelInfo; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs index a0bc3a7b..446206c5 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs @@ -5,7 +5,9 @@ using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Serialization; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Misc; +using LBPUnion.ProjectLighthouse.Types.Logging; +using LBPUnion.ProjectLighthouse.Types.Resources; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using IOFile = System.IO.File; @@ -27,7 +29,7 @@ public class ResourcesController : ControllerBase public async Task FilterResources() { ResourceList? resourceList = await this.DeserializeBody(); - if (resourceList == null) return this.BadRequest(); + if (resourceList?.Resources == null) return this.BadRequest(); string resources = resourceList.Resources.Where (s => !FileHelper.ResourceExists(s)) diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/CollectionController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/CollectionController.cs index bba25fd9..5096721d 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/CollectionController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/CollectionController.cs @@ -1,12 +1,14 @@ #nullable enable using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.Levels.Categories; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Logging; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/LevelTagsController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/LevelTagsController.cs index e937ac68..40ae0d84 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/LevelTagsController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/LevelTagsController.cs @@ -1,7 +1,10 @@ using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Interaction; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ListController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ListController.cs index 118742c3..7ee2ce79 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ListController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ListController.cs @@ -1,10 +1,13 @@ #nullable enable using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Interaction; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs index 6468e022..b7f2752d 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs @@ -3,11 +3,15 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Logging; +using LBPUnion.ProjectLighthouse.Types.Misc; +using LBPUnion.ProjectLighthouse.Types.Resources; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -219,7 +223,7 @@ public class PublishController : ControllerBase #endregion slot.FirstUploaded = oldSlot.FirstUploaded; - slot.LastUpdated = TimeHelper.UnixTimeMilliseconds(); + slot.LastUpdated = TimeHelper.TimestampMillis; slot.TeamPick = oldSlot.TeamPick; @@ -253,8 +257,8 @@ public class PublishController : ControllerBase await this.database.SaveChangesAsync(); slot.LocationId = l.Id; slot.CreatorId = user.UserId; - slot.FirstUploaded = TimeHelper.UnixTimeMilliseconds(); - slot.LastUpdated = TimeHelper.UnixTimeMilliseconds(); + slot.FirstUploaded = TimeHelper.TimestampMillis; + slot.LastUpdated = TimeHelper.TimestampMillis; if (slot.MinimumPlayers == 0 || slot.MaximumPlayers == 0) { @@ -287,7 +291,7 @@ public class PublishController : ControllerBase Slot? slot = await this.database.Slots.Include(s => s.Location).FirstOrDefaultAsync(s => s.SlotId == id); if (slot == null) return this.NotFound(); - if (slot.Location == null) throw new ArgumentNullException(); + if (slot.Location == null) throw new ArgumentNullException(nameof(id)); if (slot.CreatorId != token.UserId) return this.StatusCode(403, ""); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs index 2bd91bc8..4303f695 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs @@ -1,11 +1,11 @@ #nullable enable -using LBPUnion.ProjectLighthouse.Administration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Reviews; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Interaction; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -117,7 +117,7 @@ public class ReviewController : ControllerBase review.Text = newReview.Text; review.Deleted = false; - review.Timestamp = TimeHelper.UnixTimeMilliseconds(); + review.Timestamp = TimeHelper.TimestampMillis; // sometimes the game posts/updates a review rating without also calling dpadrate/user/etc (why??) RatedLevel? ratedLevel = await this.database.RatedLevels.FirstOrDefaultAsync(r => r.SlotId == slotId && r.UserId == token.UserId); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs index 277f7a2c..91bb0ff4 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs @@ -2,12 +2,14 @@ using System.Diagnostics.CodeAnalysis; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.StorableLists.Stores; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Logging; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SearchController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SearchController.cs index a3431423..80af2faa 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SearchController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SearchController.cs @@ -1,8 +1,9 @@ #nullable enable using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs index 8a6deaee..da23d25b 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs @@ -2,12 +2,13 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.Match.Rooms; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; -using LBPUnion.ProjectLighthouse.PlayerData.Reviews; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Interaction; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Matchmaking.Rooms; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/StatisticsController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/StatisticsController.cs index 0999b344..0c65f3c1 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/StatisticsController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/StatisticsController.cs @@ -2,7 +2,6 @@ using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using LBPUnion.ProjectLighthouse.PlayerData; using LBPUnion.ProjectLighthouse.Extensions; namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers; diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs index 143cd16d..60433956 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs @@ -3,10 +3,14 @@ using System.Text.Json; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Servers.GameServer.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Misc; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -185,7 +189,7 @@ public class UserController : ControllerBase string bodyString = await this.ReadBodyAsync(); Pins? pinJson = JsonSerializer.Deserialize(bodyString); - if (pinJson == null) return this.BadRequest(); + if (pinJson?.ProfilePins == null) return this.BadRequest(); // Sometimes the update gets called periodically as pin progress updates via playing, // may not affect equipped profile pins however, so check before setting it. diff --git a/ProjectLighthouse.Servers.GameServer/Middlewares/SetLastContactMiddleware.cs b/ProjectLighthouse.Servers.GameServer/Middlewares/SetLastContactMiddleware.cs index 76c94f35..3b08710f 100644 --- a/ProjectLighthouse.Servers.GameServer/Middlewares/SetLastContactMiddleware.cs +++ b/ProjectLighthouse.Servers.GameServer/Middlewares/SetLastContactMiddleware.cs @@ -1,5 +1,7 @@ +using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Middlewares; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Users; namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Middlewares; diff --git a/ProjectLighthouse.Servers.GameServer/Program.cs b/ProjectLighthouse.Servers.GameServer/Program.cs index 35acb397..50ef3ad6 100644 --- a/ProjectLighthouse.Servers.GameServer/Program.cs +++ b/ProjectLighthouse.Servers.GameServer/Program.cs @@ -1,7 +1,7 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Logging.Loggers.AspNet; using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Misc; using Microsoft.Extensions.DependencyInjection.Extensions; namespace LBPUnion.ProjectLighthouse.Servers.GameServer; diff --git a/ProjectLighthouse.Servers.GameServer/Startup/GameServerStartup.cs b/ProjectLighthouse.Servers.GameServer/Startup/GameServerStartup.cs index 26c0093a..9fd17804 100644 --- a/ProjectLighthouse.Servers.GameServer/Startup/GameServerStartup.cs +++ b/ProjectLighthouse.Servers.GameServer/Startup/GameServerStartup.cs @@ -3,8 +3,7 @@ using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Middlewares; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Servers.GameServer.Middlewares; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.Cookies; +using LBPUnion.ProjectLighthouse.Types.Logging; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.HttpOverrides; diff --git a/ProjectLighthouse.Servers.GameServer/Startup/TokenAuthHandler.cs b/ProjectLighthouse.Servers.GameServer/Startup/TokenAuthHandler.cs index d0cb8b54..101fd47f 100644 --- a/ProjectLighthouse.Servers.GameServer/Startup/TokenAuthHandler.cs +++ b/ProjectLighthouse.Servers.GameServer/Startup/TokenAuthHandler.cs @@ -1,6 +1,6 @@ using System.Security.Claims; using System.Text.Encodings.Web; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; diff --git a/ProjectLighthouse/Levels/Categories/CategoryHelper.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryHelper.cs similarity index 79% rename from ProjectLighthouse/Levels/Categories/CategoryHelper.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryHelper.cs index 7330fbe9..d6ff6681 100644 --- a/ProjectLighthouse/Levels/Categories/CategoryHelper.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryHelper.cs @@ -1,6 +1,7 @@ -using System.Collections.Generic; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public static class CategoryHelper { diff --git a/ProjectLighthouse/Levels/Categories/CategoryWithUser.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryWithUser.cs similarity index 90% rename from ProjectLighthouse/Levels/Categories/CategoryWithUser.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryWithUser.cs index 893d32a1..9a74f81f 100644 --- a/ProjectLighthouse/Levels/Categories/CategoryWithUser.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/CategoryWithUser.cs @@ -1,11 +1,13 @@ #nullable enable -using System.Collections.Generic; using System.Diagnostics; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Logging; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public abstract class CategoryWithUser : Category { diff --git a/ProjectLighthouse/Levels/Categories/CustomCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/CustomCategory.cs similarity index 86% rename from ProjectLighthouse/Levels/Categories/CustomCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/CustomCategory.cs index 295f0842..92300efa 100644 --- a/ProjectLighthouse/Levels/Categories/CustomCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/CustomCategory.cs @@ -1,10 +1,10 @@ #nullable enable -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class CustomCategory : Category { diff --git a/ProjectLighthouse/Levels/Categories/HeartedCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/HeartedCategory.cs similarity index 86% rename from ProjectLighthouse/Levels/Categories/HeartedCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/HeartedCategory.cs index e5f080df..22d13997 100644 --- a/ProjectLighthouse/Levels/Categories/HeartedCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/HeartedCategory.cs @@ -1,13 +1,12 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class HeartedCategory : CategoryWithUser { diff --git a/ProjectLighthouse/Levels/Categories/HighestRatedCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/HighestRatedCategory.cs similarity index 83% rename from ProjectLighthouse/Levels/Categories/HighestRatedCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/HighestRatedCategory.cs index aa41324d..962530c0 100644 --- a/ProjectLighthouse/Levels/Categories/HighestRatedCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/HighestRatedCategory.cs @@ -1,12 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using System.Security.Cryptography; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class HighestRatedCategory : Category { diff --git a/ProjectLighthouse/Levels/Categories/LuckyDipCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/LuckyDipCategory.cs similarity index 82% rename from ProjectLighthouse/Levels/Categories/LuckyDipCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/LuckyDipCategory.cs index e49b8f88..69483a50 100644 --- a/ProjectLighthouse/Levels/Categories/LuckyDipCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/LuckyDipCategory.cs @@ -1,12 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class LuckyDipCategory : Category { diff --git a/ProjectLighthouse/Levels/Categories/MostHeartedCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/MostHeartedCategory.cs similarity index 83% rename from ProjectLighthouse/Levels/Categories/MostHeartedCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/MostHeartedCategory.cs index e11a055c..db4b5cda 100644 --- a/ProjectLighthouse/Levels/Categories/MostHeartedCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/MostHeartedCategory.cs @@ -1,12 +1,11 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using System.Security.Cryptography; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class MostHeartedCategory : Category { diff --git a/ProjectLighthouse/Levels/Categories/MostPlayedCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/MostPlayedCategory.cs similarity index 85% rename from ProjectLighthouse/Levels/Categories/MostPlayedCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/MostPlayedCategory.cs index f69870a6..ffa28e68 100644 --- a/ProjectLighthouse/Levels/Categories/MostPlayedCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/MostPlayedCategory.cs @@ -1,11 +1,10 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class MostPlayedCategory : Category { diff --git a/ProjectLighthouse/Levels/Categories/NewestLevelsCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/NewestLevelsCategory.cs similarity index 81% rename from ProjectLighthouse/Levels/Categories/NewestLevelsCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/NewestLevelsCategory.cs index 12fe8fa6..3977f85a 100644 --- a/ProjectLighthouse/Levels/Categories/NewestLevelsCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/NewestLevelsCategory.cs @@ -1,11 +1,10 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class NewestLevelsCategory : Category { diff --git a/ProjectLighthouse/Levels/Categories/QueueCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/QueueCategory.cs similarity index 86% rename from ProjectLighthouse/Levels/Categories/QueueCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/QueueCategory.cs index a3eb9151..f7e1570c 100644 --- a/ProjectLighthouse/Levels/Categories/QueueCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/QueueCategory.cs @@ -1,13 +1,12 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class QueueCategory : CategoryWithUser { diff --git a/ProjectLighthouse/Levels/Categories/TeamPicksCategory.cs b/ProjectLighthouse.Servers.GameServer/Types/Categories/TeamPicksCategory.cs similarity index 74% rename from ProjectLighthouse/Levels/Categories/TeamPicksCategory.cs rename to ProjectLighthouse.Servers.GameServer/Types/Categories/TeamPicksCategory.cs index 3288e6a1..13624956 100644 --- a/ProjectLighthouse/Levels/Categories/TeamPicksCategory.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/Categories/TeamPicksCategory.cs @@ -1,11 +1,10 @@ #nullable enable -using System; -using System.Collections.Generic; -using System.Linq; using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Users; -namespace LBPUnion.ProjectLighthouse.Levels.Categories; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Categories; public class TeamPicksCategory : Category { @@ -16,8 +15,7 @@ public class TeamPicksCategory : Category public override Slot? GetPreviewSlot(Database database) => database.Slots.OrderByDescending(s => s.FirstUploaded).FirstOrDefault(s => s.TeamPick); public override IEnumerable GetSlots (Database database, int pageStart, int pageSize) - => database.Slots.ByGameVersion - (GameVersion.LittleBigPlanet3, false, true) + => database.Slots.ByGameVersion(GameVersion.LittleBigPlanet3, false, true) .OrderByDescending(s => s.FirstUploaded) .Where(s => s.TeamPick) .Skip(Math.Max(0, pageStart - 1)) diff --git a/ProjectLighthouse.Servers.GameServer/Types/Misc/ResourceList.cs b/ProjectLighthouse.Servers.GameServer/Types/Misc/ResourceList.cs new file mode 100644 index 00000000..140e4394 --- /dev/null +++ b/ProjectLighthouse.Servers.GameServer/Types/Misc/ResourceList.cs @@ -0,0 +1,16 @@ +using System.Xml.Serialization; + +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types.Misc; + +/// +/// Used by the game to send a list of hashed resources +/// Use cases include requesting which resources are filtered +/// or what resources aren't currently uploaded to the server +/// +[XmlRoot("resources")] +[XmlType("resources")] +public class ResourceList +{ + [XmlElement("resource")] + public string[]? Resources; +} \ No newline at end of file diff --git a/ProjectLighthouse/PlayerData/Profiles/ClientsConnected.cs b/ProjectLighthouse.Servers.GameServer/Types/User/ClientsConnected.cs similarity index 92% rename from ProjectLighthouse/PlayerData/Profiles/ClientsConnected.cs rename to ProjectLighthouse.Servers.GameServer/Types/User/ClientsConnected.cs index b0b9c57a..dc1d206e 100644 --- a/ProjectLighthouse/PlayerData/Profiles/ClientsConnected.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/User/ClientsConnected.cs @@ -1,7 +1,7 @@ using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.EntityFrameworkCore; -namespace LBPUnion.ProjectLighthouse.PlayerData.Profiles; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types; [Keyless] public class ClientsConnected diff --git a/ProjectLighthouse.Servers.GameServer/Types/User/NPData.cs b/ProjectLighthouse.Servers.GameServer/Types/User/NPData.cs new file mode 100644 index 00000000..d7ccb175 --- /dev/null +++ b/ProjectLighthouse.Servers.GameServer/Types/User/NPData.cs @@ -0,0 +1,21 @@ +using System.Xml.Serialization; + +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types; + +/// +/// Sent by the game client to inform the server +/// of the user's friend list +/// Used to filter activities from friends +/// +[XmlRoot("npdata")] +[XmlType("npdata")] +public class NPData +{ + [XmlArray("friends")] + [XmlArrayItem("npHandle")] + public List? Friends { get; set; } + + [XmlArray("blocked")] + [XmlArrayItem("npHandle")] + public List? BlockedUsers { get; set; } +} \ No newline at end of file diff --git a/ProjectLighthouse.Servers.GameServer/Types/User/Pins.cs b/ProjectLighthouse.Servers.GameServer/Types/User/Pins.cs new file mode 100644 index 00000000..e9658caf --- /dev/null +++ b/ProjectLighthouse.Servers.GameServer/Types/User/Pins.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types; + +public class Pins +{ + [JsonPropertyName("progress")] + public long[]? Progress { get; set; } + + [JsonPropertyName("awards")] + public long[]? Awards { get; set; } + + [JsonPropertyName("profile_pins")] + public long[]? ProfilePins { get; set; } +} \ No newline at end of file diff --git a/ProjectLighthouse/PlayerData/PrivacySettings.cs b/ProjectLighthouse.Servers.GameServer/Types/User/PrivacySettings.cs similarity index 91% rename from ProjectLighthouse/PlayerData/PrivacySettings.cs rename to ProjectLighthouse.Servers.GameServer/Types/User/PrivacySettings.cs index de57b9a1..084efba3 100644 --- a/ProjectLighthouse/PlayerData/PrivacySettings.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/User/PrivacySettings.cs @@ -2,7 +2,7 @@ using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Serialization; -namespace LBPUnion.ProjectLighthouse.PlayerData; +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types; [XmlRoot("privacySettings")] [XmlType("privacySettings")] diff --git a/ProjectLighthouse/PlayerData/Profiles/UserUpdate.cs b/ProjectLighthouse.Servers.GameServer/Types/User/UserUpdate.cs similarity index 57% rename from ProjectLighthouse/PlayerData/Profiles/UserUpdate.cs rename to ProjectLighthouse.Servers.GameServer/Types/User/UserUpdate.cs index f7d75a79..be9d959f 100644 --- a/ProjectLighthouse/PlayerData/Profiles/UserUpdate.cs +++ b/ProjectLighthouse.Servers.GameServer/Types/User/UserUpdate.cs @@ -1,9 +1,14 @@ #nullable enable -using System.Collections.Generic; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Misc; -namespace LBPUnion.ProjectLighthouse.PlayerData.Profiles; - +namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Types; +/// +/// Used by the games to update details about a user's profile +/// LBP1 only uses Location and IconHash +/// LBP2 and onward uses the rest +/// public class UserUpdate { [XmlElement("location")] @@ -33,4 +38,17 @@ public class UserUpdate [XmlElement("boo2")] public string? BooHash { get; set; } +} + +[XmlRoot("slot")] +public class UserUpdateSlot +{ + [XmlElement("type")] + public SlotType? Type { get; set; } + + [XmlElement("id")] + public int? SlotId { get; set; } + + [XmlElement("location")] + public Location? Location { get; set; } } \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminReportController.cs b/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminReportController.cs index 5effec26..cefea838 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminReportController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminReportController.cs @@ -1,7 +1,7 @@ #nullable enable -using LBPUnion.ProjectLighthouse.Administration.Reports; using LBPUnion.ProjectLighthouse.Files; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Moderation; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -54,14 +54,7 @@ public class AdminReportController : ControllerBase GriefReport? report = await this.database.Reports.FirstOrDefaultAsync(r => r.ReportId == id); if (report == null) return this.NotFound(); - if (System.IO.File.Exists(Path.Combine("png", $"{report.JpegHash}.png"))) - { - System.IO.File.Delete(Path.Combine("png", $"{report.JpegHash}.png")); - } - if (System.IO.File.Exists(Path.Combine("r", report.JpegHash))) - { - System.IO.File.Delete(Path.Combine("r", report.JpegHash)); - } + FileHelper.DeleteResource(report.JpegHash); this.database.Reports.Remove(report); diff --git a/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs b/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs index 61e65eda..8e624ef4 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs @@ -1,8 +1,10 @@ #nullable enable -using LBPUnion.ProjectLighthouse.Administration; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Logging; +using LBPUnion.ProjectLighthouse.Types.Moderation.Cases; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using IOFile = System.IO.File; diff --git a/ProjectLighthouse.Servers.Website/Controllers/Debug/RoomVisualizerController.cs b/ProjectLighthouse.Servers.Website/Controllers/Debug/RoomVisualizerController.cs index d5ce4164..ec2e7d50 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Debug/RoomVisualizerController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Debug/RoomVisualizerController.cs @@ -1,8 +1,5 @@ -using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Match.Rooms; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.Website/Controllers/ExternalAuth/AuthenticationController.cs b/ProjectLighthouse.Servers.Website/Controllers/ExternalAuth/AuthenticationController.cs index 57cf9909..6ab846ee 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/ExternalAuth/AuthenticationController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/ExternalAuth/AuthenticationController.cs @@ -1,7 +1,7 @@ #nullable enable using LBPUnion.ProjectLighthouse.Extensions; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Users; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationCaseController.cs b/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationCaseController.cs index 497b51a3..af54fb84 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationCaseController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationCaseController.cs @@ -1,5 +1,6 @@ using LBPUnion.ProjectLighthouse.Administration; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Moderation; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationRemovalController.cs b/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationRemovalController.cs index 6b17ea79..9a9d10f8 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationRemovalController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationRemovalController.cs @@ -1,8 +1,5 @@ -using LBPUnion.ProjectLighthouse.Administration; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; -using LBPUnion.ProjectLighthouse.PlayerData.Reviews; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -12,7 +9,6 @@ namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers.Moderator; [Route("moderation")] public class ModerationRemovalController : ControllerBase { - private readonly Database database; public ModerationRemovalController(Database database) @@ -69,7 +65,7 @@ public class ModerationRemovalController : ControllerBase case CommentType.Profile: canDelete = user.UserId == comment.PosterUserId || user.UserId == comment.TargetId; break; - default: throw new ArgumentOutOfRangeException(); + default: throw new ArgumentOutOfRangeException(nameof(commentId)); } if (!canDelete && !user.IsModerator) return this.Redirect(callbackUrl ?? "~/"); diff --git a/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationSlotController.cs b/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationSlotController.cs index f5cacba2..ae98bb43 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationSlotController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationSlotController.cs @@ -1,8 +1,8 @@ #nullable enable using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.Website/Controllers/ResourcesController.cs b/ProjectLighthouse.Servers.Website/Controllers/ResourcesController.cs index f54da460..6b031a54 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/ResourcesController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/ResourcesController.cs @@ -1,4 +1,5 @@ using LBPUnion.ProjectLighthouse.Files; +using LBPUnion.ProjectLighthouse.Types.Resources; using Microsoft.AspNetCore.Mvc; using IOFile = System.IO.File; diff --git a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs index 46189c2c..2da7311d 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs @@ -1,9 +1,10 @@ #nullable enable using LBPUnion.ProjectLighthouse.Helpers; -using LBPUnion.ProjectLighthouse.Levels; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Logging; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -34,7 +35,7 @@ public class SlotPageController : ControllerBase Slot? targetSlot = await this.database.Slots.Include(s => s.Location).FirstOrDefaultAsync(s => s.SlotId == id); if (targetSlot == null) return this.Redirect("~/slots/0"); - if (targetSlot.Location == null) throw new ArgumentNullException(); + if (targetSlot.Location == null) throw new ArgumentNullException(nameof(id)); if (targetSlot.CreatorId != token.UserId) return this.Redirect("~/slot/" + id); diff --git a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs index 1d361f13..76bd0e9f 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs @@ -1,9 +1,9 @@ #nullable enable using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Logging; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; -using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; +using LBPUnion.ProjectLighthouse.Types.Logging; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; diff --git a/ProjectLighthouse.Servers.Website/Extensions/PartialExtensions.cs b/ProjectLighthouse.Servers.Website/Extensions/PartialExtensions.cs index a907da5b..71be2f75 100644 --- a/ProjectLighthouse.Servers.Website/Extensions/PartialExtensions.cs +++ b/ProjectLighthouse.Servers.Website/Extensions/PartialExtensions.cs @@ -1,6 +1,5 @@ -using LBPUnion.ProjectLighthouse.Levels; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; diff --git a/ProjectLighthouse.Servers.Website/Middlewares/UserRequiredRedirectMiddleware.cs b/ProjectLighthouse.Servers.Website/Middlewares/UserRequiredRedirectMiddleware.cs index 28b279dd..9e40e014 100644 --- a/ProjectLighthouse.Servers.Website/Middlewares/UserRequiredRedirectMiddleware.cs +++ b/ProjectLighthouse.Servers.Website/Middlewares/UserRequiredRedirectMiddleware.cs @@ -1,7 +1,7 @@ using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Middlewares; -using LBPUnion.ProjectLighthouse.PlayerData; -using LBPUnion.ProjectLighthouse.PlayerData.Profiles; +using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Token; using Microsoft.EntityFrameworkCore; namespace LBPUnion.ProjectLighthouse.Servers.Website.Middlewares; diff --git a/ProjectLighthouse.Servers.Website/Pages/Admin/AdminAPIKeyPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/Admin/AdminApiKeyPage.cshtml similarity index 90% rename from ProjectLighthouse.Servers.Website/Pages/Admin/AdminAPIKeyPage.cshtml rename to ProjectLighthouse.Servers.Website/Pages/Admin/AdminApiKeyPage.cshtml index 67a541cf..7a32a1fe 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Admin/AdminAPIKeyPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Admin/AdminApiKeyPage.cshtml @@ -1,7 +1,6 @@ @page "/admin/keys" - -@using LBPUnion.ProjectLighthouse.PlayerData -@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.AdminAPIKeyPageModel +@using LBPUnion.ProjectLighthouse.Types.Entities.Token +@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.AdminApiKeyPageModel @{ Layout = "Layouts/BaseLayout"; Model.Title = "API Keys"; @@ -9,7 +8,7 @@ @inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Antiforgery @{ - var token = Antiforgery.GetAndStoreTokens(HttpContext).RequestToken; + string? token = Antiforgery.GetAndStoreTokens(HttpContext).RequestToken; }