-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAsyncGetUserCallback.cpp
More file actions
51 lines (43 loc) · 1.33 KB
/
AsyncGetUserCallback.cpp
File metadata and controls
51 lines (43 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "AsyncGetUserCallback.h"
#include "RouterServer.h"
#include "globe.h"
#include "LogComm.h"
//
using namespace JFGame;
AsyncGetUserCallback::AsyncGetUserCallback(long uid): uid(uid)
{
m_createTime = TNOWMS;
}
AsyncGetUserCallback::~AsyncGetUserCallback()
{
}
void AsyncGetUserCallback::callback_getUser(tars::Int32 ret, const userinfo::GetUserResp &resp)
{
int64_t iCostTime = TNOWMS - m_createTime;
if (iCostTime > COST_MS)
{
ROLLLOG_WARN << "@iCostTime: " << iCostTime << endl;
}
if (ret == 0)
{
auto cs = g_connMap.getCurrent(uid);
if (cs && cs->current)
{
cs->stUser.deviceID = resp.deviceID;
cs->stUser.deviceType = resp.deviceType;
cs->stUser.platform = resp.platform;
cs->stUser.channnelID = resp.channnelID;
cs->stUser.areaID = resp.areaID;
cs->stUser.isRobot = resp.isRobot;
}
ROLLLOG_DEBUG << "get user ok, uid: " << uid << ", resp: " << printTars(resp) << endl;
}
else
{
ROLLLOG_DEBUG << "get user err, uid: " << uid << ", ret: " << ret << endl;
}
}
void AsyncGetUserCallback::callback_getUser_exception(tars::Int32 ret)
{
ROLLLOG_ERROR << "get user exception, uid: " << uid << ", ret: " << ret << endl;
}