public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            string reason = null;

            switch (info.ButtonID)
            {
            case 0:                     // Cancel the jailing
            {
                if (m_Offender != null)
                {
                    JailSystem.CancelJail(m_Offender, sender.Mobile);
                }
                else if (m_Account != null)
                {
                    sender.Mobile.SendMessage("You have canceled the jailing of the account {0}.", m_Account.Username);
                }

                return;
            }

            case 1:                     // Predefined reasons
            case 2:
            case 3:
            case 4:
            case 5:
            {
                reason = m_Reasons[info.ButtonID - 1];
                break;
            }

            case 6:                     // Other, check for text
            {
                TextRelay text = info.GetTextEntry(0);
                if (text != null && !String.IsNullOrEmpty(text.Text))
                {
                    reason = text.Text;
                }
                break;
            }
            }

            if (String.IsNullOrEmpty(reason))
            {
                sender.Mobile.SendMessage("Please specify a valid reason for the jailing.");

                if (m_Offender != null)
                {
                    sender.Mobile.SendGump(new JailReasonGump(m_Offender));
                }
                else
                {
                    sender.Mobile.SendGump(new JailReasonGump(m_Account));
                }
            }
            else
            {
                sender.Mobile.SendGump(new JailingGump(m_Offender, m_Account, reason));
            }
        }
Beispiel #2
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            // Calculate days and hours first
            TimeSpan duration = TimeSpan.Zero;

            TextRelay text = info.GetTextEntry(0);

            if (text != null && !String.IsNullOrEmpty(text.Text))
            {
                m_Days    = Utility.ToInt32(text.Text);
                duration += TimeSpan.FromDays(m_Days);
            }

            text = info.GetTextEntry(1);
            if (text != null && !String.IsNullOrEmpty(text.Text))
            {
                m_Hours   = Utility.ToInt32(text.Text);
                duration += TimeSpan.FromHours(m_Hours);
            }

            text = info.GetTextEntry(2);
            if (text != null && !String.IsNullOrEmpty(text.Text))
            {
                m_Comment = text.Text;
            }

            m_AutoRelease = info.IsSwitched(0);
            m_FullJail    = info.IsSwitched(1);

            m_FullJail = m_Offender == null;

            switch (info.ButtonID)
            {
            case 0:                     // Cancel jailing
            {
                JailSystem.CancelJail(m_Offender, sender.Mobile);
                sender.Mobile.SendMessage("You have canceled the jailing of {0} and brought them to your location", m_Offender.Name);
                return;
            }

            case 1:                     // Commit jailing
            {
                if (duration <= TimeSpan.Zero)
                {
                    sender.Mobile.SendMessage("Invalid duration, please specify at least one hour.");
                    sender.Mobile.SendGump(new JailingGump(m_Offender, m_Account, m_Reason, m_AutoRelease, m_Days, m_Hours, m_FullJail, m_Comment));
                }
                else
                {
                    JailSystem.CommitJailing(m_Offender, m_Account, sender.Mobile, m_Reason, m_AutoRelease, duration, m_FullJail, m_Comment);
                }
                break;
            }
            }
        }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case 1:                      // No: make a new jail entry\
                JailSystem.InitJail(m_User, m_Offender, true);
                break;

            case 2:                     // Yes: set current jail entry to full account
                m_ExistingJail.FullJail = true;
                m_ExistingJail.AddComment(m_User, "Turning on full jail to jail {0}", m_Offender.Name);
                m_User.SendGump(new JailViewGump(m_User, m_ExistingJail, null));
                break;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Releases the offender from jail. When using FullJail it will release any character
        /// logged on the account.
        /// </summary>
        public void Release()
        {
            if (!m_FullJail)
            {
                // Only a mobile has been jailed
                if (m_Mobile != null)                   // Might have been deleted
                {
                    JailSystem.SetFree(m_Mobile);
                }
            }
            else
            {
                // All mobiles might have been jailed. Release the one that's online
                Mobile m = JailSystem.GetOnlineMobile(m_Account);

                if (m != null)
                {
                    JailSystem.SetFree(m);
                }
            }
        }
