mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-14 09:11:28 +00:00
Fix broken planet updates
This commit is contained in:
parent
9dc7ce27e1
commit
c9e5295338
2 changed files with 13 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
|||
#nullable enable
|
||||
using System.Text.Json;
|
||||
using LBPUnion.ProjectLighthouse.Database;
|
||||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
|
@ -82,7 +81,7 @@ public class UserController : ControllerBase
|
|||
if (update.Location != null) user.Location = update.Location;
|
||||
|
||||
// ReSharper disable once LoopCanBeConvertedToQuery
|
||||
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,})
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(resource)) continue;
|
||||
|
||||
|
@ -91,6 +90,9 @@ public class UserController : ControllerBase
|
|||
if (!GameResourceHelper.IsValidTexture(resource)) return this.BadRequest();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(update.PlanetHash) && !GameResourceHelper.IsValidLevel(update.PlanetHash))
|
||||
return this.BadRequest();
|
||||
|
||||
if (update.IconHash != null) user.IconHash = update.IconHash;
|
||||
|
||||
if (update.YayHash != null) user.YayHash = update.YayHash;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue