mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-27 15:38:39 +00:00
Merge branch 'refs/heads/main' into digest-refactor
# Conflicts: # ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs
This commit is contained in:
commit
0e0a900f67
86 changed files with 1477 additions and 170 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Text.Json;
|
||||
using LBPUnion.ProjectLighthouse.Configuration;
|
||||
using LBPUnion.ProjectLighthouse.Database;
|
||||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
using LBPUnion.ProjectLighthouse.Files;
|
||||
|
@ -69,6 +70,9 @@ public class UserController : GameController
|
|||
|
||||
if (update.Biography != null)
|
||||
{
|
||||
// Deny request if in read-only mode
|
||||
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
|
||||
|
||||
if (update.Biography.Length > 512) return this.BadRequest();
|
||||
|
||||
user.Biography = update.Biography;
|
||||
|
@ -81,6 +85,9 @@ public class UserController : GameController
|
|||
{
|
||||
if (string.IsNullOrWhiteSpace(resource)) continue;
|
||||
|
||||
// Deny request if in read-only mode
|
||||
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
|
||||
|
||||
if (!FileHelper.ResourceExists(resource) && !resource.StartsWith('g')) return this.BadRequest();
|
||||
|
||||
if (!GameResourceHelper.IsValidTexture(resource)) return this.BadRequest();
|
||||
|
@ -169,7 +176,7 @@ public class UserController : GameController
|
|||
// Sometimes the update gets called periodically as pin progress updates via playing,
|
||||
// may not affect equipped profile pins however, so check before setting it.
|
||||
string currentPins = user.Pins;
|
||||
string newPins = string.Join(",", pinJson.ProfilePins);
|
||||
string newPins = string.Join(",", pinJson.ProfilePins.Distinct());
|
||||
|
||||
if (string.Equals(currentPins, newPins)) return this.Ok("[{\"StatusCode\":200}]");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue