]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Move my name from regular contributors to developers
[user/henk/code/inspircd.git] / src / command_parse.cpp
index 8d5bcbee41d59a8cdaf7dc861141d4e07d1de55d..d16f38a858b2434e004eaf4910ac57285627bca7 100644 (file)
  */
 
 #include "inspircd.h"
-#include "xline.h"
-#include "socketengine.h"
-#include "socket.h"
-#include "command_parse.h"
-#include "exitcodes.h"
-
-/* Directory Searching for Unix-Only */
-#ifndef WIN32
-#include <dirent.h>
-#include <dlfcn.h>
-#endif
 
 int InspIRCd::PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype)
 {
@@ -179,7 +168,7 @@ CmdResult CommandParser::CallHandler(const std::string &commandname, const std::
        return CMD_INVALID;
 }
 
-bool CommandParser::ProcessCommand(User *user, std::string &cmd)
+bool CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
 {
        std::vector<std::string> command_p;
        irc::tokenstream tokens(cmd);
@@ -204,10 +193,10 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
 
        /* Modify the user's penalty regardless of whether or not the command exists */
        bool do_more = true;
-       if (IS_LOCAL(user) && !user->HasPrivPermission("users/flood/no-throttle"))
+       if (!user->HasPrivPermission("users/flood/no-throttle"))
        {
                // If it *doesn't* exist, give it a slightly heftier penalty than normal to deter flooding us crap
-               IS_LOCAL(user)->CommandFloodPenalty += cm != cmdlist.end() ? cm->second->Penalty * 1000 : 2000;
+               user->CommandFloodPenalty += cm != cmdlist.end() ? cm->second->Penalty * 1000 : 2000;
        }
 
 
@@ -282,9 +271,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
                return true;
 
        /* activity resets the ping pending timer */
-       LocalUser* luser = IS_LOCAL(user);
-       if (luser)
-               luser->nping = ServerInstance->Time() + luser->MyClass->GetPingTime();
+       user->nping = ServerInstance->Time() + user->MyClass->GetPingTime();
 
        if (cm->second->flags_needed)
        {
@@ -362,12 +349,12 @@ Command::~Command()
        ServerInstance->Parser->RemoveCommand(this);
 }
 
-bool CommandParser::ProcessBuffer(std::string &buffer,User *user)
+bool CommandParser::ProcessBuffer(std::string &buffer,LocalUser *user)
 {
        if (!user || buffer.empty())
                return true;
 
-       ServerInstance->Logs->Log("USERINPUT", DEBUG, "C[%s] I :%s %s",
+       ServerInstance->Logs->Log("USERINPUT", RAWIO, "C[%s] I :%s %s",
                user->uuid.c_str(), user->nick.c_str(), buffer.c_str());
        return ProcessCommand(user,buffer);
 }