Skip to content

Commit

Permalink
Modify Game.razor
Browse files Browse the repository at this point in the history
  • Loading branch information
oneheed committed Oct 3, 2023
1 parent 75c6565 commit 243f83e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@
});

await hubConnection.StartAsync();

if (!string.IsNullOrEmpty(GameId))
{
await hubConnection.SendAsync("JoinRoom", GameId.ToString(), name);
}
}

public bool IsConnected => !string.IsNullOrEmpty(name) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public async Task<dynamic> GamesAsync(GameRequest request)
PlayerId = new Guid(Convert.FromBase64String(request.Players[1].Id).Take(16).ToArray()),
PlayerName = request.Players[1].Nickname
};
_ = await new JoinGameUseCase().ExecuteAsync(joinGameRequest, _repository);

var game = await new JoinGameUseCase().ExecuteAsync(joinGameRequest, _repository);

SendGameInfo(game.Id.ToString(), game);

return new { url = $"https://oneheed.github.io/Gobblet-Gobblers/games/{createGameResponse.Id}" };
}
Expand Down

0 comments on commit 243f83e

Please sign in to comment.