extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-extern std::vector<InspSocket*> module_sockets;
-extern std::vector<userrec*> local_users;
extern int MODCOUNT;
-extern InspSocket* socket_ref[MAX_DESCRIPTORS];
extern time_t TIME;
-// This table references users by file descriptor.
-// its an array to make it VERY fast, as all lookups are referenced
-// by an integer, meaning there is no need for a scan/search operation.
-extern userrec* fd_ref_table[MAX_DESCRIPTORS];
-
extern Server* MyServer;
-extern ServerConfig *Config;
-extern user_hash clientlist;
extern chan_hash chanlist;
/* Special commands which may occur without registration of the user */
* Therefore, we need to deal with both lists concurrently. The first instance of this method does that by creating
* two instances of irc::commasepstream and reading them both together until the first runs out of tokens.
* The second version is much simpler and just has the one stream to read, and is used in NAMES, WHOIS, PRIVMSG etc.
- * Both will only parse until they reach Config->MaxTargets number of targets, to stop abuse via spam.
+ * Both will only parse until they reach ServerInstance->Config->MaxTargets number of targets, to stop abuse via spam.
*/
int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra)
{
* which called us, for every parameter pair until there are
* no more left to parse.
*/
- while (((item = items1.GetToken()) != "") && (max++ < Config->MaxTargets))
+ while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets))
{
std::string extrastuff = items2.GetToken();
parameters[splithere] = item.c_str();
* Each token we parse out, call the command handler that called us
* with it
*/
- while (((item = items1.GetToken()) != "") && (max++ < Config->MaxTargets))
+ while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets))
{
parameters[splithere] = item.c_str();
CommandObj->Handle(parameters,pcnt,user);
{
if (!user->IsModeSet(cm->second->flags_needed))
{
- WriteServ(user->fd,"481 %s :Permission Denied- You do not have the required operator privilages",user->nick);
+ user->WriteServ("481 %s :Permission Denied- You do not have the required operator privilages",user->nick);
return;
}
if (!user->HasPermission(command))
{
- WriteServ(user->fd,"481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
+ user->WriteServ("481 %s :Permission Denied- Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
return;
}
}
if ((user->registered == REG_ALL) && (!*user->oper) && (cm->second->IsDisabled()))
{
/* command is disabled! */
- WriteServ(user->fd,"421 %s %s :This command has been disabled.",user->nick,command.c_str());
+ user->WriteServ("421 %s %s :This command has been disabled.",user->nick,command.c_str());
return;
}
if (items < cm->second->min_params)
{
- WriteServ(user->fd,"461 %s %s :Not enough parameters.", user->nick, command.c_str());
+ user->WriteServ("461 %s %s :Not enough parameters.", user->nick, command.c_str());
/* If syntax is given, display this as the 461 reply */
- if ((Config->SyntaxHints) && (cm->second->syntax.length()))
- WriteServ(user->fd,"304 %s :SYNTAX %s %s", user->nick, cm->second->command.c_str(), cm->second->syntax.c_str());
+ if ((ServerInstance->Config->SyntaxHints) && (cm->second->syntax.length()))
+ user->WriteServ("304 %s :SYNTAX %s %s", user->nick, cm->second->command.c_str(), cm->second->syntax.c_str());
return;
}
if ((user->registered == REG_ALL) || (cm->second == command_user) || (cm->second == command_nick) || (cm->second == command_pass))
}
else
{
- WriteServ(user->fd,"451 %s :You have not registered",command.c_str());
+ user->WriteServ("451 %s :You have not registered",command.c_str());
return;
}
}
else if (user)
{
ServerInstance->stats->statsUnknown++;
- WriteServ(user->fd,"421 %s %s :Unknown command",user->nick,command.c_str());
+ user->WriteServ("421 %s %s :Unknown command",user->nick,command.c_str());
}
}