-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGMServantImp.h
More file actions
57 lines (47 loc) · 1.16 KB
/
Copy pathGMServantImp.h
File metadata and controls
57 lines (47 loc) · 1.16 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
#ifndef _GMServantImp_H_
#define _GMServantImp_H_
#include "servant/Application.h"
#include "GMServant.h"
#include <map>
#include <functional>
#include "Define.h"
//namespace gm
//{
// enum E_BUSINESS_TYPE : int;
//}
/**
*
*
*/
class GMServantImp : public gm::GMServant
{
public:
/**
*
*/
virtual ~GMServantImp() {}
/**
*
*/
virtual void initialize();
/**
*
*/
virtual void destroy();
public:
//http请求处理接口
virtual tars::Int32 doRequest(const vector<tars::Char> &reqBuf, const map<std::string, std::string> &extraInfo, vector<tars::Char> &rspBuf, tars::TarsCurrentPtr current);
//配牌器
virtual tars::Int32 getCards(gm::GetCardsResp &resp, tars::TarsCurrentPtr current);
public:
//
int onJsonRequest();
private:
//
void initHandlers();
private:
using HandlerType = std::function<tars::Int32(const vector<tars::Char>& reqBuf, const map<std::string, std::string>& extraInfo, vector<tars::Char>& rspBuf)>;
std::map <int, HandlerType> handlers;
};
/////////////////////////////////////////////////////
#endif