-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobalServantImp.h
More file actions
84 lines (70 loc) · 2.34 KB
/
GlobalServantImp.h
File metadata and controls
84 lines (70 loc) · 2.34 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
83
84
#ifndef _GlobalServantImp_H_
#define _GlobalServantImp_H_
#include "servant/Application.h"
#include "GlobalServant.h"
#include "XGameComm.pb.h"
#include "CommonCode.pb.h"
#include "CommonStruct.pb.h"
#include "config.pb.h"
#include "globe.h"
#include "LogComm.h"
#include "JFGameHttpProto.h"
#include "OuterFactoryImp.h"
#include "GlobalProto.h"
#include "global.pb.h"
//
using namespace std;
using namespace JFGame;
using namespace JFGameHttpProto;
using namespace global;
/**
*
*服务接口
*/
class GlobalServantImp : public GlobalServant
{
public:
/**
*
*/
GlobalServantImp();
/**
*
*/
virtual ~GlobalServantImp();
/**
*
*/
virtual void initialize();
/**
*
*/
virtual void destroy();
/**
*
*/
void initializeTimer();
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);
//TCP请求处理接口
virtual tars::Int32 onRequest(tars::Int64 lUin, const std::string &sMsgPack, const std::string &sCurServrantAddr, const JFGame::TClientParam &stClientParam, const JFGame::UserBaseInfoExt &stUserBaseInfo, tars::TarsCurrentPtr current);
//创建信息
virtual tars::Int32 createMessage(const global::CreateMessageReq &req, global::CreateMessageResp &resp, tars::TarsCurrentPtr current);
//处理问题
virtual tars::Int32 processQuest(const global::ProcessQuestReq &req, global::ProcessQuestResp &resp, tars::TarsCurrentPtr current);
public:
// 申诉
tars::Int32 onSendQuest(const XGameComm::TPackage &pkg, const GlobalProto::SendQuestReq &req, const std::string &sCurServrantAddr);
// 消息列表
tars::Int32 onQueryMessage(const XGameComm::TPackage &pkg, const GlobalProto::QueryMessageReq &req, const std::string &sCurServrantAddr);
public:
//时钟周期回调
virtual tars::Int32 doCustomMessage(bool bExpectIdle = false);
private:
//发送消息到客户端
template<typename T>
int toClientPb(const XGameComm::TPackage &tPackage, const std::string &sCurServrantAddr, XGameProto::ActionName actionName, const T &t);
};
/////////////////////////////////////////////////////
#endif