X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fnetburst.cpp;h=30a37baee3d1b605ddb939d5f63fba09a3ad86c2;hb=4f3aaaef9f8b111452ffa4498aaefeae3fcb6675;hp=b81a285b574cab1ccd17af39f44f30c222f78b88;hpb=3a3ff949670c61a4a8856e1391222e156eb1cd17;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index b81a285b5..30a37baee 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."); @@ -134,6 +137,9 @@ void TreeSocket::SendServerInfo(TreeServer* from) // Send full version string that contains more information and is shown to opers this->WriteLine(CommandSInfo::Builder(from, "fullversion", from->GetFullVersion())); + + // Send the raw version string that just contains the base info + this->WriteLine(CommandSInfo::Builder(from, "rawversion", from->GetRawVersion())); } /** Recursively send the server tree. @@ -160,10 +166,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 +245,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 +265,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 +274,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 +301,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)); } }