Beispiel #5
0
        private void MakeGump()
        {
            int  arraycnt = 0;
            bool usemobs  = false;

            if (m_Accounts.Count > 0)
            {
                arraycnt = m_Accounts.Count;
            }
            else if (m_Mobiles.Count > 0)
            {
                arraycnt = m_Mobiles.Count;
                usemobs  = true;
            }

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);
            this.AddBackground(0, 0, 485, 315, 9250);

            // Title
            this.AddAlphaRegion(20, 15, 445, 20);
            this.AddLabel(25, 15, LabelHue, string.Format("Jail System Search: Displaying {0} results.", arraycnt));

            // Table header
            this.AddImageTiled(20, 40, 120, 20, 9304);
            this.AddAlphaRegion(20, 40, 120, 20);
            this.AddLabel(25, 40, LabelHue, @"Account");

            this.AddImageTiled(145, 40, 120, 20, 9304);
            this.AddAlphaRegion(145, 40, 120, 20);
            this.AddLabel(150, 40, LabelHue, @"Player");

            this.AddImageTiled(270, 40, 90, 20, 9304);
            this.AddAlphaRegion(270, 40, 90, 20);
            this.AddLabel(275, 40, LabelHue, @"Status");

            this.AddImageTiled(365, 40, 35, 20, 9304);
            this.AddAlphaRegion(365, 40, 35, 20);
            this.AddLabel(370, 40, LabelHue, @"Jail");

            this.AddImageTiled(405, 40, 60, 20, 9304);
            this.AddAlphaRegion(405, 40, 60, 20);
            this.AddLabel(410, 40, LabelHue, "History");

            // Table background
            this.AddImageTiled(20, 65, 120, 210, 9274);
            this.AddAlphaRegion(20, 65, 120, 210);

            this.AddAlphaRegion(145, 65, 120, 210);

            this.AddImageTiled(270, 65, 90, 210, 9274);
            this.AddAlphaRegion(270, 65, 90, 210);

            this.AddAlphaRegion(365, 65, 35, 210);

            this.AddImageTiled(405, 65, 60, 210, 9274);
            this.AddAlphaRegion(405, 65, 60, 210);

            // Load data
            for (int i = m_Page * 10; i < m_Page * 10 + 10 && i < arraycnt; i++)
            {
                Account acc = null;
                Mobile  m   = null;

                if (usemobs)
                {
                    m = m_Mobiles[i];
                }
                else
                {
                    acc = m_Accounts[i];
                }

                if (acc != null)
                {
                    m = JailSystem.GetOnlineMobile(acc);
                }
                else if (m != null)
                {
                    acc = m.Account as Account;
                }

                int index = i - (m_Page * 10);

                // Account label and button
                if (acc != null)
                {
                    this.AddLabelCropped(35, 70 + index * 20, 100, 20, LabelHue, acc.Username);

                    if (m_User.AccessLevel >= AccessLevel.Administrator)
                    {
                        // View account details button : buttons from 10 to 19
                        this.AddButton(15, 75 + index * 20, 2224, 2224, 10 + index, GumpButtonType.Reply, 0);
                    }
                }

                // Player label and button
                if (m != null)
                {
                    this.AddLabelCropped(160, 70 + index * 20, 100, 20, LabelHue, m.Name);

                    // View props button: buttons from 20 to 29
                    if (m_User.AccessLevel >= AccessLevel.Lead)                       //Only >= Seer get props button
                    {
                        this.AddButton(140, 75 + index * 20, 2224, 2224, 20 + index, GumpButtonType.Reply, 0);
                    }
                }

                // Status
                if (m != null && m.NetState != null)
                {
                    // A mobile is online
                    this.AddLabel(285, 70 + index * 20, GreenHue, @"Online");

                    // View Client button: buttons from 30 to 39
                    if (m_User.AccessLevel >= AccessLevel.Lead)
                    {
                        this.AddButton(265, 75 + index * 20, 2224, 2224, 30 + index, GumpButtonType.Reply, 0);
                    }
                }
                else
                {
                    // Offline
                    this.AddLabel(285, 70 + index * 20, RedHue, @"Offline");
                }

                // Jail button: buttons from 40 to 49
                if ((m != null && m.AccessLevel == AccessLevel.Player) || (acc != null && !acc.Banned))
                {
                    this.AddButton(375, 73 + index * 20, 5601, 5605, 40 + index, GumpButtonType.Reply, 0);
                }

                // History button: buttons from 50 to 59
                if (acc != null && m_User.AccessLevel >= JailSystem.m_HistoryLevel)
                {
                    this.AddButton(428, 73 + index * 20, 5601, 5605, 50 + index, GumpButtonType.Reply, 0);
                }
            }

            this.AddAlphaRegion(20, 280, 445, 20);

            if (m_Page * 10 + 10 < arraycnt)
            {
                this.AddButton(270, 280, 4005, 4006, 2, GumpButtonType.Reply, 0);
                this.AddLabel(305, 280, LabelHue, @"Next");                 // Next: B2
            }

            if (m_Page > 0)
            {
                this.AddButton(235, 280, 4014, 4015, 1, GumpButtonType.Reply, 0);
                this.AddLabel(175, 280, LabelHue, @"Previous");                 // Prev: B1
            }

            this.AddButton(20, 280, 4017, 4018, 0, GumpButtonType.Reply, 0);
            this.AddLabel(55, 280, LabelHue, @"Close");             // Close: B0
        }
