-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetuserinfo.cpp
More file actions
72 lines (64 loc) · 2.35 KB
/
Copy pathgetuserinfo.cpp
File metadata and controls
72 lines (64 loc) · 2.35 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "common/macros.h"
#include "gameroot.h"
#include "context/context.h"
#include "Comm/ITableGame.h"
#include "utils/tarslog.h"
#include "message/sendclientmessage.h"
#include "logic/gamelogic/core/checkbegin.h"
#include "process/process.h"
#include "CommonCode.pb.h"
#include "dz.pb.h"
namespace game
{
namespace logic
{
namespace roomlogic
{
long GetUserInfo(void const *p, GameRoot *root)
{
__TRY__
using namespace RoomSo;
using namespace context;
using namespace message;
using namespace gamelogic;
using namespace process;
//
TGAME_GetUserInfo const *nnrs = static_cast<TGAME_GetUserInfo const *>(p);
//DLOG_TRACE("roomkey:" << root->cfg->getRoomKey()<<", "<<"TGAME_UserInfo_E" << ", uid: " << nnrs->lPlayerID);
//玩家对象
User *user = root->con->getUserByUid(nnrs->lPlayerID);
if (user == NULL)
{
RLOG_DEBUG << "user not exist, uid: " << nnrs->lPlayerID << endl;
return 0;
}
if(nnrs->iType == 1)
{
if(user->getPauseStartTime() > 0 && user->isPause())
{
return user->getPauseEndTime() <= TNOW ? 1 : 0;
}
long holdSeatTime = root->con->getHoldSeatTimeByUid(user->getUid());
if( holdSeatTime > 0)
{
if(holdSeatTime <= TNOW)
{
XGameDZProto::NN_msg2sGameNotice nncm;
nncm.set_inoticetype(XGameRetCode::GAME_HOLD_SEAT_TIMEOUT);
sendClientMessage<XGameDZProto::NN_msg2sGameNotice>(user->getUid(), XGameDZProto::NN_msg2csGameNotice_E, nncm, root);
return 1;
}
return 0;
}
}
else
{
return user->getDZWealth();
}
return 0;
__CATCH__
return 0;
}
}
}
}