diff --git a/ProjectLighthouse.Tests/DatabaseFact.cs b/ProjectLighthouse.Tests/DatabaseFact.cs index c453ffd4..93e2b07d 100644 --- a/ProjectLighthouse.Tests/DatabaseFact.cs +++ b/ProjectLighthouse.Tests/DatabaseFact.cs @@ -1,12 +1,12 @@ +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Types.Settings; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public sealed class DatabaseFact : FactAttribute { public DatabaseFact() { ServerSettings.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse"; - if(!ServerSettings.DbConnected) Skip = "Database not available"; + if(!ServerSettings.DbConnected) this.Skip = "Database not available"; else { using Database database = new(); database.Database.Migrate(); diff --git a/ProjectLighthouse.Tests/LighthouseTest.cs b/ProjectLighthouse.Tests/LighthouseTest.cs index 4f635259..d9027f7f 100644 --- a/ProjectLighthouse.Tests/LighthouseTest.cs +++ b/ProjectLighthouse.Tests/LighthouseTest.cs @@ -3,12 +3,12 @@ using System.IO; using System.Net.Http; using System.Threading.Tasks; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { [SuppressMessage("ReSharper", "UnusedMember.Global")] public class LighthouseTest { public readonly TestServer Server; @@ -41,7 +41,7 @@ namespace ProjectLighthouse.Tests { return (LoginResult)serializer.Deserialize(new StringReader(responseContent))!; } - public Task AuthenticatedRequest(string endpoint, string mmAuth) => AuthenticatedRequest(endpoint, mmAuth, HttpMethod.Get); + public Task AuthenticatedRequest(string endpoint, string mmAuth) => this.AuthenticatedRequest(endpoint, mmAuth, HttpMethod.Get); public Task AuthenticatedRequest(string endpoint, string mmAuth, HttpMethod method) { using var requestMessage = new HttpRequestMessage(method, endpoint); diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index b705c896..1b66add2 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -6,6 +6,10 @@ false net5.0;net6.0 + + LBPUnion.ProjectLighthouse.Tests + + LBPUnion.ProjectLighthouse.Tests diff --git a/ProjectLighthouse.Tests/Tests/AuthenticationTests.cs b/ProjectLighthouse.Tests/Tests/AuthenticationTests.cs index 9194b035..5ac770ff 100644 --- a/ProjectLighthouse.Tests/Tests/AuthenticationTests.cs +++ b/ProjectLighthouse.Tests/Tests/AuthenticationTests.cs @@ -1,11 +1,11 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Settings; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class AuthenticationTests : LighthouseTest { [Fact] public async Task ShouldReturnErrorOnNoPostData() { @@ -43,7 +43,7 @@ namespace ProjectLighthouse.Tests { public async Task CanUseToken() { LoginResult loginResult = await this.Authenticate(); - HttpResponseMessage response = await AuthenticatedRequest("/LITTLEBIGPLANETPS3_XML/eula", loginResult.AuthTicket); + HttpResponseMessage response = await this.AuthenticatedRequest("/LITTLEBIGPLANETPS3_XML/eula", loginResult.AuthTicket); string responseContent = await response.Content.ReadAsStringAsync(); Assert.True(response.IsSuccessStatusCode); diff --git a/ProjectLighthouse.Tests/Tests/DatabaseTests.cs b/ProjectLighthouse.Tests/Tests/DatabaseTests.cs index 113e2a63..1e2cf60e 100644 --- a/ProjectLighthouse.Tests/Tests/DatabaseTests.cs +++ b/ProjectLighthouse.Tests/Tests/DatabaseTests.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class DatabaseTests : LighthouseTest { [DatabaseFact] public async Task CanCreateUserTwice() { diff --git a/ProjectLighthouse.Tests/Tests/FileTypeTests.cs b/ProjectLighthouse.Tests/Tests/FileTypeTests.cs index 4f36cc1c..61960ebe 100644 --- a/ProjectLighthouse.Tests/Tests/FileTypeTests.cs +++ b/ProjectLighthouse.Tests/Tests/FileTypeTests.cs @@ -1,10 +1,10 @@ using System; using System.IO; using System.Text; -using ProjectLighthouse.Types.Files; +using LBPUnion.ProjectLighthouse.Types.Files; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class FileTypeTests { [Fact] public void ShouldRecognizeLevel() { diff --git a/ProjectLighthouse.Tests/Tests/MatchTests.cs b/ProjectLighthouse.Tests/Tests/MatchTests.cs index 4d82e285..e6ba1207 100644 --- a/ProjectLighthouse.Tests/Tests/MatchTests.cs +++ b/ProjectLighthouse.Tests/Tests/MatchTests.cs @@ -2,10 +2,10 @@ using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class MatchTests : LighthouseTest { private static readonly SemaphoreSlim semaphore = new(1, 1); @@ -14,7 +14,7 @@ namespace ProjectLighthouse.Tests { LoginResult loginResult = await this.Authenticate(); await semaphore.WaitAsync(); - HttpResponseMessage result = await AuthenticatedUploadDataRequest("LITTLEBIGPLANETPS3_XML/match", Array.Empty(), loginResult.AuthTicket); + HttpResponseMessage result = await this.AuthenticatedUploadDataRequest("LITTLEBIGPLANETPS3_XML/match", Array.Empty(), loginResult.AuthTicket); Assert.True(result.IsSuccessStatusCode); semaphore.Release(); @@ -29,7 +29,7 @@ namespace ProjectLighthouse.Tests { int oldPlayerCount = await this.GetPlayerCount(); - HttpResponseMessage result = await AuthenticatedUploadDataRequest("LITTLEBIGPLANETPS3_XML/match", Array.Empty(), loginResult.AuthTicket); + HttpResponseMessage result = await this.AuthenticatedUploadDataRequest("LITTLEBIGPLANETPS3_XML/match", Array.Empty(), loginResult.AuthTicket); Assert.True(result.IsSuccessStatusCode); int playerCount = await this.GetPlayerCount(); diff --git a/ProjectLighthouse.Tests/Tests/SerializerTests.cs b/ProjectLighthouse.Tests/Tests/SerializerTests.cs index 1f89c2f1..14c1f5c8 100644 --- a/ProjectLighthouse.Tests/Tests/SerializerTests.cs +++ b/ProjectLighthouse.Tests/Tests/SerializerTests.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class SerializerTests : LighthouseTest { [Fact] public void BlankElementWorks() { diff --git a/ProjectLighthouse.Tests/Tests/SlotTests.cs b/ProjectLighthouse.Tests/Tests/SlotTests.cs index 4b7317bd..3b136857 100644 --- a/ProjectLighthouse.Tests/Tests/SlotTests.cs +++ b/ProjectLighthouse.Tests/Tests/SlotTests.cs @@ -1,10 +1,10 @@ using System.Threading.Tasks; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Levels; -using ProjectLighthouse.Types.Profiles; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Profiles; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class SlotTests : LighthouseTest { [DatabaseFact] public async Task ShouldOnlyShowUsersLevels() { diff --git a/ProjectLighthouse.Tests/Tests/UploadTests.cs b/ProjectLighthouse.Tests/Tests/UploadTests.cs index f51504d0..30190fc3 100644 --- a/ProjectLighthouse.Tests/Tests/UploadTests.cs +++ b/ProjectLighthouse.Tests/Tests/UploadTests.cs @@ -4,7 +4,7 @@ using System.Net.Http; using System.Threading.Tasks; using Xunit; -namespace ProjectLighthouse.Tests { +namespace LBPUnion.ProjectLighthouse.Tests { public class UploadTests : LighthouseTest { public UploadTests() { string assetsDirectory = Path.Combine(Environment.CurrentDirectory, "r"); @@ -13,31 +13,31 @@ namespace ProjectLighthouse.Tests { [Fact] public async Task ShouldNotAcceptScript() { - HttpResponseMessage response = await UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/scriptTest", "ExampleFiles/TestScript.ff"); + HttpResponseMessage response = await this.UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/scriptTest", "ExampleFiles/TestScript.ff"); Assert.False(response.IsSuccessStatusCode); } [Fact] public async Task ShouldNotAcceptFarc() { - HttpResponseMessage response = await UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/farcTest", "ExampleFiles/TestFarc.farc"); + HttpResponseMessage response = await this.UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/farcTest", "ExampleFiles/TestFarc.farc"); Assert.False(response.IsSuccessStatusCode); } [Fact] public async Task ShouldNotAcceptGarbage() { - HttpResponseMessage response = await UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/garbageTest", "ExampleFiles/TestGarbage.bin"); + HttpResponseMessage response = await this.UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/garbageTest", "ExampleFiles/TestGarbage.bin"); Assert.False(response.IsSuccessStatusCode); } [Fact] public async Task ShouldAcceptTexture() { - HttpResponseMessage response = await UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/textureTest", "ExampleFiles/TestTexture.tex"); + HttpResponseMessage response = await this.UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/textureTest", "ExampleFiles/TestTexture.tex"); Assert.True(response.IsSuccessStatusCode); } [Fact] public async Task ShouldAcceptLevel() { - HttpResponseMessage response = await UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/levelTest", "ExampleFiles/TestLevel.lvl"); + HttpResponseMessage response = await this.UploadFileRequest("/LITTLEBIGPLANETPS3_XML/upload/levelTest", "ExampleFiles/TestLevel.lvl"); Assert.True(response.IsSuccessStatusCode); } } diff --git a/ProjectLighthouse/Controllers/ClientConfigurationController.cs b/ProjectLighthouse/Controllers/ClientConfigurationController.cs index 05a6492c..7e5aefce 100644 --- a/ProjectLighthouse/Controllers/ClientConfigurationController.cs +++ b/ProjectLighthouse/Controllers/ClientConfigurationController.cs @@ -1,8 +1,8 @@ using System.Diagnostics.CodeAnalysis; +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; -using ProjectLighthouse.Types.Settings; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/plain")] diff --git a/ProjectLighthouse/Controllers/CommentController.cs b/ProjectLighthouse/Controllers/CommentController.cs index d24b05cb..9f2967f1 100644 --- a/ProjectLighthouse/Controllers/CommentController.cs +++ b/ProjectLighthouse/Controllers/CommentController.cs @@ -3,13 +3,13 @@ using System.IO; using System.Linq; using System.Threading.Tasks; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Profiles; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] @@ -21,7 +21,7 @@ namespace ProjectLighthouse.Controllers { [HttpGet("userComments/{username}")] public async Task GetComments(string username) { - List comments = await database.Comments + List comments = await this.database.Comments .Include(c => c.Target) .Include(c => c.Poster) .Where(c => c.Target.Username == username) @@ -33,25 +33,25 @@ namespace ProjectLighthouse.Controllers { [HttpPost("postUserComment/{username}")] public async Task PostComment(string username) { - Request.Body.Position = 0; - string bodyString = await new StreamReader(Request.Body).ReadToEndAsync(); + this.Request.Body.Position = 0; + string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync(); XmlSerializer serializer = new(typeof(Comment)); Comment comment = (Comment)serializer.Deserialize(new StringReader(bodyString)); - User poster = await database.UserFromRequest(Request); + User poster = await this.database.UserFromRequest(this.Request); if(poster == null) return this.StatusCode(403, ""); - User target = await database.Users.FirstOrDefaultAsync(u => u.Username == username); + User target = await this.database.Users.FirstOrDefaultAsync(u => u.Username == username); if(comment == null || target == null) return this.BadRequest(); comment.PosterUserId = poster.UserId; comment.TargetUserId = target.UserId; - database.Comments.Add(comment); - await database.SaveChangesAsync(); + this.database.Comments.Add(comment); + await this.database.SaveChangesAsync(); return this.Ok(); } } diff --git a/ProjectLighthouse/Controllers/EnterLevelController.cs b/ProjectLighthouse/Controllers/EnterLevelController.cs index 778660b3..88d3933f 100644 --- a/ProjectLighthouse/Controllers/EnterLevelController.cs +++ b/ProjectLighthouse/Controllers/EnterLevelController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/enterLevel")] // [Produces("text/plain")] diff --git a/ProjectLighthouse/Controllers/LevelListController.cs b/ProjectLighthouse/Controllers/LevelListController.cs index bab8a0f5..81086377 100644 --- a/ProjectLighthouse/Controllers/LevelListController.cs +++ b/ProjectLighthouse/Controllers/LevelListController.cs @@ -2,13 +2,13 @@ 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; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Levels; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] diff --git a/ProjectLighthouse/Controllers/LevelTagsController.cs b/ProjectLighthouse/Controllers/LevelTagsController.cs index 8358fd23..1ed96dc6 100644 --- a/ProjectLighthouse/Controllers/LevelTagsController.cs +++ b/ProjectLighthouse/Controllers/LevelTagsController.cs @@ -1,8 +1,8 @@ using System; +using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; -using ProjectLighthouse.Types.Levels; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/tags")] [Produces("text/plain")] diff --git a/ProjectLighthouse/Controllers/LoginController.cs b/ProjectLighthouse/Controllers/LoginController.cs index 4af51dae..edf494d0 100644 --- a/ProjectLighthouse/Controllers/LoginController.cs +++ b/ProjectLighthouse/Controllers/LoginController.cs @@ -1,11 +1,11 @@ #nullable enable using System.IO; using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Settings; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/login")] [Produces("text/xml")] @@ -18,7 +18,7 @@ namespace ProjectLighthouse.Controllers { [HttpPost] public async Task Login() { - string body = await new StreamReader(Request.Body).ReadToEndAsync(); + string body = await new StreamReader(this.Request.Body).ReadToEndAsync(); LoginData loginData; try { @@ -28,7 +28,7 @@ namespace ProjectLighthouse.Controllers { return this.BadRequest(); } - Token? token = await database.AuthenticateUser(loginData); + Token? token = await this.database.AuthenticateUser(loginData); if(token == null) return this.StatusCode(403, ""); diff --git a/ProjectLighthouse/Controllers/MatchController.cs b/ProjectLighthouse/Controllers/MatchController.cs index bd8073d6..047063d1 100644 --- a/ProjectLighthouse/Controllers/MatchController.cs +++ b/ProjectLighthouse/Controllers/MatchController.cs @@ -1,13 +1,13 @@ #nullable enable using System.Linq; using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Helpers; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Profiles; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] diff --git a/ProjectLighthouse/Controllers/MessageController.cs b/ProjectLighthouse/Controllers/MessageController.cs index f233b92a..b53c0cc6 100644 --- a/ProjectLighthouse/Controllers/MessageController.cs +++ b/ProjectLighthouse/Controllers/MessageController.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc; -using ProjectLighthouse.Types; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/plain")] @@ -14,13 +14,13 @@ namespace ProjectLighthouse.Controllers { [HttpGet("eula")] public async Task Eula() { - User user = await this.database.UserFromRequest(Request); + User user = await this.database.UserFromRequest(this.Request); return user == null ? this.StatusCode(403, "") : this.Ok($"You are logged in as user {user.Username} (id {user.UserId})"); } [HttpGet("announce")] public IActionResult Announce() { - return Ok(""); + return this.Ok(""); } [HttpGet("notification")] diff --git a/ProjectLighthouse/Controllers/NewsController.cs b/ProjectLighthouse/Controllers/NewsController.cs index 848b67e9..5fa6e8f3 100644 --- a/ProjectLighthouse/Controllers/NewsController.cs +++ b/ProjectLighthouse/Controllers/NewsController.cs @@ -1,8 +1,8 @@ +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.News; using Microsoft.AspNetCore.Mvc; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types.News; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/news")] [Produces("text/xml")] diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/PublishController.cs index 221ad610..8136e10a 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/PublishController.cs @@ -2,15 +2,15 @@ using System.IO; using System.Linq; using System.Threading.Tasks; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Helpers; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Levels; -using ProjectLighthouse.Types.Profiles; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] @@ -42,7 +42,7 @@ namespace ProjectLighthouse.Controllers { /// [HttpPost("publish")] public async Task Publish() { - User user = await database.UserFromRequest(Request); + User user = await this.database.UserFromRequest(this.Request); if(user == null) return this.StatusCode(403, ""); Slot slot = await this.GetSlotFromBody(); @@ -52,34 +52,34 @@ namespace ProjectLighthouse.Controllers { X = 0, Y = 0, }; - database.Locations.Add(l); - await database.SaveChangesAsync(); + this.database.Locations.Add(l); + await this.database.SaveChangesAsync(); slot.LocationId = l.Id; slot.CreatorId = user.UserId; - database.Slots.Add(slot); - await database.SaveChangesAsync(); + this.database.Slots.Add(slot); + await this.database.SaveChangesAsync(); return this.Ok(slot.Serialize()); } [HttpPost("unpublish/{id:int}")] public async Task Unpublish(int id) { - Slot slot = await database.Slots + Slot slot = await this.database.Slots .Include(s => s.Location) .FirstOrDefaultAsync(s => s.SlotId == id); - database.Locations.Remove(slot.Location); - database.Slots.Remove(slot); + this.database.Locations.Remove(slot.Location); + this.database.Slots.Remove(slot); - await database.SaveChangesAsync(); + await this.database.SaveChangesAsync(); return this.Ok(); } public async Task GetSlotFromBody() { - Request.Body.Position = 0; - string bodyString = await new StreamReader(Request.Body).ReadToEndAsync(); + this.Request.Body.Position = 0; + string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync(); XmlSerializer serializer = new(typeof(Slot)); Slot slot = (Slot)serializer.Deserialize(new StringReader(bodyString)); diff --git a/ProjectLighthouse/Controllers/ResourcesController.cs b/ProjectLighthouse/Controllers/ResourcesController.cs index 615df77a..d0398660 100644 --- a/ProjectLighthouse/Controllers/ResourcesController.cs +++ b/ProjectLighthouse/Controllers/ResourcesController.cs @@ -3,14 +3,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; +using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Files; using Microsoft.AspNetCore.Mvc; -using ProjectLighthouse.Helpers; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Files; using IOFile = System.IO.File; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] @@ -23,7 +23,7 @@ namespace ProjectLighthouse.Controllers { [HttpPost("filterResources")] [HttpPost("showNotUploaded")] public async Task FilterResources() { - string bodyString = await new StreamReader(Request.Body).ReadToEndAsync(); + string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync(); XmlSerializer serializer = new(typeof(ResourceList)); ResourceList resourceList = (ResourceList)serializer.Deserialize(new StringReader(bodyString)); @@ -57,7 +57,7 @@ namespace ProjectLighthouse.Controllers { FileHelper.EnsureDirectoryCreated(assetsDirectory); if(FileHelper.ResourceExists(hash)) this.Ok(); // no reason to fail if it's already uploaded - LbpFile file = new(Encoding.ASCII.GetBytes(await new StreamReader(Request.Body).ReadToEndAsync())); + LbpFile file = new(Encoding.ASCII.GetBytes(await new StreamReader(this.Request.Body).ReadToEndAsync())); if(!FileHelper.IsFileSafe(file)) return this.UnprocessableEntity(); diff --git a/ProjectLighthouse/Controllers/SearchController.cs b/ProjectLighthouse/Controllers/SearchController.cs index d93d92d3..adaced48 100644 --- a/ProjectLighthouse/Controllers/SearchController.cs +++ b/ProjectLighthouse/Controllers/SearchController.cs @@ -1,12 +1,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types.Levels; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/SlotsController.cs index a0e4ab46..d5c0f818 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/SlotsController.cs @@ -1,11 +1,11 @@ using System.Linq; using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types.Levels; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] @@ -18,7 +18,7 @@ namespace ProjectLighthouse.Controllers { [HttpGet("slots/by")] public IActionResult SlotsBy([FromQuery] string u) { string response = Enumerable.Aggregate( - database.Slots + this.database.Slots .Include(s => s.Creator) .Include(s => s.Location) .Where(s => s.Creator.Username == u) diff --git a/ProjectLighthouse/Controllers/UserController.cs b/ProjectLighthouse/Controllers/UserController.cs index 260d0f04..1c69c039 100644 --- a/ProjectLighthouse/Controllers/UserController.cs +++ b/ProjectLighthouse/Controllers/UserController.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Xml; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Profiles; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Profiles; -namespace ProjectLighthouse.Controllers { +namespace LBPUnion.ProjectLighthouse.Controllers { [ApiController] [Route("LITTLEBIGPLANETPS3_XML/")] [Produces("text/xml")] @@ -20,7 +20,7 @@ namespace ProjectLighthouse.Controllers { [HttpGet("user/{username}")] public async Task GetUser(string username) { - User user = await database.Users + User user = await this.database.Users .Include(u => u.Location) .FirstOrDefaultAsync(u => u.Username == username); @@ -36,7 +36,7 @@ namespace ProjectLighthouse.Controllers { [HttpPost("updateUser")] public async Task UpdateUser() { - User user = await database.UserFromRequest(Request); + User user = await this.database.UserFromRequest(this.Request); if(user == null) return this.StatusCode(403, ""); @@ -62,7 +62,7 @@ namespace ProjectLighthouse.Controllers { // // // if you find a way to make it not stupid feel free to replace this - using(XmlReader reader = XmlReader.Create(Request.Body, settings)) { + using(XmlReader reader = XmlReader.Create(this.Request.Body, settings)) { List path = new(); // you can think of this as a file path in the XML, like -> -> while(await reader.ReadAsync()) { // ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault @@ -105,7 +105,7 @@ namespace ProjectLighthouse.Controllers { // the way location on a user card works is stupid and will not save with the way below as-is, so we do the following: if(locationChanged) { // only modify the database if we modify here - Location l = await database.Locations.Where(l => l.Id == user.LocationId).FirstOrDefaultAsync(); // find the location in the database again + Location l = await this.database.Locations.Where(l => l.Id == user.LocationId).FirstOrDefaultAsync(); // find the location in the database again // set the location in the database to the one we modified above l.X = user.Location.X; @@ -114,7 +114,7 @@ namespace ProjectLighthouse.Controllers { // now both are in sync, and will update in the database. } - if(database.ChangeTracker.HasChanges()) await database.SaveChangesAsync(); // save the user to the database if we changed anything + if(this.database.ChangeTracker.HasChanges()) await this.database.SaveChangesAsync(); // save the user to the database if we changed anything return this.Ok(); } } diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index a0ac9900..25c99a84 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -1,14 +1,14 @@ using System.Linq; using System.Threading.Tasks; +using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Levels; +using LBPUnion.ProjectLighthouse.Types.Profiles; +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Helpers; -using ProjectLighthouse.Types; -using ProjectLighthouse.Types.Levels; -using ProjectLighthouse.Types.Profiles; -using ProjectLighthouse.Types.Settings; -namespace ProjectLighthouse { +namespace LBPUnion.ProjectLighthouse { public class Database : DbContext { public DbSet Users { get; set; } public DbSet Locations { get; set; } @@ -27,7 +27,7 @@ namespace ProjectLighthouse { public async Task CreateUser(string username) { User user; - if((user = await Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null) + if((user = await this.Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null) return user; Location l = new(); // store to get id after submitting @@ -64,9 +64,9 @@ namespace ProjectLighthouse { } public async Task UserFromAuthToken(string authToken) { - Token? token = await Tokens.FirstOrDefaultAsync(t => t.UserToken == authToken); + Token? token = await this.Tokens.FirstOrDefaultAsync(t => t.UserToken == authToken); if(token == null) return null; - return await Users + return await this.Users .Include(u => u.Location) .FirstOrDefaultAsync(u => u.UserId == token.UserId); } @@ -76,7 +76,7 @@ namespace ProjectLighthouse { return null; } - return await UserFromAuthToken(mmAuth); + return await this.UserFromAuthToken(mmAuth); } #nullable disable } diff --git a/ProjectLighthouse/Helpers/BinaryHelper.cs b/ProjectLighthouse/Helpers/BinaryHelper.cs index 9d2e18e3..a157df82 100644 --- a/ProjectLighthouse/Helpers/BinaryHelper.cs +++ b/ProjectLighthouse/Helpers/BinaryHelper.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Text; -namespace ProjectLighthouse.Helpers { +namespace LBPUnion.ProjectLighthouse.Helpers { public static class BinaryHelper { public static string ReadString(BinaryReader reader) { List readBytes = new(); diff --git a/ProjectLighthouse/Helpers/FileHelper.cs b/ProjectLighthouse/Helpers/FileHelper.cs index 80f373b4..c98a629f 100644 --- a/ProjectLighthouse/Helpers/FileHelper.cs +++ b/ProjectLighthouse/Helpers/FileHelper.cs @@ -2,9 +2,9 @@ using System; using System.IO; using System.Linq; using System.Text; -using ProjectLighthouse.Types.Files; +using LBPUnion.ProjectLighthouse.Types.Files; -namespace ProjectLighthouse.Helpers { +namespace LBPUnion.ProjectLighthouse.Helpers { public static class FileHelper { public static readonly string ResourcePath = Path.Combine(Environment.CurrentDirectory, "r"); diff --git a/ProjectLighthouse/Helpers/HashHelper.cs b/ProjectLighthouse/Helpers/HashHelper.cs index 46e87e38..b2ea531e 100644 --- a/ProjectLighthouse/Helpers/HashHelper.cs +++ b/ProjectLighthouse/Helpers/HashHelper.cs @@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Security.Cryptography; using System.Text; -namespace ProjectLighthouse.Helpers { +namespace LBPUnion.ProjectLighthouse.Helpers { [SuppressMessage("ReSharper", "UnusedMember.Global")] public static class HashHelper { // private static readonly SHA1 sha1 = SHA1.Create(); diff --git a/ProjectLighthouse/Helpers/TimestampHelper.cs b/ProjectLighthouse/Helpers/TimestampHelper.cs index 1af33376..62ac5d60 100644 --- a/ProjectLighthouse/Helpers/TimestampHelper.cs +++ b/ProjectLighthouse/Helpers/TimestampHelper.cs @@ -1,6 +1,6 @@ using System; -namespace ProjectLighthouse.Helpers { +namespace LBPUnion.ProjectLighthouse.Helpers { public static class TimestampHelper { public static long Timestamp => (long)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; } diff --git a/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs b/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs index 1ac8af54..7fcae3a9 100644 --- a/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs +++ b/ProjectLighthouse/Migrations/20211019021627_InitialCreate.Designer.cs @@ -1,4 +1,6 @@ // + +using LBPUnion.ProjectLighthouse; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs b/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs index 47f0519f..d531cf75 100644 --- a/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs +++ b/ProjectLighthouse/Migrations/20211019031221_HeartedLevels.Designer.cs @@ -1,4 +1,6 @@ // + +using LBPUnion.ProjectLighthouse; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs b/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs index feac2430..aebb0f62 100644 --- a/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs +++ b/ProjectLighthouse/Migrations/20211019203627_LastMatches.Designer.cs @@ -1,4 +1,6 @@ // + +using LBPUnion.ProjectLighthouse; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs b/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs index a94a22a6..36a02088 100644 --- a/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs +++ b/ProjectLighthouse/Migrations/20211020220840_ResourceList.Designer.cs @@ -1,4 +1,6 @@ // + +using LBPUnion.ProjectLighthouse; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs b/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs index 01e7212f..0d81af87 100644 --- a/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs +++ b/ProjectLighthouse/Migrations/DatabaseModelSnapshot.cs @@ -1,4 +1,6 @@ // + +using LBPUnion.ProjectLighthouse; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; diff --git a/ProjectLighthouse/Program.cs b/ProjectLighthouse/Program.cs index 5851a3f8..89ddb2f2 100644 --- a/ProjectLighthouse/Program.cs +++ b/ProjectLighthouse/Program.cs @@ -1,11 +1,11 @@ using System; using System.Diagnostics; +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; -using ProjectLighthouse.Types.Settings; -namespace ProjectLighthouse { +namespace LBPUnion.ProjectLighthouse { public static class Program { public static void Main(string[] args) { Stopwatch startupStopwatch = new(); diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index fd438945..59b5059c 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -3,6 +3,8 @@ Linux net5.0;net6.0 + LBPUnion.ProjectLighthouse + LBPUnion.ProjectLighthouse diff --git a/ProjectLighthouse/Serialization/LbpSerializer.cs b/ProjectLighthouse/Serialization/LbpSerializer.cs index d72f6216..e7946c02 100644 --- a/ProjectLighthouse/Serialization/LbpSerializer.cs +++ b/ProjectLighthouse/Serialization/LbpSerializer.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -namespace ProjectLighthouse.Serialization { +namespace LBPUnion.ProjectLighthouse.Serialization { /// /// LBP doesn't like the XML serializer by C# that much, and it cant be controlled that much (cant have two root elements), /// so I wrote my own crappy one. diff --git a/ProjectLighthouse/Serialization/XmlOutputFormatter.cs b/ProjectLighthouse/Serialization/XmlOutputFormatter.cs index 0ed5eb53..da7c25ae 100644 --- a/ProjectLighthouse/Serialization/XmlOutputFormatter.cs +++ b/ProjectLighthouse/Serialization/XmlOutputFormatter.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Mvc.Formatters; -namespace ProjectLighthouse.Serialization { +namespace LBPUnion.ProjectLighthouse.Serialization { public class XmlOutputFormatter : StringOutputFormatter { public XmlOutputFormatter() { - SupportedMediaTypes.Add("text/xml"); - SupportedMediaTypes.Add("application/xml"); + this.SupportedMediaTypes.Add("text/xml"); + this.SupportedMediaTypes.Add("application/xml"); } } } \ No newline at end of file diff --git a/ProjectLighthouse/Startup.cs b/ProjectLighthouse/Startup.cs index 2b9ee311..f902da5c 100644 --- a/ProjectLighthouse/Startup.cs +++ b/ProjectLighthouse/Startup.cs @@ -1,18 +1,18 @@ using System; using System.Diagnostics; using System.IO; +using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using ProjectLighthouse.Serialization; -namespace ProjectLighthouse { +namespace LBPUnion.ProjectLighthouse { public class Startup { public Startup(IConfiguration configuration) { - Configuration = configuration; + this.Configuration = configuration; } public IConfiguration Configuration { get; } diff --git a/ProjectLighthouse/Types/Files/LbpFile.cs b/ProjectLighthouse/Types/Files/LbpFile.cs index ea84aaec..7f0a61b9 100644 --- a/ProjectLighthouse/Types/Files/LbpFile.cs +++ b/ProjectLighthouse/Types/Files/LbpFile.cs @@ -1,6 +1,6 @@ -using ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Helpers; -namespace ProjectLighthouse.Types.Files { +namespace LBPUnion.ProjectLighthouse.Types.Files { public class LbpFile { public LbpFile(byte[] data) { this.Data = data; diff --git a/ProjectLighthouse/Types/Files/LbpFileType.cs b/ProjectLighthouse/Types/Files/LbpFileType.cs index 418cb97f..6bb83d2a 100644 --- a/ProjectLighthouse/Types/Files/LbpFileType.cs +++ b/ProjectLighthouse/Types/Files/LbpFileType.cs @@ -1,4 +1,4 @@ -namespace ProjectLighthouse.Types.Files { +namespace LBPUnion.ProjectLighthouse.Types.Files { public enum LbpFileType { Script, // .ff, FSH Texture, // TEX diff --git a/ProjectLighthouse/Types/Levels/HeartedLevel.cs b/ProjectLighthouse/Types/Levels/HeartedLevel.cs index 3b3f540b..40c55dea 100644 --- a/ProjectLighthouse/Types/Levels/HeartedLevel.cs +++ b/ProjectLighthouse/Types/Levels/HeartedLevel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace ProjectLighthouse.Types.Levels { +namespace LBPUnion.ProjectLighthouse.Types.Levels { public class HeartedLevel { // ReSharper disable once UnusedMember.Global [Key] public int HeartedLevelId { get; set; } diff --git a/ProjectLighthouse/Types/Levels/LevelTags.cs b/ProjectLighthouse/Types/Levels/LevelTags.cs index 0ff16233..3bb2a212 100644 --- a/ProjectLighthouse/Types/Levels/LevelTags.cs +++ b/ProjectLighthouse/Types/Levels/LevelTags.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace ProjectLighthouse.Types.Levels { +namespace LBPUnion.ProjectLighthouse.Types.Levels { /// /// A series of tags that can be applied to a level /// diff --git a/ProjectLighthouse/Types/Levels/QueuedLevel.cs b/ProjectLighthouse/Types/Levels/QueuedLevel.cs index 1e416f48..484f0c36 100644 --- a/ProjectLighthouse/Types/Levels/QueuedLevel.cs +++ b/ProjectLighthouse/Types/Levels/QueuedLevel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace ProjectLighthouse.Types.Levels { +namespace LBPUnion.ProjectLighthouse.Types.Levels { public class QueuedLevel { // ReSharper disable once UnusedMember.Global [Key] public int QueuedLevelId { get; set; } diff --git a/ProjectLighthouse/Types/Levels/Slot.cs b/ProjectLighthouse/Types/Levels/Slot.cs index 8e7e198f..c6fe9f43 100644 --- a/ProjectLighthouse/Types/Levels/Slot.cs +++ b/ProjectLighthouse/Types/Levels/Slot.cs @@ -2,10 +2,10 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Xml.Serialization; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types.Profiles; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Profiles; -namespace ProjectLighthouse.Types.Levels { +namespace LBPUnion.ProjectLighthouse.Types.Levels { /// /// A LittleBigPlanet level. /// diff --git a/ProjectLighthouse/Types/LoginData.cs b/ProjectLighthouse/Types/LoginData.cs index 2c215933..7cb1b5ff 100644 --- a/ProjectLighthouse/Types/LoginData.cs +++ b/ProjectLighthouse/Types/LoginData.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Helpers; -namespace ProjectLighthouse.Types { +namespace LBPUnion.ProjectLighthouse.Types { // This is all the information I can understand for now. More testing is required. // Example data: // - LBP2 digital, with the RPCN username `literally1984` diff --git a/ProjectLighthouse/Types/LoginResult.cs b/ProjectLighthouse/Types/LoginResult.cs index 64bc5be0..c0ed0997 100644 --- a/ProjectLighthouse/Types/LoginResult.cs +++ b/ProjectLighthouse/Types/LoginResult.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.Xml.Serialization; -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types { +namespace LBPUnion.ProjectLighthouse.Types { /// /// Response to POST /login /// diff --git a/ProjectLighthouse/Types/News/NewsEntry.cs b/ProjectLighthouse/Types/News/NewsEntry.cs index 4d1e5b41..aecf5b88 100644 --- a/ProjectLighthouse/Types/News/NewsEntry.cs +++ b/ProjectLighthouse/Types/News/NewsEntry.cs @@ -1,6 +1,6 @@ -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types.News { +namespace LBPUnion.ProjectLighthouse.Types.News { /// /// Used on the info moon on LBP1. Broken for unknown reasons /// diff --git a/ProjectLighthouse/Types/News/NewsImage.cs b/ProjectLighthouse/Types/News/NewsImage.cs index 8167c67e..4e134ae0 100644 --- a/ProjectLighthouse/Types/News/NewsImage.cs +++ b/ProjectLighthouse/Types/News/NewsImage.cs @@ -1,6 +1,6 @@ -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types.News { +namespace LBPUnion.ProjectLighthouse.Types.News { public class NewsImage { public string Hash { get; set; } public string Alignment { get; set; } diff --git a/ProjectLighthouse/Types/Profiles/ClientsConnected.cs b/ProjectLighthouse/Types/Profiles/ClientsConnected.cs index 57c58fe7..2241ca4e 100644 --- a/ProjectLighthouse/Types/Profiles/ClientsConnected.cs +++ b/ProjectLighthouse/Types/Profiles/ClientsConnected.cs @@ -1,7 +1,7 @@ +using LBPUnion.ProjectLighthouse.Serialization; using Microsoft.EntityFrameworkCore; -using ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types.Profiles { +namespace LBPUnion.ProjectLighthouse.Types.Profiles { [Keyless] public class ClientsConnected { public bool Lbp1 { get; set; } diff --git a/ProjectLighthouse/Types/Profiles/Comment.cs b/ProjectLighthouse/Types/Profiles/Comment.cs index 7e50dac2..a10f2d16 100644 --- a/ProjectLighthouse/Types/Profiles/Comment.cs +++ b/ProjectLighthouse/Types/Profiles/Comment.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Xml.Serialization; -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types.Profiles { +namespace LBPUnion.ProjectLighthouse.Types.Profiles { [XmlRoot("comment"), XmlType("comment")] public class Comment { [Key] diff --git a/ProjectLighthouse/Types/Profiles/LastMatch.cs b/ProjectLighthouse/Types/Profiles/LastMatch.cs index c7f73fd0..0513ca78 100644 --- a/ProjectLighthouse/Types/Profiles/LastMatch.cs +++ b/ProjectLighthouse/Types/Profiles/LastMatch.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace ProjectLighthouse.Types.Profiles { +namespace LBPUnion.ProjectLighthouse.Types.Profiles { public class LastMatch { [Key] public int UserId { get; set; } public long Timestamp { get; set; } diff --git a/ProjectLighthouse/Types/Profiles/Location.cs b/ProjectLighthouse/Types/Profiles/Location.cs index 5917feae..cfaefa68 100644 --- a/ProjectLighthouse/Types/Profiles/Location.cs +++ b/ProjectLighthouse/Types/Profiles/Location.cs @@ -1,6 +1,6 @@ -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types.Profiles { +namespace LBPUnion.ProjectLighthouse.Types.Profiles { /// /// The location of a slot on a planet. /// diff --git a/ProjectLighthouse/Types/ResourceList.cs b/ProjectLighthouse/Types/ResourceList.cs index 0f81e905..a29503f5 100644 --- a/ProjectLighthouse/Types/ResourceList.cs +++ b/ProjectLighthouse/Types/ResourceList.cs @@ -1,6 +1,6 @@ using System.Xml.Serialization; -namespace ProjectLighthouse.Types { +namespace LBPUnion.ProjectLighthouse.Types { [XmlRoot("resource"), XmlType("resources")] public class ResourceList { [XmlElement("resource")] diff --git a/ProjectLighthouse/Types/Settings/PrivacySettings.cs b/ProjectLighthouse/Types/Settings/PrivacySettings.cs index 09e7e483..c381a66d 100644 --- a/ProjectLighthouse/Types/Settings/PrivacySettings.cs +++ b/ProjectLighthouse/Types/Settings/PrivacySettings.cs @@ -1,6 +1,6 @@ -using ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Serialization; -namespace ProjectLighthouse.Types.Settings { +namespace LBPUnion.ProjectLighthouse.Types.Settings { public class PrivacySettings { public string LevelVisibility { get; set; } public string ProfileVisibility { get; set; } diff --git a/ProjectLighthouse/Types/Settings/ServerSettings.cs b/ProjectLighthouse/Types/Settings/ServerSettings.cs index 238f6002..01031eef 100644 --- a/ProjectLighthouse/Types/Settings/ServerSettings.cs +++ b/ProjectLighthouse/Types/Settings/ServerSettings.cs @@ -1,7 +1,7 @@ #nullable enable using System; -namespace ProjectLighthouse.Types.Settings { +namespace LBPUnion.ProjectLighthouse.Types.Settings { public static class ServerSettings { /// /// The maximum amount of slots allowed on users' earth diff --git a/ProjectLighthouse/Types/Token.cs b/ProjectLighthouse/Types/Token.cs index 43d9ac72..9232de0c 100644 --- a/ProjectLighthouse/Types/Token.cs +++ b/ProjectLighthouse/Types/Token.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace ProjectLighthouse.Types { +namespace LBPUnion.ProjectLighthouse.Types { public class Token { // ReSharper disable once UnusedMember.Global [Key] public int TokenId { get; set; } diff --git a/ProjectLighthouse/Types/User.cs b/ProjectLighthouse/Types/User.cs index 4b202a00..2d77f692 100644 --- a/ProjectLighthouse/Types/User.cs +++ b/ProjectLighthouse/Types/User.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations.Schema; -using ProjectLighthouse.Serialization; -using ProjectLighthouse.Types.Profiles; -using ProjectLighthouse.Types.Settings; +using LBPUnion.ProjectLighthouse.Serialization; +using LBPUnion.ProjectLighthouse.Types.Profiles; +using LBPUnion.ProjectLighthouse.Types.Settings; -namespace ProjectLighthouse.Types { +namespace LBPUnion.ProjectLighthouse.Types { public class User { public int UserId { get; set; } public string Username { get; set; }