+ allow_empty_last_param = false;
+ flags_needed = 'o';
+ syntax = "<nick> <newhost>";
+ TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
+ }
+
+ CmdResult Handle(const std::vector<std::string> ¶meters, User *user)
+ {
+ const char* x = parameters[1].c_str();
+
+ if (parameters[1].length() > 63)
+ {
+ user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick.c_str());
+ return CMD_FAILURE;
+ }
+
+ for (; *x; x++)
+ {
+ if (!hostmap[(unsigned char)*x])
+ {
+ user->WriteServ("NOTICE "+user->nick+" :*** CHGHOST: Invalid characters in hostname");
+ return CMD_FAILURE;
+ }
+ }
+
+ User* dest = ServerInstance->FindNick(parameters[0]);
+
+ if ((!dest) || (dest->registered != REG_ALL))
+ {
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
+ return CMD_FAILURE;
+ }
+
+ if (IS_LOCAL(dest))