Split GameAPI and Website into their own projects

This commit is contained in:
jvyden 2022-05-14 17:28:08 -04:00
parent bb03a01246
commit 14154faaf8
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
116 changed files with 484 additions and 287 deletions

View file

@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Lighthouse API" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH"
value="$PROJECT_DIR$/ProjectLighthouse.API/bin/Debug/net6.0/LBPUnion.ProjectLighthouse.API"/>
<option name="PROGRAM_PARAMETERS" value=""/>
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/ProjectLighthouse"/>
<option name="PASS_PARENT_ENVS" value="1"/>
<option name="USE_EXTERNAL_CONSOLE" value="0"/>
<option name="USE_MONO" value="0"/>
<option name="RUNTIME_ARGUMENTS" value=""/>
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ProjectLighthouse.API/ProjectLighthouse.API.csproj"/>
<option name="PROJECT_EXE_PATH_TRACKING" value="1"/>
<option name="PROJECT_ARGUMENTS_TRACKING" value="1"/>
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0"/>
<option name="PROJECT_KIND" value="DotNetCore"/>
<option name="PROJECT_TFM" value="net6.0"/>
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Development Database"
run_configuration_type="docker-deploy"/>
<option name="Build"/>
</method>
</configuration>
</component>

View file

@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Lighthouse Game API" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH"
value="$PROJECT_DIR$/ProjectLighthouse.GameAPI/bin/Debug/net6.0/LBPUnion.ProjectLighthouse.GameAPI"/>
<option name="PROGRAM_PARAMETERS" value=""/>
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/ProjectLighthouse"/>
<option name="PASS_PARENT_ENVS" value="1"/>
<option name="USE_EXTERNAL_CONSOLE" value="0"/>
<option name="USE_MONO" value="0"/>
<option name="RUNTIME_ARGUMENTS" value=""/>
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ProjectLighthouse.GameAPI/ProjectLighthouse.GameAPI.csproj"/>
<option name="PROJECT_EXE_PATH_TRACKING" value="1"/>
<option name="PROJECT_ARGUMENTS_TRACKING" value="1"/>
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0"/>
<option name="PROJECT_KIND" value="DotNetCore"/>
<option name="PROJECT_TFM" value="net6.0"/>
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Development Database"
run_configuration_type="docker-deploy"/>
<option name="Build"/>
</method>
</configuration>
</component>

22
.run/Lighthouse.run.xml Normal file
View file

@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Lighthouse" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="$PROJECT_DIR$/ProjectLighthouse/bin/Debug/net6.0/LBPUnion.ProjectLighthouse"/>
<option name="PROGRAM_PARAMETERS" value=""/>
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/ProjectLighthouse"/>
<option name="PASS_PARENT_ENVS" value="1"/>
<option name="USE_EXTERNAL_CONSOLE" value="0"/>
<option name="USE_MONO" value="0"/>
<option name="RUNTIME_ARGUMENTS" value=""/>
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ProjectLighthouse/ProjectLighthouse.csproj"/>
<option name="PROJECT_EXE_PATH_TRACKING" value="1"/>
<option name="PROJECT_ARGUMENTS_TRACKING" value="1"/>
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1"/>
<option name="PROJECT_KIND" value="DotNetCore"/>
<option name="PROJECT_TFM" value="net6.0"/>
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Development Database"
run_configuration_type="docker-deploy"/>
<option name="Build"/>
</method>
</configuration>
</component>

View file

@ -1,12 +1,10 @@
#nullable enable
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,9 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
@ -13,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,8 +1,4 @@
#nullable enable
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
@ -11,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,8 +1,5 @@
#nullable enable
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Types;
@ -10,9 +7,8 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Types.Tickets;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using IOFile = System.IO.File;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/login")]

View file