Beispiel #6
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case 1:                      // Previous page
            {
                m_User.SendGump(new JailSearchGump(m_Mobiles, m_Accounts, m_User, m_Page - 1, m_Callback));
                break;
            }

            case 2:                     // Next page
            {
                m_User.SendGump(new JailSearchGump(m_Mobiles, m_Accounts, m_User, m_Page + 1, m_Callback));
                break;
            }

            case 0:                     // Close
            {
                if (m_Callback != null)
                {
                    try
                    {
                        m_Callback.DynamicInvoke(new object[] { m_User });
                    }
                    catch {}
                }
                break;
            }

            default:
            {
                int type  = info.ButtonID / 10;
                int index = info.ButtonID % 10;

                bool usemobs = m_Mobiles.Count > 0;

                Mobile  m   = null;
                Account acc = null;

                if (usemobs)
                {
                    m = m_Mobiles[m_Page * 10 + index];
                }
                else
                {
                    acc = m_Accounts[m_Page * 10 + index];
                }

                if (acc != null)
                {
                    m = JailSystem.GetOnlineMobile(acc);
                }
                else if (m != null)
                {
                    acc = m.Account as Account;
                }

                switch (type)
                {
                case 1:                                 // View Account details
                {
                    m_User.SendGump(new JailSearchGump(m_Mobiles, m_Accounts, m_User, m_Page, m_Callback));

                    if (acc != null)
                    {
                        m_User.SendGump(new AdminGump(m_User, AdminGumpPage.AccountDetails_Information, 0, null, "Returned from the jail system", acc));
                    }

                    break;
                }

                case 2:                                 // View Mobile props
                {
                    m_User.SendGump(new JailSearchGump(m_Mobiles, m_Accounts, m_User, m_Page, m_Callback));

                    if (m_User.AccessLevel >= AccessLevel.Lead && m != null)
                    {
                        m_User.SendGump(new PropertiesGump(m_User, m));
                    }
                    break;
                }

                case 3:                                 // View Client gump
                {
                    m_User.SendGump(new JailSearchGump(m_Mobiles, m_Accounts, m_User, m_Page, m_Callback));

                    if (m_User.AccessLevel >= AccessLevel.Lead && m != null && m.NetState != null)
                    {
                        m_User.SendGump(new ClientGump(m_User, m.NetState));
                    }
                    else
                    {
                        m_User.SendMessage("That mobile is no longer online or you do not have sufficient access.");
                    }
                    break;
                }

                case 4:                                 // Jail button
                {
                    if (acc != null)
                    {
                        JailSystem.InitJail(m_User, acc);
                    }
                    else if (m != null)
                    {
                        JailSystem.InitJail(m_User, m);
                    }

                    break;
                }

                case 5:                                 // History button
                {
                    if (acc != null)
                    {
                        List <JailEntry> history = JailSystem.SearchHistory(acc);

                        if (history.Count > 0)
                        {
                            m_User.SendGump(new JailListingGump(m_User, history, new JailGumpCallback(JailSearchCallback)));
                        }
                        else
                        {
                            m_User.SendMessage("No jail entries have been found for that account");
                            m_User.SendGump(new JailSearchGump(m_Mobiles, m_Accounts, m_User, m_Page, m_Callback));
                        }
                    }
                    break;
                }
                }
                break;
            }
            }
        }
