public override Task OnConnectedAsync() { var playerId = GetPlayerId(); var matchId = GetMatchId(); var game = _service.Load(matchId); // Groups.AddToGroupAsync(Context.ConnectionId, matchId); // Handle spectators Clients.User(playerId).UpdateState(_service.MapResponse(game, playerId)); return(base.OnConnectedAsync()); }
public ActionResult <Schotten2Response> Load(string matchId) { var playerId = User.FindFirst(ClaimTypes.NameIdentifier).Value; var game = _service.Load(matchId); return(_service.MapResponse(game, playerId)); }