Skip to content

Commit

Permalink
Fixed Create Player
Browse files Browse the repository at this point in the history
  • Loading branch information
oneheed committed Sep 17, 2023
1 parent 5edfe5c commit 0fd91be
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public GameController(ILogger<GameController> logger, IRepository repository)
[Route("~/games")]
public async Task<dynamic> GamesAsync(GameRequest request)
{
if (request.Players.Count != 2)
{
throw new Exception("Requires at least two players to play");
}

var createGameRequest = new CreateGameRequest
{
PlayerId = new Guid(Convert.FromBase64String(request.Players[0].Id).Take(16).ToArray()),
Expand Down

0 comments on commit 0fd91be

Please sign in to comment.