- size_t start = buffer.find_first_not_of(" ");
- if (start == std::string::npos)
- {
- // Discourage the user from flooding the server.
- user->CommandFloodPenalty += 2000;
- return;
- }
-
- ServerInstance->Logs->Log("USERINPUT", LOG_RAWIO, "C[%s] I %s", user->uuid.c_str(), buffer.c_str());
-
- irc::tokenstream tokens(buffer, start);
- std::string command;
- CommandBase::Params parameters;
-
- // Get the command name. This will always exist because of the check
- // at the start of the function.
- tokens.GetMiddle(command);
-
- // If this exists then the client sent a prefix as part of their
- // message. Section 2.3 of RFC 1459 technically says we should only
- // allow the nick of the client here but in practise everyone just
- // ignores it so we will copy them.
- if (command[0] == ':' && !tokens.GetMiddle(command))
- {
- // Discourage the user from flooding the server.
- user->CommandFloodPenalty += 2000;
+ ClientProtocol::ParseOutput parseoutput;
+ if (!user->serializer->Parse(user, buffer, parseoutput))