Exemplo n.º 1
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (!AuctionSystem.Running)
            {
                sender.Mobile.SendMessage(AuctionConfig.MessageHue, AuctionSystem.ST[15]);
                return;
            }

            int             buttonid = info.ButtonID;
            AuctionComparer cmp      = null;

            if (buttonid < 0 || buttonid > 6)
            {
                sender.Mobile.SendMessage("Invalid option.  Please try again.");
                return;
            }

            switch (info.ButtonID)
            {
            case 0:     // Exit
                if (m_Callback != null)
                {
                    try { m_Callback.DynamicInvoke(new object[] { sender.Mobile }); }
                    catch { }
                }
                break;

            case 1:                     // Create auction
                AuctionSystem.AuctionRequest(sender.Mobile);
                break;

            case 2:                                                    // View all auctions

                cmp = new AuctionComparer(AuctionSorting.Date, false); //Sort by date newest first
                if (cmp != null)
                {
                    m_List.Sort(cmp);
                }

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, m_List, true, false));
                // sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.Auctions, true, false));
                break;

            case 3:                     // View your auctions

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetAuctions(sender.Mobile), true, false));
                break;


            case 4:                     // View your bids

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetBids(sender.Mobile), true, false));
                break;

            case 5:                     // View pendencies

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetPendencies(sender.Mobile), true, false));
                break;

            case 6:                                                       // View all auctions sorted by ending first

                cmp = new AuctionComparer(AuctionSorting.TimeLeft, true); //Sort by ending first
                if (cmp != null)
                {
                    m_List.Sort(cmp);
                }

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, m_List, true, false));
                break;
            }
        }
Exemplo n.º 2
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (!AuctionSystem.Running)
            {
                sender.Mobile.SendMessage(AuctionConfig.MessageHue, AuctionSystem.ST[15]);
                return;
            }

            AuctionComparer cmp = null;

            switch (info.ButtonID)
            {
            case 1:                     // Name

                cmp = new AuctionComparer(AuctionSorting.Name, true);
                break;

            case 2:

                cmp = new AuctionComparer(AuctionSorting.Name, false);
                break;

            case 3:

                cmp = new AuctionComparer(AuctionSorting.Date, true);
                break;

            case 4:

                cmp = new AuctionComparer(AuctionSorting.Date, false);
                break;

            case 5:

                cmp = new AuctionComparer(AuctionSorting.TimeLeft, true);
                break;

            case 6:

                cmp = new AuctionComparer(AuctionSorting.TimeLeft, false);
                break;

            case 7:

                cmp = new AuctionComparer(AuctionSorting.Bids, true);
                break;

            case 8:

                cmp = new AuctionComparer(AuctionSorting.Bids, false);
                break;

            case 9:

                cmp = new AuctionComparer(AuctionSorting.MinimumBid, true);
                break;

            case 10:

                cmp = new AuctionComparer(AuctionSorting.MinimumBid, false);
                break;

            case 11:

                cmp = new AuctionComparer(AuctionSorting.HighestBid, true);
                break;

            case 12:

                cmp = new AuctionComparer(AuctionSorting.HighestBid, false);
                break;
            }

            if (cmp != null)
            {
                m_List.Sort(cmp);
            }

            sender.Mobile.SendGump(new AuctionListing(sender.Mobile, m_List, m_Search, m_ReturnToAuction));
        }
Exemplo n.º 3
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (!m_Buttons.Contains(info.ButtonID))
            {
                Console.WriteLine(@"The auction system located a potential exploit. 
					Player {0} (Acc. {1}) tried to press an unregistered button in a gump of type: {2}"                    ,
                                  sender.Mobile != null ? sender.Mobile.ToString() : "Unkown",
                                  sender.Mobile != null && sender.Mobile.Account != null ? (sender.Mobile.Account as Server.Accounting.Account).Username : "******",
                                  this.GetType().Name);

                return;
            }

            if (!AuctionSystem.Running)
            {
                sender.Mobile.SendMessage(AuctionSystem.MessageHue, AuctionSystem.ST[15]);
                return;
            }

            AuctionComparer cmp = null;

            switch (info.ButtonID)
            {
            case 1:                     // Name

                cmp = new AuctionComparer(AuctionSorting.Name, true);
                break;

            case 2:

                cmp = new AuctionComparer(AuctionSorting.Name, false);
                break;

            case 3:

                cmp = new AuctionComparer(AuctionSorting.Date, true);
                break;

            case 4:

                cmp = new AuctionComparer(AuctionSorting.Date, false);
                break;

            case 5:

                cmp = new AuctionComparer(AuctionSorting.TimeLeft, true);
                break;

            case 6:

                cmp = new AuctionComparer(AuctionSorting.TimeLeft, false);
                break;

            case 7:

                cmp = new AuctionComparer(AuctionSorting.Bids, true);
                break;

            case 8:

                cmp = new AuctionComparer(AuctionSorting.Bids, false);
                break;

            case 9:

                cmp = new AuctionComparer(AuctionSorting.MinimumBid, true);
                break;

            case 10:

                cmp = new AuctionComparer(AuctionSorting.MinimumBid, false);
                break;

            case 11:

                cmp = new AuctionComparer(AuctionSorting.HighestBid, true);
                break;

            case 12:

                cmp = new AuctionComparer(AuctionSorting.HighestBid, false);
                break;
            }

            if (cmp != null)
            {
                m_List.Sort(cmp);
            }

            sender.Mobile.SendGump(new AuctionListing(
                                       sender.Mobile,
                                       m_List,
                                       m_Search,
                                       m_ReturnToAuction));
        }
