mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-16 22:52:27 +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
|
@ -3,11 +3,15 @@ using LBPUnion.ProjectLighthouse.Configuration;
|
|||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
using LBPUnion.ProjectLighthouse.Files;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Levels;
|
||||
using LBPUnion.ProjectLighthouse.Logging;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Token;
|
||||
using LBPUnion.ProjectLighthouse.Types.Logging;
|
||||
using LBPUnion.ProjectLighthouse.Types.Misc;
|
||||
using LBPUnion.ProjectLighthouse.Types.Resources;
|
||||
using LBPUnion.ProjectLighthouse.Types.Users;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -219,7 +223,7 @@ public class PublishController : ControllerBase
|
|||
#endregion
|
||||
|
||||
slot.FirstUploaded = oldSlot.FirstUploaded;
|
||||
slot.LastUpdated = TimeHelper.UnixTimeMilliseconds();
|
||||
slot.LastUpdated = TimeHelper.TimestampMillis;
|
||||
|
||||
slot.TeamPick = oldSlot.TeamPick;
|
||||
|
||||
|
@ -253,8 +257,8 @@ public class PublishController : ControllerBase
|
|||
await this.database.SaveChangesAsync();
|
||||
slot.LocationId = l.Id;
|
||||
slot.CreatorId = user.UserId;
|
||||
slot.FirstUploaded = TimeHelper.UnixTimeMilliseconds();
|
||||
slot.LastUpdated = TimeHelper.UnixTimeMilliseconds();
|
||||
slot.FirstUploaded = TimeHelper.TimestampMillis;
|
||||
slot.LastUpdated = TimeHelper.TimestampMillis;
|
||||
|
||||
if (slot.MinimumPlayers == 0 || slot.MaximumPlayers == 0)
|
||||
{
|
||||
|
@ -287,7 +291,7 @@ public class PublishController : ControllerBase
|
|||
Slot? slot = await this.database.Slots.Include(s => s.Location).FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (slot == null) return this.NotFound();
|
||||
|
||||
if (slot.Location == null) throw new ArgumentNullException();
|
||||
if (slot.Location == null) throw new ArgumentNullException(nameof(id));
|
||||
|
||||
if (slot.CreatorId != token.UserId) return this.StatusCode(403, "");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue