void OnMinClientsCommand(const CString& sLine) { if (sLine.Token(1).empty()) { PutModule(t_f("Current MinClients setting: {1}")(m_iMinClients)); } else { SetMinClients(sLine.Token(1).ToUInt()); PutModule(t_f("MinClients set to {1}")(m_iMinClients)); } }
void OnReasonCommand(const CString& sLine) { CString sReason = sLine.Token(1, true); if (!sReason.empty()) { SetReason(sReason); PutModule(t_s("Away reason set")); } else { PutModule(t_f("Away reason: {1}")(m_sReason)); PutModule(t_f("Current away reason would be: {1}")(ExpandReason())); } }
void Info(const CString& line) { if (HasPemFile()) { PutModule(t_f("You have a certificate in {1}")(PemFile())); } else { PutModule(t_s( "You do not have a certificate. Please use the web interface " "to add a certificate")); if (GetUser()->IsAdmin()) { PutModule(t_f("Alternatively you can either place one at {1}")( PemFile())); } } }
void OnShowCommand(const CString& sCommand) { CString sMsgs = t_p("1 CTCP message", "{1} CTCP messages", m_iThresholdMsgs)(m_iThresholdMsgs); CString sSecs = t_p("every second", "every {1} seconds", m_iThresholdSecs)(m_iThresholdSecs); PutModule(t_f("Current limit is {1} {2}")(sMsgs, sSecs)); }
void main() { //PrepareLogFunction(io); _CrtMemCheckpoint(&s1); t_f(); _CrtMemDumpAllObjectsSince(&s1); Log("Exit sequence initiated"); std::cout << std::endl << "== INITIATE EXIT SEQUENCE." << std::endl; }
void NotifyAdmins(const CString& event) { CString client = GetUser()->GetUserName(); if (GetClient()->GetIdentifier() != "") { client += "@"; client += GetClient()->GetIdentifier(); } CString ip = GetClient()->GetRemoteIP(); SendAdmins(t_f("{1} {2} from {3}")(client, event, ip)); }
EModRet OnIRCConnecting(CIRCSock* pIRCSock) override { if (m_pISpoofLockFile != nullptr) { DEBUG("Aborting connection, ident spoof lock file exists"); PutModule( t_s("Aborting connection, another user or network is currently " "connecting and using the ident spoof file")); return HALTCORE; } if (!WriteISpoof()) { DEBUG("identfile [" + GetNV("File") + "] could not be written"); PutModule( t_f("[{1}] could not be written, retrying...")(GetNV("File"))); return HALTCORE; } SetIRCSock(pIRCSock); return CONTINUE; }
EModRet Message(const CNick& Nick, const CString& sMessage) { // We never block /me, because it doesn't cause a reply if (sMessage.Token(0).Equals("ACTION")) return CONTINUE; if (m_tLastCTCP + m_iThresholdSecs < time(nullptr)) { m_tLastCTCP = time(nullptr); m_iNumCTCP = 0; } m_iNumCTCP++; if (m_iNumCTCP < m_iThresholdMsgs) return CONTINUE; else if (m_iNumCTCP == m_iThresholdMsgs) PutModule(t_f("Limit reached by {1}, blocking all CTCP")( Nick.GetHostMask())); // Reset the timeout so that we continue blocking messages m_tLastCTCP = time(nullptr); return HALT; }
void GetFormat(const CString& sLine) { PutModule(t_f("Format is set to: {1}")(GetNV("Format"))); PutModule(t_f("Format would be expanded to: {1}")( ExpandString(GetNV("Format")))); }
void SetFormat(const CString& sLine) { SetNV("Format", sLine.Token(1, true)); PutModule(t_f("Format has been set to: {1}")(GetNV("Format"))); PutModule(t_f("Format would be expanded to: {1}")( ExpandString(GetNV("Format")))); }
void SetFile(const CString& sLine) { SetNV("File", sLine.Token(1, true)); PutModule(t_f("File has been set to: {1}")(GetNV("File"))); }
void GetFile(const CString& sLine) { PutModule(t_f("File is set to: {1}")(GetNV("File"))); }