예제 #1
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;
            }

            switch (info.ButtonID)
            {
            case 0:                     // Exit

                break;

            case 1:                     // Create auction

                AuctionSystem.AuctionRequest(sender.Mobile);

                break;

            case 2:                     // View all auctions

                sender.Mobile.SendGump(new AuctionListing(
                                           sender.Mobile,
                                           AuctionSystem.Auctions,
                                           true,
                                           true));

                break;

            case 3:                     // View your auctions

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

            case 4:                     // View your bids

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

            case 5:                     // View pendencies

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

            switch (info.ButtonID)
            {
            case 0:

                if (m_Callback != null)
                {
                    try { m_Callback.DynamicInvoke(new object[] { sender.Mobile }); }
                    catch {}
                }
                break;

            case 1:                     // View your auctions

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

            case 2:                     // View your bids

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

            case 3:                     // View your pendencies

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetPendencies(sender.Mobile), false, false));
                break;
            }
        }
예제 #3
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (!AuctionSystem.Running)
            {
                sender.Mobile.SendMessage(AuctionConfig.MessageHue, AuctionSystem.ST[15]);
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // Exit
                break;

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

            case 2:                     // View all auctions
                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.Auctions, true, true));
                break;

            case 3:                     // View your auctions

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

            case 4:                     // View your bids

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

            case 5:                     // View pendencies

                sender.Mobile.SendGump(new AuctionListing(sender.Mobile, AuctionSystem.GetPendencies(sender.Mobile), true, true));
                break;
            }
        }
예제 #4
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;
            }
        }