public Result PerformAction(IGameAction <TGameModel> gameAction, ref TGameModel game) { Result result = _decoratee.PerformAction(gameAction, ref game); if (result.Success) { _eventEmitter.TriggerAsync(_decoratee, new GameChange <TGameModel>(game, result)).Wait(); } return(result); }
public override Task OnDisconnectedAsync(Exception exception) { _userDisconnectEvent.TriggerAsync(this, new UserDisconnect <GameHub>(Context.ConnectionId)); return(base.OnDisconnectedAsync(exception)); }
public Task Ping() => _userActivityEvent.TriggerAsync(this, new UserActivity(_userContextProvider.UserId));
public override Task OnConnectedAsync() { _userConnectEvent.TriggerAsync(this, new UserConnect <GameHub>(Context.ConnectionId, _userContextProvider.UserId)); return(base.OnConnectedAsync()); }