-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameDataDef.h
More file actions
178 lines (149 loc) · 5.74 KB
/
GameDataDef.h
File metadata and controls
178 lines (149 loc) · 5.74 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#ifndef __GAME_DATA_DEF_H__
#define __GAME_DATA_DEF_H__
#include <string>
#include <map>
#include <ITableGame.h>
#include "XGameComm.pb.h"
using namespace std;
////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define WEALTH_ERR -1
#define RETCODE_ERR -1
#define TABLEID_ERR -1
#define CHAIRID_ERR -1
#define PLAYERID_ERR -1
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//桌子配置信息
typedef struct _TTableConfInfo
{
int iGameID; //游戏ID
string sRoomID; //房间ID
int iAgentID; //代理ID
int iMaxTableCount; //最大桌子数量
int iMaxSeatCount; //最大游戏玩家数
int iMinSeatCount; //最小可开始游戏玩家数
int iBasePoint; //桌子抵注
int iInitPoint; //游戏初始分数
long lMinGold; //最少携带金币,0表示无限制
long lMaxGold; //最大携带金币,0表示无限制
long lTickoutGold; //低于金币踢出
string sTableRule; //房间规则
string sRoomName; //房间名称
int iReportTime; //房间动态信息上报间隔时间
int iAutoSitTime; //快速开始排队间隔时
int iServiceFee; //服务费
int iRecycLine; //回收线
int iProfit; //盈利抽成的百分比
long bigBlind; //大盲注
long smallBlind; //小盲注
int robotNum; //机器人数量
vector<char> sGameConfig; //游戏玩法配置
CreateGameFunc pfnInitGame; //创建游戏的函数
} TableConfInfo;
//比赛场
typedef struct _MTableConfInfo
{
} MTableConfInfo;
//所有游戏集合
typedef struct _TGameGroup
{
map<std::string, TableConfInfo> mapGameGroup; // 桌子配置集合 @param string-房间ID,TableConfInfo-房间配置信息
} GameGroup;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//消息头数据
typedef struct THeadInfo
{
int iGameID; // 游戏ID
std::string sRoomID; // RoomID
std::string sRoomServerID; // RoomServerID
std::string sPlayerIP; // 客户端ip
std::string sServantAddr; // Router对象地址
THeadInfo(): iGameID(0), sRoomID(""), sRoomServerID(""), sPlayerIP(""), sServantAddr("")
{
}
} HeadInfo;
//消息请求数据
typedef struct TReqInfo
{
long lUID; // 用户ID
short nMsgID; // 推送消息ID
vector<char> vecMsgData;// 推送的数据
} ReqInfo;
//消息返回数据
typedef struct TRespInfo
{
long lUID; // 用户ID
vector<short> vecMsgIDList; //推送消息ID
vector<vector<char> > vecMsgDataList;//推送的数据
} RespInfo;
//请求机器人
typedef struct TReqRobot
{
vector<char> vecMsgData;
} ReqRobot;
//消息
typedef struct _TChatInfo
{
string sChatId;
set<long> uidList;
XGameComm::ChatInfo content;
_TChatInfo() : sChatId("")
{
uidList.clear();
}
} ChatInfo;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//RoomID分段, gameMode游戏模式枚举,可扩展
enum Eum_Game_Mode
{
E_MODE_START = 0, // 开始
E_PRIVATE_ROOM_MODE = 1, // 房卡模式(里面有1 经典 2 AOF 3 短牌 7 奥马哈)
E_MTT_MODE = 4, // 锦标赛
E_SNG_MODE = 5, // 单桌赛
E_CB_ROOM_MODE = 6, // 牛仔
E_BP_MODE = 8, // 大菠萝
E_AOF_MODE = 20, // AOF(无用)
E_QUICK_START_MODE = 21, // 快速场(无用)
E_SUOHA_MODE = 22, // SUOHA(无用)
E_DDZ_MODE = 23, // 斗地主(无用)
E_ROOM_AI_MATCH = 24, // AI比赛(无用)
E_SHORT_DECK_MODE = 25, // 短牌(无用)
E_MJ_MODE = 26, // 二人麻将(无用)
E_HD_MODE = 27, // 百人(无用)
E_MODE_END, // 结束
};
//RoomID分段,screen游戏场次枚举,可扩展
enum Eum_Game_Screen
{
E_SCREEN_START = 0, // 开始
E_PRIMARY_SCREEN = 1, // 初级场
E_MIDDLE_SCREEN = 2, // 中级场
E_HIGH_SCREEN = 3, // 高级场
E_ELITE_SCREEN = 4, // 精英级场
E_SCREEN_END = 9999, // 结束
};
//RoomIDInfo结构
typedef struct _TRoomIDInfo
{
Eum_Game_Mode eGameMode; // 游戏模式
Eum_Game_Screen eGameScreen; // 游戏场次
int iGame; // 游戏
} RoomIDInfo;
typedef struct _TDayStat //每日数据统计
{
int iRoomCount; //房间数
int iMaxOnline; //最高在线
int iCurOnline; //当前在线
long iGameTime; //游戏总时长
long lServiceFee; //抽水
long lInsureBuy; //保险买入
long lInsurePay; //保险赔付
std::set<long> sActivePlayer; //活跃玩家
std::vector<int> vecHourOnline; //每小时在线
_TDayStat(): iRoomCount(0), iMaxOnline(0), iCurOnline(0), iGameTime(0), lServiceFee(0), lInsureBuy(0), lInsurePay(0)
{
sActivePlayer.clear();
vecHourOnline.clear();
}
} DayStat;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // __GAME_DATA_DEF_H__