Beispiel #1
0
 public UnJailEntry(Mobile gm, Mobile player)
     : base(5135, 200)
 {
     m_gm = gm;
     m_player = player;
     js = JailSystem.fromMobile(m_player);
     if (js == null)
         Flags |= Network.CMEFlags.Disabled;
     else if (!js.jailed)
         Flags |= Network.CMEFlags.Disabled;
 }
Beispiel #2
0
 public MacroEntry(Mobile gm, Mobile player)
     : base(394, 200)
 {
     m_gm = gm;
     m_player = player;
     js = JailSystem.fromMobile(m_player);
     if (js == null)
     { }
     else if (js.jailed)
         Flags |= Network.CMEFlags.Disabled;
 }
Beispiel #3
0
        private void buildReviews()
        {
            if (JailSystem.list.Count < m_id) m_id = 0;
            if (m_id < 0) m_id = JailSystem.list.Count - 1;
            if (JailSystem.list.Count == 0) m_id = -1;
            int i = 0;
            if (m_id >= 0)
                foreach (JailSystem tj in JailSystem.list.Values)
                {
                    if ((i == 0) || (i == m_id))
                        js = tj;
                    i++;
                }
            if (m_id == -1)
            {
                AddLabel(BodyX + gutterOffset, BodyY + gutterOffset, 200, "No accounts are currently jailed.");
                return;
            }
            AddLabel(TitleX + gutterOffset, TitleY + gutterOffset, 200, "Reviewing: " + js.Name);
            AddLabel(TitleX + gutterOffset, TitleY + gutterOffset + LineStep, 200, string.Format("Jailed Account {0} of {1}", m_id + 1, JailSystem.list.Count));
            //previous button
            AddButton(TitleX + gutterOffset, TitleY + gutterOffset + LineStep + LineStep + 5, 2466, 2467, 44, GumpButtonType.Reply, 0);
            //next Button
            AddButton(TitleX + gutterOffset + 80, TitleY + gutterOffset + LineStep + LineStep + 5, 2469, 2470, 45, GumpButtonType.Reply, 0);
            string temp = "";
            if (js.Prisoner == null)
                js.killJail();
            else
            {
                foreach (AccountComment note in js.Prisoner.Comments)
                {
                    if ((note.AddedBy == JailSystem.JSName + "-warning") || (note.AddedBy == JailSystem.JSName + "-jailed") || (note.AddedBy == JailSystem.JSName + "-note"))
                    {
                        temp = temp + note.AddedBy + "\n\r" + note.Content + "\n\r***********\n\r";
                    }
                }
                AddLabel(BodyX + 17, BodyY + 8, 200, "History");
                AddHtml(BodyX + 13, 141, 300, 82, temp, true, true);
                //release
                AddButton(BodyX + 13, BodyY + 120, 2472, 2473, 41, GumpButtonType.Reply, 0);
                AddLabel(BodyX + 43, BodyY + 123, 200, "Release");
                AddButton(BodyX + 13, BodyY + 150, 2472, 2473, 50, GumpButtonType.Reply, 0);
                AddLabel(BodyX + 43, BodyY + 153, 200, "Ban");
                //add day
                AddButton(BodyX + 101, BodyY + 120, 250, 251, 43, GumpButtonType.Reply, 0);
                AddButton(BodyX + 116, BodyY + 120, 252, 253, 47, GumpButtonType.Reply, 0);
                AddLabel(135 + BodyX, BodyY + 123, 200, "Week");
                //add week
                AddButton(BodyX + 176, BodyY + 120, 250, 251, 42, GumpButtonType.Reply, 0);
                AddButton(BodyX + 191, BodyY + 120, 252, 253, 46, GumpButtonType.Reply, 0);
                AddLabel(BodyX + 210, BodyY + 123, 200, "Day");
                //hours
                AddButton(BodyX + 251, BodyY + 120, 250, 251, 48, GumpButtonType.Reply, 0);
                AddButton(BodyX + 266, BodyY + 120, 252, 253, 49, GumpButtonType.Reply, 0);
                AddLabel(BodyX + 284, BodyY + 123, 200, "Hour");

                AddLabel(BodyX + 13, BodyY + 170, 200, "Release at: " + js.ReleaseDate.ToString());
                if (!js.jailed)
                {
                    message("This account has been released but currently has characters in jail.");
                }
                else
                {
                    message("This account is currently jailed.");
                }
                AddHtml(BodyX + 13, BodyY + 189, 300, 74, js.reason, true, true);
            }
        }