Beispiel #7
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            // Get information first
            m_Banned  = false;
            m_Deleted = false;
            m_Old     = false;

            foreach (int flag in info.Switches)
            {
                switch (flag)
                {
                case 0:                         // Banned
                    m_Banned = true;
                    break;

                case 1:                         // Deleted
                    m_Deleted = true;
                    break;

                case 2:                         // Old
                    m_Old = true;
                    break;
                }
            }

            TextRelay text = info.GetTextEntry(1);

            if (text != null && !String.IsNullOrEmpty(text.Text))
            {
                int months = Utility.ToInt32(info.GetTextEntry(1).Text);
                if (months > 0 && months <= 12)
                {
                    m_Months = months;
                }
            }

            switch (info.ButtonID)
            {
            case 1:                     // View History
            {
                List <JailEntry> history = JailSystem.GetFullHistory();

                if (history.Count > 0)
                {
                    sender.Mobile.SendGump(new JailListingGump(sender.Mobile, JailSystem.GetFullHistory(), new JailGumpCallback(JailAdminGumpCallback)));
                }
                else
                {
                    sender.Mobile.SendMessage("The history is empty");
                    sender.Mobile.SendGump(new JailAdminGump(sender.Mobile, m_Banned, m_Deleted, m_Old, m_Months));
                }
                break;
            }

            case 2:                     // Search for players
            case 3:                     // Search for accounts
            {
                text = info.GetTextEntry(0);
                if (text != null && !String.IsNullOrEmpty(text.Text))
                {
                    List <Mobile>  mobmatches = new List <Mobile>();
                    List <Account> accmatches = new List <Account>();

                    if (info.ButtonID == 2)
                    {
                        mobmatches = JailSystem.SearchForPlayers(text.Text);
                    }
                    else
                    {
                        accmatches = JailSystem.SearchForAccounts(text.Text);
                    }

                    if (mobmatches.Count > 0 || accmatches.Count > 0)
                    {
                        sender.Mobile.SendGump(new JailSearchGump(mobmatches, accmatches, sender.Mobile, new JailGumpCallback(JailAdminGumpCallback)));
                    }
                    else
                    {
                        sender.Mobile.SendMessage("No matches found");
                        sender.Mobile.SendGump(new JailAdminGump(sender.Mobile, m_Banned, m_Deleted, m_Old, m_Months));
                    }
                }
                else
                {
                    sender.Mobile.SendMessage("Invalid search");
                    sender.Mobile.SendGump(new JailAdminGump(sender.Mobile, m_Banned, m_Deleted, m_Old, m_Months));
                }
                break;
            }

            case 4:                     // Purge
            {
                if (!(m_Deleted || m_Banned || m_Old))
                {
                    sender.Mobile.SendMessage("Invalid purge options. Please correct and try again.");
                    sender.Mobile.SendGump(new JailAdminGump(sender.Mobile, m_Banned, m_Deleted, m_Old, m_Months));
                }
                else
                {
                    JailPurge purge = new JailPurge(m_Banned, m_Deleted, m_Old, m_Months);
                    JailSystem.PurgeHistory(sender.Mobile, purge);
                    sender.Mobile.SendGump(new JailAdminGump(sender.Mobile));
                }
                break;
            }

            case 5:                     // View Jail
            {
                sender.Mobile.SendGump(new JailListingGump(sender.Mobile, JailSystem.Jailings, new JailGumpCallback(JailAdminGumpCallback)));
                break;
            }
            }
        }
