func_rount.h
1.73 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
73
74
75
76
77
78
79
80
81
82
/********************************************************************
platform:
author: kevin
copyright: All rights reserved.
purpose:
brief: ·Ϣ
*********************************************************************/
#pragma once
#include <libmysql_func_route.h>
#include <common.h>
#include "account.h"
#include "role.h"
#include "event.h"
#include "item.h"
#include "mail.h"
#include "furniture.h"
#include "pet.h"
#include "rank.h"
#include "btl_rank.h"
#include "yesterday_btl_rank.h"
#include "exprie_rank.h"
#define DB_MSG_HANDLE_FUN_PAR USER_ID uid, google::protobuf::Message* msg
DEF_MSG_HANDLE_FUN(Cfunc_route, DB)
class Cfunc_route : public Cfunc_route_base
{
public:
int do_handle_dispatcher(const void* data, uint32_t len, el::lib_tcp_peer_info_t* peer_fd_info);
void init();
void encode_msg2sendbuf(google::protobuf::Message* msg);
int gen_uid(USER_ID& uid);
uint32_t server_id;//S3001=>1
uint32_t platform_id;//S3001=>3
protected:
void init_msg_map();
protected:
//bind cmd and func
#undef BIND_PROTO_CMD
#undef BIND_PROTO_CMD_NO_CB
#define BIND_PROTO_CMD(cmd, fun_name, proto_name)\
int fun_name(DB_MSG_HANDLE_FUN_PAR)
#define BIND_PROTO_CMD_NO_CB(cmd, fun_name, proto_name)\
int fun_name(DB_MSG_HANDLE_FUN_PAR)
#include <db_cmd.h>
#undef BIND_PROTO_CMD
#undef BIND_PROTO_CMD_NO_CB
public:
Cfunc_route(el::lib_mysql_if* db);
account_t account;
role_t role;
event_t user_event;
item_t item;
mail_t mail;
furniture_t furniture;
pet_t pet;
rank_t rank;
btl_rank_t btl_rank;
yesterday_btl_rank_t yesterday_btl_rank;
exprie_rank_t exprie_rank;
DB_MSG_MAP_T m_msgMap;
};
extern std::string g_db_name_pre;
const char* g_gen_db_name(const char* db_name);
extern Cfunc_route* g_route_func;