@ -1,13 +1,10 @@
#nullable enable
using System;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Matching;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,10 +1,5 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
using LBPUnion.ProjectLighthouse.Logging;
@ -13,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Match;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Matching;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,13 +1,11 @@
#nullable enable
using System.IO;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,14 +1,12 @@
#nullable enable
using System.IO;
using System.Text.Json;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Reports;
using Microsoft.AspNetCore.Mvc;
using LBPUnion.ProjectLighthouse.Helpers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]
@ -32,7 +30,7 @@ public class ReportController : ControllerBase
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
XmlSerializer serializer = new(typeof(GriefReport));
GriefReport? report = (GriefReport?) serializer.Deserialize(new StringReader(bodyString));
GriefReport? report = (GriefReport?)serializer.Deserialize(new StringReader(bodyString));
if (report == null) return this.BadRequest();

View file

@ -1,9 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using Discord;
using LBPUnion.ProjectLighthouse.Helpers;
@ -14,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Resources;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,7 +1,4 @@
#nullable enable
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
@ -11,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Files;
using Microsoft.AspNetCore.Mvc;
using IOFile = System.IO.File;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Resources;
[ApiController]
[Produces("text/xml")]

View file

@ -1,7 +1,4 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Serialization;
@ -10,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Categories;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,8 +1,7 @@
using System;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/tags")]

View file

@ -1,15 +1,11 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,8 +1,4 @@
#nullable enable
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
@ -14,7 +10,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,9 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
@ -14,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Reviews;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]
@ -167,18 +162,17 @@ public class ReviewController : ControllerBase
List<Review?> reviewList = reviews.ToList();
string inner = reviewList
.Aggregate
(
string.Empty,
(current, review) =>
{
if (review == null) return current;
string inner = reviewList.Aggregate
(
string.Empty,
(current, review) =>
{
if (review == null) return current;
RatedReview? yourThumb = this.database.RatedReviews.FirstOrDefault(r => r.ReviewId == review.ReviewId && r.UserId == user.UserId);
return current + review.Serialize(null, yourThumb);
}
);
RatedReview? yourThumb = this.database.RatedReviews.FirstOrDefault(r => r.ReviewId == review.ReviewId && r.UserId == user.UserId);
return current + review.Serialize(null, yourThumb);
}
);
string response = LbpSerializer.TaggedStringElement
(
"reviews",

View file

@ -1,10 +1,5 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
@ -12,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]
@ -108,7 +103,15 @@ public class ScoreController : ControllerBase
}
[SuppressMessage("ReSharper", "PossibleMultipleEnumeration")]
private string getScores(int slotId, int type, User user, int pageStart = -1, int pageSize = 5, string rootName = "scores")
private string getScores
(
int slotId,
int type,
User user,
int pageStart = -1,
int pageSize = 5,
string rootName = "scores"
)
{
// This is hella ugly but it technically assigns the proper rank to a score
// var needed for Anonymous type returned from SELECT

View file

@ -1,15 +1,11 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,8 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
using LBPUnion.ProjectLighthouse.Serialization;
@ -13,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,9 +1,8 @@
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,10 +1,5 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
@ -13,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
namespace LBPUnion.ProjectLighthouse.GameAPI.Controllers;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]
@ -37,12 +32,17 @@ public class UserController : ControllerBase
{
// use an anonymous type to only fetch certain columns
var partialUser = await this.database.Users.Where(u => u.Username == username)
.Select(u => new
{
u.Username,
u.IconHash,
}).FirstOrDefaultAsync();
.Select
(
u => new
{
u.Username,
u.IconHash,
}
)
.FirstOrDefaultAsync();
if (partialUser == null) return null;
string user = LbpSerializer.TaggedStringElement("npHandle", partialUser.Username, "icon", partialUser.IconHash);
return LbpSerializer.TaggedStringElement("user", user, "type", "user");
}
@ -84,13 +84,12 @@ public class UserController : ControllerBase
User user = userAndToken.Value.Item1;
GameToken gameToken = userAndToken.Value.Item2;
this.Request.Body.Position = 0;
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
// xml hack so we can use one class to deserialize different root names
string rootElement = bodyString.Contains("updateUser") ? "updateUser" : "user";
XmlSerializer serializer = new(typeof(UserUpdate), new XmlRootAttribute(rootElement));
UserUpdate? update = (UserUpdate?) serializer.Deserialize(new StringReader(bodyString));
UserUpdate? update = (UserUpdate?)serializer.Deserialize(new StringReader(bodyString));
if (update == null) return this.BadRequest();
@ -103,7 +102,10 @@ public class UserController : ControllerBase
user.Biography = update.Biography;
}
foreach (string? resource in new[] {update.IconHash, update.YayHash, update.MehHash, update.BooHash, update.PlanetHash,})
foreach (string? resource in new[]
{
update.IconHash, update.YayHash, update.MehHash, update.BooHash, update.PlanetHash,
})
{
if (resource != null && !FileHelper.ResourceExists(resource)) return this.BadRequest();
}

