SERVERINFO* CServerTable::GetNextMapServer() { SERVERINFO* pRt = GetNextServer(); if(pRt == NULL) return NULL; if(pRt->wServerKind != MAP_SERVER) return GetNextMapServer(); else return pRt; }
SERVERINFO* CServerTable::GetNextServer() { SERVERINFO* pRt = CYHHashTable<SERVERINFO>::GetData(); if(pRt == NULL) return NULL; if(pRt->dwConnectionIndex == 0) return GetNextServer(); else return pRt; }
SERVERINFO* CServerTable::GetNextDistServer() { SERVERINFO* pRt = GetNextServer(); if(pRt == NULL) return NULL; if(pRt->wServerKind != DISTRIBUTE_SERVER) return GetNextDistServer(); else return pRt; }
SERVERINFO* CServerTable::GetNextAgentServer() { SERVERINFO* pRt = GetNextServer(); if(pRt == NULL) return NULL; if(pRt->wServerKind != AGENT_SERVER) return GetNextAgentServer(); else return pRt; }
bool CIRCNetwork::Connect() { if (!GetIRCConnectEnabled() || m_pIRCSock || !HasServers()) return false; CServer *pServer = GetNextServer(); if (!pServer) return false; if (CZNC::Get().GetServerThrottle(pServer->GetName())) { CZNC::Get().AddNetworkToQueue(this); return false; } CZNC::Get().AddServerThrottle(pServer->GetName()); bool bSSL = pServer->IsSSL(); #ifndef HAVE_LIBSSL if (bSSL) { PutStatus("Cannot connect to [" + pServer->GetString(false) + "], ZNC is not compiled with SSL."); CZNC::Get().AddNetworkToQueue(this); return false; } #endif CIRCSock *pIRCSock = new CIRCSock(this); pIRCSock->SetPass(pServer->GetPass()); DEBUG("Connecting user/network [" << m_pUser->GetUserName() << "/" << m_sName << "]"); NETWORKMODULECALL(OnIRCConnecting(pIRCSock), m_pUser, this, NULL, DEBUG("Some module aborted the connection attempt"); PutStatus("Some module aborted the connection attempt"); delete pIRCSock; CZNC::Get().AddNetworkToQueue(this); return false; );