Move servers to LBPU.PL.Servers

This commit is contained in:
jvyden 2022-05-14 23:37:55 -04:00
parent 545b5a0709
commit b2ec7eae57
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
116 changed files with 173 additions and 162 deletions

View file

@ -0,0 +1,46 @@
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers.Debug;
[ApiController]
[Route("debug/roomVisualizer")]
public class RoomVisualizerController : ControllerBase
{
private readonly Database database;
public RoomVisualizerController(Database database)
{
this.database = database;
}
[HttpGet("createFakeRoom")]
public async Task<IActionResult> CreateFakeRoom()
{
#if !DEBUG
return this.NotFound();
#else
List<User> users = await this.database.Users.OrderByDescending(_ => EF.Functions.Random()).Take(2).ToListAsync();
RoomHelper.CreateRoom(users, GameVersion.LittleBigPlanet2, Platform.PS3);
foreach (User user in users)
{
MatchHelper.SetUserLocation(user.UserId, "127.0.0.1");
}
return this.Redirect("/debug/roomVisualizer");
#endif
}
[HttpGet("deleteRooms")]
public IActionResult DeleteRooms()
{
#if !DEBUG
return this.NotFound();
#else
RoomHelper.Rooms.RemoveAll(_ => true);
return this.Redirect("/debug/roomVisualizer");
#endif
}
}