Beispiel #1
0
        protected override async Task OnStart(bool restarted)
        {
            try
            {
                var observer = CreateObserver <IGameObserver>();
                var ret      = await _game.Join(_userId, _userName, observer, null);

                _gamePlayer = _game.Cast <GamePlayerRef>().WithRequestWaiter(this);
                _playerId   = ret.Item1;
            }
            catch (Exception e)
            {
                _logger.ErrorFormat("Failed to join game({0})", e, _game.CastToIActorRef().Path);
                Self.Tell(InterfacedPoisonPill.Instance);
            }
        }