View file

@ -1,15 +1,10 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Logging.Loggers.AspNet;
using LBPUnion.ProjectLighthouse.Startup;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace LBPUnion.ProjectLighthouse;
namespace LBPUnion.ProjectLighthouse.GameAPI;
public static class Program
{
@ -27,7 +22,6 @@ public static class Program
webBuilder =>
{
webBuilder.UseStartup<GameApiStartup>();
webBuilder.UseWebRoot("StaticFiles");
webBuilder.UseUrls(ServerConfiguration.Instance.GameApiListenUrl);
}
)

View file

@ -0,0 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>LBPUnion.ProjectLighthouse.GameAPI</AssemblyName>
<RootNamespace>LBPUnion.ProjectLighthouse.GameAPI</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj"/>
</ItemGroup>
<ItemGroup>
<None Remove="gitVersion.txt"/>
<EmbeddedResource Include="gitVersion.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Remove="gitBranch.txt"/>
<EmbeddedResource Include="gitBranch.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Remove="gitRemotes.txt"/>
<EmbeddedResource Include="gitRemotes.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Remove="gitUnpushed.txt"/>
<EmbeddedResource Include="gitUnpushed.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 &gt; &quot;$(ProjectDir)/gitVersion.txt&quot;"/>
<Exec Command="git branch --show-current &gt; &quot;$(ProjectDir)/gitBranch.txt&quot;"/>
<Exec Command="git remote -v &gt; &quot;$(ProjectDir)/gitRemotes.txt&quot;"/>
<Exec Command="git log --branches --not --remotes --oneline &gt; &quot;$(ProjectDir)/gitUnpushed.txt&quot;"/>
</Target>
</Project>

View file

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View file

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View file

@ -1,7 +1,7 @@
#nullable enable
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin;
[ApiController]
[Route("/admin")]

View file

@ -1,13 +1,10 @@
#nullable enable
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Reports;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin;
[ApiController]
[Route("admin/report/{id:int}")]

View file

@ -1,11 +1,10 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin;
[ApiController]
[Route("admin/slot/{id:int}")]

View file

@ -1,10 +1,9 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.Admin;
[ApiController]
[Route("admin/user/{id:int}")]

View file

@ -1,12 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.Debug;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.Debug;
[ApiController]
[Route("debug/roomVisualizer")]

View file

@ -1,13 +1,10 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.ExternalAuth;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.ExternalAuth;
[ApiController]
[Route("/authentication")]

View file

@ -1,10 +1,9 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website.ExternalAuth;
namespace LBPUnion.ProjectLighthouse.Website.Controllers.ExternalAuth;
[ApiController]
[Route("/authentication")]

View file

@ -1,5 +1,4 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Types;
@ -12,7 +11,7 @@ using Microsoft.EntityFrameworkCore;
// TODO: Clean up this file
// - jvyden
namespace LBPUnion.ProjectLighthouse.Controllers.Website;
namespace LBPUnion.ProjectLighthouse.Website.Controllers;
[ApiController]
[Route("slot/{id:int}")]

