diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-06 17:58:59 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-06 17:58:59 +0000 |
commit | 71ad308979d9c9129507fdf85d4305fd12e18bea (patch) | |
tree | 6aaebc6d1fb6e4c49a2adf474bf4592e2d89a5e8 /src/modules/m_park.cpp | |
parent | 4cf0ae1308fe98757de42ffbe391e61844ac9e0a (diff) |
All commands now return results CMD_FAILURE or CMD_SUCCESS
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5150 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_park.cpp')
-rw-r--r-- | src/modules/m_park.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index c1c8a055b..de8eeb25e 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -61,12 +61,12 @@ parkedinfo pi; class cmd_park : public command_t { public: - cmd_park (InspIRCd* Instance) : command_t(Instance,"PARK", 0, 0) + cmd_park (InspIRCd* Instance) : command_t(Instance,"PARK", 0, 0) { this->source = "m_park.so"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { /** Parking. easy stuff. * @@ -82,6 +82,7 @@ class cmd_park : public command_t if (othersessions >= ConcurrentParks) { user->WriteServ("927 "+std::string(user->nick)+" :You are already parked up to the maximum number of allowed times."); + return CMD_FAILURE; } else { @@ -98,6 +99,7 @@ class cmd_park : public command_t pi.host = user->host; pi.parktime = time(NULL); pinfo.push_back(pi); + return CMD_SUCCESS; } } @@ -106,29 +108,30 @@ class cmd_park : public command_t class cmd_parkstats : public command_t { public: - cmd_parkstats (InspIRCd* Instance) : command_t(Instance,"PARKSTATS", 'o', 0) + cmd_parkstats (InspIRCd* Instance) : command_t(Instance,"PARKSTATS", 'o', 0) { this->source = "m_park.so"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { char status[MAXBUF]; snprintf(status,MAXBUF,"NOTICE %s :There are a total of %lu parked clients on this server, with a maximum of %lu parked sessions allowed per user.",user->nick,(unsigned long)pinfo.size(),(unsigned long)ConcurrentParks); user->WriteServ(std::string(status)); + return CMD_SUCCESS; } }; class cmd_unpark : public command_t { public: - cmd_unpark (InspIRCd* Instance) : command_t(Instance,"UNPARK", 0, 2) + cmd_unpark (InspIRCd* Instance) : command_t(Instance,"UNPARK", 0, 2) { this->source = "m_park.so"; syntax = "<nick> <key>"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { /** Unparking. complicated stuff. * @@ -150,7 +153,7 @@ class cmd_unpark : public command_t if (!unpark) { user->WriteServ("942 %s %s :Invalid user specified.",user->nick, parameters[0]); - return; + return CMD_FAILURE; } awaylog* awy; unpark->GetExt("park_awaylog", awy); @@ -159,7 +162,7 @@ class cmd_unpark : public command_t if (!awy) { user->WriteServ("943 %s %s :This user is not parked.",user->nick, unpark->nick); - return; + return CMD_FAILURE; } if (*key == atoi(parameters[1])) { @@ -205,7 +208,10 @@ class cmd_unpark : public command_t else { user->WriteServ("928 "+std::string(user->nick)+" :Incorrect park key."); + return CMD_FAILURE; } + + return CMD_SUCCESS; } }; |