mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-22 09:12:26 +00:00
Major refactor and reorganization of types (#652)
* Start of reorganization and cleanup * Remove duplicate title id * Refactor types * Fix Release building * Move classes in /Types to a Types namespace * Fix compilation error (RoomVisualizerPage strikes again) * Fix bugs created from auto merge * Fix auto-merge compilation error * Changes from review/fix failed merge
This commit is contained in:
parent
c8120b3388
commit
f1c5ad4002
316 changed files with 1623 additions and 1518 deletions
ProjectLighthouse.Servers.GameServer/Controllers
|
@ -1,10 +1,12 @@
|
|||
#nullable enable
|
||||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Servers.GameServer.Types;
|
||||
using LBPUnion.ProjectLighthouse.StorableLists.Stores;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Token;
|
||||
using LBPUnion.ProjectLighthouse.Types.Users;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -34,7 +36,7 @@ public class FriendsController : ControllerBase
|
|||
SanitizationHelper.SanitizeStringsInClass(npData);
|
||||
|
||||
List<User> friends = new();
|
||||
foreach (string friendName in npData.Friends)
|
||||
foreach (string friendName in npData.Friends ?? new List<string>())
|
||||
{
|
||||
User? friend = await this.database.Users.FirstOrDefaultAsync(u => u.Username == friendName);
|
||||
if (friend == null) continue;
|
||||
|
@ -43,7 +45,7 @@ public class FriendsController : ControllerBase
|
|||
}
|
||||
|
||||
List<int> blockedUsers = new();
|
||||
foreach (string blockedUserName in npData.BlockedUsers)
|
||||
foreach (string blockedUserName in npData.BlockedUsers ?? new List<string>())
|
||||
{
|
||||
User? blockedUser = await this.database.Users.FirstOrDefaultAsync(u => u.Username == blockedUserName);
|
||||
if (blockedUser == null) continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue