コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Actor"/> class.
        /// </summary>
        /// <param name="peer">
        /// The peer for this actor.
        /// </param>
        public Actor(HivePeer peer)
        {
            this.Peer = peer;

            this.LastPeerInfo = peer.ToString();

            this.Peer.Actor = this;

            // we copy the UserId so it doesn't get lost on peer disconnect
            this.UserId = peer.UserId;
            this.RemovedFromInactive = DateTime.MinValue;
        }
コード例 #2
0
        public void Reactivate(HivePeer peer)
        {
            this.Peer       = peer;
            this.Peer.Actor = this;

            this.LastPeerInfo = peer.ToString();

            // rejoin to all previously joined groups
            foreach (var group in this.groups)
            {
                group.Add(this);
            }

            this.KillInActiveActorCleanUpTimer();

            this.DeactivationTime = null;
        }