Exemplo n.º 1
0
        public async Task AddToGameGroup(string id, string connectionId)
        {
            await Groups.AddToGroupAsync(connectionId, id);

            var lobby = lobbiesService.GetLobbyById(id);

            lobby.SetReady();
            await Clients.Client(connectionId).SendAsync("SetPlayerTurn", lobby.Turn);

            lobby.Turn = !lobby.Turn;
            if (lobby.IsReady)
            {
                await Clients.Group(id).SendAsync("ReadyNotify");
            }
        }
Exemplo n.º 2
0
 public IActionResult Game(string Id)
 {
     return(View(lobbiesService.GetLobbyById(Id)));
 }