-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathActivityServantImp.h
More file actions
119 lines (101 loc) · 5.85 KB
/
Copy pathActivityServantImp.h
File metadata and controls
119 lines (101 loc) · 5.85 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef _ActivityServantImp_H_
#define _ActivityServantImp_H_
#include "servant/Application.h"
#include "ActivityServant.h"
#include "Lottery.pb.h"
#include "scratch.pb.h"
#include "Processor.h"
#include "DBOperator.h"
#include "TimerThread.h"
namespace XGameComm
{
class TPackage;
enum MSGTYPE : int;
}
namespace XGameProto
{
enum ActionName : int;
}
namespace Box
{
class BoxProgressRateReq;
class BoxProgressRateResp;
class QueryBoxReq;
class QueryBoxResp;
}
/**
*
*
*/
class ActivityServantImp : public activity::ActivityServant
{
public:
/**
*
*/
virtual ~ActivityServantImp() {}
/**
*
*/
virtual void initialize();
/**
*
*/
void initializeTimer();
virtual void destroy();
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 lotteryGo(const lottery::LotteryReq &req, lottery::LotteryResp &resp, tars::TarsCurrentPtr current);
virtual tars::Int32 queryLotteryDetail(const lottery::QueryLotteryDetailReq &req, lottery::QueryLotteryDetailResp &resp, tars::TarsCurrentPtr current);
//上报成就信息
virtual tars::Int32 reportAchievementInfo(tars::Int64 lUin, tars::Int32 iRank, tars::Int64 lRewardNum, tars::Int32 BetID, tars::Int32 iCondition, tars::TarsCurrentPtr current);
//获取成就信息
virtual tars::Int32 getAchievementInfo(tars::Int64 lUin, map<tars::Int32, tars::Int64>& mapAchievementInfo, tars::TarsCurrentPtr current);
//上报赛季输赢
virtual tars::Int32 reportLeagueStat(tars::Int64 lUin, tars::Int64 lWinNum, tars::Int64 lPumpNum, tars::TarsCurrentPtr current);
//获取赛季信息
virtual tars::Int32 getLeagueInfo(tars::Int64 lUin, tars::TarsCurrentPtr current);
//上报宝箱进度
virtual tars::Int32 reportBoxProgressRate(const Box::BoxProgressRateReq &req, Box::BoxProgressRateResp &resp, tars::TarsCurrentPtr current);
//查询宝箱信息
virtual tars::Int32 queryBox(const Box::QueryBoxReq &req, Box::QueryBoxResp &resp, tars::TarsCurrentPtr current);
//转盘查询
virtual tars::Int32 queryLuckeyWheel(tars::Int64 lUin, LuckeyWheel::QueryLuckeyWheelResp &resp, tars::TarsCurrentPtr current);
private:
/**************************转盘****************************/
tars::Int32 onLotteryGo(const XGameComm::TPackage &pkg, const LotteryProto::LotteryReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
tars::Int32 onQueryLotteryDetail(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
/**************************刮刮乐**************************/
int onQueryScratchDetail(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onGetScratchReward(const XGameComm::TPackage &pkg, const ScratchProto::ScratchRewardReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onObtainScratch(const XGameComm::TPackage &pkg, const ScratchProto::ObtainScratchReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onQueryScratchBoard(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
//成就
int onGetAchievementInfo(const XGameComm::TPackage &pkg, const ScratchProto::QueryAchievementInfoReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onGetAchievementInfo2(const XGameComm::TPackage &pkg, const ScratchProto::QueryAchievementInfoReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onAchievementStatus(const XGameComm::TPackage &pkg, const ScratchProto::AchievementStatusReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onAchievementBoard(const XGameComm::TPackage &pkg, const ScratchProto::QueryAchievementBoardReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onAchievementUnlock(const XGameComm::TPackage &pkg, const ScratchProto::AchievementUnlockReq &req, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
//联赛
int onLeagueBoard(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onGetLeagueRewardInfo(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
int onGetLeagueReward(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, tars::TarsCurrentPtr current);
//转盘
int onQueryLuckyWheel(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, const std::string &msg);
int onLuckyWheelLottery(const XGameComm::TPackage &pkg, const std::string &sCurServrantAddr, const std::string &msg);
void LuckyWhellLog(long uid, int propsId, long propsNum, int type, int lotteryId);
//jackpot
int onJackpotGo(const XGameComm::TPackage &pkg, const ActivityProto::JackpotGoReq &req, ActivityProto::JackpotGoResp &resp);
template<typename T>
int toClientPb(const XGameComm::TPackage &tPackage, const std::string &sCurServrantAddr, XGameProto::ActionName actionName, const T &t);
template<typename T>
int toClientPb(const XGameComm::TPackage &tPackage, const std::string &sCurServrantAddr, XGameProto::ActionName actionName, XGameComm::MSGTYPE type, const T &t);
public:
//时钟周期回调
virtual tars::Int32 doCustomMessage(bool bExpectIdle = false);
private:
//定时器管理
TimerThread m_threadTimer;
};
/////////////////////////////////////////////////////
#endif