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


C++ CUser::GetUsername方法代码示例

本文整理汇总了C++中CUser::GetUsername方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::GetUsername方法的具体用法?C++ CUser::GetUsername怎么用?C++ CUser::GetUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CUser的用法示例。


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

示例1: InterceptClientMessage

	bool InterceptClientMessage(CClientConnection* Client, int argc, const char** argv) {
		g_Ret = true;

		CUser* User = Client->GetOwner();

		CallBinds(Type_PreScript, NULL, NULL, 0, NULL);

		g_CurrentClient = Client;
		CallBinds(Type_Client, User ? User->GetUsername() : "", Client, argc, argv);
		CallBinds(Type_PostScript, NULL, NULL, 0, NULL);

		return g_Ret;
	}
开发者ID:demize,项目名称:shroudbnc,代码行数:13,代码来源:tickle.cpp

示例2: HandleCallbackClientApprove

void CServerContext::HandleCallbackClientApprove( GSClientApprove_t *pClientApprove )
{
	std::cout << "[SERVER] Back-end approved " << pClientApprove->m_SteamID << std::endl;

	SteamUserMap::iterator iter = clientSteamMap.find( pClientApprove->m_SteamID );
	if( iter != clientSteamMap.end() )
	{
		CUser *user = iter->second;
		std::cout << "[SERVER] User " << *user << " was authed, updating user data." << std::endl;
		gameserver->UpdateUserData(user->GetSteamID(), user->GetUsername().c_str(), 0);

		gameserveritems->LoadItems(user->GetSteamID());
	}
}
开发者ID:Call-of-Duty-Scripts,项目名称:TeknoMW3,代码行数:14,代码来源:CServerContext.cpp

示例3: Block

    bool Block(const CString& sUser) {
        CUser* pUser = CZNC::Get().FindUser(sUser);

        if (!pUser) return false;

        // Disconnect all clients
        vector<CClient*> vpClients = pUser->GetAllClients();
        vector<CClient*>::iterator it;
        for (it = vpClients.begin(); it != vpClients.end(); ++it) {
            (*it)->PutStatusNotice(MESSAGE);
            (*it)->Close(Csock::CLT_AFTERWRITE);
        }

        // Disconnect all networks from irc
        vector<CIRCNetwork*> vNetworks = pUser->GetNetworks();
        for (vector<CIRCNetwork*>::iterator it2 = vNetworks.begin();
             it2 != vNetworks.end(); ++it2) {
            (*it2)->SetIRCConnectEnabled(false);
        }

        SetNV(pUser->GetUsername(), "");
        return true;
    }
开发者ID:aszrul,项目名称:znc,代码行数:23,代码来源:blockuser.cpp

示例4: Build


