Пример #1
0
        public async Task SpectatorTable()
        {
            int userId;
            PlayTableStaeModel state = null;

            if (TryParsUserId(out userId))
            {
                var viewer = _tablesService.GetTableViewerByUserId(userId);
                if (viewer != null)
                {
                    state = TableHubUtils.GetTableState(viewer.tableId, _tablesService, _mapper);
                }
            }
            await Clients.User(Context.UserIdentifier).SpectatorTable(state);
        }
Пример #2
0
        public Task UpdatePlayerTableState(int playerId = -1)
        {
            if (playerId < 0)
            {
                string userId = Context.UserIdentifier;
            }
            PlayTableStaeModel modelValue = null;

            if (TryParsUserId(out playerId))
            {
                if (playerId > 0)
                {
                    modelValue = TableHubUtils.GetTablePLayerState(playerId, _tablesService, _mapper);
                    return(Clients.User(playerId.ToString()).PlayerTableState(modelValue));
                }
            }
            return(Task.FromResult <PlayTableStaeModel>(null));
        }