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

C++ PutModule函数代码示例

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

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



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


示例16: OnRawMode

	virtual void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs) {
		PutModule("* " + OpNick.GetNick() + " sets mode: " + sModes + " " + sArgs + " (" + Channel.GetName() + ")");
	}
开发者ID:sorbits,项目名称:znc,代码行数:3,代码来源:sample.cpp


示例17: Execute

 void Execute(const CString& sCommand) {
     OnIRCConnected();
     PutModule(t_s("perform commands sent"));
 }
开发者ID:GLolol,项目名称:znc,代码行数:4,代码来源:perform.cpp


示例18: SetNSNameCommand

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


示例19: OnModCommand

	virtual void OnModCommand(const CString& sCommand) {
		CString sCmdName = sCommand.Token(0).AsLower();
		if (sCmdName == "add") {
			CString sPerf = sCommand.Token(1, true);

			if (sPerf.empty()) {
				PutModule("Usage: add <command>");
				return;
			}

			if (sPerf.Left(1) == "/")
				sPerf.LeftChomp();

			if (sPerf.Token(0).Equals("MSG")) {
				sPerf = "PRIVMSG " + sPerf.Token(1, true);
			}

			if ((sPerf.Token(0).Equals("PRIVMSG") ||
				sPerf.Token(0).Equals("NOTICE")) &&
				sPerf.Token(2).Left(1) != ":") {
				sPerf = sPerf.Token(0) + " " + sPerf.Token(1)
					+ " :" + sPerf.Token(2, true);
			}
			m_vPerform.push_back(sPerf);
			PutModule("Added!");
			Save();
		} else if (sCmdName == "del") {
			u_int iNum = sCommand.Token(1, true).ToUInt();
			if (iNum > m_vPerform.size() || iNum <= 0) {
				PutModule("Illegal # Requested");
				return;
			} else {
				m_vPerform.erase(m_vPerform.begin() + iNum - 1);
				PutModule("Command Erased.");
			}
			Save();
		} else if (sCmdName == "list") {
			int i = 1;
			CString sExpanded;
			for (VCString::iterator it = m_vPerform.begin(); it != m_vPerform.end(); it++, i++) {
				sExpanded = GetUser()->ExpandString(*it);
				if (sExpanded != *it)
					PutModule(CString(i) + ": " + *it + " (" + sExpanded + ")");
				else
					PutModule(CString(i) + ": " + *it);
			}
			PutModule(" -- End of List");
		} else if (sCmdName == "execute") {
			OnIRCConnected();
			PutModule("perform commands sent");
		} else if (sCmdName == "swap") {
			u_int iNumA = sCommand.Token(1).ToUInt();
			u_int iNumB = sCommand.Token(2).ToUInt();

			if (iNumA > m_vPerform.size() || iNumA <= 0 || iNumB > m_vPerform.size() || iNumB <= 0) {
				PutModule("Illegal # Requested");
			} else {
				std::iter_swap(m_vPerform.begin() + (iNumA - 1), m_vPerform.begin() + (iNumB - 1));
				PutModule("Commands Swapped.");
				Save();
			}
		} else {
			PutModule("Commands: add <command>, del <nr>, list, execute, swap <nr> <nr>");
		}
	}
开发者ID:stevestreza,项目名称:ZNC-Node,代码行数:65,代码来源:perform.cpp


示例20: OnModCommand

	virtual void OnModCommand(const CString& sLine) {
		CString sCommand = sLine.Token(0).AsUpper();

		if (sCommand.Equals("HELP")) {
			PutModule("Commands are: ListUsers, AddChans, DelChans, AddUser, DelUser");
		} else if (sCommand.Equals("TIMERS")) {
			ListTimers();
		} else if (sCommand.Equals("ADDUSER") || sCommand.Equals("DELUSER")) {
			CString sUser = sLine.Token(1);
			CString sHost = sLine.Token(2);
			CString sKey = sLine.Token(3);

			if (sCommand.Equals("ADDUSER")) {
				if (sHost.empty()) {
					PutModule("Usage: " + sCommand + " <user> <hostmask> <key> [channels]");
				} else {
					CAutoOpUser* pUser = AddUser(sUser, sKey, sHost, sLine.Token(4, true));

					if (pUser) {
						SetNV(sUser, pUser->ToString());
					}
				}
			} else {
				DelUser(sUser);
				DelNV(sUser);
			}
		} else if (sCommand.Equals("LISTUSERS")) {
			if (m_msUsers.empty()) {
				PutModule("There are no users defined");
				return;
			}

			CTable Table;

			Table.AddColumn("User");
			Table.AddColumn("Hostmask");
			Table.AddColumn("Key");
			Table.AddColumn("Channels");

			for (map<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
				Table.AddRow();
				Table.SetCell("User", it->second->GetUsername());
				Table.SetCell("Hostmask", it->second->GetHostmask());
				Table.SetCell("Key", it->second->GetUserKey());
				Table.SetCell("Channels", it->second->GetChannels());
			}

			PutModule(Table);
		} else if (sCommand.Equals("ADDCHANS") || sCommand.Equals("DELCHANS")) {
			CString sUser = sLine.Token(1);
			CString sChans = sLine.Token(2, true);

			if (sChans.empty()) {
				PutModule("Usage: " + sCommand + " <user> <channel> [channel] ...");
				return;
			}

			CAutoOpUser* pUser = FindUser(sUser);

			if (!pUser) {
				PutModule("No such user");
				return;
			}

			if (sCommand.Equals("ADDCHANS")) {
				pUser->AddChans(sChans);
				PutModule("Channel(s) added to user [" + pUser->GetUsername() + "]");
			} else {
				pUser->DelChans(sChans);
				PutModule("Channel(s) Removed from user [" + pUser->GetUsername() + "]");
			}

			SetNV(pUser->GetUsername(), pUser->ToString());
		} else {
			PutModule("Unknown command, try HELP");
		}
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:77,代码来源:autoop.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PutMsg函数代码示例发布时间:2022-05-30
下一篇:
C++ PutLhsVar函数代码示例发布时间: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