• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PutIRC函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PutIRC函数的典型用法代码示例。如果您正苦于以下问题:C++ PutIRC函数的具体用法?C++ PutIRC怎么用?C++ PutIRC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PutIRC函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PutIRC

bool TwitchGroupChat::OnLoad(const CString& sArgsi, CString& sMessage)
{
    PutIRC("CAP REQ :twitch.tv/commands");
    PutIRC("CAP REQ :twitch.tv/tags");

    return true;
}
开发者ID:carriercomm,项目名称:ZncTwitchTMI,代码行数:7,代码来源:twitchwhisp.cpp


示例2: strlen

void CIRCNetwork::JoinChans(set<CChan*>& sChans) {
	CString sKeys, sJoin;
	bool bHaveKey = false;
	size_t uiJoinLength = strlen("JOIN ");

	while (!sChans.empty()) {
		set<CChan*>::iterator it = sChans.begin();
		const CString& sName = (*it)->GetName();
		const CString& sKey = (*it)->GetKey();
		size_t len = sName.length() + sKey.length();
		len += 2; // two comma

		if (!sKeys.empty() && uiJoinLength + len >= 512)
			break;

		if (!sJoin.empty()) {
			sJoin += ",";
			sKeys += ",";
		}
		uiJoinLength += len;
		sJoin += sName;
		if (!sKey.empty()) {
			sKeys += sKey;
			bHaveKey = true;
		}
		sChans.erase(it);
	}

	if (bHaveKey)
		PutIRC("JOIN " + sJoin + " " + sKeys);
	else
		PutIRC("JOIN " + sJoin);
}
开发者ID:stephank,项目名称:znc,代码行数:33,代码来源:IRCNetwork.cpp


示例3: OverrideCommand

	void OverrideCommand(const CString& sLine) {
		m_bTemporaryAcceptMotd = true;
		const CString sServer = sLine.Token(1);

		if (sServer.empty()) {
			PutIRC("motd");
		} else {
			PutIRC("motd " + sServer);
		}
	}
开发者ID:BlaXpirit,项目名称:znc,代码行数:10,代码来源:block_motd.cpp


示例4: Authenticate

 void Authenticate(const CString& sLine) {
     if (m_Mechanisms.GetCurrent().Equals("PLAIN") && sLine.Equals("+")) {
         CString sAuthLine = GetNV("username") + '\0' + GetNV("username") +
                             '\0' + GetNV("password");
         sAuthLine.Base64Encode();
         PutIRC("AUTHENTICATE " + sAuthLine);
     } else {
         /* Send blank authenticate for other mechanisms (like EXTERNAL). */
         PutIRC("AUTHENTICATE +");
     }
 }
开发者ID:DreamBNC,项目名称:znc,代码行数:11,代码来源:sasl.cpp


示例5: OnUserCTCP

    virtual EModRet OnUserCTCP(CString& sTarget, CString& sMessage) {
        if (sMessage.Equals("DCC ", false, 4)) {
            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();
            CString sIP = GetLocalDCCIP();

            if (!UseClientIP()) {
                uLongIP = CUtils::GetLongIP(m_pClient->GetRemoteIP());
            }

            if (sType.Equals("CHAT")) {
                unsigned short uBNCPort = CDCCBounce::DCCRequest(sTarget, uLongIP, uPort, "", true, this, "");
                if (uBNCPort) {
                    PutIRC("PRIVMSG " + sTarget + " :\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(sTarget, uLongIP, uPort, sFile, false, this, "");
                if (uBNCPort) {
                    PutIRC("PRIVMSG " + sTarget + " :\001DCC SEND " + sFile + " " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + " " + CString(uFileSize) + "\001");
                }
            } else if (sType.Equals("RESUME")) {
                // PRIVMSG user :DCC RESUME "znc.o" 58810 151552
                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) {
                        PutIRC("PRIVMSG " + sTarget + " :\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()) {
                        PutIRC("PRIVMSG " + sTarget + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetLocalPort()) + " " + sMessage.Token(4) + "\001");
                    }
                }
            }

            return HALTCORE;
        }

        return CONTINUE;
    }
开发者ID:sorbits,项目名称:znc,代码行数:53,代码来源:bouncedcc.cpp


示例6: Close

