Beispiel #1
0
 /// <summary>
 /// Remove a possesser from this player
 /// </summary>
 public void Exorcise(PossessSession session)
 {
     lock (possessLock)
     {
         var list = new List <PossessSession>(PossessedBy);
         list.Remove(session);
         PossessedBy = list.ToArray();
     }
 }
Beispiel #2
0
        /// <summary>
        /// Add a possesser to this player
        /// </summary>
        public void Possess(PossessSession session)
        {
            var ghostList = new List <PossessSession>(session.Player.PossessedBy);

            if (this.Session is PossessSession && ghostList.Contains((PossessSession)this.Session))
            {
                session.Player.TellSystem(Chat.Red, "Already possessed by " + Name);
                return;
            }

            lock (possessLock)
            {
                var list = new List <PossessSession>(PossessedBy);
                list.Add(session);
                PossessedBy = list.ToArray();
            }
        }