本文整理汇总了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;
}
示例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;
}
示例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));
}
示例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));
}
}
示例5: Window
void
RosterView::UnlinkUser(UserID *removed_user)
{
Window()->Lock();
uint32 index = FindUser(removed_user);
if (index >= 0) RemoveItem(index);
Window()->Unlock();
}
示例6: FindUser
void SessionImpl::AddUser(const UserPtr& newUser)
{
UserPtr existingUser = FindUser(newUser->GetID());
if (!existingUser)
{
m_users.push_back(newUser);
}
}
示例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; }
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例13: FindUser
int ClientManager::packet_broadcasttest_proc(ObjectUser::User* p_user)
{
ObjectUser *pObjectUser = FindUser(p_user->id);
if (pObjectUser != NULL) {
}
return true;
}
示例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);
}
示例15: DelUser
void CUserView::DelUser(CString strIP)
{
//查找指定IP的用户项
int nItem=FindUser(strIP);
if(-1==nItem)
return;
//删除用户
CListCtrl &theCtrl=GetListCtrl();
theCtrl.DeleteItem(nItem);
}