Beispiel #8
0
        private void MakeGump()
        {
            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;

            bool active = JailSystem.IsActive(m_Jail);

            this.AddPage(0);

            this.AddBackground(0, 0, 600, 400, 9250);
            this.AddAlphaRegion(15, 15, 570, 370);

            // Title
            this.AddLabel(20, 20, RedHue, @"Jail Record Review");

            // Status
            this.AddLabel(290, 20, LabelHue, @"Status:");
            int    statusHue = GreenHue;
            string status    = "Active";

            if (m_Jail.Account == null)
            {
                statusHue = RedHue;
                status    = "Account Deleted";
            }
            else if (m_Jail.Account.Banned)
            {
                statusHue = RedHue;
                status    = "Account Banned";
            }
            else if (m_Jail.Expired)
            {
                statusHue = GreenHue;
                status    = "Expired";
            }

            this.AddLabel(350, 20, statusHue, status);

            // History Record
            this.AddImageTiled(19, 39, 562, 52, 3604);
            this.AddAlphaRegion(20, 40, 560, 50);
            this.AddHtml(20, 40, 560, 50, string.Format("<basefont color=#CCCCCC>{0}", m_Jail.HistoryRecord), false, false);

            // Player
            this.AddLabel(40, 90, LabelHue, @"Player:");

            if (m_Jail.Mobile != null)
            {
                // Player Props: Button 1
                if (m_User.AccessLevel >= JailSystem.m_JailLevel)
                {
                    if (m_User.AccessLevel >= AccessLevel.Lead)
                    {
                        this.AddButton(19, 93, 5601, 5605, 1, GumpButtonType.Reply, 0);
                    }
                    this.AddLabel(90, 90, GreenHue, m_Jail.Mobile.Name);
                }
            }
            else
            {
                this.AddLabel(90, 90, RedHue, "Not Available");
            }

            // Account
            this.AddLabel(310, 90, LabelHue, @"Account:");

            if (m_Jail.Account != null)
            {
                // Account Information: Button 2
                if (m_User.AccessLevel >= AccessLevel.Administrator)
                {
                    this.AddButton(290, 93, 5601, 5605, 2, GumpButtonType.Reply, 0);
                }

                this.AddLabel(370, 90, GreenHue, m_Jail.Account.Username);
            }
            else
            {
                this.AddLabel(370, 90, RedHue, "Deleted");
            }

            if (active)
            {
                // Jail Duration
                this.AddLabel(20, 120, LabelHue, "Jail Duration:");

                // Days: Text 0
                this.AddLabel(160, 120, LabelHue, @"Days");
                this.AddImageTiled(114, 119, 42, 22, 5154);
                this.AddAlphaRegion(115, 120, 40, 20);
                this.AddTextEntry(125, 120, 20, 20, LabelHue, 0, m_Jail.Duration.Days.ToString());

                // Hours: Text 1
                this.AddLabel(240, 120, LabelHue, @"Hours");
                this.AddImageTiled(194, 119, 42, 22, 5154);
                this.AddAlphaRegion(195, 120, 40, 20);
                this.AddTextEntry(205, 120, 20, 20, LabelHue, 1, m_Jail.Duration.Hours.ToString());

                // Update Jail Duration: Button 7
                if (m_User.AccessLevel >= JailSystem.m_JailLevel)
                {
                    this.AddButton(290, 120, 4005, 4006, 7, GumpButtonType.Reply, 0);
                    this.AddLabel(330, 120, LabelHue, @"Update jail duration");
                }

                // Auto Release
                this.AddLabel(20, 150, LabelHue, @"Auto Release:");
                this.AddLabel(160, 150, m_Jail.AutoRelease ? GreenHue : RedHue, m_Jail.AutoRelease ? "Enabled" : "Disabled");

                // Toggle Auto Release: Button 3
                if (m_User.AccessLevel >= JailSystem.m_JailLevel)
                {
                    this.AddButton(290, 150, 4005, 4006, 3, GumpButtonType.Reply, 0);
                    this.AddLabel(330, 150, LabelHue, string.Format("Turn {0} auto release", m_Jail.AutoRelease ? "off" : "on"));
                }

                // Full Account Jail
                this.AddLabel(20, 180, LabelHue, @"Full Account Jail:");
                this.AddLabel(160, 180, m_Jail.FullJail ? GreenHue : RedHue, m_Jail.FullJail ? "Enabled" : "Disabled");

                // Full Account Jail toggle: Button 4
                if (m_Jail.Mobile != null || (!m_Jail.FullJail))
                {
                    if (m_User.AccessLevel >= JailSystem.m_JailLevel)
                    {
                        this.AddLabel(330, 180, LabelHue, string.Format("Turn {0} full account jail", m_Jail.FullJail ? "off" : "on"));
                        this.AddButton(290, 180, 4005, 4006, 4, GumpButtonType.Reply, 0);
                    }
                }

                // New comment: Text 2
                this.AddLabel(290, 210, LabelHue, @"New comment");
                this.AddImageTiled(289, 229, 292, 102, 5154);
                this.AddAlphaRegion(290, 230, 290, 100);
                this.AddTextEntry(290, 230, 290, 100, LabelHue, 2, @"");

                // Add comment: Button 5
                this.AddLabel(330, 335, LabelHue, @"Add comment");
                this.AddButton(290, 335, 4011, 4012, 5, GumpButtonType.Reply, 0);

                // Unjail: Button 6
                if (m_User.AccessLevel >= JailSystem.m_JailLevel)
                {
                    this.AddLabel(330, 360, LabelHue, @"Unjail");
                    this.AddButton(290, 360, 4002, 4003, 6, GumpButtonType.Reply, 0);
                }
            }
            else
            {
                this.AddLabel(20, 120, LabelHue, "This jailing has expired and cannot be modified");
            }

            // Comments
            string html = "";

            if (m_Jail.Comments.Count == 0)
            {
                html = "There are no comments";
            }
            else
            {
                foreach (string comment in m_Jail.Comments)
                {
                    html += string.Format("{0}<br>", comment);
                }
            }

            this.AddLabel(20, 210, LabelHue, @"Comments:");
            this.AddImageTiled(19, 229, 262, 152, 3604);
            this.AddAlphaRegion(20, 230, 260, 150);
            this.AddHtml(20, 230, 260, 150, html, false, true);

            if (m_User.AccessLevel >= JailSystem.m_HistoryLevel && m_Jail.Account != null)
            {
                // History: Button 8
                this.AddButton(450, 335, 4029, 4030, 8, GumpButtonType.Reply, 0);
                this.AddLabel(490, 335, LabelHue, @"History");
            }

            // Close: button 0
            this.AddButton(450, 360, 4023, 4024, 0, GumpButtonType.Reply, 0);
            this.AddLabel(490, 360, LabelHue, @"Close");
        }
