Ejemplo n.º 1
0
        protected override async Task OnInitializedAsync()
        {
            userName = ProfileSvc.UserName;
            userId   = ProfileSvc.UserId;

            if (string.IsNullOrWhiteSpace(userName))
            {
                userName = await EditProfileModal.ShowAsync();
            }

            if (GameId == null)
            {
                NavigationManager.NavigateTo($"story-poker/{GameHelper.GenerateGameId()}", true);
            }

            if (!string.IsNullOrWhiteSpace(GameId))
            {
                ScrumPokerHub.Init(GameId);

                ScrumPokerHub.OnReconnected             += Reconnected;
                ScrumPokerHub.OnReceiveVote             += ReceivedVote;
                ScrumPokerHub.OnAddPlayer               += NewPlayerAdded;
                ScrumPokerHub.OnRemovePlayer            += RemovePlayer;
                ScrumPokerHub.OnReceiveInitialGameState += ReceivedInitialGameState;
                ScrumPokerHub.OnGameEnded               += GameEnded;
                ScrumPokerHub.OnGameReset               += GameReset;

                await ScrumPokerHub.StartAsync();

                await ScrumPokerHub.JoinGameAsync();
            }
        }
Ejemplo n.º 2
0
 protected async void Reconnected(object sender, string connectionId)
 {
     await ScrumPokerHub.JoinGameAsync();
 }