Remove() public method

public Remove ( Server.Mobile m ) : void
m Server.Mobile
return void
示例#1
0
        public static void EventSink_Logout(Mobile from)
        {
            Party p = Get(from);

            p?.Remove(from);

            from.Party = null;
        }
示例#2
0
        public static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile from = e.Mobile;
            Party  p    = Get(from);

            p?.Remove(from);

            from.Party = null;
        }
示例#3
0
        public static void EventSink_Logout(Mobile from)
        {
            Party p = Party.Get(from);

            if (p != null)
            {
                p.Remove(from);
            }

            from.Party = null;
        }
示例#4
0
        public static void EventSink_Logout(LogoutEventArgs e)
        {
            Mobile from = e.Mobile;
            Party  p    = Party.Get(from);

            if (p != null)
            {
                p.Remove(from);
            }

            from.Party = null;
        }
示例#5
0
        public override void OnRemove(Mobile from, Mobile target)
        {
            Party p = Party.Get(from);

            if (p == null)
            {
                from.SendLocalizedMessage(3000211);                 // You are not in a party.
                return;
            }

            if (p.Leader == from && target == null)
            {
                from.SendLocalizedMessage(1005455);                 // Who would you like to remove from your party?
                from.Target = new RemovePartyTarget();
            }
            else if ((p.Leader == from || from == target) && p.Contains(target))
            {
                p.Remove(target);
            }
        }
示例#6
0
        protected override void OnTarget(Mobile from, object o)
        {
            if (o is Mobile m)
            {
                Party p = Party.Get(from);

                if (p == null || p.Leader != from || !p.Contains(m))
                {
                    return;
                }

                if (from == m)
                {
                    from.SendLocalizedMessage(1005446);                     // You may only remove yourself from a party if you are not the leader.
                }
                else
                {
                    p.Remove(m);
                }
            }
        }