#include <servers.h>
Inherits Extensible.

Public Member Functions | |
| Server (Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid="", bool jupe=false) | |
| void | Delete (const Anope::string &reason) |
| const Anope::string & | GetName () const |
| unsigned | GetHops () const |
| void | SetDescription (const Anope::string &desc) |
| const Anope::string & | GetDescription () const |
| void | SetSID (const Anope::string &sid) |
| const Anope::string & | GetSID () const |
| const std::vector< Server * > & | GetLinks () const |
| Server * | GetUplink () |
| void | AddLink (Server *s) |
| void | DelLink (Server *s) |
| void | Sync (bool sync_links) |
| bool | IsSynced () const |
| void | Unsync () |
| bool | IsULined () const |
| bool | IsJuped () const |
| void | Notice (const BotInfo *source, const Anope::string &message) |
Static Public Member Functions | |
| static Server * | Find (const Anope::string &name, Server *s=NULL) |
Data Fields | |
| unsigned | users |
Private Member Functions | |
| ~Server () | |
Private Attributes | |
| Anope::string | name |
| unsigned int | hops |
| Anope::string | description |
| Anope::string | sid |
| std::vector< Server * > | links |
| Server * | uplink |
| bool | syncing |
| bool | juped |
| Anope::string | quit_reason |
Class representing a server
Definition at line 42 of file servers.h.
| Server::Server | ( | Server * | uplink, | |
| const Anope::string & | name, | |||
| unsigned | hops, | |||
| const Anope::string & | description, | |||
| const Anope::string & | sid = "", |
|||
| bool | jupe = false | |||
| ) |
Constructor
| uplink | The uplink this server is from, is only NULL when creating Me | |
| name | The server name | |
| hops | Hops from services server | |
| description | Server rdescription | |
| sid | Server sid/numeric | |
| jupe | If the server is juped |
Definition at line 28 of file servers.cpp.
References AddLink(), BotInfo::botchannels, BotListByNick, BotInfo::botmodes, Anope::string::c_str(), ChannelList, IRCDProto::DefaultPseudoclientModes, Anope::string::empty(), Find(), ModeManager::FindChannelModeByChar(), Channel::FindUser(), FOREACH_MOD, GetLinks(), GetName(), ModeManager::GetStatusChar(), I_OnNewServer, BotInfo::introduced, IRCD, juped, Anope::string::length(), MODE_STATUS, User::nick, Anope::string::npos, IRCDProto::SendBOB(), IRCDProto::SendChannel(), IRCDProto::SendClientIntroduction(), IRCDProto::SendJoin(), IRCDProto::SendServer(), IRCDProto::SendSQLine(), Channel::SetModeInternal(), User::SetModesInternal(), syncing, Mode::type, uplink, UserListByNick, and Channel::users.
| Server::~Server | ( | ) | [private] |
Destructor
Definition at line 117 of file servers.cpp.
References Servers::Capab, Config, Anope::CurTime, Delete(), DelLink(), Find(), GetName(), User::IsIdentified(), User::IsRecognized(), NickAlias::last_quit, NickAlias::last_seen, links, LOG_DEBUG, NickAlias::nc, User::nick, ServerConfig::NSHideNetSplitQuit, User::Quit(), quit_reason, User::server, uplink, and UserListByNick.
| void Server::AddLink | ( | Server * | s | ) |
Adds a link to this server
| s | The linking server |
Definition at line 203 of file servers.cpp.
References GetName(), and links.
Referenced by Server().
| void Server::Delete | ( | const Anope::string & | reason | ) |
Delete this server with a reason
| reason | The reason |
Definition at line 153 of file servers.cpp.
References FOREACH_MOD, I_OnServerQuit, and quit_reason.
Referenced by Message::SQuit::Run(), IRCDMessageRSQuit::Run(), and ~Server().
| void Server::DelLink | ( | Server * | s | ) |
Delinks a server from this server
| s | The server |
Definition at line 210 of file servers.cpp.
References GetName(), and links.
Referenced by ~Server().
| Server * Server::Find | ( | const Anope::string & | name, | |
| Server * | s = NULL | |||
| ) | [static] |
Find a server
| name | The name or SID/numeric | |
| s | The server list to search for this server on, defaults to our Uplink |
Definition at line 328 of file servers.cpp.
References Anope::string::equals_ci(), Anope::string::equals_cs(), GetLinks(), GetName(), GetSID(), and LOG_DEBUG_2.
Referenced by CommandOSDNS::AddServer(), CommandOSDNS::DelServer(), CommandOSDNS::DisplayPoolState(), CommandOSNOOP::Execute(), CommandOSJupe::Execute(), MessageSource::MessageSource(), ModuleDNS::ModuleDNS(), CommandOSDNS::OnPool(), Message::SQuit::Run(), Message::MOTD::Run(), IRCDMessageRSQuit::Run(), IRCDMessageNick::Run(), Server(), Servers::TS6_SID_Retrieve(), and ~Server().
| const Anope::string & Server::GetDescription | ( | ) | const |
Get the server description
Definition at line 175 of file servers.cpp.
References description.
Referenced by Log::BuildPrefix().
| unsigned Server::GetHops | ( | ) | const |
Get the number of hops this server is from services
Definition at line 165 of file servers.cpp.
References hops.
| const std::vector< Server * > & Server::GetLinks | ( | ) | const |
Get the list of links this server has, or NULL if it has none
Definition at line 193 of file servers.cpp.
References links.
Referenced by MyXMLRPCEvent::DoStats(), CommandOSStats::DoStatsUplink(), CommandOSJupe::Execute(), Find(), Servers::GetUplink(), MessageSource::MessageSource(), IRCDMessageEndBurst::Run(), IRCDMessageBurst::Run(), Server(), MyGlobalService::ServerGlobal(), stats_count_servers(), and UplinkSocket::~UplinkSocket().
| const Anope::string & Server::GetName | ( | ) | const |
Get the name for this server
Definition at line 160 of file servers.cpp.
References name.
Referenced by AddLink(), Log::BuildPrefix(), DelLink(), CommandOSNOOP::Execute(), Find(), MessageSource::GetName(), Log::Log(), Message::SQuit::Run(), IRCDMessageEndburst::Run(), IRCDMessageRSQuit::Run(), InspIRCdProto::SendConnect(), InspIRCd12Proto::SendNumericInternal(), InspIRCdProto::SendNumericInternal(), IRCDProto::SendSquit(), UnrealIRCdProto::SendSVSKillInternal(), InspIRCd12Proto::SendSVSKillInternal(), InspIRCdProto::SendSVSKillInternal(), UnrealIRCdProto::SendSVSNOOP(), BahamutIRCdProto::SendSVSNOOP(), Server(), User::User(), UplinkSocket::Message::~Message(), ~Server(), UplinkSocket::~UplinkSocket(), and User::~User().
| const Anope::string & Server::GetSID | ( | ) | const |
Get the server numeric/SID, else the server name
Definition at line 185 of file servers.cpp.
References Anope::string::empty(), IRCD, name, IRCDProto::RequiresID, and sid.
Referenced by Find(), Message::Ping::Run(), IRCDMessageEncap::Run(), IRCDMessageRSQuit::Run(), RatboxProto::SendConnect(), PlexusProto::SendConnect(), HybridProto::SendConnect(), and UplinkSocket::Message::~Message().
| Server * Server::GetUplink | ( | ) |
Get the uplink server for this server, if this is our uplink will be Me
Definition at line 198 of file servers.cpp.
References uplink.
Referenced by Message::SQuit::Run(), IRCDMessageRSQuit::Run(), IRCDMessageMetadata::Run(), and Sync().
| bool Server::IsJuped | ( | ) | const |
Check if this server is juped (a pseudoserver other than us)
Definition at line 315 of file servers.cpp.
References juped.
Referenced by CommandOSDNS::AddServer(), CommandOSNOOP::Execute(), ModuleDNS::OnNewServer(), IRCDMessageRSQuit::Run(), MyGlobalService::ServerGlobal(), and UplinkSocket::Message::~Message().
| bool Server::IsSynced | ( | ) | const |
Check if this server is synced
Definition at line 294 of file servers.cpp.
References syncing.
Referenced by BotInfo::Assign(), BotInfo::BotInfo(), User::Login(), CSLog::OnLog(), ModuleDNS::OnNewServer(), ModuleProxyScan::OnUserConnect(), ModuleDNSBL::OnUserConnect(), OSNews::OnUserConnect(), LogInfo::ProcessMessage(), Channel::RemoveMode(), Channel::Reset(), IRCDMessageMetadata::Run(), Channel::SetCorrectModes(), Channel::SetMode(), Channel::SetModesInternal(), Sync(), Channel::Sync(), CSSeen::UpdateUser(), and BotInfo::~BotInfo().
| bool Server::IsULined | ( | ) | const |
Check if this server is ULined
Definition at line 304 of file servers.cpp.
References Config, and ServerConfig::Ulines.
Referenced by BSKick::bot_kick(), BSKick::check_ban(), ChannelInfo::CheckKick(), Channel::Kick(), Channel::SetCorrectModes(), and User::User().
| void Server::Notice | ( | const BotInfo * | source, | |
| const Anope::string & | message | |||
| ) |
Send a message to alll users on this server
| source | The source of the message | |
| message | The message |
Definition at line 320 of file servers.cpp.
References Config, IRCD, ServerConfig::NSDefFlags, IRCDProto::SendGlobalNotice(), and IRCDProto::SendGlobalPrivmsg().
Referenced by GlobalCore::OnNewServer(), and MyGlobalService::ServerGlobal().
| void Server::SetDescription | ( | const Anope::string & | desc | ) |
Set the server description
| desc | The new description |
Definition at line 170 of file servers.cpp.
References description.
| void Server::SetSID | ( | const Anope::string & | sid | ) |
Change this servers SID
| sid | The new SID |
Definition at line 180 of file servers.cpp.
References sid.
Referenced by ProtoHybrid::ProtoHybrid(), and ProtoInspIRCd::ProtoInspIRCd().
| void Server::Sync | ( | bool | sync_links | ) |
Finish syncing this server and optionally all links to it
| sync_links | True to sync the links for this server too (if any) |
Definition at line 227 of file servers.cpp.
References BotInfo::Assign(), Anope::AtTerm(), ChannelInfo::bi, ChannelInfo::c, ChannelList, ModeManager::FindChannelModeByName(), Channel::FindUser(), FOREACH_MOD, Anope::Fork(), GetUplink(), Extensible::HasExt(), I_OnPreUplinkSync, I_OnServerSync, I_OnUplinkSync, IRCD, IsSynced(), links, LOG_TERMINAL, ChannelInfo::name, Anope::NoFork, RegisteredChannelList, IRCDProto::SendChannel(), IRCDProto::SendEOB(), Channel::SetMode(), Channel::Sync(), Sync(), syncing, ChannelInfo::time_registered, and ChannelInfo::WhoSends().
Referenced by IRCDMessageEndburst::Run(), IRCDMessageBurst::Run(), and Sync().
| void Server::Unsync | ( | ) |
Unsync the server. Only used for Me->Unsync()
Definition at line 299 of file servers.cpp.
References syncing.
Referenced by UplinkSocket::~UplinkSocket().
Anope::string Server::description [private] |
Definition at line 50 of file servers.h.
Referenced by GetDescription(), and SetDescription().
unsigned int Server::hops [private] |
bool Server::juped [private] |
std::vector<Server *> Server::links [private] |
Anope::string Server::name [private] |
Anope::string Server::quit_reason [private] |
Anope::string Server::sid [private] |
bool Server::syncing [private] |
Server* Server::uplink [private] |
Definition at line 56 of file servers.h.
Referenced by GetUplink(), Server(), and ~Server().
| unsigned Server::users |
Definition at line 83 of file servers.h.
Referenced by Anope::Init(), User::User(), and User::~User().
1.7.1