当前位置: 首页>>代码示例>>C++>>正文


C++ CNick类代码示例

本文整理汇总了C++中CNick的典型用法代码示例。如果您正苦于以下问题:C++ CNick类的具体用法?C++ CNick怎么用?C++ CNick使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CNick类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnTopic

	virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) {
		PutModule("* " + Nick.GetNick() + " changes topic on " + Channel.GetName() + " to '" + sTopic + "'");

		return CONTINUE;
	}
开发者ID:FooBarWidget,项目名称:znc,代码行数:5,代码来源:sample.cpp

示例2: OnTopic

CModule::EModRet CLogMod::OnTopic(CNick& Nick, CChan& Channel, CString& sTopic)
{
	PutLog("*** " + Nick.GetNick() + " changes topic to '" + sTopic + "'", Channel);
	return CONTINUE;
}
开发者ID:rwaldron,项目名称:znc,代码行数:5,代码来源:log.cpp

示例3: OnChanNotice

CModule::EModRet CLogMod::OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage)
{
	PutLog("-" + Nick.GetNick() + "- " + sMessage, Channel);
	return CONTINUE;
}
开发者ID:rwaldron,项目名称:znc,代码行数:5,代码来源:log.cpp

示例4: OnQuit

void CLogMod::OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans)
{
	for (std::vector<CChan*>::const_iterator pChan = vChans.begin(); pChan != vChans.end(); ++pChan)
		PutLog("*** Quits: " + Nick.GetNick() + " (" + Nick.GetIdent() + "@" + Nick.GetHost() + ") (" + sMessage + ")", **pChan);
}
开发者ID:rwaldron,项目名称:znc,代码行数:5,代码来源:log.cpp

示例5: OnPart

void CLogMod::OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage)
{
	PutLog("*** Parts: " + Nick.GetNick() + " (" + Nick.GetIdent() + "@" + Nick.GetHost() + ") (" + sMessage + ")", Channel);
}
开发者ID:rwaldron,项目名称:znc,代码行数:4,代码来源:log.cpp

示例6: OnPart

	virtual void OnPart(const CNick& cNick, CChan& cChannel)
	{
		AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), cNick.GetNickMask() + " PART"));
		if (cNick.GetNick().Equals(m_pUser->GetNick()))
			SaveBufferToDisk(); // need to force a save here to see this!
	}
开发者ID:toddhainsworth,项目名称:znc,代码行数:6,代码来源:savebuff.cpp

示例7: OnRawMode

void CLogMod::OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs)
{
	PutLog("*** " + OpNick.GetNick() + " sets mode: " + sModes + " " + sArgs, Channel);
}
开发者ID:rwaldron,项目名称:znc,代码行数:4,代码来源:log.cpp

示例8: FindNick

