summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-20 09:37:09 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-20 09:37:09 +0000
commit33ce32eb8bfddfc1cb04668a03c9b795d33eb9c0 (patch)
tree5ce23d124919d8042645495f184b0f42f2e9171c /src/commands
parentccfcdda27482fe2ac99d0da936ef1a1374223624 (diff)
More numerics.h conversion
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10049 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/cmd_admin.cpp8
-rw-r--r--src/commands/cmd_away.cpp4
-rw-r--r--src/commands/cmd_commands.cpp4
-rw-r--r--src/commands/cmd_info.cpp64
-rw-r--r--src/commands/cmd_invite.cpp16
5 files changed, 48 insertions, 48 deletions
diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp
index 327b675ad..e4adb582b 100644
--- a/src/commands/cmd_admin.cpp
+++ b/src/commands/cmd_admin.cpp
@@ -24,10 +24,10 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance)
*/
CmdResult CommandAdmin::Handle (const std::vector<std::string>& parameters, User *user)
{
- user->WriteNumeric(256, "%s :Administrative info for %s",user->nick.c_str(),ServerInstance->Config->ServerName);
+ user->WriteNumeric(RPL_ADMINME, "%s :Administrative info for %s",user->nick.c_str(),ServerInstance->Config->ServerName);
if (*ServerInstance->Config->AdminName)
- user->WriteNumeric(257, "%s :Name - %s",user->nick.c_str(),ServerInstance->Config->AdminName);
- user->WriteNumeric(258, "%s :Nickname - %s",user->nick.c_str(),ServerInstance->Config->AdminNick);
- user->WriteNumeric(259, "%s :E-Mail - %s",user->nick.c_str(),ServerInstance->Config->AdminEmail);
+ user->WriteNumeric(RPL_ADMINLOC1, "%s :Name - %s",user->nick.c_str(),ServerInstance->Config->AdminName);
+ user->WriteNumeric(RPL_ADMINLOC2, "%s :Nickname - %s",user->nick.c_str(),ServerInstance->Config->AdminNick);
+ user->WriteNumeric(RPL_ADMINEMAIL, "%s :E-Mail - %s",user->nick.c_str(),ServerInstance->Config->AdminEmail);
return CMD_SUCCESS;
}
diff --git a/src/commands/cmd_away.cpp b/src/commands/cmd_away.cpp
index d6f9189e7..96da5cda5 100644
--- a/src/commands/cmd_away.cpp
+++ b/src/commands/cmd_away.cpp
@@ -35,7 +35,7 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User
user->awaytime = ServerInstance->Time();
user->awaymsg.assign(parameters[0], 0, ServerInstance->Config->Limits.MaxAway);
- user->WriteNumeric(306, "%s :You have been marked as being away",user->nick.c_str());
+ user->WriteNumeric(RPL_NOWAWAY, "%s :You have been marked as being away",user->nick.c_str());
}
else
{
@@ -45,7 +45,7 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User
return CMD_FAILURE;
user->awaymsg.clear();
- user->WriteNumeric(305, "%s :You are no longer marked as being away",user->nick.c_str());
+ user->WriteNumeric(RPL_UNAWAY, "%s :You are no longer marked as being away",user->nick.c_str());
}
return CMD_SUCCESS;
diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp
index 9d77de6ca..2c2bf0894 100644
--- a/src/commands/cmd_commands.cpp
+++ b/src/commands/cmd_commands.cpp
@@ -25,13 +25,13 @@ CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
{
for (Commandtable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
{
- user->WriteNumeric(702, "%s :%s %s %d %d",
+ user->WriteNumeric(RPL_COMMANDS, "%s :%s %s %d %d",
user->nick.c_str(),
i->second->command.c_str(),
i->second->source.c_str(),
i->second->min_params,
i->second->Penalty);
}
- user->WriteNumeric(704, "%s :End of COMMANDS list",user->nick.c_str());
+ user->WriteNumeric(RPL_COMMANDSEND, "%s :End of COMMANDS list",user->nick.c_str());
return CMD_SUCCESS;
}
diff --git a/src/commands/cmd_info.cpp b/src/commands/cmd_info.cpp
index 1802cbdce..0af22d512 100644
--- a/src/commands/cmd_info.cpp
+++ b/src/commands/cmd_info.cpp
@@ -23,38 +23,38 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance)
*/
CmdResult CommandInfo::Handle (const std::vector<std::string>&, User *user)
{
- user->WriteServ( "371 %s : -/\\- \2InspIRCd\2 -\\/-", user->nick.c_str());
- user->WriteServ( "371 %s : November 2002 - Present", user->nick.c_str());
- user->WriteServ( "371 %s : ", user->nick.c_str());
- user->WriteServ( "371 %s :\2Core Developers\2:", user->nick.c_str());
- user->WriteServ( "371 %s : Craig Edwards, Brain, <brain@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : Craig McLure, Craig, <craig@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : Robin Burchell, w00t, <w00t@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : Oliver Lupton, Om, <om@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : John Brooks, Special, <special@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : Pippijn van Steenhoven, pippijn, <pippijn@one09.net>", user->nick.c_str());
- user->WriteServ( "371 %s : Dennis Friis, peavey, <peavey@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : Thomas Stagner, aquanight, <aquanight@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : Eric Dietz, fez, <fez@inspircd.org>", user->nick.c_str());
- user->WriteServ( "371 %s : ", user->nick.c_str());
- user->WriteServ( "371 %s :\2Regular Contributors\2:", user->nick.c_str());
- user->WriteServ( "371 %s : satmd nenolod John2 Skip", user->nick.c_str());
- user->WriteServ( "371 %s : jilles Majic eggy Trystan", user->nick.c_str());
- user->WriteServ( "371 %s : Quension danieldg praetorian", user->nick.c_str());
- user->WriteServ( "371 %s : GreenReaper psychon searchirc.com irc-junkie.org", user->nick.c_str());
- user->WriteServ( "371 %s : ", user->nick.c_str());
- user->WriteServ( "371 %s :\2Other Contributors\2:", user->nick.c_str());
- user->WriteServ( "371 %s : dmb Zaba skenmy LeaChim", user->nick.c_str());
- user->WriteServ( "371 %s : Thunderhacker Dan Jason owine", user->nick.c_str());
- user->WriteServ( "371 %s : Adremelech dz BuildSmart HiroP", user->nick.c_str());
- user->WriteServ( "371 %s : ThaPrince Bricker AnMaster djGrrr", user->nick.c_str());
- user->WriteServ( "371 %s : ", user->nick.c_str());
- user->WriteServ( "371 %s :\2Former Contributors\2:", user->nick.c_str());
- user->WriteServ( "371 %s : CC jamie typobox43 Burlex (win32)", user->nick.c_str());
- user->WriteServ( "371 %s : Stskeeps ", user->nick.c_str());
- user->WriteServ( "371 %s : ", user->nick.c_str());
- user->WriteServ( "371 %s : Best experienced with: \2An IRC client\2", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : -/\\- \2InspIRCd\2 -\\/-", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : November 2002 - Present", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : ", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s :\2Core Developers\2:", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Craig Edwards, Brain, <brain@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Craig McLure, Craig, <craig@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Robin Burchell, w00t, <w00t@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Oliver Lupton, Om, <om@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : John Brooks, Special, <special@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Pippijn van Steenhoven, pippijn, <pippijn@one09.net>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Dennis Friis, peavey, <peavey@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Thomas Stagner, aquanight, <aquanight@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Eric Dietz, fez, <fez@inspircd.org>", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : ", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s :\2Regular Contributors\2:", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : satmd nenolod John2 Skip", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : jilles Majic eggy Trystan", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Quension danieldg praetorian", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : GreenReaper psychon searchirc.com irc-junkie.org", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : ", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s :\2Other Contributors\2:", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : dmb Zaba skenmy LeaChim", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Thunderhacker Dan Jason owine", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Adremelech dz BuildSmart HiroP", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : ThaPrince Bricker AnMaster djGrrr", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : ", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, " %s :\2Former Contributors\2:", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, " %s : CC jamie typobox43 Burlex (win32)", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, " %s : Stskeeps ", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, " %s : ", user->nick.c_str());
+ user->WriteNumeric(RPL_INFO, "%s : Best experienced with: \2An IRC client\2", user->nick.c_str());
FOREACH_MOD(I_OnInfo,OnInfo(user));
- user->WriteServ( "374 %s :End of /INFO list", user->nick.c_str());
+ user->WriteNumeric(RPL_ENDOFINFO, "%s :End of /INFO list", user->nick.c_str());
return CMD_SUCCESS;
}
diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp
index 116198d73..c0da70b6e 100644
--- a/src/commands/cmd_invite.cpp
+++ b/src/commands/cmd_invite.cpp
@@ -37,7 +37,7 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
if ((!c) || (!u))
{
- user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), c ? parameters[0].c_str() : parameters[1].c_str());
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), c ? parameters[0].c_str() : parameters[1].c_str());
return CMD_FAILURE;
}
@@ -45,33 +45,33 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
{
if (c->GetStatus(user) < STATUS_HOP)
{
- user->WriteNumeric(482, "%s %s :You must be a channel %soperator", user->nick.c_str(), c->name.c_str(), c->GetStatus(u) == STATUS_HOP ? "" : "half-");
+ user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You must be a channel %soperator", user->nick.c_str(), c->name.c_str(), c->GetStatus(u) == STATUS_HOP ? "" : "half-");
return CMD_FAILURE;
}
}
if (c->HasUser(u))
{
- user->WriteNumeric(443, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name.c_str());
+ user->WriteNumeric(ERR_USERONCHANNEL, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name.c_str());
return CMD_FAILURE;
}
if ((IS_LOCAL(user)) && (!c->HasUser(user)))
{
- user->WriteNumeric(442, "%s %s :You're not on that channel!",user->nick.c_str(), c->name.c_str());
+ user->WriteNumeric(ERR_NOTONCHANNEL, "%s %s :You're not on that channel!",user->nick.c_str(), c->name.c_str());
return CMD_FAILURE;
}
+ {
FOREACH_RESULT(I_OnUserPreInvite,OnUserPreInvite(user,u,c,timeout));
if (MOD_RESULT == 1)
- {
return CMD_FAILURE;
}
u->InviteTo(c->name.c_str(), timeout);
u->WriteFrom(user,"INVITE %s :%s",u->nick.c_str(),c->name.c_str());
- user->WriteNumeric(341, "%s %s %s",user->nick.c_str(),u->nick.c_str(),c->name.c_str());
+ user->WriteNumeric(RPL_INVITING, "%s %s %s",user->nick.c_str(),u->nick.c_str(),c->name.c_str());
switch (ServerInstance->Config->AnnounceInvites)
{
case ServerConfig::INVITE_ANNOUNCE_ALL:
@@ -99,9 +99,9 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
InvitedList* il = user->GetInviteList();
for (InvitedList::iterator i = il->begin(); i != il->end(); i++)
{
- user->WriteNumeric(346, "%s :%s",user->nick.c_str(),i->first.c_str());
+ user->WriteNumeric(RPL_INVITELIST, "%s :%s",user->nick.c_str(),i->first.c_str());
}
- user->WriteNumeric(347, "%s :End of INVITE list",user->nick.c_str());
+ user->WriteNumeric(RPL_ENDOFINVITELIST, "%s :End of INVITE list",user->nick.c_str());
}
return CMD_SUCCESS;
}