* module).
*/
virtual void OnLoadModule(Module* mod,std::string name);
+
+ /** Called once every five seconds for background processing.
+ * This timer can be used to control timed features. Its period is not accurate
+ * enough to be used as a clock, but it is gauranteed to be called at least once in
+ * any five second period, directly from the main loop of the server.
+ */
+ virtual void OnBackgroundTimer(time_t curtime);
};
log(DEBUG,"Checking extension items for %s",key.c_str());
if (this->Extension_Items.find(key) != this->Extension_Items.end())
{
- log(DEBUG,"Found item %s %s",key.c_str(),(this->Extension_Items.find(key))->second);
return (this->Extension_Items.find(key))->second;
}
log(DEBUG,"Cant find item %s",key.c_str());
void Module::On005Numeric(std::string &output) { };
int Module::OnKill(userrec* source, userrec* dest, std::string reason) { return 0; };
void Module::OnLoadModule(Module* mod,std::string name) { };
-
+void Module::OnBackgroundTimer(time_t curtime) { };
// server is a wrapper class that provides methods to all of the C-style
// exports in the core
{
zombie->fd = alive->fd;
alive->fd = FD_MAGIC_NUMBER;
- Write(zombie->fd,"NICK %s",zombie->nick);
+ Write(zombie->fd,":%s!%s@%s NICK %s",alive->nick,alive->ident,alive->host,zombie->nick);
kill_link(alive,message.c_str());
for (int i = 0; i != MAXCHANS; i++)
{
{
if (zombie->chans[i].channel->name)
{
- Write(zombie->fd,"JOIN %s",zombie->chans[i].channel->name);
+ chanrec* Ptr = zombie->chans[i].channel;
+ WriteFrom(zombie->fd,zombie,"JOIN %s",Ptr->name);
+ if (Ptr->topicset)
+ {
+ WriteServ(zombie->fd,"332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic);
+ WriteServ(zombie->fd,"333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset);
+ }
+ userlist(zombie,Ptr);
+ WriteServ(zombie->fd,"366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name);
+ WriteServ(zombie->fd,"324 %s %s +%s",zombie->nick, Ptr->name,chanmodes(Ptr));
+ WriteServ(zombie->fd,"329 %s %s %d", zombie->nick, Ptr->name, Ptr->created);
+
}
}
}