コード例 #1
0
ファイル: TableHub.cs プロジェクト: UteHaus/doppelkopf-multi
        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
ファイル: TableHub.cs プロジェクト: UteHaus/doppelkopf-multi
        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));
        }