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

C++ GetNV函数代码示例

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

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



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

示例1: 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.AsUpper().find("IDENTIFY") != CString::npos
				&& sMessage.find("help") == CString::npos) {
			MCString msValues;
			msValues["password"] = GetNV("Password");
			PutIRC(CString::NamedFormat(GetNV("IdentifyCmd"), msValues));
		}
	}
开发者ID:Brijen,项目名称:znc,代码行数:19,代码来源:nickserv.cpp


示例2: OnIRCConnecting

    EModRet OnIRCConnecting(CIRCSock* pIRCSock) override {
        if (m_pISpoofLockFile != nullptr) {
            DEBUG("Aborting connection, ident spoof lock file exists");
            PutModule(
                t_s("Aborting connection, another user or network is currently "
                    "connecting and using the ident spoof file"));
            return HALTCORE;
        }

        if (!WriteISpoof()) {
            DEBUG("identfile [" + GetNV("File") + "] could not be written");
            PutModule(
                t_f("[{1}] could not be written, retrying...")(GetNV("File")));
            return HALTCORE;
        }

        SetIRCSock(pIRCSock);
        return CONTINUE;
    }
开发者ID:BtbN,项目名称:znc,代码行数:19,代码来源:identfile.cpp


示例3: SilentCommand

	void SilentCommand(const CString& sLine) {
		const CString sValue = sLine.Token(1);

		if (!sValue.empty()) {
			SetNV("silent_timeouts", sValue);
		}

		CString sPrefix = GetNV("silent_timeouts").ToBool() ? "dis" : "en";
		PutModule("Timeout messages are " + sPrefix + "abled.");
	}
开发者ID:Brijen,项目名称:znc,代码行数:10,代码来源:route_replies.cpp


示例4: CheckRequireAuth

	bool CheckRequireAuth() {
		if (!m_bAuthenticated && GetNV(NV_REQUIRE_AUTH).ToBool()) {
			GetNetwork()->SetIRCConnectEnabled(false);
			PutModule("Disabling network, we require authentication.");
			PutModule("Use 'RequireAuth no' to disable.");
			return true;
		}

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


示例5: GetFake

	CString GetFake(const CString& name) {
		CString stored = GetNV(name);
		
		if(stored.empty()) {
			stored = IncIp();
			SetNV(name, stored);
		}
		
		return CGIIRC_IP_PREFIX + stored;
	}
开发者ID:Googolplexed,项目名称:znc,代码行数:10,代码来源:cgiirc.cpp


示例6: GetMechanismsString

	CString GetMechanismsString() const {
		if (GetNV(NV_MECHANISMS).empty()) {
			CString sDefaults = "";

			for (size_t i = 0; SupportedMechanisms[i].szName != NULL; i++) {
				if (SupportedMechanisms[i].bDefault) {
					if (!sDefaults.empty()) {
						sDefaults += " ";
					}

					sDefaults += SupportedMechanisms[i].szName;
				}
			}

			return sDefaults;
		}

		return GetNV(NV_MECHANISMS);
	}
开发者ID:ConorOG,项目名称:znc,代码行数:19,代码来源:sasl.cpp


示例7: DelCtcp

    void DelCtcp(const CString& sCtcp) {
        // Remove a ctcp request to the ctcp queries we're listening to.
        CString sCtcpNotifier = sCtcp.Token(1).AsUpper();

        if (!GetNV("ctcp_" + sCtcpNotifier).empty()) {
            DelNV("ctcp_" + sCtcpNotifier);
            PutModule("Deleted CTCP notifier: " + sCtcpNotifier);
        } else {
            PutModule("Could not find CTCP notifier: " + sCtcpNotifier);
        }
    }
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:11,代码来源:ctcp_notifier.cpp


示例8: AddCtcp

    void AddCtcp(const CString& sCtcp) {
        // Add a ctcp request from the ctcp queries we're listening to.
        CString sCtcpNotifier = sCtcp.Token(1).AsUpper();

        if (GetNV("ctcp_" + sCtcpNotifier).empty()) {
            SetNV("ctcp_" + sCtcpNotifier, "y");
            PutModule("Added CTCP notifier: " + sCtcpNotifier);
        } else {
            PutModule("CTCP notifier for " + sCtcpNotifier + " was already set.");
        }
    }
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:11,代码来源:ctcp_notifier.cpp


示例9: RequireAuthCommand

    void RequireAuthCommand(const CString& sLine) {
        if (!sLine.Token(1).empty()) {
            SetNV(NV_REQUIRE_AUTH, sLine.Token(1));
        }

        if (GetNV(NV_REQUIRE_AUTH).ToBool()) {
            PutModule("We require SASL negotiation to connect");
        } else {
            PutModule("We will connect even if SASL fails");
        }
    }
开发者ID:DreamBNC,项目名称:znc,代码行数:11,代码来源:sasl.cpp


示例10: OnModCommand

	virtual void OnModCommand(const CString& sCommand) {
		CString sCmd = sCommand.Token(0);
		
		if (sCmd.Equals("settoken")) {
			CString sToken = sCommand.Token(1,true);
			if (!sToken.empty()) {
				if (SetNV("token",sToken)) {
					PutModule("Token [" + sToken + "] setted");
				} else {
					PutModule("Token set error (?)");
				}
				
			} else {
				//PutModule("Usage SetToken <token>");
				if (DelNV("token")) PutModule("Token deleted.");
			}
		} else if (sCmd.Equals("setpassword")) {
			CString sPassw = sCommand.Token(1,true);
			if (!sPassw.empty()) {
				if (SetNV("password",sPassw)) {
					PutModule("Password setted");
				} else {
					PutModule("Password set error (?)");
				}

			} else {
				//PutModule("Usage SetPassword <password>");
				if (DelNV("password")) PutModule("Passwored deleted.");
			}
		} else if (sCmd.Equals("show")) {

			PutModule("Token: [" + GetNV("token") + "]");
			PutModule("Password: [" + GetNV("password") + "]");

		} else if (sCmd.Equals("HELP")) {
			PutModule("Try: Show, SetToken, SetPassword");

		} else {
			PutModule("Unknown command, try 'Help'");
		}
	}
开发者ID:asturel,项目名称:znc_modules,代码行数:41,代码来源:notifier.cpp


示例11: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sMessage)
	{
		if (sArgs.empty())
			m_sPass = GetNV("Password");
		else {
			m_sPass = sArgs;
			SetNV("Password", m_sPass);
			SetArgs("");
		}

		return true;
	}
