-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobotwinrate.cpp
More file actions
47 lines (41 loc) · 1.39 KB
/
robotwinrate.cpp
File metadata and controls
47 lines (41 loc) · 1.39 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
#include "common/macros.h"
#include "gameroot.h"
#include "context/context.h"
#include "Comm/ITableGame.h"
#include "utils/tarslog.h"
#include "process/process.h"
namespace majong
{
namespace logic
{
namespace roomlogic
{
void SetRobotWinRate(void const *p, GameRoot *root)
{
PERFSTATS_ENTRY();
__TRY__
using namespace RoomSo;
using namespace context;
TRobotDecideRsp const *nnrs = static_cast<TRobotDecideRsp const *>(p);
//DLOG_TRACE("roomid:"<<root->roomid()<<", "<<"TGAME_RobotWRate_E.");
if(!nnrs)
{
//DLOG_TRACE("roomid:"<<root->roomid()<<", "<<"TGAME_RobotWRate_E nnrs is nullptr.");
return;
}
for(auto it : nnrs->robotRate)
{
User *user = root->con->getUserByUid(it.first);
if(!user)
{
continue;
}
user->setRobotUserParam("wRate", "", (it.second / 100.00));
DLOG_TRACE("roomid:"<<root->roomid()<<", "<<"uid:"<< it.first<<", wrate:"<< it.second);
}
__CATCH__
PERFSTATS_EXIT();
}
}
}
}