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

C++ FindUser函数代码示例

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

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



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

示例1: OnLoad

    virtual bool OnLoad(const CString& sArgs, CString& sMessage) {
        // Load the chans from the command line
        unsigned int a = 0;
        VCString vsChans;
        sArgs.Split(" ", vsChans, false);

        for (VCString::const_iterator it = vsChans.begin(); it != vsChans.end(); ++it) {
            CString sName = "Args";
            sName += CString(a);
            AddUser(sName, "*", *it);
        }

        // Load the saved users
        for (MCString::iterator it = BeginNV(); it != EndNV(); it++) {
            const CString& sLine = it->second;
            CAutoVoiceUser* pUser = new CAutoVoiceUser;

            if (!pUser->FromString(sLine) || FindUser(pUser->GetUsername().AsLower())) {
                delete pUser;
            } else {
                m_msUsers[pUser->GetUsername().AsLower()] = pUser;
            }
        }

        return true;
    }
开发者ID:stevestreza,项目名称:ZNC-Node,代码行数:26,代码来源:autovoice.cpp


示例2: FindUser

int ClientManager::packet_send_msg_proc(ObjectUser::User* p_user)
{
	ObjectUser *pObjectUser = FindUser(p_user->id);

	if (pObjectUser != NULL)
	{
		p_user->id = pObjectUser->sUser_info.id;
		pObjectUser->Set_Msg("org\n");

#if 1
		DWORD writen = 0;

		/* return message by send socket */
		if (WSASend(p_user->id,
			(WSABUF*)&pc_socket_info->dataBuf,
			1,
			(DWORD *)&writen,
			0,
			&pc_socket_info->overlapped,
			NULL) == SOCKET_ERROR) {
			if (WSAGetLastError() != WSA_IO_PENDING) {
				printf("WSASend Error.. [%d] \n", WSAGetLastError());
			}
		}
#endif
		broadcast_userinfo(p_user->id, &pObjectUser->sUser_info);
	}
	return true;
}
开发者ID:wodka12,项目名称:reference_source,代码行数:29,代码来源:ClientManager.cpp


示例3: HandleAuthentication

bool CTCPServerInt::HandleAuthentication(CTCPClient_ptr c, const std::string &username, const std::string &password)
{
	_tRemoteShareUser *pUser=FindUser(username);
	if (pUser==NULL)
		return false;

	return ((pUser->Username==username)&&(pUser->Password==password));
}
开发者ID:clafa,项目名称:domoticz,代码行数:8,代码来源:TCPServer.cpp


示例4: FindUser

void UsersGroup::Join(NetworkDefs::TUiid uuid, std::shared_ptr<IUser> user)
{
    auto existingUser = FindUser(uuid);
    if (!existingUser)
    {
        m_users.emplace(std::make_pair(uuid, user));
    }
}
开发者ID:Stalker7005,项目名称:MySkype,代码行数:8,代码来源:UsersGroup.cpp


示例5: Window

void
RosterView::UnlinkUser(UserID *removed_user)
{
	Window()->Lock();
	uint32 index = FindUser(removed_user);
	if (index >= 0) RemoveItem(index);
	Window()->Unlock();
}
开发者ID:devaspot,项目名称:chat,代码行数:8,代码来源:RosterView.cpp


示例6: FindUser

void SessionImpl::AddUser(const UserPtr& newUser)
{
    UserPtr existingUser = FindUser(newUser->GetID());
    if (!existingUser)
    {
        m_users.push_back(newUser);
    }
}
开发者ID:Darrenbydesign,项目名称:HoloToolkit,代码行数:8,代码来源:SessionImpl.cpp


示例7: if

bool CMac::AddLogin(CString sUsername, CString sPassword, CString sIRCUsername, CString sHost, CString sIdentd)
{	if(FindLogin(sIRCUsername)) return false;
	user *pUser=FindUser(sUsername); if(!pUser) return false;
	if(pUser) if(CheckPassword(sPassword, pUser))
	{	if(pUser->sHost.Compare("")) if(!strstr(sHost.CStr(), pUser->sHost.CStr())) return false;
		login *pLogin=new login; pLogin->pUser=pUser; pLogin->sUsername=sUsername;
		pLogin->sIRCUsername=sIRCUsername; llStart.push_back(pLogin); return true; }
	return false; }