Beispiel #4
0
        public static void onLoad()
        {
            //System.Console.WriteLine("Loading Jailings");
            FileStream idxFileStream;
            FileStream binFileStream;
            //BinaryReader idxReader;
            BinaryFileReader idxReader;
            BinaryFileReader binReader;
            //GenericReader idxReader;
            long tPos;
            int tID;
            int tLength;
            JailSystem tJail;
            int JailCount = 0;
            int temp = 0;

            // Scriptiz : false pour annuler le if et pour qu'on charge toujours les paramètres par défaut !
            if (false && (File.Exists(idxPath)) && (File.Exists(binPath)))
            {
                idxFileStream = new FileStream(idxPath, (FileMode)3, (FileAccess)1, (FileShare)1);
                binFileStream = new FileStream(binPath, (FileMode)3, (FileAccess)1, (FileShare)1);
                try
                {
                    idxReader = new BinaryFileReader(new BinaryReader(idxFileStream));
                    binReader = new BinaryFileReader(new BinaryReader(binFileStream));
                    JailCount = idxReader.ReadInt();

                    if (JailCount > 0)
                    {
                        for (int i = 0; i < JailCount; i++)
                        {
                            temp = idxReader.ReadInt();//catch the version number which we wont use
                            tID = idxReader.ReadInt();
                            tPos = idxReader.ReadLong();
                            tLength = idxReader.ReadInt();
                            tJail = new JailSystem(tID);
                            binReader.Seek(tPos, 0);
                            try
                            {
                                tJail.Deserialize((GenericReader)binReader);
                                if (binReader.Position != ((long)tPos + tLength))
                                    throw new Exception(String.Format("***** Bad serialize on {0} *****", tID));
                            }
                            catch
                            { }
                        }
                    }
                    loadingameeditsettings((GenericReader)binReader);

                }
                finally
                {
                    if (idxFileStream != null)
                        idxFileStream.Close();
                    if (binFileStream != null)
                        binFileStream.Close();
                }
            }
            else
            {
                JailSystem.defaultSettings();
                //System.Console.WriteLine("{0}: No prior Jailsystem save, using default settings", JailSystem.JSName);
            }
            //System.Console.WriteLine("{0} Jailings Loaded:{1}", JailCount, list.Count);
        }
Beispiel #5
0
        public JailBanGump(JailSystem js)
            : base(10, 30)
        {

            buildit(js);
        }
Beispiel #6
0
 public void buildit(JailSystem js)
 {
     m_js = js;
     AddBackground(0, 0, 300, 300, 5054);
     AddBlackAlpha(5, 5, 290, 290);
     AddColorLabel(8, 8, 288, 288, Color("Are you sure you wish to ban this account?", SelectedColor32));
     AddButton(120, 200, 241, 243, 10, GumpButtonType.Reply, 0);
     AddButton(50, 200, 239, 240, 6, GumpButtonType.Reply, 0);
 }
