本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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();
}
示例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());
}
}
示例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();
}
示例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())
//.........这里部分代码省略.........