开发者ID:A-Massarella,项目名称:Botnet,代码行数:8,代码来源:mac.cpp


示例8: ms_whois

/*
 * ms_whois - server message handler
 *
 * parv[0] = sender prefix
 * parv[1] = nickname masklist
 *
 * or
 *
 * parv[1] = target server, or a nickname representing a server to target.
 * parv[2] = nickname masklist
 */
int ms_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
  char*           nick;
  char*           tmp;
  char*           p = 0;
  int             found = 0;
  int		  total = 0;

  if (parc < 2)
  {
    send_reply(sptr, ERR_NONICKNAMEGIVEN);
    return 0;
  }

  if (parc > 2)
  {
    if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=
        HUNTED_ISME)
      return 0;
    parv[1] = parv[2];
  }

  total = 0;
  
  for (tmp = parv[1]; (nick = ircd_strtok(&p, tmp, ",")); tmp = 0)
  {
    struct Client *acptr = 0;

    found = 0;
    
    collapse(nick);
    

    acptr = FindUser(nick);
    if (acptr && !IsServer(acptr)) {
      found++;
      do_whois(sptr, acptr, parc);
    }

    if (!found)
      send_reply(sptr, ERR_NOSUCHNICK, nick);
      
    total+=found;
      
    if (total >= MAX_WHOIS_LINES) {
      send_reply(sptr, ERR_QUERYTOOLONG, parv[1]);
      break;
    }
      
    if (p)
      p[-1] = ',';
  } /* of tokenised parm[1] */
  send_reply(sptr, RPL_ENDOFWHOIS, parv[1]);

  return 0;
}
开发者ID:aboutnet,项目名称:ircu-abnet,代码行数:67,代码来源:m_whois.c


示例9: debugLogA

