コード例 #1
0
        private void ThreadedValidation()
        {
            if (!MySQLManager.ValidateInput(m_Owner, m_Answer, m_TriesLeft))
            {
                if (m_TriesLeft == 1)
                {
                    new KillTimer(m_Owner).Start(); //Dirty fix to fix any possible threaded issues.
                }
                if (m_TotalTriesLeft <= 0)          //So people can't spam and eventually enter the correct answer
                {
                    m_Owner.SendAsciiMessage("You have entered the incorrect answer too many times and you will now need to page staff to get unfrozen");
                    m_Owner.AntiMacroGump = false;
                    return;
                }

                if (m_TriesLeft > 0)
                {
                    m_TriesLeft--;
                }

                m_TotalTriesLeft--;

                m_Owner.SendAsciiMessage("Wrong answer!");
                AntiMacroGump newGump = new AntiMacroGump(this);
                m_Owner.SendGump(newGump);

                //We dont want to end the timer and free the owner
                return;
            }

            //End the timer
            if (m_MacroTimer != null)
            {
                m_MacroTimer.Stop();
                m_MacroTimer = null;
            }

            FreeOwner();

            m_Owner.SendAsciiMessage(string.Format("Thank you {0} for validating your presence. Have a nice day!", m_Owner.Name));
            m_Owner.CantWalk = false;
            if (m_Owner.Frozen)
            {
                m_Owner.Frozen = false;
            }
        }
コード例 #2
0
        private AntiMacroGump(PlayerMobile owner) : base( 0, 0 )
        {
            m_Owner = owner;
            m_Owner.AntiMacroGump = true;

            m_Seed = Utility.Random(9999);
            m_TriesLeft = c_MaxTriesBeforeDeath;
            m_TotalTriesLeft = c_MaxAllowedTries;

            //Start the macro check timer. If the user doesn't respond within c_MaxTime seconds, he will be penalized.
            m_MacroTimer = new NewMacroTimer(this, c_MaxTime);
            m_MacroTimer.Start();

            InitiateGump();

            if (m_GumpDictionary.ContainsKey(m_Owner))
                m_GumpDictionary[m_Owner] = this;
            else
                m_GumpDictionary.Add(m_Owner, this);
        }
コード例 #3
0
        private AntiMacroGump(AntiMacroGump oldGump) : base(0, 0)
        {
            m_Owner = oldGump.m_Owner;

            m_Seed           = oldGump.m_Seed;
            m_TriesLeft      = oldGump.m_TriesLeft;
            m_TotalTriesLeft = oldGump.m_TotalTriesLeft;

            m_MacroTimer = oldGump.m_MacroTimer;

            InitiateGump();

            if (m_GumpDictionary.ContainsKey(m_Owner))
            {
                m_GumpDictionary[m_Owner] = this;
            }
            else
            {
                m_GumpDictionary.Add(m_Owner, this);
            }
        }
コード例 #4
0
        private AntiMacroGump(PlayerMobile owner) : base(0, 0)
        {
            m_Owner = owner;
            m_Owner.AntiMacroGump = true;

            m_Seed           = Utility.Random(9999);
            m_TriesLeft      = c_MaxTriesBeforeDeath;
            m_TotalTriesLeft = c_MaxAllowedTries;

            //Start the macro check timer. If the user doesn't respond within c_MaxTime seconds, he will be penalized.
            m_MacroTimer = new NewMacroTimer(this, c_MaxTime);
            m_MacroTimer.Start();

            InitiateGump();

            if (m_GumpDictionary.ContainsKey(m_Owner))
            {
                m_GumpDictionary[m_Owner] = this;
            }
            else
            {
                m_GumpDictionary.Add(m_Owner, this);
            }
        }
コード例 #5
0
        private AntiMacroGump(AntiMacroGump oldGump) : base(0, 0)
        {
            m_Owner = oldGump.m_Owner;

            m_Seed = oldGump.m_Seed;
            m_TriesLeft = oldGump.m_TriesLeft;
            m_TotalTriesLeft = oldGump.m_TotalTriesLeft;

            m_MacroTimer = oldGump.m_MacroTimer;

            InitiateGump();

            if (m_GumpDictionary.ContainsKey(m_Owner))
                m_GumpDictionary[m_Owner] = this;
            else
                m_GumpDictionary.Add(m_Owner, this);
        }
コード例 #6
0
        private void ThreadedValidation()
        {
            if (!MySQLManager.ValidateInput(m_Owner, m_Answer, m_TriesLeft))
            {
                if (m_TriesLeft == 1)
                    new KillTimer(m_Owner).Start(); //Dirty fix to fix any possible threaded issues.

                if (m_TotalTriesLeft <= 0) //So people can't spam and eventually enter the correct answer
                {
                    m_Owner.SendAsciiMessage("You have entered the incorrect answer too many times and you will now need to page staff to get unfrozen");
                    m_Owner.AntiMacroGump = false;
                    return;
                }

                if (m_TriesLeft > 0)
                    m_TriesLeft--;

                m_TotalTriesLeft--;

                m_Owner.SendAsciiMessage("Wrong answer!");
                AntiMacroGump newGump = new AntiMacroGump(this);
                m_Owner.SendGump(newGump);

                //We dont want to end the timer and free the owner
                return;
            }

            //End the timer
            if (m_MacroTimer != null)
            {
                m_MacroTimer.Stop();
                m_MacroTimer = null;
            }

            FreeOwner();

            m_Owner.SendAsciiMessage(string.Format("Thank you {0} for validating your presence. Have a nice day!", m_Owner.Name));
            m_Owner.CantWalk = false;
            if (m_Owner.Frozen)
                m_Owner.Frozen = false;
        }