diff --git a/ProjectLighthouse.Tests/Tests/FileTypeTests.cs b/ProjectLighthouse.Tests/Tests/FileTypeTests.cs index f3484871..4f36cc1c 100644 --- a/ProjectLighthouse.Tests/Tests/FileTypeTests.cs +++ b/ProjectLighthouse.Tests/Tests/FileTypeTests.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Net; using System.Text; using ProjectLighthouse.Types.Files; using Xunit; diff --git a/ProjectLighthouse/Controllers/ClientConfigurationController.cs b/ProjectLighthouse/Controllers/ClientConfigurationController.cs index fe8ff61f..7b4f949e 100644 --- a/ProjectLighthouse/Controllers/ClientConfigurationController.cs +++ b/ProjectLighthouse/Controllers/ClientConfigurationController.cs @@ -29,7 +29,7 @@ namespace ProjectLighthouse.Controllers { public IActionResult PrivacySettings() { PrivacySettings ps = new() { LevelVisibility = "all", - ProfileVisibility = "all" + ProfileVisibility = "all", }; return this.Ok(ps.Serialize()); diff --git a/ProjectLighthouse/Controllers/LevelListController.cs b/ProjectLighthouse/Controllers/LevelListController.cs index 2088280a..80f17d7c 100644 --- a/ProjectLighthouse/Controllers/LevelListController.cs +++ b/ProjectLighthouse/Controllers/LevelListController.cs @@ -69,7 +69,7 @@ namespace ProjectLighthouse.Controllers { #region Hearted Levels [HttpGet("favouriteSlots/{username}")] - public async Task GetFavouriteSlots(string username) { + public IActionResult GetFavouriteSlots(string username) { IEnumerable heartedLevels = new Database().HeartedLevels .Include(q => q.User) .Include(q => q.Slot) diff --git a/ProjectLighthouse/Controllers/LoginController.cs b/ProjectLighthouse/Controllers/LoginController.cs index 51f01b56..e26f56b8 100644 --- a/ProjectLighthouse/Controllers/LoginController.cs +++ b/ProjectLighthouse/Controllers/LoginController.cs @@ -33,7 +33,7 @@ namespace ProjectLighthouse.Controllers { return this.Ok(new LoginResult { AuthTicket = "MM_AUTH=" + token.UserToken, - LbpEnvVer = ServerSettings.ServerName + LbpEnvVer = ServerSettings.ServerName, }.Serialize()); } } diff --git a/ProjectLighthouse/Controllers/NewsController.cs b/ProjectLighthouse/Controllers/NewsController.cs index 4fc3216e..c002f22a 100644 --- a/ProjectLighthouse/Controllers/NewsController.cs +++ b/ProjectLighthouse/Controllers/NewsController.cs @@ -14,12 +14,12 @@ namespace ProjectLighthouse.Controllers { Summary = "test summary", Image = new NewsImage { Hash = "4947269c5f7061b27225611ee58a9a91a8031bbe", - Alignment = "right" + Alignment = "right", }, Id = 1, Title = "Test Title", Text = "Test Text", - Date = 1348755214000 + Date = 1348755214000, }.Serialize()); return this.Ok(LbpSerializer.StringElement("news", newsEntry)); diff --git a/ProjectLighthouse/Controllers/UserController.cs b/ProjectLighthouse/Controllers/UserController.cs index baebd029..81a47c7e 100644 --- a/ProjectLighthouse/Controllers/UserController.cs +++ b/ProjectLighthouse/Controllers/UserController.cs @@ -40,7 +40,7 @@ namespace ProjectLighthouse.Controllers { if(user == null) return this.StatusCode(403, ""); XmlReaderSettings settings = new() { - Async = true // this is apparently not default + Async = true, // this is apparently not default }; bool locationChanged = false; diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index d4adeafc..09f785be 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -45,7 +45,7 @@ namespace ProjectLighthouse { Token token = new() { UserToken = HashHelper.GenerateAuthToken(), - UserId = user.UserId + UserId = user.UserId, }; this.Tokens.Add(token); @@ -54,8 +54,6 @@ namespace ProjectLighthouse { return token; } - public async Task IsUserAuthenticated(string authToken) => await this.UserFromAuthToken(authToken) != null; - public async Task UserFromAuthToken(string authToken) { Token? token = await Tokens.FirstOrDefaultAsync(t => t.UserToken == authToken); if(token == null) return null; diff --git a/ProjectLighthouse/Startup.cs b/ProjectLighthouse/Startup.cs index b9e9b518..7b0c8c87 100644 --- a/ProjectLighthouse/Startup.cs +++ b/ProjectLighthouse/Startup.cs @@ -3,12 +3,10 @@ using System.IO; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types; namespace ProjectLighthouse { public class Startup { diff --git a/ProjectLighthouse/Types/Comment.cs b/ProjectLighthouse/Types/Comment.cs index d3abdec0..85665237 100644 --- a/ProjectLighthouse/Types/Comment.cs +++ b/ProjectLighthouse/Types/Comment.cs @@ -1,6 +1,5 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; using System.Xml.Serialization; using ProjectLighthouse.Serialization; diff --git a/ProjectLighthouse/Types/Files/LbpFile.cs b/ProjectLighthouse/Types/Files/LbpFile.cs index 710f9647..ea84aaec 100644 --- a/ProjectLighthouse/Types/Files/LbpFile.cs +++ b/ProjectLighthouse/Types/Files/LbpFile.cs @@ -1,4 +1,3 @@ -using System.IO; using ProjectLighthouse.Helpers; namespace ProjectLighthouse.Types.Files { diff --git a/ProjectLighthouse/Types/HeartedLevel.cs b/ProjectLighthouse/Types/HeartedLevel.cs index 09b99c0b..a0d84ba7 100644 --- a/ProjectLighthouse/Types/HeartedLevel.cs +++ b/ProjectLighthouse/Types/HeartedLevel.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace ProjectLighthouse.Types { public class HeartedLevel { + // ReSharper disable once UnusedMember.Global [Key] public int HeartedLevelId { get; set; } public int UserId { get; set; } diff --git a/ProjectLighthouse/Types/LevelTags.cs b/ProjectLighthouse/Types/LevelTags.cs index af721f42..4ef2787d 100644 --- a/ProjectLighthouse/Types/LevelTags.cs +++ b/ProjectLighthouse/Types/LevelTags.cs @@ -82,6 +82,6 @@ namespace ProjectLighthouse.Types { Spikes, Collectables, Vertical, - Balancing + Balancing, } } \ No newline at end of file diff --git a/ProjectLighthouse/Types/QueuedLevel.cs b/ProjectLighthouse/Types/QueuedLevel.cs index f9e191a7..7a712061 100644 --- a/ProjectLighthouse/Types/QueuedLevel.cs +++ b/ProjectLighthouse/Types/QueuedLevel.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace ProjectLighthouse.Types { public class QueuedLevel { + // ReSharper disable once UnusedMember.Global [Key] public int QueuedLevelId { get; set; } public int UserId { get; set; } diff --git a/ProjectLighthouse/Types/Slot.cs b/ProjectLighthouse/Types/Slot.cs index 75662fba..f1856961 100644 --- a/ProjectLighthouse/Types/Slot.cs +++ b/ProjectLighthouse/Types/Slot.cs @@ -1,8 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; using System.Xml.Serialization; -using Microsoft.EntityFrameworkCore.Metadata.Internal; using ProjectLighthouse.Serialization; namespace ProjectLighthouse.Types { diff --git a/ProjectLighthouse/Types/Token.cs b/ProjectLighthouse/Types/Token.cs index f17e99b0..43d9ac72 100644 --- a/ProjectLighthouse/Types/Token.cs +++ b/ProjectLighthouse/Types/Token.cs @@ -1,6 +1,9 @@ +using System.ComponentModel.DataAnnotations; + namespace ProjectLighthouse.Types { public class Token { - public int TokenId { get; set; } + // ReSharper disable once UnusedMember.Global + [Key] public int TokenId { get; set; } public int UserId { get; set; } public string UserToken { get; set; } } diff --git a/ProjectLighthouse/Types/User.cs b/ProjectLighthouse/Types/User.cs index ac846725..4851cfc5 100644 --- a/ProjectLighthouse/Types/User.cs +++ b/ProjectLighthouse/Types/User.cs @@ -1,5 +1,4 @@ using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; using ProjectLighthouse.Serialization; namespace ProjectLighthouse.Types { @@ -60,7 +59,7 @@ namespace ProjectLighthouse.Types { // "lbp1", "lbp2", "lbp3", - "crossControl" + "crossControl", }; private string SerializeSlots() {