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


C++ CChan::GetNicks方法代码示例

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


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

示例1:

	void OnOp2(const CNick* pOpNick, const CNick& Nick, CChan& Channel, bool bNoChange) override {
		if (Nick.NickEquals(GetNetwork()->GetNick())) {
			const map<CString,CNick>& msNicks = Channel.GetNicks();

			for (const auto& it : msNicks) {
				if (!it.second.HasPerm(CChan::Voice)) {
					CheckAutoVoice(it.second, Channel);
				}
			}
		}
	}
开发者ID:BlaXpirit,项目名称:znc,代码行数:11,代码来源:autovoice.cpp

示例2: OnOp

	virtual void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
		if (Nick.GetNick() == m_pNetwork->GetIRCNick().GetNick()) {
			const map<CString,CNick>& msNicks = Channel.GetNicks();

			for (map<CString,CNick>::const_iterator it = msNicks.begin(); it != msNicks.end(); ++it) {
				if (!it->second.HasPerm(CChan::Op)) {
					CheckAutoOp(it->second, Channel);
				}
			}
		}
	}
开发者ID:FooBarWidget,项目名称:znc,代码行数:11,代码来源:autoop.cpp

示例3: GetCommonChans

unsigned int CNick::GetCommonChans(vector<CChan*>& vRetChans, CIRCNetwork* pNetwork) const {
	vRetChans.clear();

	const vector<CChan*>& vChans = pNetwork->GetChans();

	for (unsigned int a = 0; a < vChans.size(); a++) {
		CChan* pChan = vChans[a];
		const map<CString,CNick>& msNicks = pChan->GetNicks();

		for (map<CString,CNick>::const_iterator it = msNicks.begin(); it != msNicks.end(); ++it) {
			if (it->first.Equals(m_sNick)) {
				vRetChans.push_back(pChan);
				continue;
			}
		}
	}

	return vRetChans.size();
}
开发者ID:jimloco,项目名称:znc,代码行数:19,代码来源:Nick.cpp

示例4: AutoCycle

	void AutoCycle(CChan& Channel) {
		if (!IsAutoCycle(Channel.GetName()))
			return;

		// Did we recently annoy opers via cycling of an empty channel?
		if (m_recentlyCycled.HasItem(Channel.GetName()))
			return;

		// Is there only one person left in the channel?
		if (Channel.GetNickCount() != 1)
			return;

		// Is that person us and we don't have op?
		const CNick& pNick = Channel.GetNicks().begin()->second;
		if (!pNick.HasPerm(CChan::Op) && pNick.GetNick().Equals(m_pNetwork->GetCurNick())) {
			Channel.Cycle();
			m_recentlyCycled.AddItem(Channel.GetName());
		}
	}
开发者ID:jimloco,项目名称:znc,代码行数:19,代码来源:autocycle.cpp

示例5: GetCommonChans

size_t CNick::GetCommonChans(vector<CChan*>& vRetChans, CUser* pUser) const {
	vRetChans.clear();

	const vector<CChan*>& vChans = pUser->GetChans();

	for (size_t a = 0; a < vChans.size(); a++) {
		CChan* pChan = vChans[a];
		const map<CString,CNick*>& msNicks = pChan->GetNicks();

		for (map<CString,CNick*>::const_iterator it = msNicks.begin(); it != msNicks.end(); it++) {
			if (it->first.Equals(m_sNick)) {
				vRetChans.push_back(pChan);
				continue;
			}
		}
	}

	return vRetChans.size();
}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:19,代码来源:Nick.cpp

示例6: UserCommand

void CClient::UserCommand(CString& sLine) {
	if (!m_pUser) {
		return;
	}

	if (sLine.empty()) {
		return;
	}

	NETWORKMODULECALL(OnStatusCommand(sLine), m_pUser, m_pNetwork, this, return);

	const CString sCommand = sLine.Token(0);

	if (sCommand.Equals("HELP")) {
		HelpUser();
	} else if (sCommand.Equals("LISTNICKS")) {
		if (!m_pNetwork) {
			PutStatus("You must be connected with a network to use this command");
			return;
		}

		CString sChan = sLine.Token(1);

		if (sChan.empty()) {
			PutStatus("Usage: ListNicks <#chan>");
			return;
		}

		CChan* pChan = m_pNetwork->FindChan(sChan);

		if (!pChan) {
			PutStatus("You are not on [" + sChan + "]");
			return;
		}

		if (!pChan->IsOn()) {
			PutStatus("You are not on [" + sChan + "] [trying]");
			return;
		}

		const map<CString,CNick>& msNicks = pChan->GetNicks();
		CIRCSock* pIRCSock = m_pNetwork->GetIRCSock();
		const CString& sPerms = (pIRCSock) ? pIRCSock->GetPerms() : "";

		if (!msNicks.size()) {
			PutStatus("No nicks on [" + sChan + "]");
			return;
		}

		CTable Table;

		for (unsigned int p = 0; p < sPerms.size(); p++) {
			CString sPerm;
			sPerm += sPerms[p];
			Table.AddColumn(sPerm);
		}

		Table.AddColumn("Nick");
		Table.AddColumn("Ident");
		Table.AddColumn("Host");

		for (map<CString,CNick>::const_iterator a = msNicks.begin(); a != msNicks.end(); ++a) {
			Table.AddRow();

			for (unsigned int b = 0; b < sPerms.size(); b++) {
				if (a->second.HasPerm(sPerms[b])) {
					CString sPerm;
					sPerm += sPerms[b];
					Table.SetCell(sPerm, sPerm);
				}
			}

			Table.SetCell("Nick", a->second.GetNick());
			Table.SetCell("Ident", a->second.GetIdent());
			Table.SetCell("Host", a->second.GetHost());
		}

		PutStatus(Table);
	} else if (sCommand.Equals("DETACH")) {
		if (!m_pNetwork) {
			PutStatus("You must be connected with a network to use this command");
			return;
		}

		CString sChan = sLine.Token(1);

		if (sChan.empty()) {
			PutStatus("Usage: Detach <#chan>");
			return;
		}

		const vector<CChan*>& vChans = m_pNetwork->GetChans();
		vector<CChan*>::const_iterator it;
		unsigned int uMatches = 0, uDetached = 0;
		for (it = vChans.begin(); it != vChans.end(); ++it) {
			if (!(*it)->GetName().WildCmp(sChan))
				continue;
			uMatches++;

			if ((*it)->IsDetached())
//.........这里部分代码省略.........
开发者ID:IshaqAzmi,项目名称:GKZNC,代码行数:101,代码来源:ClientCommand.cpp


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