[Bobbot-cvs] Plugins/Sphere SphereConnection.cs,1.1,1.2 SpherePlugin.cs,1.3,1.4
Status: Alpha
Brought to you by:
iainmckay
From: Mr S. C. <mrs...@us...> - 2004-12-24 01:26:21
|
Update of /cvsroot/bobbot/Plugins/Sphere In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29920/Sphere Modified Files: SphereConnection.cs SpherePlugin.cs Log Message: - Corrected a Spelling Mistake. - Added a 500ms delay between sending the login code and password when connecting the sphere to prevent losing the connection. - Added 'Jail Help <Command>' private command. Gives a more detailed description for each of the Jail Commands and provides examples. - Changed the command list (When providing unknown command for Jail) to display less detail for commands. - Put more spaces in the code. (so silly people like Jock can read it :D) Index: SpherePlugin.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/SpherePlugin.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpherePlugin.cs 23 Dec 2004 23:00:05 -0000 1.3 --- SpherePlugin.cs 24 Dec 2004 01:25:56 -0000 1.4 *************** *** 302,306 **** private void OnTimerElapsed(object sender, ElapsedEventArgs e) { ! Kernel.Instance.Network.SendChannelMessage(m_Config.OutputChannel, "Resyncing Bot"); if (m_Server.IsConnected) --- 302,306 ---- private void OnTimerElapsed(object sender, ElapsedEventArgs e) { ! //Kernel.Instance.Network.SendChannelMessage(m_Config.OutputChannel, "Resyncing Bot"); if (m_Server.IsConnected) *************** *** 461,469 **** { Kernel.Instance.Network.SendClientNotice(user, "Incorrect Usage. (Jail <command> [<arguments>])"); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Add <Account> <Length> [<Reason>]' - Jails <Account> and enters the information into the database. <Length> is in hours. <Reason> is optional."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Del <Account>' - Releases <Account> from jail and removes the database entry."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Info <Account>' - Displays jail entry information for <Account>"); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail List' - Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Save' - Forces the Jail Database to be saved."); return; } --- 461,472 ---- { Kernel.Instance.Network.SendClientNotice(user, "Incorrect Usage. (Jail <command> [<arguments>])"); ! Kernel.Instance.Network.SendClientNotice(user, "Following commands are available to you"); ! Kernel.Instance.Network.SendClientNotice(user, "Use 'Jail Help <command>' for more information"); ! Kernel.Instance.Network.SendClientNotice(user, "------------------------------------------------"); ! 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 Info Displays jail entry information"); ! Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Save Forces the Jail Database to be saved."); return; } *************** *** 557,568 **** } default: { Kernel.Instance.Network.SendClientNotice(user, "Unknown Command '{0}'", args[0]); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Add <Account> <Length> [<Reason>]' - Jails <Account> and enters the information into the database. <Length> is in hours. <Reason> is optional."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Del <Account>' - Releases <Account> from jail and removes the database entry."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Info <Account>' - Displays jail entry information for <Account>"); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail List' - Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "'Jail Save' - Forces the Jail Database to be saved."); return; } --- 560,646 ---- } + case "help": + { + if (args.Length < 2) + { + Kernel.Instance.Network.SendClientNotice(user, "Incorrect Arguments: 'Jail Help <Command>'"); + return; + } + + switch (args[1].ToLower()) + { + case "add": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Add <Account> <Length> [<Reason>]", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Adds a new jail database entry for <Account>. The account will"); + Kernel.Instance.Network.SendClientNotice(user, "automatically be jailed ingame."); + Kernel.Instance.Network.SendClientNotice(user, "The release date will be set <Length> hours after the jail"); + Kernel.Instance.Network.SendClientNotice(user, "time, and will automatically released from jail at that time."); + Kernel.Instance.Network.SendClientNotice(user, "The <Reason> argument is saved into the database for all users"); + Kernel.Instance.Network.SendClientNotice(user, "to view. This is optional and can be left out if not desired."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Add myAccount 24", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, " /msg {0} Jail Add myAccount 24 Jailed for bug abuse.", Kernel.Instance.Network.Nickname); + return; + } + + case "del": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Del <Account>", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Deletes the entry for <Account> from the database. The account"); + Kernel.Instance.Network.SendClientNotice(user, "will automatically released ingame."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Del myAccount", Kernel.Instance.Network.Nickname); + return; + } + + case "save": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Save", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Forces the Jail Database to be saved immediately. Unsaved jail"); + Kernel.Instance.Network.SendClientNotice(user, "entries will result in players not being released if the Bot"); + Kernel.Instance.Network.SendClientNotice(user, "is restarted."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Save", Kernel.Instance.Network.Nickname); + return; + } + + case "list": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail List", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Displays a list of all the currently jailed accounts, along with"); + Kernel.Instance.Network.SendClientNotice(user, "their release dates. For more information on a jail entry, use"); + Kernel.Instance.Network.SendClientNotice(user, "Jail Info"); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail List", Kernel.Instance.Network.Nickname); + return; + } + + case "info": + { + Kernel.Instance.Network.SendClientNotice(user, "/msg {0} Jail Info <Account>", Kernel.Instance.Network.Nickname); + Kernel.Instance.Network.SendClientNotice(user, "Displays information on <Account>'s jail entry."); + Kernel.Instance.Network.SendClientNotice(user, "Example: /msg {0} Jail Info myAccount", Kernel.Instance.Network.Nickname); + return; + } + + default: + { + Kernel.Instance.Network.SendClientNotice(user, "No help is available for this command."); + return; + } + + } + + return; + } + default: { Kernel.Instance.Network.SendClientNotice(user, "Unknown Command '{0}'", args[0]); ! Kernel.Instance.Network.SendClientNotice(user, "Following commands are available to you"); ! Kernel.Instance.Network.SendClientNotice(user, "Use 'Jail Help <command>' for more information"); ! Kernel.Instance.Network.SendClientNotice(user, "------------------------------------------------"); ! 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 Info Displays jail entry information"); ! Kernel.Instance.Network.SendClientNotice(user, "Jail List Displays full list of jailed accounts."); ! Kernel.Instance.Network.SendClientNotice(user, "Jail Save Forces the Jail Database to be saved."); return; } Index: SphereConnection.cs =================================================================== RCS file: /cvsroot/bobbot/Plugins/Sphere/SphereConnection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SphereConnection.cs 11 Dec 2004 14:19:24 -0000 1.1 --- SphereConnection.cs 24 Dec 2004 01:25:48 -0000 1.2 *************** *** 236,239 **** --- 236,242 ---- Write(new byte[] {1}); + + Thread.Sleep( 500 ); // Pause between login code & password to ensure connection success. + Write(Password); |