Example #1
0
        public CaptchaGump(Mobile from, PostCaptchaAction act, object ActionObject)
            : base(100, 100)
        {
            m_From         = from;
            m_Action       = act;
            m_ActionObject = ActionObject;
            Closable       = true;
            Disposable     = true;
            Dragable       = true;
            Resizable      = false;

            char a = (char)(Utility.Random(26) + 65);
            char b = (char)(Utility.Random(26) + 65);
            char c = (char)(Utility.Random(26) + 65);

            m_A = a;
            m_B = b;
            m_C = c;

            AddPage(0);
            setupBackground();
            int[,] a_data = getCharacterData(a);
            a_data        = rotateVector(a_data, Utility.RandomMinMax(-30, 30));

            int[,] b_data = getCharacterData(b);
            b_data        = rotateVector(b_data, Utility.RandomMinMax(-30, 30));

            int[,] c_data = getCharacterData(c);
            c_data        = rotateVector(c_data, Utility.RandomMinMax(-30, 30));

            printCharacter(a_data, 38, 11, Utility.Random(1500));
            printCharacter(b_data, 92, 11, Utility.Random(1500));
            printCharacter(c_data, 146, 11, Utility.Random(1500));
        }
Example #2
0
        public static void sendCaptcha(Mobile from, PostCaptchaAction act, object actionObject)
        {
            if (from == null || act == null)
            {
                return;
            }

            if (from is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)from;
                if (DateTime.Now > pm.NextCaptchaTime)
                {
                    pm.CloseGump(typeof(CaptchaGump));
                    pm.SendGump(new CaptchaGump(pm, act, actionObject));
                    return;
                }
            }
            act(from, actionObject);
        }
Example #3
0
        public static void sendCaptcha(Mobile from, PostCaptchaAction act, object actionObject)
        {
            if (from == null || act == null)
            {
                return;
            }

            if (from is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)from;
                if (DateTime.Now > pm.NextCaptchaTime)
                {
                    from.SendAsciiMessage(0x22, "Please verify you are not AFK.");
                    pm.CloseGump(typeof(CaptchaGump));
                    pm.SendGump(new CaptchaGump(pm, act, actionObject));

                    return;
                }
            }
            act(from, actionObject);
        }
Example #4
0
        public static void sendCaptcha(Mobile from, PostCaptchaAction act, object actionObject )
        {
            if (from == null || act == null)
                return;

            if (from is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)from;
                if (DateTime.Now > pm.NextCaptchaTime)
                {
                    from.SendAsciiMessage( 0x22, "Please verify you are not AFK." );
                    pm.CloseGump( typeof( CaptchaGump ) );
                    pm.SendGump( new CaptchaGump(pm, act, actionObject));

                    return;
                }
            }
            act(from, actionObject);
        }
Example #5
0
        public CaptchaGump(Mobile from, PostCaptchaAction act, object ActionObject)
            : base(100, 100)
        {
            m_From = from;
            m_Action = act;
            m_ActionObject = ActionObject;
            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;

            char a = (char)(Utility.Random(26) + 65);
            char b = (char)(Utility.Random(26) + 65);
            char c = (char)(Utility.Random(26) + 65);
            m_A = a;
            m_B = b;
            m_C = c;

            AddPage(0);
            setupBackground();
            int[,] a_data = getCharacterData(a);
            a_data = rotateVector(a_data, Utility.RandomMinMax(-30,30));

            int[,] b_data = getCharacterData(b);
            b_data = rotateVector(b_data, Utility.RandomMinMax(-30,30));

            int[,] c_data = getCharacterData(c);
            c_data = rotateVector(c_data, Utility.RandomMinMax(-30,30));

            printCharacter(a_data, 38, 11, Utility.Random(1500));
            printCharacter(b_data, 92, 11, Utility.Random(1500));
            printCharacter(c_data, 146, 11, Utility.Random(1500));
        }