void CIRCSock::Quit(const CString& sQuitMsg) {
	if (!m_bAuthed) {
		Close(CLT_NOW);
		return;
	}
	if (!sQuitMsg.empty()) {
		PutIRC("QUIT :" + sQuitMsg);
	} else {
		PutIRC("QUIT :" + m_pNetwork->ExpandString(m_pNetwork->GetUser()->GetQuitMsg()));
	}
	Close(CLT_AFTERWRITE);
}
开发者ID:jimloco,项目名称:znc,代码行数:12,代码来源:IRCSock.cpp


示例7: OnIRCRegistration

	virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) {
		CString fake = GetFake(m_pUser->GetUserName());
		PutIRC("WEBIRC " + m_pPass + " ZNC " + CleanHostname(m_pUser->GetCleanUserName()) + CGIIRC_HOSTNAME_SUFFIX + " " + fake);
    sIdent = m_pUser->GetCleanUserName();

		return CONTINUE;
	}
开发者ID:Googolplexed,项目名称:znc,代码行数:7,代码来源:cgiirc.cpp


示例8: OnUserNotice

	EModRet OnUserNotice(CString& sTarget, CString& sMessage) override {
		sTarget.TrimPrefix(NickPrefix());

		if (sMessage.TrimPrefix("``")) {
			return CONTINUE;
		}

		MCString::iterator it = FindNV(sTarget.AsLower());

		if (it != EndNV()) {
			CChan* pChan = GetNetwork()->FindChan(sTarget);
			CString sNickMask = GetNetwork()->GetIRCNick().GetNickMask();
			if (pChan) {
				if (!pChan->AutoClearChanBuffer())
					pChan->AddBuffer(":" + NickPrefix() + _NAMEDFMT(sNickMask) + " NOTICE " + _NAMEDFMT(sTarget) + " :{text}", sMessage);
				GetUser()->PutUser(":" + NickPrefix() + sNickMask + " NOTICE " + sTarget + " :" + sMessage, NULL, GetClient());
			}

			CString sMsg = MakeIvec() + sMessage;
			sMsg.Encrypt(it->second);
			sMsg.Base64Encode();
			sMsg = "+OK *" + sMsg;

			PutIRC("NOTICE " + sTarget + " :" + sMsg);
			return HALTCORE;
		}

		return CONTINUE;
	}
开发者ID:jpnurmi,项目名称:znc,代码行数:29,代码来源:crypt.cpp


示例9: SetBack

	void SetBack() {
		RemTimer("simple_away");
		if (m_bWeSetAway) {
			PutIRC("AWAY");
			m_bWeSetAway = false;
		}
	}
开发者ID:KielBNC,项目名称:znc,代码行数:7,代码来源:simple_away.cpp


示例10: OnModCommand

 virtual void OnModCommand( const CString& sCommand )
 {
     CString sCmdName = sCommand.Token(0).AsLower();
     if(sCmdName == "set") {
         CString sPass = sCommand.Token(1, true) + " ";
         m_sAuth = sPass;
         PutModule("Auth set");
     } else if(sCmdName == "auth") {
         if (m_sAuth.empty())
             PutModule("No auth set");
         else {
             PutIRC("PRIVMSG [email protected] :auth " + m_sAuth);
             PutModule("Authing!");
         }
     } else if(sCmdName == "show") {
         if (m_sAuth.empty())
             PutModule("No auth set");
         else
             PutModule("Current user and password: " +  m_sAuth);
     } else if(sCmdName == "save") {
         SetNV("Auth", m_sAuth);
         PutModule("Saved!");
     } else {
         PutModule("Commands: set <user password>, show, save");
     }
 }
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:26,代码来源:qauth.cpp


示例11: Cloak

	void Cloak() {
		if (m_bCloaked)
			return;

		PutModule("Cloak: Trying to cloak your hostname, setting +x...");
		PutIRC("MODE " + GetUser()->GetIRCSock()->GetNick() + " +x");
	}
开发者ID:ZachBeta,项目名称:znc,代码行数:7,代码来源:q.cpp


