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); }
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)); }