public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case 0:                     // Exit
                break;

            case 1:                     // Owner Props
                m_User.SendGump(this);
                m_User.SendGump(new PropertiesGump(m_User, m_Auction.Owner));
                break;

            case 2:                     // Owner Account
                m_User.SendGump(this);
                m_User.SendGump(new AdminGump(m_User, AdminGumpPage.AccountDetails_Information, 0, null, "Request from the auction system", m_Auction.Account));
                break;

            case 3:                     // Owner Client
                m_User.SendGump(this);

                if (m_Auction.Owner.NetState != null)
                {
                    m_User.SendGump(new ClientGump(m_User, m_Auction.Owner.NetState));
                }
                break;

            case 4:                     // Item Props
                m_User.SendGump(this);
                m_User.SendGump(new PropertiesGump(m_User, m_Auction.Item));
                break;

            case 5:                     // Get Item
                m_User.SendGump(this);

                if (m_Auction.Creature && m_Auction.Pet != null)
                {
                    m_User.SendMessage("That cannot be used on pets");
                }
                else
                {
                    m_User.Backpack.AddItem(m_Auction.Item);
                }
                AuctionLog.WriteViewItem(m_Auction, m_User);
                break;

            case 6:                     // Return Item
                if (m_Auction.Creature)
                {
                    m_Auction.Pet.SetControlMaster(null);
                    m_Auction.Pet.ControlOrder = Server.Mobiles.OrderType.Stay;
                    m_Auction.Pet.Internalize();
                }
                else
                {
                    Item item = m_Auction.Item;

                    if (item != null)
                    {
                        if (item.Parent is Mobile)
                        {
                            ((Mobile)item.Parent).RemoveItem(item);
                        }
                        else if (item.Parent is Item)
                        {
                            ((Item)item.Parent).RemoveItem(item);
                        }
                    }

                    AuctionSystem.ControlStone.AddItem(m_Auction.Item);
                    m_Auction.Item.Parent = AuctionSystem.ControlStone;
                }
                AuctionLog.WriteReturnItem(m_Auction, m_User);
                m_User.SendGump(this);
                break;

            case 7:                     // Auction Props
                m_User.SendGump(this);
                m_User.SendGump(new PropertiesGump(m_User, m_Auction));
                break;

            case 8:                     // End Auction
                m_Auction.End(m_User);
                goto case 0;

            case 9:                     // End and Return
                m_Auction.StaffDelete(m_User, ItemFate.ReturnToOwner);
                goto case 0;

            case 10:                     // End and Get
                m_Auction.StaffDelete(m_User, ItemFate.ReturnToStaff);
                goto case 0;

            case 11:                     // End and Delete
                m_Auction.StaffDelete(m_User, ItemFate.Delete);
                goto case 0;
            }
        }
示例#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;
            }

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

            case 1:                     // Owner Props

                m_User.SendGump(this);
                m_User.SendGump(new PropertiesGump(m_User, m_Auction.Owner));
                break;

            case 2:                     // Owner Account

                m_User.SendGump(this);
                m_User.SendGump(new AdminGump(m_User, AdminGumpPage.AccountDetails_Information, 0, null, "Request from the auction system", m_Auction.Account));
                break;

            case 3:                     // Owner Client

                m_User.SendGump(this);

                if (m_Auction.Owner.NetState != null)
                {
                    m_User.SendGump(new ClientGump(m_User, m_Auction.Owner.NetState));
                }
                break;

            case 4:                     // Item Props

                m_User.SendGump(this);
                m_User.SendGump(new PropertiesGump(m_User, m_Auction.Item));
                break;

            case 5:                     // Get Item

                m_User.SendGump(this);

                if (m_Auction.Creature && m_Auction.Pet != null)
                {
                    m_Auction.Pet.MoveToWorld(m_User.Location, m_User.Map);
                }
                else
                {
                    m_User.Backpack.AddItem(m_Auction.Item);
                }

                AuctionLog.WriteViewItem(m_Auction, m_User);

                break;

            case 6:                     // Return Item

                if (m_Auction.Creature)
                {
                    m_Auction.Pet.SetControlMaster(null);
                    m_Auction.Pet.ControlOrder = Server.Mobiles.OrderType.Stay;
                    m_Auction.Pet.Internalize();
                }
                else
                {
                    Item item = m_Auction.Item;

                    if (item != null)
                    {
                        if (item.Parent is Mobile)
                        {
                            ((Mobile)item.Parent).RemoveItem(item);
                        }
                        else if (item.Parent is Item)
                        {
                            ((Item)item.Parent).RemoveItem(item);
                        }
                    }

                    AuctionSystem.ControlStone.Items.Add(m_Auction.Item);
                    m_Auction.Item.Parent = AuctionSystem.ControlStone;
                }

                AuctionLog.WriteReturnItem(m_Auction, m_User);

                m_User.SendGump(this);

                break;

            case 7:                     // Auction Props

                m_User.SendGump(this);
                m_User.SendGump(new PropertiesGump(m_User, m_Auction));
                break;

            case 8:                     // End Auction

                m_Auction.End(m_User);
                goto case 0;

            case 9:                     // End and Return

                m_Auction.StaffDelete(m_User, ItemFate.ReturnToOwner);
                goto case 0;

            case 10:                     // End and Get

                m_Auction.StaffDelete(m_User, ItemFate.ReturnToStaff);
                goto case 0;

            case 11:                     // End and Delete

                m_Auction.StaffDelete(m_User, ItemFate.Delete);
                goto case 0;
            }
        }