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

            AuctionItem auction = Auction;

            if (auction == null)
            {
                sender.Mobile.SendMessage(AuctionConfig.MessageHue, AuctionSystem.ST[31]);
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // View auction details

                if (m_InformationMode && !m_VerifyAuction)
                {
                    // This is an outbid message, no need to return after visiting the auction
                    sender.Mobile.SendGump(new AuctionViewGump(sender.Mobile, Auction));
                }
                else
                {
                    sender.Mobile.SendGump(new AuctionViewGump(sender.Mobile, Auction, new AuctionGumpCallback(ResendMessage)));
                }
                break;

            case 1:                     // OK

                if (m_InformationMode)
                {
                    if (m_VerifyAuction)
                    {
                        auction.ConfirmInformationMessage(m_OwnerTarget);
                    }
                }
                else
                {
                    auction.ConfirmResponseMessage(m_OwnerTarget, true);
                }
                break;

            case 2:                     // Cancel

                auction.ConfirmResponseMessage(m_OwnerTarget, false);
                break;
            }
        }
示例#2
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;
            }

            AuctionItem auction = Auction;

            if (auction == null)
            {
                sender.Mobile.SendMessage(AuctionSystem.MessageHue, AuctionSystem.ST[31]);
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // View auction details

                if (m_InformationMode && !m_VerifyAuction)
                {
                    // This is an outbid message, no need to return after visiting the auction
                    sender.Mobile.SendGump(new AuctionViewGump(sender.Mobile, Auction));
                }
                else
                {
                    sender.Mobile.SendGump(new AuctionViewGump(sender.Mobile, Auction, new AuctionGumpCallback(ResendMessage)));
                }
                break;

            case 1:                     // OK

                if (m_InformationMode)
                {
                    if (m_VerifyAuction)
                    {
                        auction.ConfirmInformationMessage(m_OwnerTarget);
                    }
                }
                else
                {
                    auction.ConfirmResponseMessage(m_OwnerTarget, true);
                }
                break;

            case 2:                     // Cancel

                auction.ConfirmResponseMessage(m_OwnerTarget, false);
                break;
            }
        }