]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_user/core_user.cpp
Improve the descriptions of various core modules.
[user/henk/code/inspircd.git] / src / coremods / core_user / core_user.cpp
index a2ffc009ebd9283b670a706329242800d53c7be3..8f90c4ec5c8669b6646112c105bfc9e1271b39d5 100644 (file)
@@ -40,7 +40,7 @@ class CommandPass : public SplitCommand
         * @param user The user issuing the command
         * @return A value from CmdResult to indicate command success or failure.
         */
-       CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser *user)
+       CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
        {
                // Check to make sure they haven't registered -- Fix by FCS
                if (user->registered == REG_ALL)
@@ -57,13 +57,13 @@ class CommandPass : public SplitCommand
 
 /** Handle /PING.
  */
-class CommandPing : public Command
+class CommandPing : public SplitCommand
 {
  public:
        /** Constructor for ping.
         */
        CommandPing(Module* parent)
-               : Command(parent, "PING", 1, 2)
+               : SplitCommand(parent, "PING", 1, 2)
        {
                syntax = "<servername> [:<servername>]";
        }
@@ -73,9 +73,10 @@ class CommandPing : public Command
         * @param user The user issuing the command
         * @return A value from CmdResult to indicate command success or failure.
         */
-       CmdResult Handle(const std::vector<std::string>& parameters, User* user)
+       CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
        {
-               user->WriteServ("PONG %s :%s", ServerInstance->Config->ServerName.c_str(), parameters[0].c_str());
+               ClientProtocol::Messages::Pong pong(parameters[0]);
+               user->Send(ServerInstance->GetRFCEvents().pong, pong);
                return CMD_SUCCESS;
        }
 };
@@ -99,7 +100,7 @@ class CommandPong : public Command
         * @param user The user issuing the command
         * @return A value from CmdResult to indicate command success or failure.
         */
-       CmdResult Handle(const std::vector<std::string>& parameters, User* user)
+       CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
        {
                // set the user as alive so they survive to next ping
                LocalUser* localuser = IS_LOCAL(user);
@@ -139,7 +140,6 @@ void MessageWrapper::ReadConfig(const char* prefixname, const char* suffixname,
 class CoreModUser : public Module
 {
        CommandAway cmdaway;
-       CommandMode cmdmode;
        CommandNick cmdnick;
        CommandPart cmdpart;
        CommandPass cmdpass;
@@ -147,11 +147,27 @@ class CoreModUser : public Module
        CommandPong cmdpong;
        CommandQuit cmdquit;
        CommandUser cmduser;
+       CommandIson cmdison;
+       CommandUserhost cmduserhost;
+       SimpleUserModeHandler invisiblemode;
+       ModeUserOperator operatormode;
+       ModeUserServerNoticeMask snomaskmode;
 
  public:
        CoreModUser()
-               : cmdaway(this), cmdmode(this), cmdnick(this), cmdpart(this), cmdpass(this), cmdping(this)
-               , cmdpong(this), cmdquit(this), cmduser(this)
+               : cmdaway(this)
+               , cmdnick(this)
+               , cmdpart(this)
+               , cmdpass(this)
+               , cmdping(this)
+               , cmdpong(this)
+               , cmdquit(this)
+               , cmduser(this)
+               , cmdison(this)
+               , cmduserhost(this)
+               , invisiblemode(this, "invisible", 'i')
+               , operatormode(this)
+               , snomaskmode(this)
        {
        }
 
@@ -163,7 +179,7 @@ class CoreModUser : public Module
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides the AWAY, MODE, NICK, PART, PASS, PING, PONG, QUIT and USER commands", VF_VENDOR|VF_CORE);
+               return Version("Provides the AWAY, ISON, NICK, PART, PASS, PING, PONG, QUIT, USERHOST, and USER commands", VF_VENDOR|VF_CORE);
        }
 };