开发者ID:ZachBeta,项目名称:znc,代码行数:12,代码来源:nickserv.cpp


示例12: OnLoad

    bool OnLoad(const CString& sArgs, CString& sMessage) override {
        if (!sArgs.empty() && sArgs != "<hidden>") {
            SetNV("Password", sArgs);
            SetArgs("<hidden>");
        }

        if (GetNV("IdentifyCmd").empty()) {
            SetNV("IdentifyCmd", "NICKSERV IDENTIFY {password}");
        }

        return true;
    }
开发者ID:sctigercat1,项目名称:znc,代码行数:12,代码来源:nickserv.cpp


示例13: WriteISpoof

    bool WriteISpoof() {
        if (m_pISpoofLockFile != nullptr) {
            return false;
        }

        m_pISpoofLockFile = new CFile;
        if (!m_pISpoofLockFile->TryExLock(GetNV("File"), O_RDWR | O_CREAT)) {
            delete m_pISpoofLockFile;
            m_pISpoofLockFile = nullptr;
            return false;
        }

        char buf[1024];
        memset((char*)buf, 0, 1024);
        m_pISpoofLockFile->Read(buf, 1024);
        m_sOrigISpoof = buf;

        if (!m_pISpoofLockFile->Seek(0) || !m_pISpoofLockFile->Truncate()) {
            delete m_pISpoofLockFile;
            m_pISpoofLockFile = nullptr;
            return false;
        }

        CString sData = ExpandString(GetNV("Format"));

        // If the format doesn't contain anything expandable, we'll
        // assume this is an "old"-style format string.
        if (sData == GetNV("Format")) {
            sData.Replace("%", GetUser()->GetIdent());
        }

        DEBUG("Writing [" + sData + "] to ident spoof file [" +
              m_pISpoofLockFile->GetLongName() + "] for user/network [" +
              GetUser()->GetUserName() + "/" + GetNetwork()->GetName() + "]");

        m_pISpoofLockFile->Write(sData + "\n");

        return true;
    }
开发者ID:BtbN,项目名称:znc,代码行数:39,代码来源:identfile.cpp


示例14: GetReply

	CString GetReply() {
		CString sReply = GetNV("Reply");
		if (sReply.empty()) {
			sReply = "%nick% is currently away, try again later";
			SetReply(sReply);
		}

		if (m_pNetwork) {
			return m_pNetwork->ExpandString(sReply);
		}

		return m_pUser->ExpandString(sReply);
	}
开发者ID:jimloco,项目名称:znc,代码行数:13,代码来源:autoreply.cpp