Beispiel #7
0
        public void buildIt(JailSystem tjs, Mobile owner, Mobile prisoner, int page, string error, string reason, string month, string week, string day, string hour, string minute, bool fullreturn)
        {
            js = tjs;
            m_return = fullreturn;
            m_page = page;
            if ((reason != "") && (reason != null))
                m_reason = reason;
            else
                m_reason = reasons[1];
            jailor = owner;
            badBoy = prisoner;
            m_reason = reason;
            jailor.CloseGump(typeof(JailGump));
            Closable = false;
            Dragable = false;
            AddPage(0);
            AddBackground(0, 0, 326, 295, 5054);
            AddImageTiled(9, 6, 308, 140, 2624);
            AddAlphaRegion(9, 6, 308, 140);
            AddLabel(16, 98, 200, "Reason");
            AddBackground(14, 114, 290, 24, 0x2486);
            AddTextEntry(18, 116, 282, 20, 200, 0, m_reason);
            AddButton(14, 11, 1209, 1210, 3, GumpButtonType.Reply, 0);
            AddLabel(30, 7, 200, reasons[0]);
            AddButton(14, 29, 1209, 1210, 4, GumpButtonType.Reply, 0);
            AddLabel(30, 25, 200, reasons[1]);
            AddButton(14, 47, 1209, 1210, 5, GumpButtonType.Reply, 0);
            AddLabel(30, 43, 200, reasons[2]);
            AddButton(150, 11, 1209, 1210, 6, GumpButtonType.Reply, 0);
            AddLabel(170, 7, 200, reasons[3]);
            AddButton(150, 29, 1209, 1210, 7, GumpButtonType.Reply, 0);
            AddLabel(170, 24, 200, reasons[4]);
            AddButton(150, 47, 1209, 1210, 8, GumpButtonType.Reply, 0);
            AddLabel(170, 43, 200, reasons[5]);
            AddButton(14, 66, 1209, 1210, 9, GumpButtonType.Reply, 0);
            AddLabel(30, 62, 200, reasons[6]);
            AddButton(14, 84, 1209, 1210, 10, GumpButtonType.Reply, 0);
            AddLabel(30, 80, 200, reasons[7]);
            //ok button
            AddButton(258, 268, 2128, 2130, 1, GumpButtonType.Reply, 0);
            AddImageTiled(8, 153, 308, 113, 2624);
            AddAlphaRegion(8, 153, 308, 113);
            if (m_return == true)
                AddButton(15, 210, 2153, 2151, 2, GumpButtonType.Reply, 0);
            else
                AddButton(15, 210, 2151, 2153, 2, GumpButtonType.Reply, 0);
            AddLabel(50, 212, 200, "Return to where jailed from on release");
            if ((error != "") && (error != null))
            {
                AddLabel(10, 235, 200, error);
            }
            if (m_page == 0)
            {
                //auto
                //auto/manual
                AddButton(11, 268, 2111, 2114, 25, GumpButtonType.Reply, 0);
                AddLabel(16, 160, 200, "Months");
                AddBackground(19, 178, 34, 24, 0x2486);
                AddTextEntry(21, 180, 30, 20, 0, 7, month);
                AddLabel(62, 160, 200, "Weeks");
                AddBackground(63, 178, 34, 24, 0x2486);
                AddTextEntry(65, 180, 30, 20, 0, 6, week);
                AddLabel(106, 160, 200, "Days");
                AddBackground(104, 178, 34, 24, 0x2486);
                AddTextEntry(107, 180, 30, 20, 0, 5, day);
                AddLabel(145, 160, 200, "Hours");
                AddBackground(145, 178, 34, 24, 0x2486);
                AddTextEntry(147, 180, 30, 20, 0, 9, hour);
                AddLabel(185, 160, 200, "Minutes");
                AddBackground(191, 178, 34, 24, 0x2486);
                AddTextEntry(194, 180, 30, 20, 0, 8, minute);
            }
            else
            {
                AddButton(11, 268, 2114, 2111, 27, GumpButtonType.Reply, 0);
                AddLabel(14, 160, 200, "Account will be Jailed for one year");
                AddLabel(14, 178, 200, "or until released, which comes first");

            }
        }
Beispiel #8
0
 public static void Jail(Mobile badBoy, DateTime dt, string reason, bool releasetoJailing, string jailedBy, AccessLevel l, bool useBoot)
 {
     JailSystem js = JailSystem.fromMobile(badBoy);
     if (js == null)
     {
         js = new JailSystem(badBoy, l);
     }
     else
     {
         if (js.jailed)
         {
             js.lockupMobile(badBoy, useBoot);
             return;
         }
     }
     js.fillJailReport(badBoy, dt, reason, releasetoJailing, jailedBy);
     js.lockupMobile(badBoy, useBoot);
 }
Beispiel #9
0
 public JailGump(JailSystem tjs, Mobile owner, Mobile prisoner, int page, string error, string reason, string month, string week, string day, string hour, string minute, bool fullreturn)
     : base(100, 40)
 {
     buildIt(tjs, owner, prisoner, page, error, reason, month, week, day, hour, minute, fullreturn);
 }
Beispiel #10
0
 public JailGump(JailSystem tjs, Mobile owner, Mobile prisoner, int page, string error, string reason)
     : base(100, 40)
 {
     buildIt(tjs, owner, prisoner, page, error, reason, "0", "0", "1", "0", "0", true);
 }
Beispiel #11
0
        public static JailSystem lockup(Mobile m)
        {
            try
            {
                JailSystem js = JailSystem.fromMobile(m);
                if (js == null)
                    js = new JailSystem(m);

                js.lockupMobile(m);
                return js;
            }
            catch
            {
                System.Console.WriteLine("{0}: Lockup call failed on-{1}", JailSystem.JSName, m.Name);
                return null;
            }
        }
Beispiel #12
0
 public jailing(JailSystem js)
     : base(js.ReleaseDate.Subtract(System.DateTime.Now))
 {
     Prisoner = js;
 }
Beispiel #13
0
        public static void newJailingFromGMandPlayer(Mobile from, Mobile m)
        {
            JailSystem js = JailSystem.fromMobile(m);
            if (js == null)
            {
                js = new JailSystem();
            }
            else
            {
                if (js.jailed)
                {
                    from.SendMessage("{0} is already jailed", m.Name);
                    js.lockupMobile(m);
                    return;
                }
            }
            js.resetReleaseDateOneDay();
            js.lockupMobile(m);
            js.jailor = from.Name;

            if (m.Equals(from))
                m.SendLocalizedMessage(503315);
            else
                m.SendLocalizedMessage(503316);

            from.SendGump((new JailGump(js, from, m, 0, "", "")));
        }