*
* Written by Craig Edwards, Craig McLure, and others.
* This program is free but copyrighted software; see
*
* Written by Craig Edwards, Craig McLure, and others.
* This program is free but copyrighted software; see
extern std::vector<userrec*> all_opers;
extern user_hash clientlist;
extern chan_hash chanlist;
extern std::vector<userrec*> all_opers;
extern user_hash clientlist;
extern chan_hash chanlist;
/** log()
* Write a line of text `text' to the logfile (and stdout, if in nofork) if the level `level'
* is greater than the configured loglevel.
/** log()
* Write a line of text `text' to the logfile (and stdout, if in nofork) if the level `level'
* is greater than the configured loglevel.
vsnprintf(textbuffer, MAXBUF, text, argsPtr);
va_end(argsPtr);
vsnprintf(textbuffer, MAXBUF, text, argsPtr);
va_end(argsPtr);
- // FIX: Stops a message going to the same person more than once
- memset(&already_sent,0,MAX_DESCRIPTORS);
+ // XXX: Save on memset calls by using an ID. This clever trick thought of during discussion with nazzy and w00t.
+ uniq_id++;
WriteFrom_NoFormat(i->second->fd,u,textbuffer);
sent_to_at_least_one = true;
}
WriteFrom_NoFormat(i->second->fd,u,textbuffer);
sent_to_at_least_one = true;
}
WriteFrom_NoFormat(i->second->fd,u,text);
sent_to_at_least_one = true;
}
WriteFrom_NoFormat(i->second->fd,u,text);
sent_to_at_least_one = true;
}
// firstly decrement the count on each channel
for (std::vector<ucrec*>::iterator f = u->chans.begin(); f != u->chans.end(); f++)
{
// firstly decrement the count on each channel
for (std::vector<ucrec*>::iterator f = u->chans.begin(); f != u->chans.end(); f++)
{
if (!Config->MOTD.size())
{
WriteServ(user->fd,"422 %s :Message of the day file is missing.",user->nick);
if (!Config->MOTD.size())
{
WriteServ(user->fd,"422 %s :Message of the day file is missing.",user->nick);
WriteServ(user->fd,"375 %s :%s message of the day", user->nick, Config->ServerName);
for (unsigned int i = 0; i < Config->MOTD.size(); i++)
WriteServ(user->fd,"375 %s :%s message of the day", user->nick, Config->ServerName);
for (unsigned int i = 0; i < Config->MOTD.size(); i++)
- WriteServ(user->fd,"372 %s :- ",user->nick,Config->MOTD[i].c_str());
+ WriteServ(user->fd,"372 %s :- %s",user->nick,Config->MOTD[i].c_str());
Config->ConfValue(Config->config_data, "module","name",count,configToken,MAXBUF);
printf("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
Config->ConfValue(Config->config_data, "module","name",count,configToken,MAXBUF);
printf("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
{
log(DEFAULT,"Exiting due to a module loader error.");
printf("\nThere was an error loading a module: %s\n\n",ServerInstance->ModuleError());
{
log(DEFAULT,"Exiting due to a module loader error.");
printf("\nThere was an error loading a module: %s\n\n",ServerInstance->ModuleError());