public void jail() { JailSystem.Jail((m_prisoner as Mobile), TimeSpan.FromDays(2), "Interefering with a Role-Playing event.", true, (m_jailor as Mobile).Name, AccessLevel.Seer); ((Mobile)m_prisoner).CantWalk = false; ((Mobile)m_prisoner).Squelched = false; (m_prisoner as Mobile).SendMessage("You are now in jail for disrupting an event. Do not expect to see the staff member who jailed you until after the event has ended."); }
protected override void OnTarget(Mobile from, object targeted) { if (from is PlayerMobile && targeted is PlayerMobile) { Mobile m = (Mobile)targeted; JailSystem.macroTest(from, m); } }
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); }
public macroerEntry(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 |= CMEFlags.Disabled; } }
public unJailEntry(Mobile gm, Mobile player) : base(5135, 200) { m_gm = gm; m_player = player; js = JailSystem.fromMobile(m_player); if (js == null) { Flags |= CMEFlags.Disabled; } else if (!js.jailed) { Flags |= CMEFlags.Disabled; } }
public override void OnClick() { if (js == null) { JailSystem.macroTest(m_gm, m_player); } else if (!js.jailed) { JailSystem.macroTest(m_gm, m_player); } else { m_gm.SendMessage("They are already in jail."); } }
protected override void OnTarget(Mobile from, object targeted) { if (from is PlayerMobile && targeted is PlayerMobile) { string temp = "jail"; Mobile m = (Mobile)targeted; if (from.AccessLevel < m.AccessLevel) { from.SendMessage("{0} has a higher access level than you and you can not do that.", m.Name); if (m_releasing) { temp = "release"; } CommandLogging.WriteLine(from, from.Name + " tried to " + temp + " " + m.Name); m.SendMessage(from.Name + " tried to " + temp + " you"); } else //jailor has a higher (or equal) access level than the target if (m_releasing) { JailSystem js = JailSystem.fromAccount((Account)m.Account); if (js == null) { from.SendMessage(m.Name + " no jail object"); return; } js.forceRelease(from); m.SendLocalizedMessage(501659); } else { //temp="jailed"; JailSystem.newJailingFromGMandPlayer(from, m); } } else { from.SendLocalizedMessage(503312); } }
public void caughtInTheAct(bool confessed) { if (caughtFired) { return; } caughtFired = true; if (!confessed) { JailSystem.Jail(badBoy, 1, 0, 0, JailGump.reasons[0], true, jailor.Name); jailor.SendMessage("{0} has been jailed for {1} from the warning you issued.", badBoy.Name, JailGump.reasons[0]); } else { JailSystem.Jail(badBoy, 0, 5, 0, JailGump.reasons[0], true, jailor.Name); jailor.SendMessage("{0} was been jailed for {1} when they confessed on the warning you issued.", badBoy.Name, JailGump.reasons[0]); } if (myTimer != null) { myTimer.Stop(); } }
public static JailSystem lockup( Mobile m ) { try { JailSystem js = fromMobile( m ); if( js == null ) js = new JailSystem( m ); js.lockupMobile( m ); return js; } catch { Console.WriteLine( "{0}: Lockup call failed on-{1}", JSName, m.Name ); return null; } }
public override void OnClick() { JailSystem.newJailingFromGMandPlayer(m_gm, m_player); //this is where we jail them }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case 20: //previous button m_id--; if (m_id < 0) { m_id = m_warn.Count - 1; } from.SendGump(new JailWarnGump(from, badBoy, info.GetTextEntry(0).Text, m_id, m_warn)); break; case 21: //next button m_id++; if (m_id >= m_warn.Count) { m_id = 0; } from.SendGump(new JailWarnGump(from, badBoy, info.GetTextEntry(0).Text, m_id, m_warn)); break; //reason buttons case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: from.SendGump(new JailWarnGump(from, badBoy, JailGump.reasons[info.ButtonID - 3], m_id, m_warn)); break; case 1: //warn them from.CloseGump(typeof(JailWarnGump)); if (m_reason == JailGump.reasons[0]) { //they are macroing JailSystem.macroTest(from, badBoy); } else { //not Unattended macroing badBoy.SendGump(new JailWarningGump(from, badBoy, m_reason)); } break; case 2: //jail them from.CloseGump(typeof(JailWarnGump)); from.SendGump(new JailGump(JailSystem.lockup(badBoy), from, badBoy, 0, "", m_reason, "0", "0", "1", "0", "0", true)); break; default: break; } }
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) { 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"); } }
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); }
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); }
public JailBanGump(JailSystem js) : base(10, 30) { buildit(js); }
public static void onLoad() { 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; if( ( 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.ReadEncodedInt(); 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( binReader ); if( binReader.Position != ( tPos + tLength ) ) throw new Exception( String.Format( "***** Bad serialize on {0} *****", tID ) ); } catch { } } else { } loadingameeditsettings( binReader ); } finally { if( idxFileStream != null ) idxFileStream.Close(); if( binFileStream != null ) binFileStream.Close(); } } else { defaultSettings(); Console.WriteLine( "{0}: No prior Jailsystem save, using default settings", JSName ); } Console.WriteLine( "{0} Jailings Loaded:{1}", JailCount, list.Count ); }
public JailingTimer( JailSystem js ) : base( js.ReleaseDate.Subtract( DateTime.Now ) ) { Prisoner = js; }
public static void newJailingFromGMandPlayer( Mobile from, Mobile m ) { JailSystem js = 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, "", "" ) ) ); }
public static void Jail( Mobile badBoy, DateTime dt, string reason, bool releasetoJailing, string jailedBy, AccessLevel l, bool useBoot ) { JailSystem js = 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 ); }
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); 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); } }