本文整理汇总了C++中CChan::RemNick方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::RemNick方法的具体用法?C++ CChan::RemNick怎么用?C++ CChan::RemNick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::RemNick方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPartMessage
bool CIRCSock::OnPartMessage(CPartMessage& Message) {
const CNick& Nick = Message.GetNick();
CString sChan = Message.GetTarget();
CChan* pChan = m_pNetwork->FindChan(sChan);
bool bDetached = false;
if (pChan) {
pChan->RemNick(Nick.GetNick());
Message.SetChan(pChan);
IRCSOCKMODULECALL(OnPartMessage(Message), NOTHING);
if (pChan->IsDetached()) bDetached = true;
}
if (Nick.NickEquals(GetNick())) {
m_pNetwork->DelChan(sChan);
}
/*
* We use this boolean because
* m_pNetwork->DelChan() will delete this channel
* and thus we would dereference an
* already-freed pointer!
*/
return bDetached;
}
示例2: OnKickMessage
bool CIRCSock::OnKickMessage(CKickMessage& Message) {
CString sChan = Message.GetParam(0);
CString sKickedNick = Message.GetKickedNick();
CChan* pChan = m_pNetwork->FindChan(sChan);
if (pChan) {
Message.SetChan(pChan);
IRCSOCKMODULECALL(OnKickMessage(Message), NOTHING);
// do not remove the nick till after the OnKick call, so modules
// can do Chan.FindNick or something to get more info.
pChan->RemNick(sKickedNick);
}
if (GetNick().Equals(sKickedNick) && pChan) {
pChan->SetIsOn(false);
// Don't try to rejoin!
pChan->Disable();
}
return (pChan && pChan->IsDetached());
}
示例3: ReadLine
//.........这里部分代码省略.........
// Todo: use nick compare function here
if (Nick.GetNick().Equals(GetNick())) {
// We are changing our own nick, the clients always must see this!
bIsVisible = true;
SetNick(sNewNick);
}
NETWORKMODULECALL(OnNick(Nick, sNewNick, vFoundChans), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
if (!bIsVisible) {
return;
}
} else if (sCmd.Equals("QUIT")) {
CString sMessage = sRest.TrimPrefix_n();
bool bIsVisible = false;
// :[email protected] QUIT :message
if (Nick.GetNick().Equals(GetNick())) {
m_pNetwork->PutStatus("You quit [" + sMessage + "]");
// We don't call module hooks and we don't
// forward this quit to clients (Some clients
// disconnect if they receive such a QUIT)
return;
}
vector<CChan*> vFoundChans;
const vector<CChan*>& vChans = m_pNetwork->GetChans();
for (unsigned int a = 0; a < vChans.size(); a++) {
CChan* pChan = vChans[a];
if (pChan->RemNick(Nick.GetNick())) {
vFoundChans.push_back(pChan);
if (!pChan->IsDetached()) {
bIsVisible = true;
}
}
}
NETWORKMODULECALL(OnQuit(Nick, sMessage, vFoundChans), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
if (!bIsVisible) {
return;
}
} else if (sCmd.Equals("JOIN")) {
CString sChan = sRest.Token(0).TrimPrefix_n();
CChan* pChan;
// Todo: use nick compare function
if (Nick.GetNick().Equals(GetNick())) {
m_pNetwork->AddChan(sChan, false);
pChan = m_pNetwork->FindChan(sChan);
if (pChan) {
pChan->ResetJoinTries();
pChan->Enable();
pChan->SetIsOn(true);
PutIRC("MODE " + sChan);
}
} else {
pChan = m_pNetwork->FindChan(sChan);
}
if (pChan) {