mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-20 16:22:27 +00:00
Lots of bug fixes and performance improvements (#410)
* Many bug fixes and performance enhancements * Fix warnings and speed up photos with me * Finish refactoring user serialization * Finish refactoring user serialization Use GameTokens instead of User when possible Prevent negative page sizes * Fix debug compilation * Add gzip compression to example nginx config * Remove deflate changes * Add UsernameFromWebToken Co-authored-by: Jayden <jvyden@jvyden.xyz>
This commit is contained in:
parent
8dbd0e63ff
commit
d23a264b8a
43 changed files with 625 additions and 505 deletions
|
@ -3,9 +3,8 @@ using System.Buffers;
|
|||
using System.IO.Pipelines;
|
||||
using System.Xml.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Files;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Logging;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
@ -32,8 +31,8 @@ public class ResourcesController : ControllerBase
|
|||
[HttpPost("showNotUploaded")]
|
||||
public async Task<IActionResult> FilterResources()
|
||||
{
|
||||
User? user = await this.database.UserFromGameRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||
|
||||
|
@ -52,8 +51,8 @@ public class ResourcesController : ControllerBase
|
|||
[HttpGet("r/{hash}")]
|
||||
public async Task<IActionResult> GetResource(string hash)
|
||||
{
|
||||
User? user = await this.database.UserFromGameRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
string path = FileHelper.GetResourcePath(hash);
|
||||
|
||||
|
@ -67,8 +66,8 @@ public class ResourcesController : ControllerBase
|
|||
[HttpPost("upload/{hash}")]
|
||||
public async Task<IActionResult> UploadResource(string hash)
|
||||
{
|
||||
User? user = await this.database.UserFromGameRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
string assetsDirectory = FileHelper.ResourcePath;
|
||||
string path = FileHelper.GetResourcePath(hash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue