DaZeus
2.0
|
#include <network.h>
Public Types | |
enum | DisconnectReason { UnknownReason, ShutdownReason, ConfigurationReloadReason, SwitchingServersReason, ErrorReason, TimeoutReason, AdminRequestReason } |
enum | ChannelMode { UserMode = 0, OpMode = 1, HalfOpMode = 2, VoiceMode = 4, UnknownMode = 8, OpAndVoiceMode = OpMode | VoiceMode } |
Public Member Functions | |
Network (const NetworkConfig *c) | |
Constructor. More... | |
~Network () | |
Destructor. More... | |
void | addListener (NetworkListener *nl) |
bool | autoConnectEnabled () const |
Whether this network is marked for autoconnection. More... | |
const std::vector < ServerConfig * > & | servers () const |
std::string | nick () const |
Server * | activeServer () const |
const NetworkConfig * | config () const |
int | serverUndesirability (const ServerConfig *sc) const |
std::string | networkName () const |
std::vector< std::string > | joinedChannels () const |
std::map< std::string, std::string > | topics () const |
std::map< std::string, ChannelMode > | usersInChannel (std::string channel) const |
bool | isIdentified (const std::string &user) const |
bool | isKnownUser (const std::string &user) const |
void | connectToNetwork (bool reconnect=false) |
void | disconnectFromNetwork (DisconnectReason reason=UnknownReason) |
Disconnect from the network. More... | |
void | checkTimeouts () |
void | joinChannel (std::string channel) |
void | leaveChannel (std::string channel) |
void | say (std::string destination, std::string message) |
void | action (std::string destination, std::string message) |
void | names (std::string channel) |
void | ctcp (std::string destination, std::string message) |
void | sendWhois (std::string destination) |
void | flagUndesirableServer (const ServerConfig *sc) |
void | serverIsActuallyOkay (const ServerConfig *sc) |
void | addDescriptors (fd_set *in_set, fd_set *out_set, int *maxfd) |
void | processDescriptors (fd_set *in_set, fd_set *out_set) |
void | run () |
Static Public Member Functions | |
static std::string | toString (const Network *n) |
static void | run (std::vector< Network * > networks) |
Friends | |
class | Server |
dazeus::Network::Network | ( | const NetworkConfig * | c | ) |
Constructor.
Definition at line 30 of file network.cpp.
dazeus::Network::~Network | ( | ) |
Destructor.
Definition at line 48 of file network.cpp.
void dazeus::Network::action | ( | std::string | destination, |
std::string | message | ||
) |
Definition at line 71 of file network.cpp.
dazeus::Server * dazeus::Network::activeServer | ( | ) | const |
Returns the active server in this network, or 0 if there is none.
Definition at line 57 of file network.cpp.
void dazeus::Network::addDescriptors | ( | fd_set * | in_set, |
fd_set * | out_set, | ||
int * | maxfd | ||
) |
Definition at line 474 of file network.cpp.
|
inline |
bool dazeus::Network::autoConnectEnabled | ( | ) | const |
Whether this network is marked for autoconnection.
Definition at line 66 of file network.cpp.
void dazeus::Network::checkTimeouts | ( | ) |
Definition at line 489 of file network.cpp.
const dazeus::NetworkConfig * dazeus::Network::config | ( | ) | const |
Definition at line 159 of file network.cpp.
void dazeus::Network::connectToNetwork | ( | bool | reconnect = false | ) |
Definition at line 164 of file network.cpp.
void dazeus::Network::ctcp | ( | std::string | destination, |
std::string | message | ||
) |
Definition at line 293 of file network.cpp.
void dazeus::Network::disconnectFromNetwork | ( | DisconnectReason | reason = UnknownReason | ) |
Disconnect from the network.
Definition at line 304 of file network.cpp.
void dazeus::Network::flagUndesirableServer | ( | const ServerConfig * | sc | ) |
Definition at line 373 of file network.cpp.
bool dazeus::Network::isIdentified | ( | const std::string & | user | ) | const |
Definition at line 385 of file network.cpp.
bool dazeus::Network::isKnownUser | ( | const std::string & | user | ) | const |
Definition at line 389 of file network.cpp.
void dazeus::Network::joinChannel | ( | std::string | channel | ) |
Definition at line 319 of file network.cpp.
std::vector< std::string > dazeus::Network::joinedChannels | ( | ) | const |
Definition at line 85 of file network.cpp.
void dazeus::Network::leaveChannel | ( | std::string | channel | ) |
Definition at line 327 of file network.cpp.
void dazeus::Network::names | ( | std::string | channel | ) |
Definition at line 78 of file network.cpp.
std::string dazeus::Network::networkName | ( | ) | const |
Definition at line 361 of file network.cpp.
std::string dazeus::Network::nick | ( | ) | const |
Definition at line 354 of file network.cpp.
void dazeus::Network::processDescriptors | ( | fd_set * | in_set, |
fd_set * | out_set | ||
) |
Definition at line 478 of file network.cpp.
void dazeus::Network::run | ( | ) |
Definition at line 515 of file network.cpp.
|
static |
Definition at line 521 of file network.cpp.
void dazeus::Network::say | ( | std::string | destination, |
std::string | message | ||
) |
Definition at line 335 of file network.cpp.
void dazeus::Network::sendWhois | ( | std::string | destination | ) |
Definition at line 343 of file network.cpp.
void dazeus::Network::serverIsActuallyOkay | ( | const ServerConfig * | sc | ) |
Definition at line 380 of file network.cpp.
const std::vector< dazeus::ServerConfig * > & dazeus::Network::servers | ( | ) | const |
Definition at line 348 of file network.cpp.
int dazeus::Network::serverUndesirability | ( | const ServerConfig * | sc | ) | const |
Definition at line 368 of file network.cpp.
std::map< std::string, std::string > dazeus::Network::topics | ( | ) | const |
Definition at line 95 of file network.cpp.
|
static |
Copyright (c) Sjors Gielen, 2010-2012 See LICENSE for license.
Definition at line 12 of file network.cpp.
std::map< std::string, dazeus::Network::ChannelMode > dazeus::Network::usersInChannel | ( | std::string | channel | ) | const |
Definition at line 100 of file network.cpp.