示例15: GetAwayReason

	CString GetAwayReason() const {
		CString sAway = GetNV("reason");

		if (sAway.empty()) {
			sAway = AWAY_DEFAULT_REASON;
		}

		if (m_pNetwork) {
			return m_pNetwork->ExpandString(sAway);
		}

		return m_pUser->ExpandString(sAway);
	}
开发者ID:rask330,项目名称:znc-contrib,代码行数:13,代码来源:clientaway.cpp


示例16: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sMessage) {
		if (!sArgs.empty())
			m_sFormat = sArgs;
		else
			m_sFormat = GetNV("nick");

		if (m_sFormat.empty()) {
			m_sFormat = "zz_%nick%";
		}

		SetNV("nick", m_sFormat);

		return true;
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:14,代码来源:awaynick.cpp


示例17: PutIRC

void CUrlBufferModule::CheckLineForTrigger(const CString& sMessage, const CString& sTarget)
{
	if(GetNV("enablepublic").ToBool())
	{
		VCString words;
		sMessage.Split(" ", words, false, "", "", true, true);
		for (size_t a = 0; a < words.size(); a++) 
		{
			CString& word = words[a];
			if(word.AsLower() == "!showlinks")
			{
				if(lastUrls.empty())
					PutIRC("PRIVMSG " + sTarget + " :No links were found...");
				else 
				{
					unsigned int maxLinks = GetNV("buffersize").ToUInt();
								
					if (a+1 < words.size())
					{
						unsigned int size = words[a+1].ToUInt();
						if(size!=0 && size<UINT_MAX) //if it was a valid number
							maxLinks = size;
					}
                                        
                    unsigned int maxSize = lastUrls.size()-1;
                    for(unsigned int i=0; i<=maxSize && i<maxLinks; i++)
                    {
                          sleep(1);
                          PutIRC("PRIVMSG " + sTarget + " :" + nicks[maxSize-i] + ": "+ lastUrls[maxSize-i]);
                    }

				}
			}
		}
	}
}
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:36,代码来源:urlbuffer.cpp


示例18: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sMessage) {
		if (!sArgs.empty()) {
			SetNV("Password", sArgs);
			SetArgs("");
		}

		if (GetNV("IdentifyCmd").empty()) {
			SetNV("IdentifyCmd", "PRIVMSG NickServ :IDENTIFY {password}");
		}
		if (GetNV("GhostCmd").empty()) {
			SetNV("GhostCmd", "PRIVMSG NickServ :GHOST {nickname} {password}");
		}
		if (GetNV("RecoverCmd").empty()) {
			SetNV("RecoverCmd", "PRIVMSG NickServ :RECOVER {nickname} {password}");
		}
		if (GetNV("ReleaseCmd").empty()) {
			SetNV("ReleaseCmd", "PRIVMSG NickServ :RELEASE {nickname} {password}");
		}
		if (GetNV("GroupCmd").empty()) {
			SetNV("GroupCmd", "PRIVMSG NickServ :GROUP {nickname} {password}");
		}

		return true;
	}
开发者ID:KTE,项目名称:znc,代码行数:24,代码来源:nickserv.cpp


示例19: OnModCommand

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

		if (sCmd.Equals("SHOW")) {
			PutModule("Current reply is: " + GetNV("Reply")
					+ " (" + GetReply() + ")");
		} else if (sCmd.Equals("SET")) {
			SetReply(sCommand.Token(1, true));
			PutModule("New reply set");
		} else {
			PutModule("Available commands are:");
			PutModule("Show        - Displays the current query reply");
			PutModule("Set <reply> - Sets a new reply");
		}
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:15,代码来源:autoreply.cpp


示例20: OnLoad

	virtual bool OnLoad(const CString & sArgs, CString & sMessage) {
		CString sTarget = GetNV("target");
		if (sTarget.Equals("syslog"))
			m_eLogMode = LOG_TO_SYSLOG;
		else if (sTarget.Equals("both"))
			m_eLogMode = LOG_TO_BOTH;
		else if (sTarget.Equals("file"))
			m_eLogMode = LOG_TO_FILE;
		else
			m_eLogMode = LOG_TO_FILE;

		m_sLogFile = GetSavePath() + "/znc.log";

		Log("Logging started. ZNC PID[" + CString(getpid()) + "] UID/GID[" + CString(getuid()) + ":" + CString(getgid()) + "]");
		return true;
	}
开发者ID:evaryont,项目名称:znc,代码行数:16,代码来源:adminlog.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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