예제 #1
0
        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);
        }
예제 #2
0
 public override Task OnDisconnectedAsync(Exception exception)
 {
     _userDisconnectEvent.TriggerAsync(this, new UserDisconnect <GameHub>(Context.ConnectionId));
     return(base.OnDisconnectedAsync(exception));
 }
예제 #3
0
 public Task Ping()
 => _userActivityEvent.TriggerAsync(this, new UserActivity(_userContextProvider.UserId));
예제 #4
0
 public override Task OnConnectedAsync()
 {
     _userConnectEvent.TriggerAsync(this, new UserConnect <GameHub>(Context.ConnectionId, _userContextProvider.UserId));
     return(base.OnConnectedAsync());
 }