当前位置: 首页>>代码示例>>C++>>正文


C++ PutModule函数代码示例

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


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

示例1: OnModCommand

	virtual void OnModCommand(const CString& sCmdLine)
	{
		CString sCommand = sCmdLine.Token(0);
		CString sArgs    = sCmdLine.Token(1, true);

		if (sCommand.Equals("setpass"))
		{
			PutModule("Password set to [" + sArgs + "]");
			m_sPassword = CBlowfish::MD5(sArgs);

		} else if (sCommand.Equals("dumpbuff"))
		{
			CString sFile;
			if (DecryptChannel(sArgs, sFile))
			{
				VCString vsLines;
				VCString::iterator it;

				sFile.Split("\n", vsLines);

				for (it = vsLines.begin(); it != vsLines.end(); ++it) {
					CString sLine(*it);
					sLine.Trim();
					PutModule("[" + sLine + "]");
				}
			}
			PutModule("//!-- EOF " + sArgs);
		} else if (sCommand.Equals("replay"))
		{
			Replay(sArgs);
			PutModule("Replayed " + sArgs);

		} else if (sCommand.Equals("save"))
		{
			SaveBufferToDisk();
			PutModule("Done.");
		} else
			PutModule("Unknown command [" + sCommand + "]");
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:39,代码来源:savebuff.cpp

示例2: Timeout

	void Timeout()
	{
		// The timer will be deleted after this by the event loop

		if (GetNV("silent_timeouts") != "yes") {
			PutModule("This module hit a timeout which is possibly a bug.");
			PutModule("Use \"silent yes\" to disable this message.");
			PutModule("Last request: " + m_sLastRequest);
			PutModule("Expected replies: ");

			for (size_t i = 0; m_pReplies[i].szReply != NULL; i++) {
				if (m_pReplies[i].bLastResponse)
					PutModule(m_pReplies[i].szReply +
							CString(" (last)"));
				else
					PutModule(m_pReplies[i].szReply);
			}
		}

		m_pDoing = NULL;
		m_pReplies = NULL;
		SendRequest();
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:23,代码来源:route_replies.cpp

示例3: OnModCommand

	virtual void OnModCommand( const CString& sCommand )
	{
		CString sCmdName = sCommand.Token(0).AsLower();
		if(sCmdName == "set")
		{
			CString sInterval = sCommand.Token(1, true);
			SetInterval(sInterval.ToInt());

			if(m_uiInterval == 0)
				PutModule("AntiIdle is now turned off.");
			else
				PutModule("AntiIdle is now set to " + CString(m_uiInterval) + " seconds.");
		} else if(sCmdName == "off") {
			SetInterval(0);
			PutModule("AntiIdle is now turned off");
		} else if(sCmdName == "show") {
			if(m_uiInterval == 0)
				PutModule("AntiIdle is turned off.");
			else
				PutModule("AntiIdle is set to " + CString(m_uiInterval) + " seconds.");
		} else {
			PutModule("Commands: set, off, show");
		}
	}
开发者ID:jimloco,项目名称:znc,代码行数:24,代码来源:antiidle.cpp

示例4: OnBroadcast

	virtual EModRet OnBroadcast(CString& sMessage) {
		PutModule("------ [" + sMessage + "]");
		sMessage = "======== [" + sMessage + "] ========";
		return CONTINUE;
	}
开发者ID:sorbits,项目名称:znc,代码行数:5,代码来源:sample.cpp

示例5: SendSkypeMsgToIRC

	void SendSkypeMsgToIRC(const CReceivedSkypeMsg *a_msg)
	{
		CString l_msgBuffer;

		if(a_msg->timestamp < time(0) - 120 && !a_msg->edited)
		{
			char l_timeBuf[100];
			strftime(l_timeBuf, 100, "[%a %H:%M:%S] ", localtime(&a_msg->timestamp));
			l_msgBuffer = l_timeBuf;
		}

		if(!a_msg->edited)
		{
			if(a_msg->type == "EMOTED")
			{
				l_msgBuffer += a_msg->fromDispname + " ";
			}
			else
			{
				l_msgBuffer += "<" + a_msg->fromDispname + "> ";
			}

			l_msgBuffer += a_msg->body;
		}
		else
		{
			char l_timeBuf[100];
			strftime(l_timeBuf, 100, "%H:%M:%S", localtime(&a_msg->timestamp));

			if(a_msg->body == "[deleted]")
			{
				l_msgBuffer += "(" + a_msg->fromDispname + " deleted their message from " + CString(l_timeBuf) + ")";
			}
			else
			{
				l_msgBuffer += a_msg->fromDispname + " edited their message from " + CString(l_timeBuf) + ": " + a_msg->body;
			}
		}

		l_msgBuffer.Replace("\r", "");
		l_msgBuffer.Replace("\n", " ");

		for(MCString::iterator it = m_chanNameMap.begin(); it != m_chanNameMap.end(); it++)
		{
			if(it->second.Equals(a_msg->chatName))
			{
				std::wstring l_buffer = Utf8ToWide(l_msgBuffer);
				std::wstring l_line;
				CString l_utfLine;

				do
				{
					l_line = l_buffer.substr(0, 400);
					l_buffer.erase(0, 400);

					if(!l_buffer.empty())
					{
						l_line += L"...";
						l_buffer = L"..." + l_buffer;
					}

					l_utfLine = WideToUtf8(l_line);

					PutIRC("PRIVMSG " + it->first + " :" + l_utfLine);
					PutUser(":" + m_pUser->GetIRCNick().GetNick() + "[email protected] PRIVMSG " + it->first + " :" + l_utfLine);
				} while(!l_buffer.empty());

				return;
			}
		}

		PutModule("WARNING: Group chat " + a_msg->chatName + " not mapped to any channel. A message has been lost.");
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:73,代码来源:modskype.cpp

示例6: OnDevoice

	virtual void OnDevoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {
		PutModule(((bNoChange) ? "[0] [" : "[1] [") + OpNick.GetNick() + "] devoiced [" + Nick.GetNick() + "] on [" + Channel.GetName() + "]");
	}
开发者ID:sorbits,项目名称:znc,代码行数:3,代码来源:sample.cpp

示例7: OnIRCDisconnected

	virtual void OnIRCDisconnected() {
		PutModule("You got disconnected BoyOh.");
	}
开发者ID:sorbits,项目名称:znc,代码行数:3,代码来源:sample.cpp

示例8: ShowSocks

    void ShowSocks(bool bShowHosts) {
        CSockManager& m = CZNC::Get().GetManager();
        if (!m.size()) {
            PutStatus("You have no open sockets.");
            return;
        }

        std::priority_queue<CSocketSorter> socks;

        for (unsigned int a = 0; a < m.size(); a++) {
            socks.push(m[a]);
        }

        CTable Table;
        Table.AddColumn("Name");
        Table.AddColumn("Created");
        Table.AddColumn("State");
#ifdef HAVE_LIBSSL
        Table.AddColumn("SSL");
#endif
        Table.AddColumn("Local");
        Table.AddColumn("Remote");

        while (!socks.empty()) {
            Csock* pSocket = socks.top().GetSock();
            socks.pop();

            Table.AddRow();

            switch (pSocket->GetType()) {
            case Csock::LISTENER:
                Table.SetCell("State", "Listen");
                break;
            case Csock::INBOUND:
                Table.SetCell("State", "Inbound");
                break;
            case Csock::OUTBOUND:
                if (pSocket->IsConnected())
                    Table.SetCell("State", "Outbound");
                else
                    Table.SetCell("State", "Connecting");
                break;
            default:
                Table.SetCell("State", "UNKNOWN");
                break;
            }

            unsigned long long iStartTime = pSocket->GetStartTime();
            time_t iTime = iStartTime / 1000;
            Table.SetCell("Created", FormatTime("%Y-%m-%d %H:%M:%S", iTime));

#ifdef HAVE_LIBSSL
            if (pSocket->GetSSL()) {
                Table.SetCell("SSL", "Yes");
            } else {
                Table.SetCell("SSL", "No");
            }
#endif


            Table.SetCell("Name", pSocket->GetSockName());
            CString sVHost;
            if (bShowHosts) {
                sVHost = pSocket->GetBindHost();
            }
            if (sVHost.empty()) {
                sVHost = pSocket->GetLocalIP();
            }
            Table.SetCell("Local", sVHost + " " + CString(pSocket->GetLocalPort()));

            CString sHost;
            if (!bShowHosts) {
                sHost = pSocket->GetRemoteIP();
            }
            // While connecting, there might be no ip available
            if (sHost.empty()) {
                sHost = pSocket->GetHostName();
            }

            u_short uPort;
            // While connecting, GetRemotePort() would return 0
            if (pSocket->GetType() == Csock::OUTBOUND) {
                uPort = pSocket->GetPort();
            } else {
                uPort = pSocket->GetRemotePort();
            }
            if (uPort != 0) {
                Table.SetCell("Remote", sHost + " " + CString(uPort));
            } else {
                Table.SetCell("Remote", sHost);
            }
        }

        PutModule(Table);
        return;
    }
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:96,代码来源:listsockets.cpp

示例9: SetFile

	void SetFile(const CString& sLine) {
		SetNV("File", sLine.Token(1, true));
		PutModule("File has been set to: " + GetNV("File"));
	}
开发者ID:ConorOG,项目名称:znc,代码行数:4,代码来源:identfile.cpp

示例10: SetCommand

	void SetCommand(const CString& sLine) {
		SetNV("Password", sLine.Token(1, true));
		PutModule("Password set");
	}
开发者ID:KTE,项目名称:znc,代码行数:4,代码来源:nickserv.cpp

示例11: OnRaw

	virtual EModRet OnRaw(CString& sLine) {
		PutModule("IRC -> [" + sLine + "]");
		return CONTINUE;
	}
开发者ID:bpcampbe,项目名称:znc,代码行数:4,代码来源:raw.cpp

示例12: OnModCommand

	virtual void OnModCommand(const CString& sCommand) {
		if (!GetUser()->IsAdmin()) {
			PutModule("Access denied");
			return;
		}

		CString sCmd = sCommand.Token(0);

		if (sCmd.Equals("target")) {
			CString sArg = sCommand.Token(1, true);
			CString sTarget;
			CString sMessage;
			LogMode mode;

			if (sArg.Equals("file")) {
				sTarget = "file";
				sMessage = "Now only logging to file";
				mode = LOG_TO_FILE;
			}
#ifndef _WIN32
			else if (sArg.Equals("syslog")) {
				sTarget = "syslog";
				sMessage = "Now only logging to syslog";
				mode = LOG_TO_SYSLOG;
			} else if (sArg.Equals("both")) {
				sTarget = "both";
				sMessage = "Now logging to file and syslog";
				mode = LOG_TO_BOTH;
			} 
#endif
			else {
				PutModule("Unknown target");
				return;
			}

			Log(sMessage);
			SetNV("target", sTarget);
			m_eLogMode = mode;
			PutModule(sMessage);
		} else if (sCmd.Equals("show")) {
			CString sTarget;

#ifndef _WIN32
			switch (m_eLogMode)
			{
			case LOG_TO_FILE:
				sTarget = "file";
				break;
			case LOG_TO_SYSLOG:
				sTarget = "syslog";
				break;
			case LOG_TO_BOTH:
				sTarget = "both, file and syslog";
				break;
			}
#else
			sTarget = "file";
#endif

			PutModule("Logging is enabled for " + sTarget);
			if (m_eLogMode != LOG_TO_SYSLOG)
				PutModule("Log file will be written to [" + m_sLogFile + "]");
		} else
#ifndef _WIN32
			PutModule("Commands: show, target <file|syslog|both>");
#else
			PutModule("Commands: Only logging to a file is supported on Win32.");
#endif
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:69,代码来源:adminlog.cpp

示例13: GetFile

 void GetFile(const CString& sLine) {
     PutModule(t_f("File is set to: {1}")(GetNV("File")));
 }
开发者ID:BtbN,项目名称:znc,代码行数:3,代码来源:identfile.cpp

示例14: OnShowCommand

	void OnShowCommand(const CString& sCommand) {
		PutModule("Current limit is " + CString(m_iThresholdMsgs) + " CTCPs "
				"in " + CString(m_iThresholdSecs) + " secs");
	}
开发者ID:clem16,项目名称:znc,代码行数:4,代码来源:ctcpflood.cpp

示例15: ViewCommandsCommand

 void ViewCommandsCommand(const CString& sLine) {
     PutModule("IDENTIFY " + GetNV("IdentifyCmd"));
 }
开发者ID:sctigercat1,项目名称:znc,代码行数:3,代码来源:nickserv.cpp


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