本文整理汇总了C++中CChan::GetKey方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::GetKey方法的具体用法?C++ CChan::GetKey怎么用?C++ CChan::GetKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::GetKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunJob
virtual void RunJob()
{
if (!m_pUser->GetIRCSock())
return;
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it)
{
CChan *pChan = m_pUser->FindChan(it->first);
if (!pChan) {
pChan = new CChan(it->first, m_pUser, true);
if (!it->second.empty())
pChan->SetKey(it->second);
if (!m_pUser->AddChan(pChan)) {
/* AddChan() deleted that channel */
PutModule("Could not join [" + it->first
+ "] (# prefix missing?)");
continue;
}
}
if (!pChan->IsOn()) {
PutModule("Joining [" + pChan->GetName() + "]");
PutIRC("JOIN " + pChan->GetName() + (pChan->GetKey().empty()
? "" : " " + pChan->GetKey()));
}
}
}
示例2: RunJob
virtual void RunJob() {
CUser* user = m_pModule->GetUser();
CChan* pChan = user->FindChan(GetName().Token(1, true));
if (pChan) {
pChan->Enable();
GetModule()->PutIRC("JOIN " + pChan->GetName() + " " + pChan->GetKey());
}
}
示例3: RunJob
virtual void RunJob() override {
CIRCNetwork* pNetwork = GetModule()->GetNetwork();
CChan* pChan = pNetwork->FindChan(GetName().Token(1, true));
if (pChan) {
pChan->Enable();
GetModule()->PutIRC("JOIN " + pChan->GetName() + " " + pChan->GetKey());
}
}
示例4: JoinChans
void CIRCNetwork::JoinChans() {
bool bHaveKey = false;
size_t joinLength = 4; // join
CString sChannels, sKeys;
for (vector<CChan*>::iterator it = m_vChans.begin(); it != m_vChans.end(); ++it) {
CChan *pChan = *it;
if (pChan->IsOn() || pChan->IsDisabled() || !JoinChan(pChan)) {
continue;
}
size_t length = pChan->GetName().length() + pChan->GetKey().length() + 2; // +2 for either space or commas
if ((joinLength + length) >= 510) {
// Sent what we got, and cleanup
PutIRC("JOIN " + sChannels + (bHaveKey ? (" " + sKeys) : ""));
sChannels = "";
sKeys = "";
joinLength = 4; // join
bHaveKey = false;
}
if (!sChannels.empty()) {
sChannels += ",";
sKeys += ",";
}
if (!pChan->GetKey().empty()) {
bHaveKey = true;
sKeys += pChan->GetKey();
}
sChannels += pChan->GetName();
joinLength += length;
}
if (!sChannels.empty()) {
PutIRC("JOIN " + sChannels + (bHaveKey ? (" " + sKeys) : ""));
}
}
示例5: OnKick
virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& pChan, const CString& sMessage) {
if (m_pUser->GetCurNick().Equals(sKickedNick)) {
if (!delay) {
PutIRC("JOIN " + pChan.GetName() + " " + pChan.GetKey());
pChan.Enable();
return;
}
AddTimer(new CRejoinJob(this, delay, 1, "Rejoin " + pChan.GetName(),
"Rejoin channel after a delay"));
}
}
示例6: Clone
void CChan::Clone(CChan& chan) {
// We assume that m_sName and m_pNetwork are equal
SetBufferCount(chan.GetBufferCount(), true);
SetKeepBuffer(chan.KeepBuffer());
SetKey(chan.GetKey());
SetDefaultModes(chan.GetDefaultModes());
if (IsDetached() != chan.IsDetached()) {
// Only send something if it makes sense
// (= Only detach if client is on the channel
// and only attach if we are on the channel)
if (IsOn()) {
if (IsDetached()) {
JoinUser(false, "");
} else {
DetachUser();
}
}
SetDetached(chan.IsDetached());
}
}