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


C++ FindUser函数代码示例

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


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


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