Beispiel #9
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case 0:                     // Close the gump
            {
                if (m_Callback != null)
                {
                    try
                    {
                        m_Callback.DynamicInvoke(new object[] { m_User });
                    }
                    catch {}
                }
                break;
            }

            case 1:                     // Display player props
            {
                if (sender.Mobile.AccessLevel >= JailSystem.m_JailLevel)
                {
                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));

                    if (m_User.AccessLevel >= AccessLevel.Lead && m_Jail.Mobile != null)
                    {
                        m_User.SendGump(new PropertiesGump(m_User, m_Jail.Mobile));
                    }
                }
                break;
            }

            case 2:                     // Display account admin
            {
                if (sender.Mobile.AccessLevel >= AccessLevel.Administrator)
                {
                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));

                    if (m_Jail.Account != null)
                    {
                        m_User.SendGump(new AdminGump(m_User, AdminGumpPage.AccountDetails_Information, 0, null, "Jailed account information", m_Jail.Account));
                    }
                }
                break;
            }

            case 3:                     // AutoRelease toggle
            {
                if (sender.Mobile.AccessLevel >= JailSystem.m_JailLevel)
                {
                    m_Jail.AutoRelease = !m_Jail.AutoRelease;
                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));
                }
                break;
            }

            case 4:                     // FullJail toggle
            {
                if (sender.Mobile.AccessLevel >= JailSystem.m_JailLevel)
                {
                    m_Jail.FullJail = !m_Jail.FullJail;
                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));
                }
                break;
            }

            case 5:                     // Add comment
            {
                TextRelay comment = info.GetTextEntry(2);

                if (comment == null || String.IsNullOrEmpty(comment.Text))
                {
                    m_User.SendMessage("Can't add an empty comment");
                }
                else
                {
                    m_Jail.AddComment(m_User, comment.Text);
                }

                m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));
                break;
            }

            case 6:                     // Unjail
            {
                if (sender.Mobile.AccessLevel >= JailSystem.m_JailLevel)
                {
                    JailSystem.Release(m_Jail, m_User);
                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));
                }
                break;
            }

            case 7:                     // Update duration
            {
                if (sender.Mobile.AccessLevel >= JailSystem.m_JailLevel)
                {
                    TimeSpan duration = TimeSpan.Zero;

                    TextRelay text = info.GetTextEntry(0);
                    if (text != null && !String.IsNullOrEmpty(text.Text))
                    {
                        duration += TimeSpan.FromDays(Utility.ToInt32(text.Text));
                    }

                    text = info.GetTextEntry(1);
                    if (text != null && !String.IsNullOrEmpty(text.Text))
                    {
                        duration += TimeSpan.FromHours(Utility.ToInt32(text.Text));
                    }

                    if (duration == TimeSpan.Zero)
                    {
                        m_User.SendMessage("Invalid duration specified. If you wish to release the player, use the unjail button.");
                    }
                    else
                    {
                        m_Jail.Duration = duration;
                    }

                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));
                }
                break;
            }

            case 8:                     // History
            {
                if (sender.Mobile.AccessLevel >= JailSystem.m_HistoryLevel)
                {
                    m_User.SendGump(new JailViewGump(m_User, m_Jail, m_Callback));

                    List <JailEntry> history = JailSystem.SearchHistory(m_Jail.Account);

                    if (history.Count > 0)
                    {
                        m_User.SendGump(new JailListingGump(m_User, history, null));
                    }
                }
                break;
            }
            }
        }