Eliminate duplicate rooms

This commit is contained in:
jvyden 2022-07-25 19:57:13 -04:00
parent 5d6e339fa8
commit be592bbacb
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 27 additions and 7 deletions

View file

@ -46,4 +46,17 @@ public class RoomVisualizerController : ControllerBase
return this.Redirect("/debug/roomVisualizer");
#endif
}
[HttpGet("createRoomsWithDuplicatePlayers")]
public async Task<IActionResult> CreateRoomsWithDuplicatePlayers()
{
#if !DEBUG
return this.NotFound();
#else
List<int> users = await this.database.Users.OrderByDescending(_ => EF.Functions.Random()).Take(1).Select(u => u.UserId).ToListAsync();
RoomHelper.CreateRoom(users, GameVersion.LittleBigPlanet2, Platform.PS3);
RoomHelper.CreateRoom(users, GameVersion.LittleBigPlanet2, Platform.PS3);
return this.Redirect("/debug/roomVisualizer");
#endif
}
}