本文整理汇总了C++中CChan::GetBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::GetBuffer方法的具体用法?C++ CChan::GetBuffer怎么用?C++ CChan::GetBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::GetBuffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnJoin
virtual void OnJoin(const CNick& cNick, CChan& cChannel)
{
if (cNick.GetNick().Equals(m_pUser->GetNick()) && cChannel.GetBuffer().empty())
{
BootStrap((CChan *)&cChannel);
if (!cChannel.GetBuffer().empty())
Replay(cChannel.GetName());
}
AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), cNick.GetNickMask() + " JOIN"));
}
示例2: UserCommand
//.........这里部分代码省略.........
const vector<CChan*>& vChans = pNetwork->GetChans();
CIRCSock* pIRCSock = pNetwork->GetIRCSock();
const CString& sPerms = (pIRCSock) ? pIRCSock->GetPerms() : "";
if (!vChans.size()) {
PutStatus("There are no channels defined.");
return;
}
CTable Table;
Table.AddColumn("Name");
Table.AddColumn("Status");
Table.AddColumn("Conf");
Table.AddColumn("Buf");
Table.AddColumn("Modes");
Table.AddColumn("Users");
for (unsigned int p = 0; p < sPerms.size(); p++) {
CString sPerm;
sPerm += sPerms[p];
Table.AddColumn(sPerm);
}
unsigned int uNumDetached = 0, uNumDisabled = 0,
uNumJoined = 0;
for (unsigned int a = 0; a < vChans.size(); a++) {
const CChan* pChan = vChans[a];
Table.AddRow();
Table.SetCell("Name", pChan->GetPermStr() + pChan->GetName());
Table.SetCell("Status", ((vChans[a]->IsOn()) ? ((vChans[a]->IsDetached()) ? "Detached" : "Joined") : ((vChans[a]->IsDisabled()) ? "Disabled" : "Trying")));
Table.SetCell("Conf", CString((pChan->InConfig()) ? "yes" : ""));
Table.SetCell("Buf", CString((pChan->KeepBuffer()) ? "*" : "") + CString(pChan->GetBufferCount()));
Table.SetCell("Modes", pChan->GetModeString());
Table.SetCell("Users", CString(pChan->GetNickCount()));
map<char, unsigned int> mPerms = pChan->GetPermCounts();
for (unsigned int b = 0; b < sPerms.size(); b++) {
char cPerm = sPerms[b];
Table.SetCell(CString(cPerm), CString(mPerms[cPerm]));
}
if(pChan->IsDetached()) uNumDetached++;
if(pChan->IsOn()) uNumJoined++;
if(pChan->IsDisabled()) uNumDisabled++;
}
PutStatus(Table);
PutStatus("Total: " + CString(vChans.size()) + " - Joined: " + CString(uNumJoined) +
" - Detached: " + CString(uNumDetached) + " - Disabled: " + CString(uNumDisabled));
} else if (sCommand.Equals("ADDNETWORK")) {
#ifndef ENABLE_ADD_NETWORK
if (!m_pUser->IsAdmin()) {
PutStatus("Permission denied");
return;
}
#endif
CString sNetwork = sLine.Token(1);
if (sNetwork.empty()) {
PutStatus("Usage: AddNetwork <name>");
return;
}