Exemplo n.º 4
0
		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			if ( ! AuctionSystem.Running )
			{
				sender.Mobile.SendMessage( AuctionConfig.MessageHue, AuctionSystem.ST[ 15 ]  );
				return;
			}

			AuctionComparer cmp = null;

			switch( info.ButtonID )
			{
				case 1: // Name

					cmp = new AuctionComparer( AuctionSorting.Name, true );
					break;

				case 2:

					cmp = new AuctionComparer( AuctionSorting.Name, false );
					break;

				case 3:

					cmp = new AuctionComparer( AuctionSorting.Date, true );
					break;

				case 4:

					cmp = new AuctionComparer( AuctionSorting.Date, false );
					break;

				case 5:

					cmp = new AuctionComparer( AuctionSorting.TimeLeft, true );
					break;

				case 6:

					cmp = new AuctionComparer( AuctionSorting.TimeLeft, false );
					break;

				case 7:

					cmp = new AuctionComparer( AuctionSorting.Bids, true );
					break;

				case 8:

					cmp = new AuctionComparer( AuctionSorting.Bids, false );
					break;

				case 9:

					cmp = new AuctionComparer( AuctionSorting.MinimumBid, true );
					break;

				case 10:

					cmp = new AuctionComparer( AuctionSorting.MinimumBid, false );
					break;

				case 11:

					cmp = new AuctionComparer( AuctionSorting.HighestBid, true );
					break;

				case 12:

					cmp = new AuctionComparer( AuctionSorting.HighestBid, false );
					break;
			}

			if ( cmp != null )
			{
				m_List.Sort( cmp );
			}

			sender.Mobile.SendGump( new AuctionListing( sender.Mobile, m_List, m_Search, m_ReturnToAuction ) );
		}
		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			if ( ! AuctionSystem.Running )
			{
				sender.Mobile.SendMessage( AuctionConfig.MessageHue, AuctionSystem.ST[ 15 ] );
				return;
			}

            int buttonid = info.ButtonID;
            AuctionComparer cmp = null;

            if (buttonid < 0 || buttonid > 6)
            {
                sender.Mobile.SendMessage("Invalid option.  Please try again.");
                return;
            }

			switch ( info.ButtonID )
			{
                case 0: // Exit
                    if (m_Callback != null)
                    {
                        try { m_Callback.DynamicInvoke(new object[] { sender.Mobile }); }
                        catch { }
                    }
                    break;

				case 1: // Create auction
					AuctionSystem.AuctionRequest( sender.Mobile );
					break;

                case 2: // View all auctions

                    cmp = new AuctionComparer(AuctionSorting.Date, false);//Sort by date newest first
                    if (cmp != null)
                    {
                        m_List.Sort(cmp);
                    }

                    sender.Mobile.SendGump(new AuctionListing(sender.Mobile, m_List, true, false));
                   // sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.Auctions, true, false));
					break;

				case 3: // View your auctions

                    sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetAuctions(sender.Mobile), true, false));
                    break;


				case 4: // View your bids

                    sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetBids(sender.Mobile), true, false));
                    break;

				case 5: // View pendencies

                    sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetPendencies(sender.Mobile), true, false));
                    break;
                case 6: // View all auctions sorted by ending first

                    cmp = new AuctionComparer(AuctionSorting.TimeLeft, true);//Sort by ending first
                    if (cmp != null)
                    {
                        m_List.Sort(cmp);
                    }

                    sender.Mobile.SendGump(new AuctionListing(sender.Mobile, m_List, true, false));
                    break;

			}
		}
Exemplo n.º 6
0
		public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
		{
			if ( ! m_Buttons.Contains( info.ButtonID ) )
			{
				Console.WriteLine( @"The auction system located a potential exploit. 
					Player {0} (Acc. {1}) tried to press an unregistered button in a gump of type: {2}",
					sender.Mobile != null ? sender.Mobile.ToString() : "Unkown",
					sender.Mobile != null && sender.Mobile.Account != null ? ( sender.Mobile.Account as Server.Accounting.Account ).Username : "******",
					this.GetType().Name );

				return;
			}

			if ( ! AuctionSystem.Running )
			{
				sender.Mobile.SendMessage( AuctionSystem.MessageHue, AuctionSystem.ST[ 15 ]  );
				return;
			}

			AuctionComparer cmp = null;

			switch( info.ButtonID )
			{
				case 1: // Name

					cmp = new AuctionComparer( AuctionSorting.Name, true );
					break;

				case 2:

					cmp = new AuctionComparer( AuctionSorting.Name, false );
					break;

				case 3:

					cmp = new AuctionComparer( AuctionSorting.Date, true );
					break;

				case 4:

					cmp = new AuctionComparer( AuctionSorting.Date, false );
					break;

				case 5:

					cmp = new AuctionComparer( AuctionSorting.TimeLeft, true );
					break;

				case 6:

					cmp = new AuctionComparer( AuctionSorting.TimeLeft, false );
					break;

				case 7:

					cmp = new AuctionComparer( AuctionSorting.Bids, true );
					break;

				case 8:

					cmp = new AuctionComparer( AuctionSorting.Bids, false );
					break;

				case 9:

					cmp = new AuctionComparer( AuctionSorting.MinimumBid, true );
					break;

				case 10:

					cmp = new AuctionComparer( AuctionSorting.MinimumBid, false );
					break;

				case 11:

					cmp = new AuctionComparer( AuctionSorting.HighestBid, true );
					break;

				case 12:

					cmp = new AuctionComparer( AuctionSorting.HighestBid, false );
					break;
			}

			if ( cmp != null )
			{
				m_List.Sort( cmp );
			}

			sender.Mobile.SendGump( new AuctionListing(
				sender.Mobile,
				m_List,
				m_Search,
				m_ReturnToAuction ) );
		}