本文整理汇总了C++中CNick::GetHost方法的典型用法代码示例。如果您正苦于以下问题:C++ CNick::GetHost方法的具体用法?C++ CNick::GetHost怎么用?C++ CNick::GetHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNick
的用法示例。
在下文中一共展示了CNick::GetHost方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CIgnore(const CString& sHostMask, const CString& sType) {
CNick Nick;
Nick.Parse(sHostMask);
m_sHostMask = ((Nick.GetNick().empty()) ? "*" : Nick.GetNick());
m_sHostMask += "!";
m_sHostMask += (Nick.GetIdent().empty()) ? "*" : Nick.GetIdent();
m_sHostMask += "@";
m_sHostMask += (Nick.GetHost().empty()) ? "*" : Nick.GetHost();
m_sType = sType;
}
示例2: OnInvite
EModRet OnInvite(const CNick& Nick, const CString& sChan) override {
if (!Nick.NickEquals("Q") ||
!Nick.GetHost().Equals("CServe.quakenet.org"))
return CONTINUE;
if (m_bJoinOnInvite) GetNetwork()->AddChan(sChan, false);
return CONTINUE;
}
示例3: Clone
void CNick::Clone(const CNick& SourceNick) {
SetNick(SourceNick.GetNick());
SetIdent(SourceNick.GetIdent());
SetHost(SourceNick.GetHost());
m_sChanPerms = SourceNick.m_sChanPerms;
m_pNetwork = SourceNick.m_pNetwork;
}
示例4: OnQuit
void CLogMod::OnQuit(const CNick& Nick, const CString& sMessage,
const vector<CChan*>& vChans) {
if (!HasNV("quits") || GetNV("quits").ToBool()) {
for (CChan* pChan : vChans)
PutLog("*** Quits: " + Nick.GetNick() + " (" + Nick.GetIdent() +
"@" + Nick.GetHost() + ") (" + sMessage + ")",
*pChan);
}
}
示例5: FixupChanNick
// #124: OnChanMsg(): nick doesn't have perms
static void FixupChanNick(CNick& Nick, CChan* pChan) {
// A channel nick has up-to-date channel perms, but might be
// lacking (usernames-in-host) the associated ident & host.
// An incoming message, on the other hand, has normally a full
// [email protected] prefix. Sync the two so that channel nicks
// get the potentially missing piece of info and module hooks
// get the perms.
CNick* pChanNick = pChan->FindNick(Nick.GetNick());
if (pChanNick) {
if (!Nick.GetIdent().empty()) {
pChanNick->SetIdent(Nick.GetIdent());
}
if (!Nick.GetHost().empty()) {
pChanNick->SetHost(Nick.GetHost());
}
Nick.Clone(*pChanNick);
}
}
示例6: HandleMessage
void HandleMessage(CNick& Nick, const CString& sMessage)
{
if (!m_sAuth.empty()
&& Nick.GetNick().CaseCmp("Q") == 0
&& Nick.GetHost().CaseCmp("CServe.quakenet.org") == 0
&& sMessage.find("AUTH") != CString::npos
&& sMessage.find("authenticate") != CString::npos) {
PutIRC("PRIVMSG [email protected] :auth " + m_sAuth);
}
}
示例7: OnKick
virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) {
CString sOpNick = TclEscape(CString(OpNick.GetNick()));
CString sNick = TclEscape(sKickedNick);
CString sOpHost = TclEscape(CString(OpNick.GetIdent() + "@" + OpNick.GetHost()));
CString sCommand = "Binds::ProcessKick {" + sOpNick + "} {" + sOpHost + "} - {" + Channel.GetName() + "} {" + sNick + "} {" + sMessage + "}";
i = Tcl_Eval(interp, sCommand.c_str());
if (i != TCL_OK) {
PutModule(Tcl_GetStringResult(interp));
}
}
示例8: OnPrivMsg
virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) {
CString sMes = TclEscape(sMessage);
CString sNick = TclEscape(CString(Nick.GetNick()));
CString sHost = TclEscape(CString(Nick.GetIdent() + "@" + Nick.GetHost()));
CString sCommand = "Binds::ProcessMsgm {" + sNick + "} {" + sHost + "} - {" + sMes + "}";
i = Tcl_Eval(interp, sCommand.c_str());
if (i != TCL_OK) {
PutModule(Tcl_GetStringResult(interp));
}
return CONTINUE;
}
示例9: OnChanMsg
EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) override {
CString sMes = TclEscape(sMessage);
CString sNick = TclEscape(CString(Nick.GetNick()));
CString sHost = TclEscape(CString(Nick.GetIdent() + "@" + Nick.GetHost()));
CString sChannel = TclEscape(CString(Channel.GetName()));
CString sCommand = "Binds::ProcessPubm {" + sNick + "} {" + sHost + "} - {" + sChannel + "} {" + sMes + "}";
i = Tcl_Eval(interp, sCommand.c_str());
if (i != TCL_OK) {
PutModule(Tcl_GetStringResult(interp));
}
return CONTINUE;
}
示例10: OnNick
virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) {
CString sOldNick = TclEscape(CString(OldNick.GetNick()));
CString sNewNickTmp = TclEscape(sNewNick);
CString sHost = TclEscape(CString(OldNick.GetIdent() + "@" + OldNick.GetHost()));
CString sCommand;
// Nick change is triggered for each common chan so that binds can be chan specific
unsigned int nLength = vChans.size();
for (unsigned int n = 0; n < nLength; n++) {
sCommand = "Binds::ProcessNick {" + sOldNick + "} {" + sHost + "} - {" + vChans[n]->GetName() + "} {" + sNewNickTmp + "}";
i = Tcl_Eval(interp, sCommand.c_str());
if (i != TCL_OK) {
PutModule(Tcl_GetStringResult(interp));
}
}
}
示例11: OnPart
void CLogMod::OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage)
{
PutLog("*** Parts: " + Nick.GetNick() + " (" + Nick.GetIdent() + "@" + Nick.GetHost() + ") (" + sMessage + ")", Channel);
}
示例12: OnJoin
void CLogMod::OnJoin(const CNick& Nick, CChan& Channel)
{
PutLog("*** Joins: " + Nick.GetNick() + " (" + Nick.GetIdent() + "@" + Nick.GetHost() + ")", Channel);
}
示例13: OnQuit
void CLogMod::OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans)
{
for (std::vector<CChan*>::const_iterator pChan = vChans.begin(); pChan != vChans.end(); ++pChan)
PutLog("*** Quits: " + Nick.GetNick() + " (" + Nick.GetIdent() + "@" + Nick.GetHost() + ") (" + sMessage + ")", **pChan);
}
示例14: HandleMessage
EModRet HandleMessage(const CNick& Nick, CString sMessage) {
if (!Nick.NickEquals("Q") ||
!Nick.GetHost().Equals("CServe.quakenet.org"))
return CONTINUE;
sMessage.Trim();
#if Q_DEBUG_COMMUNICATION
PutModule("[ZNC <-- Q] " + sMessage);
#endif
// WHOAMI
if (sMessage.find("WHOAMI is only available to authed users") !=
CString::npos) {
m_bAuthed = false;
Auth();
m_bCatchResponse = m_bRequestedWhoami;
} else if (sMessage.find("Information for user") != CString::npos) {
m_bAuthed = true;
m_msChanModes.clear();
m_bCatchResponse = m_bRequestedWhoami;
m_bRequestedWhoami = true;
} else if (m_bRequestedWhoami && sMessage.WildCmp("#*")) {
CString sChannel = sMessage.Token(0);
CString sFlags = sMessage.Token(1, true).Trim_n().TrimLeft_n("+");
m_msChanModes[sChannel] = sFlags;
} else if (m_bRequestedWhoami && m_bCatchResponse &&
(sMessage.Equals("End of list.") ||
sMessage.Equals(
"account, or HELLO to create an account."))) {
m_bRequestedWhoami = m_bCatchResponse = false;
return HALT;
}
// AUTH
else if (sMessage.Equals("Username or password incorrect.")) {
m_bAuthed = false;
PutModule("Auth failed: " + sMessage);
return HALT;
} else if (sMessage.WildCmp("You are now logged in as *.")) {
m_bAuthed = true;
PutModule("Auth successful: " + sMessage);
WhoAmI();
return HALT;
} else if (m_bRequestedChallenge &&
sMessage.Token(0).Equals("CHALLENGE")) {
m_bRequestedChallenge = false;
if (sMessage.find("not available once you have authed") !=
CString::npos) {
m_bAuthed = true;
} else {
if (sMessage.find("HMAC-SHA-256") != CString::npos) {
ChallengeAuth(sMessage.Token(1));
} else {
PutModule(
"Auth failed: Q does not support HMAC-SHA-256 for "
"CHALLENGEAUTH, falling back to standard AUTH.");
SetUseChallenge(false);
Auth();
}
}
return HALT;
}
// prevent buffering of Q's responses
return !m_bCatchResponse && GetUser()->IsUserAttached() ? CONTINUE
: HALT;
}
示例15: OnPart
virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) {
PutModule("* Parts: " + Nick.GetNick() + " (" + Nick.GetIdent() + "!" + Nick.GetHost() + ")");
}