本文整理汇总了C++中CNick::GetNickMask方法的典型用法代码示例。如果您正苦于以下问题:C++ CNick::GetNickMask方法的具体用法?C++ CNick::GetNickMask怎么用?C++ CNick::GetNickMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNick
的用法示例。
在下文中一共展示了CNick::GetNickMask方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPrivCTCP
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) {
if (sMessage.Equals("DCC ", false, 4) && m_pUser->IsUserAttached()) {
// DCC CHAT chat 2453612361 44592
CString sType = sMessage.Token(1);
CString sFile = sMessage.Token(2);
unsigned long uLongIP = sMessage.Token(3).ToULong();
unsigned short uPort = sMessage.Token(4).ToUShort();
unsigned long uFileSize = sMessage.Token(5).ToULong();
if (sType.Equals("CHAT")) {
CNick FromNick(Nick.GetNickMask());
unsigned short uBNCPort = CDCCBounce::DCCRequest(FromNick.GetNick(), uLongIP, uPort, "", true, this, CUtils::GetIP(uLongIP));
if (uBNCPort) {
CString sIP = GetLocalDCCIP();
m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pUser->GetNick() + " :\001DCC CHAT chat " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + "\001");
}
} else if (sType.Equals("SEND")) {
// DCC SEND readme.txt 403120438 5550 1104
unsigned short uBNCPort = CDCCBounce::DCCRequest(Nick.GetNick(), uLongIP, uPort, sFile, false, this, CUtils::GetIP(uLongIP));
if (uBNCPort) {
CString sIP = GetLocalDCCIP();
m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pUser->GetNick() + " :\001DCC SEND " + sFile + " " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + " " + CString(uFileSize) + "\001");
}
} else if (sType.Equals("RESUME")) {
// Need to lookup the connection by port, filter the port, and forward to the user
unsigned short uResumePort = sMessage.Token(3).ToUShort();
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); ++it) {
CDCCBounce* pSock = (CDCCBounce*) *it;
if (pSock->GetLocalPort() == uResumePort) {
m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pClient->GetNick() + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetUserPort()) + " " + sMessage.Token(4) + "\001");
}
}
} else if (sType.Equals("ACCEPT")) {
// Need to lookup the connection by port, filter the port, and forward to the user
set<CSocket*>::const_iterator it;
for (it = BeginSockets(); it != EndSockets(); ++it) {
CDCCBounce* pSock = (CDCCBounce*) *it;
if (pSock->GetUserPort() == sMessage.Token(3).ToUShort()) {
m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pClient->GetNick() + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetLocalPort()) + " " + sMessage.Token(4) + "\001");
}
}
}
return HALTCORE;
}
return CONTINUE;
}
示例2: OnNick
virtual void OnNick(const CNick& cNick, const CString& sNewNick, const vector<CChan*>& vChans)
{
for (size_t a = 0; a < vChans.size(); a++)
{
AddBuffer(*vChans[a], SpoofChanMsg(vChans[a]->GetName(), cNick.GetNickMask() + " NICK " + sNewNick));
}
}
示例3: OnNick
virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) {
vector<CChan*>::const_iterator it;
CString sMsg = OldNick.GetNickMask() + " is now known as " + sNewNick;
for (it = vChans.begin(); it != vChans.end(); ++it) {
AddBuffer(**it, sMsg);
}
}
示例4: OnQuit
virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans) {
vector<CChan*>::const_iterator it;
CString sMsg = Nick.GetNickMask() + " quit with message: [" + sMessage + "]";
for (it = vChans.begin(); it != vChans.end(); ++it) {
AddBuffer(**it, sMsg);
}
}
示例5: OnQuit
virtual void OnQuit(const CNick& cNick, const CString& sMessage, const vector<CChan*>& vChans)
{
for (size_t a = 0; a < vChans.size(); a++)
{
AddBuffer(*vChans[a], SpoofChanMsg(vChans[a]->GetName(), cNick.GetNickMask() + " QUIT " + sMessage));
}
if (cNick.GetNick().Equals(m_pUser->GetNick()))
SaveBufferToDisk(); // need to force a save here to see this!
}
示例6: 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"));
}
示例7: HandleMessage
void HandleMessage(CNick& Nick, const CString& sMessage) {
// Flip the NOTICE into PRIVMSG
PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + GetUser()->GetNick() + " :" + sMessage);
}
示例8: OnPart
virtual void OnPart(const CNick& cNick, CChan& cChannel)
{
AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), cNick.GetNickMask() + " PART"));
if (cNick.GetNick().Equals(m_pUser->GetNick()))
SaveBufferToDisk(); // need to force a save here to see this!
}
示例9: OnKick
virtual void OnKick(const CNick& cNick, const CString& sOpNick, CChan& cChannel, const CString& sMessage)
{
AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), sOpNick + " KICK " + cNick.GetNickMask() + " " + sMessage));
}
示例10: OnRawMode
virtual void OnRawMode(const CNick& cOpNick, CChan& cChannel, const CString& sModes, const CString& sArgs)
{
AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), cOpNick.GetNickMask() + " MODE " + sModes + " " + sArgs));
}
示例11: OnTopic
virtual EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) {
AddBuffer(Channel, Nick.GetNickMask() + " changed the topic to: " + sTopic);
return CONTINUE;
}
示例12: OnPart
virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) {
AddBuffer(Channel, Nick.GetNickMask() + " parted with message: [" + sMessage + "]");
}
示例13: OnJoin
virtual void OnJoin(const CNick& Nick, CChan& Channel) {
AddBuffer(Channel, Nick.GetNickMask() + " joined");
}
示例14: OnKick
virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) {
AddBuffer(Channel, OpNick.GetNickMask() + " kicked " + sKickedNick
+ " Reason: [" + sMessage + "]");
}
示例15: OnRawMode
virtual void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs) {
AddBuffer(Channel, OpNick.GetNickMask() + " set mode: " + sModes + " " + sArgs);
}