X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fnetburst.cpp;h=5115c7aa8a670b1566acebf1e91ee2e8ebeeea1d;hb=70be9c79d284982d03744443b84268bef44a3080;hp=b81a285b574cab1ccd17af39f44f30c222f78b88;hpb=6fe1f4e1136f2ab95a88e68af1894bf6002d03f4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index b81a285b5..5115c7aa8 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -27,6 +27,7 @@ #include "treeserver.h" #include "main.h" #include "commands.h" +#include "modules/server.h" /** * Creates FMODE messages, used only when syncing channels @@ -108,19 +109,21 @@ void TreeSocket::DoBurst(TreeServer* s) capab->auth_challenge ? "challenge-response" : "plaintext password"); this->CleanNegotiationInfo(); this->WriteLine(CmdBuilder("BURST").push_int(ServerInstance->Time())); - /* Send server tree */ + // Introduce all servers behind us this->SendServers(Utils->TreeRoot, s); BurstState bs(this); - /* Send users and their oper status */ + // Introduce all users this->SendUsers(bs); + // Sync all channels const chan_hash& chans = ServerInstance->GetChans(); for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i) SyncChannel(i->second, bs); + // Send all xlines this->SendXLines(); - FOREACH_MOD(OnSyncNetwork, (bs.server)); + FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), ServerEventListener, OnSyncNetwork, (bs.server)); this->WriteLine(CmdBuilder("ENDBURST")); ServerInstance->SNO->WriteToSnoMask('l',"Finished bursting to \2"+ s->GetName()+"\2."); @@ -160,10 +163,7 @@ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s) } /** Send one or more FJOINs for a channel of users. - * If the length of a single line is more than 480-NICKMAX - * in length, it is split over multiple lines. - * Send one or more FMODEs for a channel with the - * channel bans, if there's any. + * If the length of a single line is too long, it is split over multiple lines. */ void TreeSocket::SendFJoins(Channel* c) { @@ -242,7 +242,7 @@ void TreeSocket::SendListModes(Channel* chan) this->WriteLine(fmode.finalize()); } -/** Send channel topic, modes and metadata */ +/** Send channel users, topic, modes and global metadata */ void TreeSocket::SyncChannel(Channel* chan, BurstState& bs) { SendFJoins(chan); @@ -262,7 +262,7 @@ void TreeSocket::SyncChannel(Channel* chan, BurstState& bs) this->WriteLine(CommandMetadata::Builder(chan, item->name, value)); } - FOREACH_MOD(OnSyncChannel, (chan, bs.server)); + FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), ServerEventListener, OnSyncChannel, (chan, bs.server)); } void TreeSocket::SyncChannel(Channel* chan) @@ -271,11 +271,9 @@ void TreeSocket::SyncChannel(Channel* chan) SyncChannel(chan, bs); } -/** send all users and their oper state/modes */ +/** Send all users and their state, including oper and away status and global metadata */ void TreeSocket::SendUsers(BurstState& bs) { - ProtocolInterface::Server& piserver = bs.server; - const user_hash& users = ServerInstance->Users->GetUsers(); for (user_hash::const_iterator u = users.begin(); u != users.end(); ++u) { @@ -300,6 +298,6 @@ void TreeSocket::SendUsers(BurstState& bs) this->WriteLine(CommandMetadata::Builder(user, item->name, value)); } - FOREACH_MOD(OnSyncUser, (user, piserver)); + FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), ServerEventListener, OnSyncUser, (user, bs.server)); } }