Example #1
0
        public static void TryLeaveTournament(Mobile from, bool kicked)
        {
            if (IsInTournament(from))
            {
                TournamentStone ts = GetPlayerStone(from);

                if (ts != null)
                {
                    if (ts.Fighting != null && ts.Fighting.Contains(from))
                    {
                        from.SendAsciiMessage("You cannot leave a tournament while fighting");
                    }
                    else
                    {
                        ts.RemovePlayer(from, false, kicked);
                    }
                }
            }
        }
Example #2
0
            protected override void OnTick()
            {
                if (m_Stone != null && m_Stone.Started && m_Stone.Contestants.Contains(m_Mobile))
                {
                    if (m_Mobile.NetState == null) //Not logged in, kick from tournament
                    {
                        bool fighting = false;

                        if (m_Stone.Fighting.Contains(m_Mobile))
                        {
                            fighting = true;
                        }

                        m_Stone.RemovePlayer(m_Mobile, false, true);

                        if (fighting) //Only try to add more fighters if the disconnected player was fighting, otherwise bugs will occur
                        {
                            m_Stone.AddFighters(false);
                        }
                    }
                }
            }