Пример #1
0
 void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
 {
     _channel = (ActorBoundChannelRef)channel;
     if (_id.StartsWith("bot") == false)
     {
         _eventObserver.Channel = new AkkaReceiverNotificationChannel(((ActorBoundChannelRef)channel).CastToIActorRef());
     }
 }
Пример #2
0
        void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
        {
            if (tag == null)
                return;

            // Deactivate observer bound to closed channel

            var userId = (long)tag;
            var player = _players.FirstOrDefault(p => p.UserId == userId);
            if (player != null)
                player.Observer = null;
        }
Пример #3
0
        void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
        {
            if (tag == null)
                return;

            // Change notification message route to open channel

            var userId = (long)tag;
            var player = _players.FirstOrDefault(p => p.UserId == userId);
            if (player != null && player.Observer != null)
            {
                AkkaReceiverNotificationChannel.OverrideReceiver(
                    player.Observer.Channel, ((ActorBoundChannelRef)channel).CastToIActorRef());
            }
        }
Пример #4
0
        void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
        {
            // Deactivate observer bound to closed channel

            var userId = tag as string;

            if (userId != null)
            {
                UserData userData;
                if (_userMap.TryGetValue(userId, out userData))
                {
                    userData.Observer = null;
                }
            }
        }
Пример #5
0
        void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
        {
            if (tag == null)
            {
                return;
            }

            // Deactivate observer bound to closed channel

            var userId = (long)tag;
            var player = _players.FirstOrDefault(p => p.UserId == userId);

            if (player != null)
            {
                player.Observer = null;
            }
        }
Пример #6
0
        void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
        {
            if (tag == null)
            {
                return;
            }

            // Change notification message route to open channel

            var userId = (long)tag;
            var player = _players.FirstOrDefault(p => p.UserId == userId);

            if (player != null && player.Observer != null)
            {
                AkkaReceiverNotificationChannel.OverrideReceiver(
                    player.Observer.Channel, ((ActorBoundChannelRef)channel).CastToIActorRef());
            }
        }
Пример #7
0
        void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
        {
            // Change notification message route to open channel

            var userId = tag as string;

            if (userId != null)
            {
                UserData userData;
                if (_userMap.TryGetValue(userId, out userData))
                {
                    var actorChannel = userData.Observer.Channel as AkkaReceiverNotificationChannel;
                    if (actorChannel != null)
                    {
                        userData.Observer.Channel = new AkkaReceiverNotificationChannel(((ActorBoundChannelRef)channel).CastToIActorRef());
                    }
                }
            }
        }
Пример #8
0
 void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
 {
     _channel = null;
 }
Пример #9
0
 void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
 {
     _channel = null;
 }
Пример #10
0
 void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
 {
     _channel = (ActorBoundChannelRef)channel;
 }
 void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
 {
     _tagByChannelClose = tag;
     Self.Tell(InterfacedPoisonPill.Instance);
 }
 void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
 {
     _tagByChannelOpen = tag;
 }
Пример #13
0
 void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
 {
     _channel = (ActorBoundChannelRef)channel;
 }
 void IActorBoundChannelObserver.ChannelClose(IActorBoundChannel channel, object tag)
 {
     _tagByChannelClose = tag;
     Self.Tell(InterfacedPoisonPill.Instance);
 }
 void IActorBoundChannelObserver.ChannelOpen(IActorBoundChannel channel, object tag)
 {
     _tagByChannelOpen = tag;
 }