Tidy up controllers

This commit is contained in:
jvyden 2022-01-31 22:35:51 -05:00
commit fd2e5636df
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
21 changed files with 33 additions and 33 deletions

View file

@ -6,7 +6,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -13,7 +13,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using IOFile = System.IO.File;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/login")]

View file

@ -7,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -14,7 +14,7 @@ using LBPUnion.ProjectLighthouse.Types.Match;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Matching;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -8,7 +8,7 @@ using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]
@ -38,13 +38,13 @@ public class MessageController : ControllerBase
User? user = await this.database.UserFromGameRequest(this.Request);
if (user == null) return this.StatusCode(403, "");
#else
(User, GameToken)? userAndToken = await this.database.UserAndGameTokenFromRequest(this.Request);
(User, GameToken)? userAndToken = await this.database.UserAndGameTokenFromRequest(this.Request);
if (userAndToken == null) return this.StatusCode(403, "");
if (userAndToken == null) return this.StatusCode(403, "");
// ReSharper disable once PossibleInvalidOperationException
User user = userAndToken.Value.Item1;
GameToken gameToken = userAndToken.Value.Item2;
// ReSharper disable once PossibleInvalidOperationException
User user = userAndToken.Value.Item1;
GameToken gameToken = userAndToken.Value.Item2;
#endif
string announceText = ServerSettings.Instance.AnnounceText;
@ -56,13 +56,13 @@ public class MessageController : ControllerBase
(
announceText +
#if DEBUG
"\n\n---DEBUG INFO---\n" +
$"user.UserId: {user.UserId}\n" +
$"token.Approved: {gameToken.Approved}\n" +
$"token.Used: {gameToken.Used}\n" +
$"token.UserLocation: {gameToken.UserLocation}\n" +
$"token.GameVersion: {gameToken.GameVersion}\n" +
"---DEBUG INFO---" +
"\n\n---DEBUG INFO---\n" +
$"user.UserId: {user.UserId}\n" +
$"token.Approved: {gameToken.Approved}\n" +
$"token.Used: {gameToken.Used}\n" +
$"token.UserLocation: {gameToken.UserLocation}\n" +
$"token.GameVersion: {gameToken.GameVersion}\n" +
"---DEBUG INFO---" +
#endif
"\n"
);

View file

@ -15,7 +15,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -12,7 +12,7 @@ using LBPUnion.ProjectLighthouse.Types.Files;
using Microsoft.AspNetCore.Mvc;
using IOFile = System.IO.File;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Resources;
[ApiController]
[Produces("text/xml")]

View file

@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Categories;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -2,7 +2,7 @@ using System;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/tags")]

View file

@ -9,7 +9,7 @@ using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -13,7 +13,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -13,7 +13,7 @@ using LBPUnion.ProjectLighthouse.Types.Reviews;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -7,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types.Levels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -11,7 +11,7 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi.Slots;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -3,7 +3,7 @@ using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]

View file

@ -12,7 +12,7 @@ using LBPUnion.ProjectLighthouse.Types.Profiles;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Controllers;
namespace LBPUnion.ProjectLighthouse.Controllers.GameApi;
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/")]