statisitcs_srv.h
1.15 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
#pragma once
#include <common.h>
#include <proto_header.h>
#include <common_msg.pb.h>
#undef BIND_PROTO_CMD
#undef BIND_PROTO_CMD_NO_CB
#define BIND_PROTO_CMD(cmd, fun_name, proto_name)\
static const CMD_ID statisitcs_##proto_name##_cmd = cmd;
#define BIND_PROTO_CMD_NO_CB(cmd, fun_name, proto_name)\
static const CMD_ID statisitcs_##proto_name##_cmd = cmd;
#include <statisitcs_cmd.h>
#undef BIND_PROTO_CMD
#undef BIND_PROTO_CMD_NO_CB
class statisitcs_t
{
public:
statisitcs_t();
virtual ~statisitcs_t();
void log(USER_ID uid, common_msg::E_STATISTICS_TYPE type);
void log( USER_ID uid, common_msg::E_STATISTICS_TYPE type,
uint32_t expand_param1 );
void log( USER_ID uid, common_msg::E_STATISTICS_TYPE type,
uint32_t expand_param1, uint32_t expand_param2 );
void log( USER_ID uid, common_msg::E_STATISTICS_TYPE type,
uint32_t expand_param1, uint32_t expand_param2, uint32_t expand_param3 );
int send_msg(google::protobuf::Message* msg, USER_ID uid, CMD_ID cmd);
el::lib_tcp_peer_info_t* fd_info;
void offline();
protected:
private:
int send(const void* data, uint32_t len);
server_send_data_t send_msg_buf;
};
extern statisitcs_t* g_statisitcs;