void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
{
	debugLogA("CVkProto::OnReceiveUserInfo %d", reply->resultCode);
	if (reply->resultCode != 200)
		return;

	JSONROOT pRoot;
	JSONNODE *pResponse = CheckJsonResponse(pReq, reply, pRoot);
	if (pResponse == NULL)
		return;

	for (size_t i=0; ; i++) {
		JSONNODE *pRecord = json_at(pResponse, i);
		if (pRecord == NULL) break;

		LONG userid = json_as_int( json_get(pRecord, "uid"));
		if (userid == 0)
			return;

		MCONTACT hContact;
		if (userid == m_myUserId)
			hContact = NULL;
		else if ((hContact = FindUser(userid, false)) == NULL)
			return;

		CMString tszNick;
		ptrT szValue( json_as_string( json_get(pRecord, "first_name")));
		if (szValue) {
			setTString(hContact, "FirstName", szValue);
			tszNick.Append(szValue);
			tszNick.AppendChar(' ');
		}

		if (szValue = json_as_string( json_get(pRecord, "last_name"))) {
			setTString(hContact, "LastName", szValue);
			tszNick.Append(szValue);
		}

		if (!tszNick.IsEmpty())
			setTString(hContact, "Nick", tszNick);
	
		setByte(hContact, "Gender", json_as_int( json_get(pRecord, "sex")) == 2 ? 'M' : 'F');
	
		if (szValue = json_as_string( json_get(pRecord, "bdate"))) {
			int d, m, y;
			if ( _stscanf(szValue, _T("%d.%d.%d"), &d, &m, &y) == 3) {
				setByte(hContact, "BirthDay", d);
				setByte(hContact, "BirthMonth", m);
				setWord(hContact, "BirthYear", y);
			}
		}

		szValue = json_as_string( json_get(pRecord, "photo_medium"));
		SetAvatarUrl(hContact, szValue);
	}
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:56,代码来源:vk_thread.cpp


示例10: EnterCriticalSection

int ClientManager::Recv_Client_Packet(SOCKETINFO* socket_info, BYTE* packet)
{
	EnterCriticalSection(&cs);
	ObjectUser *pObjectUser = FindUser(socket_info->fd);

	//유저 구조체에서 소켓정보 빼올수있는지 실험 -> 성공
	//pc_socket_info = socket_info;
	pc_socket_info = pObjectUser->user_socket_info;

	if (pObjectUser != NULL) {

		CStream* pStream = *pStreamSP;
		/****************/
		/* Open Stream  */
		/****************/
		pStream->StartRead();
		USHORT P_Header = Read_Stream_Header(*pStreamSP, packet);

		switch (P_Header)
		{
		case P_SEND_MSG:
			packet_send_msg_proc(&pObjectUser->sUser_info);
			break;
		case P_MOVE_POS:
			packet_move_proc(&pObjectUser->sUser_info);
			break;
		case P_BROAD_CAST_MSG:
			/* broad casting */
			broadcast_userinfo(pObjectUser->sUser_info.id, &pObjectUser->sUser_info);
			//pClientManager->broadcast_userinfo_zone(sInfo->fd, pOvluser);
			break;
		case P_LOBBY_MSG:
			//recv_packet_user_join_room(pObjectUser->sUser_info.id);
			packet_lobby_proc(pObjectUser, pc_socket_info, pStreamSP);
			break;
		//16.05.31
		case P_CLIENT_TO_SERVER_MSG:
			packet_client_to_server_proc(&pObjectUser->sUser_info, pc_socket_info);
			break;
		//16.06.09
		case P_BATTLE_MSG:
			recv_packet_battle_proc(pObjectUser, pStreamSP);
			break;

		case P_MAX:
			break;
		}
		/****************/
		/* Close Stream */
		/****************/
		pStream->EndRead();
	}
	/* need mutext */
	LeaveCriticalSection(&cs);
	return true;
}
开发者ID:wodka12,项目名称:source,代码行数:56,代码来源:ClientManager.cpp


示例11: foo

void foo()
{
  if (mask && ((mask[0] == '\0') ||
          (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*')))))
	      mask = NULL;
        if ((acptr = FindUser(nick)) &&
	            ((!(bitsel & WHOSELECT_OPER)) || IsAnOper(acptr)) &&
		                Process(acptr) && SHOW_MORE(sptr, counter))
        mask = NULL;
}
开发者ID:Distrotech,项目名称:indent,代码行数:10,代码来源:brackets.c


示例12: lock

UINT16 CUserMgr::CkUser(UINT32 &dwUserID, TCHAR *pszZoneName, UINT8  byAuthType, UINT8  byAuthMethod, UINT32 dwPlayerID, UINT16 wCareerID, TCHAR* pszUserName, TCHAR* pszPasswd, TCHAR* pszDeviceID, TCHAR* pszNotifyID, UINT16 wZoneID, UINT32 dwCliVer)
{
    CSDMutexLock lock(m_oMutex);
    CUser* poUser = FindUser(dwPlayerID);
    if(NULL == poUser)
    {
        return ERR_COMMON::ID_OTHER_ERR;
    }
    return poUser->CkUser(dwUserID, pszZoneName, dwPlayerID, byAuthType, byAuthMethod, pszUserName, pszPasswd, pszDeviceID, pszNotifyID, wCareerID, wZoneID, dwCliVer);
}
开发者ID:mildrock,项目名称:dummy,代码行数:10,代码来源:usermgr.cpp


示例13: FindUser

int ClientManager::packet_broadcasttest_proc(ObjectUser::User* p_user)
{
	ObjectUser *pObjectUser = FindUser(p_user->id);

	if (pObjectUser != NULL) {

	}

	return true;
}
开发者ID:wodka12,项目名称:source,代码行数:10,代码来源:ClientManager.cpp


示例14: FindUser

void COmokRoom::SendTo(SOCKET you, const char* str, int msglen)
{
	EVENTSOCKET* temp = FindUser(you);
	if(temp == NULL)
		return ;

	SOCKET s = temp->sSocket;
	send(s, str, msglen, 0);

}
开发者ID:shepherd44,项目名称:bitstudy,代码行数:10,代码来源:RoomInfo.cpp


示例15: DelUser

void CUserView::DelUser(CString strIP)
{
    //查找指定IP的用户项
    int nItem=FindUser(strIP);
    if(-1==nItem)
        return;
    //删除用户
    CListCtrl &theCtrl=GetListCtrl();
    theCtrl.DeleteItem(nItem);

}
开发者ID:zhangruizhru,项目名称:FeiQ,代码行数:11,代码来源:UserView.cpp


示例16: m_uid

 ///////////////////////////////////////////////////////////////////////
 // Constructor: CEvPasswd
 //
 //       Author: $author$
 //         Date: 7/23/2009
 ///////////////////////////////////////////////////////////////////////
 CEvPasswd
 (const char* chars=0,
  LONG length=-1)
 : m_uid(INVALID_UID),
   m_gid(INVALID_GID)
 {
     EvError error;
     if (chars)
     if ((error = FindUser(chars, length)))
         throw(error);
 }
开发者ID:medusade,项目名称:mxde,代码行数:17,代码来源:cevpasswd.hpp


示例17: debugLogA

MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT* psr)
{
	debugLogA("CVkProto::AddToList");

	int uid = _ttoi(psr->id.t);
	if (!uid)
		return NULL;

	MCONTACT hContact = FindUser(uid, true);
	RetrieveUserInfo(uid);
	return hContact;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:12,代码来源:vk_proto.cpp


示例18: l

    void IRCChannel::SendMsg(string m) {
        IRCLine l("PRIVMSG",m);
        l.params.push_back(name);
      
        client.SendIRCLine(l);

        MessageEventArg arg;
        arg.user = FindUser(client.GetNick());
        arg.channel = this;
        arg.message = m;

        msgEvent.Notify(arg);
    }
开发者ID:OpenEngineDK,项目名称:extensions-IRC,代码行数:13,代码来源:IRCChannel.cpp


示例19: main

int main(){
//Kamus Lokal
	int Y;
	int i,j;
	int input;
	List tes;
	InfoUser X,Z;
	adrUser usr; 

//Algoritma
	/*
	Load(&tes);
	usr=FirstUser(tes);
	for(i=1;i<10;i++)PrintUser(usr,i);
	usr=NextUser(usr);
	for(i=1;i<10;i++)PrintUser(usr,i);
	*/
	CreateList(&tes);
	printf("List Kosong : %d\n",IsListEmpty (tes));
	printf("Masukkan nama user \n");
	scanf("%s",&X.usr);	
	printf("%s\n", X.usr);
	InsVUser(&tes,X);
	scanf("%s",&Z.usr);	
	InsVUser(&tes,Z);
	usr = FindUser(&tes,X);
	printf("%x\n",usr);
	j=-1;
	for (i=0;i<10;i++){
		j=j*-1;
		InsVScore(usr,j*i*100000,0);	
		InsVScore(usr,j*i*j*100000,1);
		InsVScore(usr,j*i*i*100000,2);
		InsVScore(usr,j*i*100000,3);
		InsVScore(usr,j*i*100000,4);
		InsVScore(usr,j*i*100000,5);
		InsVScore(usr,j*i*100000,6);
		InsVScore(usr,j*i*100000,7);
	}
			PrintUser(usr,0);
	usr=NextUser(usr);
	for (i=10;i>=0;i--){
		j=j*-1;
		InsVScore(usr,j*i*100000,0);
		InsVScore(usr,j*i*j*100000,1);	
	}
				PrintUser(usr,0);
	Save(tes);

	return 0;
}
开发者ID:muhammadnizami,项目名称:tubes-alstruk-wordament,代码行数:51,代码来源:mainmlistv5.c


示例20: FindUser

	std::tuple<ERROR_CODE, User*> UserManager::GetUser(const int sessionIndex)
	{
		auto pUser = FindUser(sessionIndex);

		if (pUser == nullptr) {
			return{ std::tuple<ERROR_CODE, User*> {ERROR_CODE::USER_MGR_INVALID_SESSION_INDEX, nullptr} };
		}

		if (pUser->IsConfirm() == false) {
			return{ std::tuple<ERROR_CODE, User*>{ERROR_CODE::USER_MGR_NOT_CONFIRM_USER, nullptr} };
		}

		return{ std::tuple<ERROR_CODE, User*>{ERROR_CODE::NONE, pUser} };
	}
开发者ID:inho9377,项目名称:GameServerPractice,代码行数:14,代码来源:UserManager.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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