Ejemplo n.º 1
0
            protected override void OnTick()
            {
                count--;

                if (m_TournamentStone != null && m_TournamentStone.Started)
                {
                    if (count <= 0)
                    {
                        if (m_TournamentStone.Contestants.Count >= 2)
                        {
                            CommandHandlers.BroadcastMessage(AccessLevel.Player, 38, "An automated tournament has begun");
                            m_TournamentStone.AcceptingContestants = false;
                            m_TournamentStone.AddFighters(true);
                            Stop();
                        }
                        else
                        {
                            TournamentCore.SendMessage(m_TournamentStone.Contestants, "Not enough players joined, ending tournament");
                            m_TournamentStone.EndTournament(false);
                            Stop();
                        }
                    }
                    else if (count <= 10)
                    {
                        CommandHandlers.BroadcastMessage(AccessLevel.Player, 38, string.Format("An automated and supplied 1v1 tournament will start in {0} minute{1}! Type .jointour to join or .watchtour to watch", count, count == 1 ? "" : "s"));
                    }
                }
                else
                {
                    Stop();
                }
            }
Ejemplo n.º 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);
                        }
                    }
                }
            }