//.........这里部分代码省略.........
                    bSubmission = true;
                }
            }
        }

        if ((pViewer != NULL) && pViewer->GetIsBannedFromPosting())
        {
            bUpdateWasValid = false;
            sUpdateError = "Not allowed";
            sUpdateType = "restricteduser";
        }

        if ( bUpdateWasValid && bSubmission && bUpdateWasValid )
        {
            bUpdateWasValid  = UpdateUserDetails(pViewer, sUpdateError, sUpdateType);
        }

        bSuccess = bSuccess && InitPage(pWholePage, "USERDETAILS",true);

        // now add the XML for the FORM and its contents
        int iUserID = pViewer->GetUserID();

        CTDVString sUsername;
        //	CTDVString sFirstNames;
        //	CTDVString sLastName;
        CTDVString sEmail;
        CTDVString sPrefSkin;
        int iPrefUserMode;
        int iPrefForumStyle;
        CTDVString sPrefXML;
        CTDVString sSiteSuffix;
        CTDVString sRegion;
        // get the users settings, which may have just been updated...
        bSuccess = bSuccess && pViewer->GetUsername(sUsername);
        //		bSuccess = bSuccess && pViewer->GetFirstNames(sFirstNames);
        //		bSuccess = bSuccess && pViewer->GetLastName(sLastName);
        bSuccess = bSuccess && pViewer->GetEmail(sEmail);
        bSuccess = bSuccess && pViewer->GetPrefSkin(&sPrefSkin);
        bSuccess = bSuccess && pViewer->GetPrefUserMode(&iPrefUserMode);
        bSuccess = bSuccess && pViewer->GetPrefForumStyle(&iPrefForumStyle);
        bSuccess = bSuccess && pViewer->GetPrefXML(&sPrefXML);
        bSuccess = bSuccess && pViewer->GetSiteSuffix(sSiteSuffix);
        bSuccess = bSuccess && pViewer->GetRegion(sRegion);

        // construct the XML for the FORM and then insert it inside the body of the page
        if (bSuccess)
        {
            // TODO: is this the only XML we need to output?
            CTDVString sMessage;
            CTDVString sMessageType = "";

            if (sUpdateError.IsEmpty() && bSubmission)
            {
                sMessage = "Your details have been updated";
                sMessageType="detailsupdated";

            }
            else
            {
                sMessage = sUpdateError;
                sMessageType = sUpdateType;
            }

            // escape all XML sequences in the name fields before showing them in the form
            CXMLObject::EscapeAllXML(&sUsername);
            //		CXMLObject::EscapeAllXML(&sFirstNames);
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:67,代码来源:NewUserDetailsPageBuilder.cpp

示例5: InterceptClientCommand

	bool InterceptClientCommand(CClientConnection* Client, const char* Subcommand, int argc, const char** argv, bool NoticeUser) {
		CUser* User = Client->GetOwner();

		g_NoticeUser = NoticeUser;

		g_CurrentClient = Client;

		g_Ret = true;

		CallBinds(Type_Command, Client->GetOwner()->GetUsername(), Client, argc, argv);

		if (g_Ret && strcasecmp(Subcommand, "help") == 0 && User && User->IsAdmin()) {
			commandlist_t *Commands = Client->GetCommandList();

			AddCommand(Commands, "tcl", "Admin", "executes tcl commands", "Syntax: "
				"tcl command\nExecutes the specified tcl command.");

			g_Ret = false;
		}

		if (g_Ret && strcasecmp(Subcommand, "tcl") == 0 && User && User->IsAdmin()) {
			if (argc <= 1) {
				if (NoticeUser)
					Client->RealNotice("Syntax: tcl :command");
				else
					Client->Privmsg("Syntax: tcl :command");

				return true;
			}

			setctx(User->GetUsername());

			Tcl_DString dsScript;
			const char **argvdup;

			argvdup = ArgDupArray(argv);
			ArgRejoinArray(argvdup, 1);

			g_CurrentClient = Client;

			int Code = Tcl_EvalEx(g_Interp, Tcl_UtfToExternalDString(g_Encoding, argvdup[1], -1, &dsScript),
				-1, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);

			ArgFreeArray(argvdup);

			Tcl_DStringFree(&dsScript);

			Tcl_Obj* Result = Tcl_GetObjResult(g_Interp);

			const char* strResult = Tcl_GetString(Result);

			if (Code == TCL_ERROR) {
				if (NoticeUser)
					Client->RealNotice("An error occured in the tcl script:");
				else
					Client->Privmsg("An error occured in the tcl script:");
			}

			if (strResult && *strResult) {
				Tcl_DString dsResult;

				char* Dup = strdup(Tcl_UtfToExternalDString(g_Encoding, strResult, -1, &dsResult));

				Tcl_DStringFree(&dsResult);

				char* token = strtok(Dup, "\n");

				while (token != NULL) {
					if (NoticeUser)
						Client->RealNotice(*token ? token : "empty string.");
					else
						Client->Privmsg(*token ? token : "empty string.");

					token = strtok(NULL, "\n");
				}

				free(Dup);
			} else {
					if (NoticeUser)
						Client->RealNotice("<no error>");
					else
						Client->Privmsg("<no error>");
			}

			g_Ret = false;
		}

		return !g_Ret;
	}
开发者ID:demize,项目名称:shroudbnc,代码行数:89,代码来源:tickle.cpp


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