示例12: SendRequest

    void SendRequest() {
        requestQueue::iterator it;

        if (m_pDoing || m_pReplies) return;

        if (m_vsPending.empty()) return;

        it = m_vsPending.begin();

        if (it->second.empty()) {
            m_vsPending.erase(it);
            SendRequest();
            return;
        }

        // When we are called from the timer, we need to remove it.
        // We can't delete it (segfault on return), thus we
        // just stop it. The main loop will delete it.
        CTimer* pTimer = FindTimer("RouteTimeout");
        if (pTimer) {
            pTimer->Stop();
            UnlinkTimer(pTimer);
        }
        AddTimer(
            new CRouteTimeout(this, 60, 1, "RouteTimeout",
                              "Recover from missing / wrong server replies"));

        m_pDoing = it->first;
        m_pReplies = it->second[0].reply;
        m_sLastRequest = it->second[0].sLine;
        PutIRC(it->second[0].sLine);
        it->second.erase(it->second.begin());
    }
开发者ID:Adam-,项目名称:znc,代码行数:33,代码来源:route_replies.cpp


示例13: Authenticate

	void Authenticate(const CString& sLine) {
		if (m_Mechanisms.GetCurrent().Equals("PLAIN") && sLine.Equals("+")) {
			CString sAuthLine = GetNV("username") + '\0' + GetNV("username")  + '\0' + GetNV("password");
			sAuthLine.Base64Encode();
			PutIRC("AUTHENTICATE " + sAuthLine);
#ifdef HAVE_SASL_MECHANISM
		} else if (m_Mechanisms.GetCurrent().Equals("DH-BLOWFISH")) {
			AuthenticateBlowfish(sLine);
		} else if (m_Mechanisms.GetCurrent().Equals("DH-AES")) {
			AuthenticateAES(sLine);
#endif
		} else {
			/* Send blank authenticate for other mechanisms (like EXTERNAL). */
			PutIRC("AUTHENTICATE +");
		}
	}
开发者ID:ConorOG,项目名称:znc,代码行数:16,代码来源:sasl.cpp


示例14: 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()));
			}
		}
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:26,代码来源:stickychan.cpp


示例15: HandleMessage

 void HandleMessage(CNick& Nick, const CString& sMessage) {
     CString sNickServName = (!GetNV("NickServName").empty())
                                 ? GetNV("NickServName")
                                 : "NickServ";
     if (!GetNV("Password").empty() && Nick.NickEquals(sNickServName) &&
         (sMessage.find("msg") != CString::npos ||
          sMessage.find("authenticate") != CString::npos ||
          sMessage.find("choose a different nickname") != CString::npos ||
          sMessage.find("please choose a different nick") != CString::npos ||
          sMessage.find("If this is your nick, identify yourself with") !=
              CString::npos ||
          sMessage.find("If this is your nick, type") != CString::npos ||
          sMessage.find("This is a registered nickname, please identify") !=
              CString::npos ||
          sMessage.StripControls_n().find(
              "type /NickServ IDENTIFY password") != CString::npos ||
          sMessage.StripControls_n().find(
              "type /msg NickServ IDENTIFY password") != CString::npos) &&
         sMessage.AsUpper().find("IDENTIFY") != CString::npos &&
         sMessage.find("help") == CString::npos) {
         MCString msValues;
         msValues["password"] = GetNV("Password");
         PutIRC(CString::NamedFormat(GetNV("IdentifyCmd"), msValues));
     }
 }
开发者ID:sctigercat1,项目名称:znc,代码行数:25,代码来源:nickserv.cpp


示例16: OnUserMsg

	virtual EModRet OnUserMsg(CString& sTarget, CString& sMessage) {
		sTarget.TrimLeft(NickPrefix());

		if (sMessage.Left(2) == "``") {
			sMessage.LeftChomp(2);
			return CONTINUE;
		}

		MCString::iterator it = FindNV(sTarget.AsLower());

		if (it != EndNV()) {
			CChan* pChan = m_pNetwork->FindChan(sTarget);
			if (pChan) {
				if (!pChan->AutoClearChanBuffer())
					pChan->AddBuffer(":" + NickPrefix() + _NAMEDFMT(m_pNetwork->GetIRCNick().GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sTarget) + " :{text}", sMessage);
				m_pUser->PutUser(":" + NickPrefix() + m_pNetwork->GetIRCNick().GetNickMask() + " PRIVMSG " + sTarget + " :" + sMessage, NULL, m_pClient);
			}

			CString sMsg = MakeIvec() + sMessage;
			sMsg.Encrypt(it->second);
			sMsg.Base64Encode();
			sMsg = "+OK *" + sMsg;

			PutIRC("PRIVMSG " + sTarget + " :" + sMsg);
			return HALTCORE;
		}

		return CONTINUE;
	}
开发者ID:ConorOG,项目名称:znc,代码行数:29,代码来源:crypt.cpp