void CChan::ModeChange(const CString& sModes, const CNick* pOpNick) {
	CString sModeArg = sModes.Token(0);
	CString sArgs = sModes.Token(1, true);
	bool bAdd = true;

	/* Try to find a CNick* from this channel so that pOpNick->HasPerm()
	 * works as expected. */
	if (pOpNick) {
		CNick* OpNick = FindNick(pOpNick->GetNick());
		/* If nothing was found, use the original pOpNick, else use the
		 * CNick* from FindNick() */
		if (OpNick)
			pOpNick = OpNick;
	}

	if (pOpNick) {
		NETWORKMODULECALL(OnRawMode(*pOpNick, *this, sModeArg, sArgs), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
	}

	for (unsigned int a = 0; a < sModeArg.size(); a++) {
		const unsigned char& uMode = sModeArg[a];

		if (uMode == '+') {
			bAdd = true;
		} else if (uMode == '-') {
			bAdd = false;
		} else if (m_pNetwork->GetIRCSock()->IsPermMode(uMode)) {
			CString sArg = GetModeArg(sArgs);
			CNick* pNick = FindNick(sArg);
			if (pNick) {
				unsigned char uPerm = m_pNetwork->GetIRCSock()->GetPermFromMode(uMode);

				if (uPerm) {
					bool bNoChange = (pNick->HasPerm(uPerm) == bAdd);

					if (bAdd) {
						pNick->AddPerm(uPerm);

						if (pNick->GetNick().Equals(m_pNetwork->GetCurNick())) {
							AddPerm(uPerm);
						}
					} else {
						pNick->RemPerm(uPerm);

						if (pNick->GetNick().Equals(m_pNetwork->GetCurNick())) {
							RemPerm(uPerm);
						}
					}

					if (uMode && pOpNick) {
						NETWORKMODULECALL(OnChanPermission(*pOpNick, *pNick, *this, uMode, bAdd, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);

						if (uMode == CChan::M_Op) {
							if (bAdd) {
								NETWORKMODULECALL(OnOp(*pOpNick, *pNick, *this, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
							} else {
								NETWORKMODULECALL(OnDeop(*pOpNick, *pNick, *this, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
							}
						} else if (uMode == CChan::M_Voice) {
							if (bAdd) {
								NETWORKMODULECALL(OnVoice(*pOpNick, *pNick, *this, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
							} else {
								NETWORKMODULECALL(OnDevoice(*pOpNick, *pNick, *this, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
							}
						}
					}
				}
			}
		} else {
			bool bList = false;
			CString sArg;

			switch (m_pNetwork->GetIRCSock()->GetModeType(uMode)) {
				case CIRCSock::ListArg:
					bList = true;
					sArg = GetModeArg(sArgs);
					break;
				case CIRCSock::HasArg:
					sArg = GetModeArg(sArgs);
					break;
				case CIRCSock::NoArg:
					break;
				case CIRCSock::ArgWhenSet:
					if (bAdd) {
						sArg = GetModeArg(sArgs);
					}

					break;
			}

			bool bNoChange;
			if (bList) {
				bNoChange = false;
			} else if (bAdd) {
				bNoChange = HasMode(uMode) && GetModeArg(uMode) == sArg;
			} else {
				bNoChange = !HasMode(uMode);
			}
			NETWORKMODULECALL(OnMode(*pOpNick, *this, uMode, sArg, bAdd, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);

//.........这里部分代码省略.........
开发者ID:toddhainsworth,项目名称:znc,代码行数:101,代码来源:Chan.cpp

示例9: IsMatch

	bool IsMatch(const CNick& Nick, const CString& sType) const {
		return (GetType().Equals("all") || GetType().Equals(sType)) &&
			   (Nick.GetHostMask().WildCmp(m_sHostMask));
	}
开发者ID:Xe,项目名称:dotfiles,代码行数:4,代码来源:ignore.cpp

示例10: OnRawMode

	virtual void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs) {
		PutModule("* " + OpNick.GetNick() + " sets mode: " + sModes + " " + sArgs + " (" + Channel.GetName() + ")");
	}
开发者ID:FooBarWidget,项目名称:znc,代码行数:3,代码来源:sample.cpp

示例11: OnChanCTCP

    EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage) {
        if (IsCtcpNotifier(sMessage.Token(0)))
            PutModule("Replying to CTCP " + sMessage.Token(0) + " by " + Nick.GetNick() + " (" + Nick.GetHostMask() + ") to " + Channel.GetName() + ".");

        return CONTINUE;
    }
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:6,代码来源:ctcp_notifier.cpp

示例12: OnDevoice

	virtual void OnDevoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
		PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] devoiced [" + Nick.GetNick() + "] on [" + Channel.GetName() + "]");
	}
开发者ID:FooBarWidget,项目名称:znc,代码行数:3,代码来源:sample.cpp

示例13: OnChanPermission

	virtual void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange) {
		PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] set mode [" + Channel.GetName() + ((bAdded) ? "] +" : "] -") + CString(uMode) + " " + Nick.GetNick());
	}
开发者ID:FooBarWidget,项目名称:znc,代码行数:3,代码来源:sample.cpp

示例14: OnPrivMsg

	virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) {
		PutModule("[" + Nick.GetNick() + "] privmsg [" + sMessage + "]");
		sMessage = "\002" + sMessage + "\002";

		return CONTINUE;
	}
开发者ID:FooBarWidget,项目名称:znc,代码行数:6,代码来源:sample.cpp

示例15: OnRawMode

	virtual void OnRawMode(const CNick& cOpNick, CChan& cChannel, const CString& sModes, const CString& sArgs)
	{
		AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), cOpNick.GetNickMask() + " MODE " + sModes + " " + sArgs));
	}
开发者ID:toddhainsworth,项目名称:znc,代码行数:4,代码来源:savebuff.cpp


注:本文中的CNick类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。