1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 20:33:12 +02:00

The rest of the earlier command changes

This commit is contained in:
Adam
2010-11-27 00:04:13 -06:00
parent 2b10cc84ea
commit 71c433cc50
158 changed files with 1575 additions and 1615 deletions
+9 -9
View File
@@ -29,9 +29,9 @@ enum CommandReturn
};
extern CoreExport Command *FindCommand(BotInfo *bi, const Anope::string &cmd);
extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const Anope::string &cmd);
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &message, bool fantasy);
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message, bool fantasy);
extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, ChannelInfo *ci, const Anope::string &cmd);
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &message, ChannelInfo *ci);
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message, ChannelInfo *ci);
enum CommandFlag
{
@@ -101,22 +101,22 @@ class CoreExport Command : public Flags<CommandFlag>
virtual CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params) = 0;
/** Called when HELP is requsted for the client this command is on.
* @param u The user requesting help
* @param source The source
*/
virtual void OnServHelp(User *u);
virtual void OnServHelp(CommandSource &source);
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
* @param u The user requesting help
* @param source The source
* @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL")
* @return true if help was provided to the user, false otherwise.
*/
virtual bool OnHelp(User *u, const Anope::string &subcommand);
virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand);
/** Requested when the user provides bad syntax to this command (not enough params, etc).
* @param u The user executing the command.
* @param source The source
* @param subcommand The subcommand the user tried to use
*/
virtual void OnSyntaxError(User *u, const Anope::string &subcommand);
virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
/** Set which command permission (e.g. chanserv/forbid) is required for this command.
* @param reststr The permission required to successfully execute this command
+3 -3
View File
@@ -146,7 +146,7 @@ E const Anope::string GetString(NickCore *nc, LanguageString string);
E const Anope::string GetString(User *u, LanguageString string);
E const Anope::string GetString(const char *domain, Anope::string language, const Anope::string &string);
E const char *const language_strings[LANG_STRING_COUNT];
E void SyntaxError(BotInfo *bi, User *u, const Anope::string &command, LanguageString message);
E void SyntaxError(CommandSource &source, const Anope::string &command, LanguageString message);
/*** logger.cpp ***/
E void InitLogChannels(ServerConfig *);
@@ -189,10 +189,10 @@ class CoreExport UplinkSocket : public ConnectionSocket
/**** memoserv.c ****/
E void ms_init();
E void rsend_notify(User *u, Memo *m, const Anope::string &chan);
E void rsend_notify(CommandSource &source, Memo *m, const Anope::string &chan);
E void check_memos(User *u);
E MemoInfo *getmemoinfo(const Anope::string &name, bool &ischan, bool &isforbid);
E void memo_send(User *u, const Anope::string &name, const Anope::string &text, int z);
E void memo_send(CommandSource &source, const Anope::string &name, const Anope::string &text, int z);
/**** messages.c ****/
+6 -8
View File
@@ -284,11 +284,10 @@ class CoreExport Module : public Extensible
Version GetVersion() const;
/** Send a message to a user in their language, if a translation is available
* @param from Client to send the message from
* @param to User to send the message to
* @param source The source of the message
* @param fmt The message
*/
void SendMessage(BotInfo *from, User *to, const char *fmt, ...);
void SendMessage(CommandSource &source, const char *fmt, ...);
/**
* Add a module provided command to the given service.
@@ -365,19 +364,18 @@ class CoreExport Module : public Extensible
* @param bi The bot the command is being run from
* @param command The command
* @param message The parameters used for the command
* @param fantasy true if this is a fantasy command
* @param ci If a tanasy command, the channel the comman was used on
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
virtual EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, bool fantasy) { return EVENT_CONTINUE; }
virtual EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, ChannelInfo *ci) { return EVENT_CONTINUE; }
/** Called before a command is due to be executed.
* @param u The user executing the command
* @param service The service the command is associated with
* @param source The source of the command
* @param command The command the user is executing
* @param params The parameters the user is sending
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
virtual EventReturn OnPreCommand(User *u, BotInfo *service, const Anope::string &command, const std::vector<Anope::string> &params) { return EVENT_CONTINUE; }
virtual EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params) { return EVENT_CONTINUE; }
/** Called after a command has been executed.
* @param source The source of the command