示例17: OnRaw

	virtual EModRet OnRaw(CString &sLine) {
		if (sLine.Token(0).Equals("AUTHENTICATE")) {
			Authenticate(sLine.Token(1, true));
		} else if (sLine.Token(1).Equals("903")) {
			/* SASL success! */
			m_pNetwork->GetIRCSock()->ResumeCap();
			m_bAuthenticated = true;
			DEBUG("sasl: Authenticated with mechanism [" << m_Mechanisms.GetCurrent() << "]");
		} else if (sLine.Token(1).Equals("904") || sLine.Token(1).Equals("905")) {
			DEBUG("sasl: Mechanism [" << m_Mechanisms.GetCurrent() << "] failed.");
			PutModule(m_Mechanisms.GetCurrent() + " mechanism failed.");

			if (m_Mechanisms.HasNext()) {
				m_Mechanisms.IncrementIndex();
				PutIRC("AUTHENTICATE " + m_Mechanisms.GetCurrent());
			} else {
				CheckRequireAuth();
				m_pNetwork->GetIRCSock()->ResumeCap();
			}
		} else if (sLine.Token(1).Equals("906")) {
			/* CAP wasn't paused? */
			DEBUG("sasl: Reached 906.");
			CheckRequireAuth();
		} else if (sLine.Token(1).Equals("907")) {
			m_bAuthenticated = true;
			m_pNetwork->GetIRCSock()->ResumeCap();
			DEBUG("sasl: Received 907 -- We are already registered");
		} else {
			return CONTINUE;
		}

		return HALT;
	}
开发者ID:ConorOG,项目名称:znc,代码行数:33,代码来源:sasl.cpp


示例18: OnClientDisconnect

	virtual void OnClientDisconnect() {
		if (!m_pUser->GetAllClients().empty())
			return;
		for (VCString::iterator it = m_vPerform.begin();
			it != m_vPerform.end();  it++) {
			PutIRC(GetUser()->ExpandString(*it));
		}
	}
开发者ID:Xe,项目名称:dotfiles,代码行数:8,代码来源:antiperform.cpp


示例19: OnUserRaw

	virtual EModRet OnUserRaw(CString& sLine) {
		CString sCmd = sLine.Token(0);

		if (sCmd.Equals("AWAY")) {
			if (m_pClient->IsAway()) {
				m_pClient->SetAway(false);
				m_pClient->PutClient(":irc.znc.in 305 " + m_pClient->GetNick() + " :You are no longer marked as being away");

				if (m_pNetwork) {
					const vector<CChan*>& vChans = m_pNetwork->GetChans();
					vector<CChan*>::const_iterator it;

					for (it = vChans.begin(); it != vChans.end(); ++it) {
						// Skip channels which are detached or we don't use keepbuffer
						if (!(*it)->IsDetached() && (*it)->AutoClearChanBuffer()) {
							(*it)->ClearBuffer();
						}
					}

					m_pNetwork->ClearQueryBuffer();

					if (GetAutoAway() && m_pNetwork->IsIRCAway()) {
						PutIRC("AWAY");
					}
				}
			} else {
				m_pClient->SetAway(true);
				m_pClient->PutClient(":irc.znc.in 306 " + m_pClient->GetNick() + " :You have been marked as being away");

				if (GetAutoAway() && m_pNetwork && !m_pNetwork->IsIRCAway() && !m_pNetwork->IsUserOnline()) {
					// Use the supplied reason if there was one
					CString sAwayReason = sLine.Token(1, true).TrimPrefix_n();

					if (sAwayReason.empty()) {
						sAwayReason = GetAwayReason();
					}

					PutIRC("AWAY :" + sAwayReason);
				}
			}

			return HALTCORE;
		}

		return CONTINUE;
	}
开发者ID:rask330,项目名称:znc-contrib,代码行数:46,代码来源:clientaway.cpp


示例20: Handle

	void Handle(const CString& sNick) {
		if (m_Messaged.HasItem(sNick))
			return;

		if (m_pUser->IsUserAttached())
			return;

		m_Messaged.AddItem(sNick);
		PutIRC("PRIVMSG " + sNick + " :" + GetReply());
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:10,代码来源:autoreply.cpp



注:本文中的PutIRC函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PutLhsVar函数代码示例发布时间:2022-05-30
下一篇:
C++ PutEventLog函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap