Ejemplo n.º 1
0
		m_pUser->AddBytesRead(GetBytesRead());
		m_pUser->AddBytesWritten(GetBytesWritten());
	}
}

void CClient::ReadLine(const CString& sData) {
	CString sLine = sData;

	sLine.TrimRight("\n\r");

	DEBUG("(" << ((m_pUser) ? m_pUser->GetUserName() : GetRemoteIP()) << ") CLI -> ZNC [" << sLine << "]");

	if (IsAttached()) {
		MODULECALL(OnUserRaw(sLine), m_pUser, this, return);
	} else {
		GLOBALMODULECALL(OnUnknownUserRaw(sLine), m_pUser, this, return);
	}

	CString sCommand = sLine.Token(0);
	if (sCommand.Left(1) == ":") {
		// Evil client! Sending a nickmask prefix on client's command
		// is bad, bad, bad, bad, bad, bad, bad, bad, BAD, B A D!
		sLine = sLine.Token(1, true);
		sCommand = sLine.Token(0);
	}

	if (sCommand.Equals("PASS")) {
		if (!IsAttached()) {
			m_bGotPass = true;
			m_sPass = sLine.Token(1);
			if (m_sPass.Left(1) == ":")
Ejemplo n.º 2
0
bool CGlobalModules::OnUnknownUserRaw(CString& sLine) {
	GLOBALMODHALTCHK(OnUnknownUserRaw(sLine));
}
Ejemplo n.º 3
0
bool CGlobalModules::OnUnknownUserRaw(CClient* pClient, CString& sLine) {
	GLOBALMODHALTCHK(OnUnknownUserRaw(pClient, sLine));
}
Ejemplo n.º 4
0
Archivo: Client.cpp Proyecto: ex0a/znc
		m_pUser->AddBytesRead(GetBytesRead());
		m_pUser->AddBytesWritten(GetBytesWritten());
	}
}

void CClient::ReadLine(const CString& sData) {
	CString sLine = sData;

	sLine.TrimRight("\n\r");

	DEBUG("(" << GetFullName() << ") CLI -> ZNC [" << sLine << "]");

	if (IsAttached()) {
		NETWORKMODULECALL(OnUserRaw(sLine), m_pUser, m_pNetwork, this, return);
	} else {
		GLOBALMODULECALL(OnUnknownUserRaw(this, sLine), return);
	}

	CString sCommand = sLine.Token(0);
	if (sCommand.Left(1) == ":") {
		// Evil client! Sending a nickmask prefix on client's command
		// is bad, bad, bad, bad, bad, bad, bad, bad, BAD, B A D!
		sLine = sLine.Token(1, true);
		sCommand = sLine.Token(0);
	}

	if (!IsAttached()) { // The following commands happen before authentication with ZNC
		if (sCommand.Equals("PASS")) {
			m_bGotPass = true;

			CString sAuthLine = sLine.Token(1, true).TrimPrefix_n();
Ejemplo n.º 5
0
bool CModules::OnUnknownUserRaw(CClient* pClient, CString& sLine) {
	MODHALTCHK(OnUnknownUserRaw(pClient, sLine));
}
Ejemplo n.º 6
0
bool CModules::OnUnknownUserRaw(CString& sLine) {
	MODHALTCHK(OnUnknownUserRaw(sLine));
}