View file

@ -1,12 +1,11 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers.Website;
namespace LBPUnion.ProjectLighthouse.Website.Controllers;
[ApiController]
[Route("user/{id:int}")]

View file

@ -1,5 +1,5 @@
@page "/admin/user/{id:int}/ban"
@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminBanUserPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminBanUserPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,12 +1,10 @@
#nullable enable
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin;
public class AdminBanUserPage : BaseLayout
{

View file

@ -3,7 +3,7 @@
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Maintenance
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminPanelPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminPanelPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,13 +1,11 @@
#nullable enable
using System.Collections.Generic;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Maintenance;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin;
public class AdminPanelPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/admin/users"
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminPanelUsersPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminPanelUsersPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,13 +1,10 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin;
public class AdminPanelUsersPage : BaseLayout
{

View file

@ -1,5 +1,5 @@
@page "/admin/user/{id:int}/setGrantedSlots"
@model LBPUnion.ProjectLighthouse.Pages.Admin.AdminSetGrantedSlotsPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Admin.AdminSetGrantedSlotsPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,11 +1,10 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages.Admin;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin;
public class AdminSetGrantedSlotsPage : BaseLayout
{

View file

@ -1,5 +1,5 @@
@page "/verifyEmail"
@model LBPUnion.ProjectLighthouse.Pages.CompleteEmailVerificationPage
@model LBPUnion.ProjectLighthouse.Website.Pages.CompleteEmailVerificationPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,13 +1,12 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Profiles.Email;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class CompleteEmailVerificationPage : BaseLayout
{

View file

@ -1,5 +1,5 @@
@page "/debug/filter"
@model LBPUnion.ProjectLighthouse.Pages.Debug.FilterTestPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Debug.FilterTestPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,9 +1,9 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages.Debug;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Debug;
public class FilterTestPage : BaseLayout
{

View file

@ -2,7 +2,7 @@
@using LBPUnion.ProjectLighthouse.Helpers
@using LBPUnion.ProjectLighthouse.Types
@using LBPUnion.ProjectLighthouse.Types.Match
@model LBPUnion.ProjectLighthouse.Pages.Debug.RoomVisualizerPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Debug.RoomVisualizerPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,12 +1,12 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
#if !DEBUG
using LBPUnion.ProjectLighthouse.Types;
#endif
namespace LBPUnion.ProjectLighthouse.Pages.Debug;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Debug;
public class RoomVisualizerPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/debug/version"
@using LBPUnion.ProjectLighthouse.Helpers
@model LBPUnion.ProjectLighthouse.Pages.Debug.VersionInfoPage
@model LBPUnion.ProjectLighthouse.Website.Pages.Debug.VersionInfoPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,8 +1,8 @@
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages.Debug;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Debug;
public class VersionInfoPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/authentication"
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.AuthenticationPage
@model LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth.AuthenticationPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,14 +1,12 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Net;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth;
namespace LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth;
public class AuthenticationPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/authentication/autoApprovals"
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.ManageUserApprovedIpAddressesPage
@model LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth.ManageUserApprovedIpAddressesPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,13 +1,10 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth;
namespace LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth;
public class ManageUserApprovedIpAddressesPage : BaseLayout
{

View file

@ -1,7 +1,7 @@
@page "/"
@using LBPUnion.ProjectLighthouse.Types
@using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.LandingPage
@model LBPUnion.ProjectLighthouse.Website.Pages.LandingPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,15 +1,12 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class LandingPage : BaseLayout
{

View file

@ -2,7 +2,7 @@
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Types
@using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout
@model LBPUnion.ProjectLighthouse.Website.Pages.Layouts.BaseLayout
@{
if (Model!.User == null)

View file

@ -1,9 +1,8 @@
#nullable enable
using System.Collections.Generic;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LBPUnion.ProjectLighthouse.Pages.Layouts;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
public class BaseLayout : PageModel
{

View file

@ -1,6 +1,6 @@
@page "/login"
@using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.LoginForm
@model LBPUnion.ProjectLighthouse.Website.Pages.LoginForm
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,19 +1,16 @@
#nullable enable
using System;
using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Profiles.Email;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Http;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class LoginForm : BaseLayout
{
@ -37,7 +34,7 @@ public class LoginForm : BaseLayout
return this.Page();
}
if (!await Request.CheckCaptchaValidity())
if (!await this.Request.CheckCaptchaValidity())
{
this.Error = "You must complete the captcha correctly.";
return this.Page();

View file

@ -1,5 +1,5 @@
@page "/logout"
@model LBPUnion.ProjectLighthouse.Pages.LogoutPage
@model LBPUnion.ProjectLighthouse.Website.Pages.LogoutPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,10 +1,9 @@
#nullable enable
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class LogoutPage : BaseLayout
{

View file

@ -1,5 +1,4 @@
@using System.IO
@using System.Web
@using System.Web
@using LBPUnion.ProjectLighthouse.Types.Profiles
<div class="ui yellow segment" id="comments">
<h2>Comments</h2>

View file

@ -1,5 +1,5 @@
@page "/passwordReset"
@model LBPUnion.ProjectLighthouse.Pages.PasswordResetPage
@model LBPUnion.ProjectLighthouse.Website.Pages.PasswordResetPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,12 +1,11 @@
#nullable enable
using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class PasswordResetPage : BaseLayout
{

View file

@ -1,5 +1,5 @@
@page "/passwordResetRequired"
@model LBPUnion.ProjectLighthouse.Pages.PasswordResetRequiredPage
@model LBPUnion.ProjectLighthouse.Website.Pages.PasswordResetRequiredPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,9 +1,9 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class PasswordResetRequiredPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/photos/{pageNumber:int}"
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.PhotosPage
@model LBPUnion.ProjectLighthouse.Website.Pages.PhotosPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,15 +1,11 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class PhotosPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/register"
@using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.RegisterForm
@model LBPUnion.ProjectLighthouse.Website.Pages.RegisterForm
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,15 +1,14 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class RegisterForm : BaseLayout
{
@ -61,7 +60,7 @@ public class RegisterForm : BaseLayout
return this.Page();
}
if (!await Request.CheckCaptchaValidity())
if (!await this.Request.CheckCaptchaValidity())
{
this.Error = "You must complete the captcha correctly.";
return this.Page();

View file

@ -1,6 +1,6 @@
@page "/admin/reports/{pageNumber:int}"
@using LBPUnion.ProjectLighthouse.Types.Reports
@model LBPUnion.ProjectLighthouse.Pages.ReportsPage
@model LBPUnion.ProjectLighthouse.Website.Pages.ReportsPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,17 +1,13 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Reports;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class ReportsPage : BaseLayout
{

View file

@ -1,5 +1,5 @@
@page "/login/sendVerificationEmail"
@model LBPUnion.ProjectLighthouse.Pages.SendVerificationEmailPage
@model LBPUnion.ProjectLighthouse.Website.Pages.SendVerificationEmailPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,14 +1,12 @@
#nullable enable
using System;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Profiles.Email;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class SendVerificationEmailPage : BaseLayout
{

View file

@ -1,6 +1,6 @@
@page "/login/setEmail"
@using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.SetEmailForm
@model LBPUnion.ProjectLighthouse.Website.Pages.SetEmailForm
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,17 +1,14 @@
#nullable enable
using System;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Profiles.Email;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Http;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class SetEmailForm : BaseLayout
{

View file

@ -4,7 +4,7 @@
@using LBPUnion.ProjectLighthouse.Types
@using LBPUnion.ProjectLighthouse.Types.Reviews
@using LBPUnion.ProjectLighthouse.Types.Settings
@model LBPUnion.ProjectLighthouse.Pages.SlotPage
@model LBPUnion.ProjectLighthouse.Website.Pages.SlotPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,17 +1,14 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using LBPUnion.ProjectLighthouse.Types.Profiles;
using LBPUnion.ProjectLighthouse.Types.Reviews;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class SlotPage : BaseLayout
{

View file

@ -1,7 +1,7 @@
@page "/slots/{pageNumber:int}"
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Types.Levels
@model LBPUnion.ProjectLighthouse.Pages.SlotsPage
@model LBPUnion.ProjectLighthouse.Website.Pages.SlotsPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,17 +1,13 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class SlotsPage : BaseLayout
{
@ -41,7 +37,8 @@ public class SlotsPage : BaseLayout
if (part.Contains("by:"))
{
targetAuthor = part.Replace("by:", "");
} else if (part.Contains("game:"))
}
else if (part.Contains("game:"))
{
if (part.Contains('1')) targetGame = GameVersion.LittleBigPlanet1;
else if (part.Contains('2')) targetGame = GameVersion.LittleBigPlanet2;

View file

@ -2,7 +2,7 @@
@using System.Web
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.UserPage
@model LBPUnion.ProjectLighthouse.Website.Pages.UserPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,15 +1,12 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Profiles;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class UserPage : BaseLayout
{

View file

@ -1,7 +1,7 @@
@page "/users/{pageNumber:int}"
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Pages.UsersPage
@model LBPUnion.ProjectLighthouse.Website.Pages.UsersPage
@{
Layout = "Layouts/BaseLayout";

View file

@ -1,15 +1,11 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Pages;
namespace LBPUnion.ProjectLighthouse.Website.Pages;
public class UsersPage : BaseLayout
{

View file

@ -0,0 +1,38 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Logging.Loggers.AspNet;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using LBPUnion.ProjectLighthouse.Website.Startup;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace LBPUnion.ProjectLighthouse.Website;
public static class Program
{
public static void Main(string[] args)
{
StartupTasks.Run(args, ServerType.Website);
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
=> Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults
(
webBuilder =>
{
webBuilder.UseStartup<WebsiteStartup>();
webBuilder.UseWebRoot("StaticFiles");
webBuilder.UseUrls(ServerConfiguration.Instance.WebsiteListenUrl);
}
)
.ConfigureLogging
(
logging =>
{
logging.ClearProviders();
logging.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, AspNetToLighthouseLoggerProvider>());
}
);
}

View file

@ -0,0 +1,79 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>LBPUnion.ProjectLighthouse.Website</AssemblyName>
<RootNamespace>LBPUnion.ProjectLighthouse.Website</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj"/>
</ItemGroup>
<ItemGroup>
<None Remove="gitVersion.txt"/>
<EmbeddedResource Include="gitVersion.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Remove="gitBranch.txt"/>
<EmbeddedResource Include="gitBranch.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Remove="gitRemotes.txt"/>
<EmbeddedResource Include="gitRemotes.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<None Remove="gitUnpushed.txt"/>
<EmbeddedResource Include="gitUnpushed.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="Pages\Admin\AdminBanUserPage.cshtml"/>
<AdditionalFiles Include="Pages\Admin\AdminPanelPage.cshtml"/>
<AdditionalFiles Include="Pages\Admin\AdminPanelUsersPage.cshtml"/>
<AdditionalFiles Include="Pages\Admin\AdminSetGrantedSlotsPage.cshtml"/>
<AdditionalFiles Include="Pages\CompleteEmailVerificationPage.cshtml"/>
<AdditionalFiles Include="Pages\Debug\FilterTestPage.cshtml"/>
<AdditionalFiles Include="Pages\Debug\RoomVisualizerPage.cshtml"/>
<AdditionalFiles Include="Pages\Debug\VersionInfoPage.cshtml"/>
<AdditionalFiles Include="Pages\ExternalAuth\AuthenticationPage.cshtml"/>
<AdditionalFiles Include="Pages\ExternalAuth\ManageUserApprovedIpAddressesPage.cshtml"/>
<AdditionalFiles Include="Pages\LandingPage.cshtml"/>
<AdditionalFiles Include="Pages\Layouts\BaseLayout.cshtml"/>
<AdditionalFiles Include="Pages\LoginForm.cshtml"/>
<AdditionalFiles Include="Pages\LogoutPage.cshtml"/>
<AdditionalFiles Include="Pages\Partials\AdminPanelStatisticPartial.cshtml"/>
<AdditionalFiles Include="Pages\Partials\AdminSetGrantedSlotsFormPartial.cshtml"/>
<AdditionalFiles Include="Pages\Partials\CaptchaPartial.cshtml"/>
<AdditionalFiles Include="Pages\Partials\CommentsPartial.cshtml"/>
<AdditionalFiles Include="Pages\Partials\PhotoPartial.cshtml"/>
<AdditionalFiles Include="Pages\Partials\SlotCardPartial.cshtml"/>
<AdditionalFiles Include="Pages\Partials\UserCardPartial.cshtml"/>
<AdditionalFiles Include="Pages\PasswordResetPage.cshtml"/>
<AdditionalFiles Include="Pages\PasswordResetRequiredPage.cshtml"/>
<AdditionalFiles Include="Pages\PhotosPage.cshtml"/>
<AdditionalFiles Include="Pages\RegisterForm.cshtml"/>
<AdditionalFiles Include="Pages\ReportsPage.cshtml"/>
<AdditionalFiles Include="Pages\SendVerificationEmailPage.cshtml"/>
<AdditionalFiles Include="Pages\SetEmailForm.cshtml"/>
<AdditionalFiles Include="Pages\SlotPage.cshtml"/>
<AdditionalFiles Include="Pages\SlotsPage.cshtml"/>
<AdditionalFiles Include="Pages\UserPage.cshtml"/>
<AdditionalFiles Include="Pages\UsersPage.cshtml"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.5"/>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 &gt; &quot;$(ProjectDir)/gitVersion.txt&quot;"/>
<Exec Command="git branch --show-current &gt; &quot;$(ProjectDir)/gitBranch.txt&quot;"/>
<Exec Command="git remote -v &gt; &quot;$(ProjectDir)/gitRemotes.txt&quot;"/>
<Exec Command="git log --branches --not --remotes --oneline &gt; &quot;$(ProjectDir)/gitUnpushed.txt&quot;"/>
</Target>
</Project>

View file

@ -0,0 +1,61 @@
using LBPUnion.ProjectLighthouse.Startup;
using LBPUnion.ProjectLighthouse.Startup.Middlewares;
using Microsoft.AspNetCore.HttpOverrides;
namespace LBPUnion.ProjectLighthouse.Website.Startup;
public sealed class WebsiteStartup
{
public WebsiteStartup(IConfiguration configuration)
{
this.Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
#if DEBUG
services.AddRazorPages().WithRazorPagesAtContentRoot().AddRazorRuntimeCompilation();
#else
services.AddRazorPages().WithRazorPagesAtContentRoot();
#endif
services.AddDbContext<Database>();
services.Configure<ForwardedHeadersOptions>
(
options =>
{
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
}
);
#if DEBUG
services.AddSingleton<IHostLifetime, DebugWarmupLifetime>();
#else
services.AddSingleton<IHostLifetime, ConsoleLifetime>();
#endif
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
#if DEBUG
app.UseDeveloperExceptionPage();
#endif
app.UseForwardedHeaders();
app.UseMiddleware<RequestLogMiddleware>();
app.UseRouting();
app.UseStaticFiles();
app.UseEndpoints(endpoints => endpoints.MapControllers());
app.UseEndpoints(endpoints => endpoints.MapRazorPages());
}
}

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more