[Bobbot-cvs] Plugins/Sphere SpherePlugin.cs,1.4,1.5
Status: Alpha
Brought to you by:
iainmckay
From: Mr S. C. <mrs...@us...> - 2004-12-24 20:27:41
|
Update of /cvsroot/bobbot/Plugins/Sphere In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12404/Sphere Modified Files: SpherePlugin.cs Log Message: - Added 'Jail Edit <Account> <Length> [<Reason>]' as a private command. Edits an account entry by adding the <Length> (Can be a negative value) and amending the Reason set. - Added bool JailSystem.JailEdit(string[] args) - Added bool JailSystem.JailEdit(string account, string gm, string length, string reason) - Added bool JailSystem.EditEntry(string account, string gm, string length, string reason) Index: SpherePlugin.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/SpherePlugin.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SpherePlugin.cs 24 Dec 2004 01:25:56 -0000 1.4 --- SpherePlugin.cs 24 Dec 2004 20:27:32 -0000 1.5 *************** *** 466,469 **** --- 466,470 ---- Kernel.Instance.Network.SendClientNotice(user, "Jail Add Jails an account."); Kernel.Instance.Network.SendClientNotice(user, "Jail Del Releases an account from jail."); + Kernel.Instance.Network.SendClientNotice(user, "Jail Edit Edits an account entry."); Kernel.Instance.Network.SendClientNotice(user, "Jail Info Displays jail entry information"); Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); *************** *** 481,484 **** --- 482,492 ---- return; } + + if (m_JailSystem.IsJailed(args[1])) + { + Kernel.Instance.Network.SendClientNotice(user, "Account '{0}' is already jailed!", args[1]); + return; + } + string jailargs = ""; for (int i = 3; i < args.Length; i++) *************** *** 489,492 **** --- 497,501 ---- else Kernel.Instance.Network.SendClientNotice(user, "Unable to jail '{0}'", args[1]); + return; } *************** *** 510,513 **** --- 519,549 ---- else Kernel.Instance.Network.SendClientNotice(user, "Unable to release '{0}'", args[1]); + + return; + } + + case "edit": + { + if (args.Length < 3) + { + Kernel.Instance.Network.SendClientNotice(user, "Incorrect Arguments: 'Jail Edit <Account> <Length> [<Reason>]'"); + return; + } + + if (!m_JailSystem.IsJailed(args[1])) + { + Kernel.Instance.Network.SendClientNotice(user, "Account '{0}' wasn't jailed!", args[1]); + return; + } + + string jailargs = ""; + for (int i = 3; i < args.Length; i++) + jailargs += " " + args[i]; + + if (m_JailSystem.EditJail(args[1], user.Nickname, args[2], jailargs.Trim())) + Kernel.Instance.Network.SendClientNotice(user, "'{0}'s jail entry is edited!", args[1]); + else + Kernel.Instance.Network.SendClientNotice(user, "Unable to edit jail entry '{0}'!", args[1]); + return; } *************** *** 548,551 **** --- 584,588 ---- else Kernel.Instance.Network.SendClientNotice(user, "Account '{0}' Not Jailed!", args[1]); + return; } *************** *** 557,560 **** --- 594,598 ---- else Kernel.Instance.Network.SendClientNotice(user, "Database Failed to Save!"); + return; } *************** *** 593,596 **** --- 631,648 ---- } + case "edit": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Edit <Account> <Length> [<Reason>]", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Edits the entry for <Account> in the database, exchanging the"); + Kernel.Instance.Network.SendClientNotice(user, "entry's length to <Length> hours."); + Kernel.Instance.Network.SendClientNotice(user, "If [<Reason>] is provided then this will also be amended."); + Kernel.Instance.Network.SendClientNotice(user, "The 'Jailed By' property of the jail entry will be amended to "); + Kernel.Instance.Network.SendClientNotice(user, "indicate that the entry has been amended by another staff"); + Kernel.Instance.Network.SendClientNotice(user, "member if that is the case."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Edit myAccount 24", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, " /msg {0} Jail Edit myAccount 24 Jailed for bug abuse.", Kernel.Instance.Network.Nickname); + return; + } + case "save": { *************** *** 628,633 **** } - - return; } --- 680,683 ---- *************** *** 640,643 **** --- 690,694 ---- Kernel.Instance.Network.SendClientNotice(user, "Jail Add Jails an account."); Kernel.Instance.Network.SendClientNotice(user, "Jail Del Releases an account from jail."); + Kernel.Instance.Network.SendClientNotice(user, "Jail Edit Edits an account entry."); Kernel.Instance.Network.SendClientNotice(user, "Jail Info Displays jail entry information"); Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); |