/// <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();
            }
        }
Beispiel #2
0
 public PossessSession Join(Client player, Client victim)
 {
     PossessSession session = new PossessSession(player, victim);
     return session;
 }
 /// <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 #4
0
        public PossessSession Join(Client player, Client victim)
        {
            PossessSession session = new PossessSession(player, victim);

            return(session);
        }