Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Private Attributes

Server Class Reference

#include <servers.h>

Inherits Extensible.

Collaboration diagram for Server:
Collaboration graph
[legend]

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::stringGetName () const
unsigned GetHops () const
void SetDescription (const Anope::string &desc)
const Anope::stringGetDescription () const
void SetSID (const Anope::string &sid)
const Anope::stringGetSID () const
const std::vector< Server * > & GetLinks () const
ServerGetUplink ()
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 ServerFind (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
Serveruplink
bool syncing
bool juped
Anope::string quit_reason

Detailed Description

Class representing a server

Definition at line 42 of file servers.h.


Constructor & Destructor Documentation

Server::Server ( Server uplink,
const Anope::string name,
unsigned  hops,
const Anope::string description,
const Anope::string sid = "",
bool  jupe = false 
)
Server::~Server (  )  [private]

Member Function Documentation

void Server::AddLink ( Server s  ) 

Adds a link to this server

Parameters:
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

Parameters:
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

Parameters:
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]
const Anope::string & Server::GetDescription (  )  const

Get the server description

Returns:
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

Returns:
Number of hops

Definition at line 165 of file servers.cpp.

References hops.

const std::vector< Server * > & Server::GetLinks (  )  const
const Anope::string & Server::GetName (  )  const
const Anope::string & Server::GetSID (  )  const
Server * Server::GetUplink (  ) 

Get the uplink server for this server, if this is our uplink will be Me

Returns:
The servers uplink

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)

Returns:
true if this server is a juped server

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
bool Server::IsULined (  )  const

Check if this server is ULined

Returns:
true or false

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

Parameters:
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

Parameters:
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

Parameters:
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  ) 
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().


Field Documentation

Definition at line 50 of file servers.h.

Referenced by GetDescription(), and SetDescription().

unsigned int Server::hops [private]

Definition at line 48 of file servers.h.

Referenced by GetHops().

bool Server::juped [private]

Definition at line 60 of file servers.h.

Referenced by IsJuped(), and Server().

std::vector<Server *> Server::links [private]

Definition at line 54 of file servers.h.

Referenced by AddLink(), DelLink(), GetLinks(), Sync(), and ~Server().

Definition at line 46 of file servers.h.

Referenced by GetName(), and GetSID().

Definition at line 63 of file servers.h.

Referenced by Delete(), and ~Server().

Definition at line 52 of file servers.h.

Referenced by GetSID(), and SetSID().

bool Server::syncing [private]

Definition at line 58 of file servers.h.

Referenced by IsSynced(), Server(), Sync(), and Unsync().

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().


The documentation for this class was generated from the following files: