public/protocol/gamehall/game.proto

580 lines
17 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package gamehall;
option go_package = "mongo.games.com/game/protocol/gamehall";
//操作结果
enum OpResultCode_Game {
OPRC_Sucess_Game = 0; //成功
OPRC_Error_Game = 1; //失败
OPRC_RoomNotExist_Game = 1016; //房间不存在
OPRC_GameNotExist_Game = 1017; //游戏不存在
OPRC_GameHadClosed = 1018; //暂未开放
OPRC_RoomIsFull_Game = 1019; //房间已满
OPRC_RoomHadExist_Game = 1020; //已经创建过房间了
OPRC_GameStarting_Game = 1022; //抱歉,战斗已经开始,不能再加入了
OPRC_CannotWatchReasonInOther_Game = 1024; //你在别的场里,不能进去观看
OPRC_MoneyNotEnough_Game = 1040; //钻石不够了
OPRC_CannotWatchReasonRoomNotStart_Game = 1042; //房间未开始,不能进去观看
OPRC_OnlyAllowClubMemberEnter_Game = 1043; //只允许俱乐部成员进入
OPRC_YourResVerIsLow_Game = 1044; //资源版本过低
OPRC_YourAppVerIsLow_Game = 1045; //APK版本过低
OPRC_ScenePosFull_Game = 1048; //位置满了不能再坐人
OPRC_SceneEnterForWatcher_Game = 1050; //可以进入观战
OPRC_RoomHadClosed_Game = 1053; //牌局已结束,正在结算
OPRC_SceneServerMaintain_Game = 1054; //服务器维护中,请稍后创建
OPRC_SameIpForbid_Game = 1055; //同ip不可进
OPRC_CoinNotEnough_Game = 1056; //金币不足
OPRC_CoinTooMore_Game = 1058; //金币太多了,请换高倍场
OPRC_InOtherGameIng_Game = 1059; //正在进行其他游戏,请稍等
OPRC_OpYield_Game = 1082; //操作被挂起
OPRC_AllocRoomIdFailed_Game = 1097; //房间id获取失败
OPRC_PrivateRoomCountLimit_Game = 1098; //私人房间上限
OPRC_RoomNotExit = 1099; // 已经不在房间了
OPRC_MatchAudience = 1100; // 不在比赛观战白名单
OPRC_PasswordError = 1101; //密码错误
OPRC_CostNotEnough = 1102; //房卡不足
OPRC_LowerRice_ScenceMax_Game = 1075; //超过最大下米数量
OPRC_LowerRice_PlayerMax_Game = 1076; //超过单个用户最大下米数
OPRC_LowerRice_PlayerDownMax_Game = 1077;
OPRC_YourAreGamingCannotLeave_Game = 1078;
OPRC_ThirdPltProcessing_Game = 1096; //三方平台正在处理中
OPRC_RoomGameTimes_Game = 1103;//超过最大游戏次数
OPRC_MustBindPromoter_Game = 1113; //必须绑定推广员
Oprc_Club_ClubIsClose_Game = 5023; //俱乐部没有开放
//DG
OPRC_Dg_RegistErr_Game = 9000;
OPRC_Dg_LoginErr_Game = 9001;
OPRC_Dg_PlatErr_Game = 9002;
OPRC_Dg_QuotaNotEnough_Game = 9003; //平台DG配额不足
OPRC_Thr_GameClose_Game = 9010; //游戏维护中
}
enum GameHallPacketID {
// client -> worldsrv 协议
// 消息id 2200-2319
// 弃用消息号
PACKET_GameHall_ZERO = 0;
// 创建房间
PACKET_CS_CREATEROOM = 2202;
PACKET_SC_CREATEROOM = 2203;
// 进入房间
PACKET_CS_ENTERROOM = 2204;
PACKET_SC_ENTERROOM = 2205;
// 返回房间
PACKET_CS_RETURNROOM = 2206;
PACKET_SC_RETURNROOM = 2207;
// 进入游戏
PACKET_CS_ENTERGAME = 2209;
PACKET_SC_ENTERGAME = 2210;
// 退出游戏
PACKET_CS_QUITGAME = 2211;
PACKET_SC_QUITGAME = 2212;
// 获取游戏分场配置
PACKET_CS_GETGAMECONFIG = 2231;
PACKET_SC_GETGAMECONFIG = 2232;
// 修改游戏开关
PACKET_SC_CHANGEGAMESTATUS = 2233;
// 充值弹框协议
PACKET_SC_PLAYERRECHARGEANSWER = 2258;
// 创建竞技馆私人房
PACKET_CS_CREATEPRIVATEROOM = 2272;
PACKET_SC_CREATEPRIVATEROOM = 2273;
// 查询竞技馆私人房列表
PACKET_CS_GETPRIVATEROOMLIST = 2274;
PACKET_SC_GETPRIVATEROOMLIST = 2275;
// 查询自由桌房间列表
PACKET_CS_QUERYROOMINFO = 2280;
PACKET_SC_QUERYROOMINFO = 2281;
// 同步房间下注状态
PACKET_SC_GAMESTATE = 2285;
// 观众进入房间
PACKET_CS_AUDIENCE_ENTERROOM = 2208;
// 观众坐下
PACKET_CS_AUDIENCESIT = 2293;
PACKET_SC_AUDIENCESIT = 2294;
// 公告
PACKET_CS_COMNOTICE = 2295;
PACKET_SC_COMNOTICE = 2296;
// 界面入口开关
PACKET_SC_CHANGEENTRYSWITCH = 2297;
// 公告更新
PACKET_SC_NoticeChange = 2298;
// 保持更新
PACKET_CSTouchType = 2299;
// 竞技馆房间信息
PACKET_CSRoomConfig = 2300;
PACKET_SCRoomConfig = 2301;
// 启动招募
PACKET_CSRoomRecruit = 2302;
PACKET_SCRoomRecruit = 2303;
// 邀请加入房间
PACKET_CSInviteJoinRoom = 2304;
PACKET_SCInviteJoinRoom = 2305;
// client -> gamesrv 协议
// 消息id 8000~8099
// 离开房间
PACKET_CS_LEAVEROOM = 8001;
PACKET_SC_LEAVEROOM = 8002;
// 解散房间
PACKET_CS_DESTROYROOM = 8003;
PACKET_SC_DESTROYROOM = 8004;
// 强制开始
PACKET_CS_FORCESTART = 8005;
PACKET_SC_FORCESTART = 8006;
// 观众离开房间
PACKET_CS_AUDIENCE_LEAVEROOM = 8007;
// 玩家切换标志,暂离状态
PACKET_CS_PLAYER_SWITCHFLAG = 8008;
// 房间事件,互动表情
PACKET_CSRoomEvent = 8009;
PACKET_SCRoomEvent = 8010;
}
//PACKET_CS_CREATEROOM
message CSCreateRoom{
int32 GameId = 1; //游戏模式
int32 BaseCoin = 2; //底分(tienlen)
int32 SceneMode = 3;//牌桌类型 0.公共 2.私人
int32 MaxPlayerNum = 4;//人数(tienlen)
// 房间参数
// 例如,十三水 参数规则定义在 data/gameconfig/thirteenfree.json中的Params,按Params声明顺序传参数
// [0,0,30,50,0] 4人自动摆牌30秒底分50没有癞子
// [1,1,90,50000,1] 8人手动摆牌90秒底分50000有癞子
repeated int32 Params = 5;
int32 Id = 6; // gamefreeid
}
//PACKET_SC_CREATEROOM
message SCCreateRoom{
int32 GameId = 1; //游戏模式
int32 BaseCoin = 2; //底分
int32 SceneMode = 3;//牌桌类型 0.公共 2.私人
int32 MaxPlayerNum = 4;//人数
repeated int32 Params = 5; //场参数
OpResultCode_Game OpRetCode = 6; //结果
}
//PACKET_CS_ENTERROOM
//PACKET_CS_AUDIENCE_ENTERROOM
//玩家请求进入游戏
message CSEnterRoom{
int32 RoomId = 1; //房间编号
int32 GameId = 2; //游戏编号, 不需要了
string Password = 3; //房间密码
}
//PACKET_SC_ENTERROOM
message SCEnterRoom{
int32 GameId = 1; //游戏ID
int32 ModeType = 2; //游戏模式(玩法,已经不用了)
repeated int32 Params = 3; //场参数
int32 RoomId = 4; //房间编号
int32 HallId = 5; //厅id
OpResultCode_Game OpRetCode = 6; //结果
int32 ClubId = 7;
int32 GameFreeId = 8; //游戏场次id
}
//PACKET_CS_RETURNROOM
message CSReturnRoom{
int32 ApkVer = 1;
int32 ResVer = 2;
bool IsLoaded = 3;
int32 RoomId = 4;
//int32 LogicId = 5; //这个字段是冗余的
}
//PACKET_SC_RETURNROOM
message SCReturnRoom{
OpResultCode_Game OpRetCode = 1; //结果
int32 RoomId = 2; //房间ID
int32 GameId = 3; //游戏ID
int32 ModeType = 4; //场类型
repeated int32 Params = 5; //场参数
int32 HallId = 6; //厅id
int32 MinApkVer = 7; //最低apk版本号
int32 LatestApkVer = 8;//最新apk版本号
int32 MinResVer = 9; //最低资源版本号
int32 LatestResVer = 10;//最新资源版本号
bool IsLoaded = 11; //加载完成标记
int32 ClubId = 12;
}
//PACKET_CS_ENTERGAME
message CSEnterGame {
int32 Id = 1; //游戏id
repeated int32 OpParams = 2;
string Platform = 3;
int32 ApkVer = 4;
int32 ResVer = 5;
}
//PACKET_SC_ENTERGAME
message SCEnterGame {
OpResultCode_Game OpCode = 1; //操作码
int32 Id = 2; //
repeated int32 OpParams = 3;
int32 MinApkVer = 4; //最低apk版本号
int32 LatestApkVer = 5; //最新apk版本号
int32 MinResVer = 6; //最低资源版本号
int32 LatestResVer = 7; //最新资源版本号
}
//PACKET_CS_QUITGAME
message CSQuitGame {
int32 Id = 1; //游戏id
bool IsAudience = 2; //是否是观众
}
//PACKET_SC_QUITGAME
message SCQuitGame {
OpResultCode_Game OpCode = 1; //操作码
int32 Id = 2;
int32 Reason = 3;//原因
}
message GameConfig1{
int32 LogicId = 1; //对应DB_GameFree.xlsx中的id
int64 LimitCoin = 2; //进房下限
int64 MaxCoinLimit = 3;//入场上限
int32 BaseScore = 4; //底分
repeated int64 OtherIntParams = 5; //其他参数
int32 BetScore = 6; //押注限制
repeated int32 MaxBetCoin = 7; //多门押注限制
int32 MatchMode = 8;//0:默认1:队列
int64 LotteryCoin = 9;//彩金池
string LotteryCfg = 10;//彩金池配置
bool Status = 11; //游戏开关 全局开关&&平台开关
int32 SceneType = 12; // 场次类型
repeated int32 ChessGradeLimit =13; // 入场象棋积分限制区间
int32 RankType = 14; // 段位类型
int32 SceneAdd = 15; // 场次加成
}
//PACKET_CS_GETGAMECONFIG
message CSGetGameConfig {
string Platform = 1; //平台
string Channel = 2; //渠道号
int32 GameId = 3; //游戏id
}
message ChessRankInfo {
int32 Score = 1; // 积分
string Name = 2; // 段位名称
}
//PACKET_SC_GETGAMECONFIG
message SCGetGameConfig {
repeated GameConfig1 GameCfg = 1;//指定游戏的配置信息
int32 GameId = 2; //游戏Id
repeated ChessRankInfo ChessRanks = 3; //段位表
}
//PACKET_SC_CHANGEGAMESTATUS == 2233
message SCChangeGameStatus {
repeated GameConfig1 GameCfg = 1; //全局游戏状态发生变动,且自身平台游戏转台处于开启
}
//PACKET_SC_CHANGEENTRYSWITCH
message SCChangeEntrySwitch {
int32 Index = 1; // 游戏id
repeated bool Switch = 2; // 0游戏入口开关 1hot开关 2new开关
}
//创建竞技馆私人房间
//PACKET_CS_CREATEPRIVATEROOM
message CSCreatePrivateRoom{
int32 GameFreeId = 1; //游戏id
int32 RoomTypeId = 2; //房间类型id
int32 RoomConfigId = 3; //房间配置id
int32 Round = 4; //局数
int32 PlayerNum = 5; //人数
int32 NeedPassword = 6; //是否需要密码 1需要
int32 CostType = 7; // 房卡支付方式 1AA 2房主
int32 Voice = 8; //是否开启语音 1开启
}
//PACKET_SC_CREATEPRIVATEROOM
message SCCreatePrivateRoom{
OpResultCode_Game OpRetCode = 1; //结果
int32 GameFreeId = 2; //游戏id
int32 RoomTypeId = 3; //房间类型id
int32 RoomConfigId = 4; //房间配置id
int32 Round = 5; //局数
int32 PlayerNum = 6; //人数
int32 NeedPassword = 7; //是否需要密码 1需要
int32 CostType = 8; //房卡支付方式 1AA 2房主
int32 Voice = 9; //是否开启语音 1开启
int32 RoomId = 10; //房间id
string Password = 11; //房间密码
}
//PACKET_CS_GETPRIVATEROOMLIST
message CSGetPrivateRoomList{
int32 RoomConfigId = 1; //房间配置id
int32 GameFreeId = 2; // 场次id
int32 RoomId = 3; // 房间id
int32 RoomTypeId = 4; // 玩法类型id
}
message PrivatePlayerInfo{
int32 SnId = 1; // 玩家id
string Name = 2; // 玩家昵称
int32 UseRoleId = 3;//使用的人物模型id
}
//个人创建的房间信息
message PrivateRoomInfo{
int32 GameFreeId = 1; //场次id
int32 GameId = 2; //游戏id
int32 RoomTypeId = 3; //玩法类型id
int32 RoomConfigId = 4; //房间配置id
int32 RoomId = 5; //房间号
int32 NeedPassword = 6; //是否需要密码 1是
int32 CurrRound = 7; //当前第几轮
int32 MaxRound = 8; //最大轮数
int32 CurrNum = 9; //当前人数
int32 MaxPlayer = 10; //最大人数
int64 CreateTs = 11; //创建时间戳
int32 State = 12; //房间状态 0等待中 1进行中 2已结束
repeated PrivatePlayerInfo Players = 13; //玩家列表
bool IsSystem = 14; //是否系统创建
int32 WinSnId = 15; //赢家id
string WinName = 16; //赢家昵称
int32 WinRoleId = 17; //赢家人物模型id
}
//PACKET_SC_GETPRIVATEROOMLIST
message SCGetPrivateRoomList{
int32 Tp = 1; // 0所有配置 1更新 2新增 3删除
repeated PrivateRoomInfo Datas = 2; //房间列表
}
//PACKET_CS_QUERYROOMINFO
message CSQueryRoomInfo{
repeated int32 GameIds = 1;
int32 GameSite = 2; //1.初级 2.中级 3.高级
repeated int32 Id = 3; //gamefreeid
int32 SceneMode = 4; // 0公共房 2私人房
}
//自由桌房间信息
message QRoomInfo{
int32 GameFreeId = 1; //游戏id
int32 GameId = 2;
int32 RoomId = 3; //房间编号
int64 BaseCoin = 4;
int64 LimitCoin = 5;
int32 CurrNum = 6; //当前人数
int32 MaxPlayer = 7; //最大人数
int32 Creator = 8;
int32 CreateTs = 9; //创建时间戳
repeated int32 Params = 10; // 建房参数
}
//PACKET_SC_QUERYROOMINFO
message SCQueryRoomInfo{
repeated int32 GameIds = 1;
int32 GameSite = 2; //1.初级 2.中级 3.高级
repeated QRoomInfo RoomInfo = 3; //房间列表
OpResultCode_Game OpRetCode = 4; //结果
}
message GameState {
int32 GameFreeId = 1;
int64 Ts = 2;
int32 Sec = 3;
}
//PACKET_SC_GAMESTATE
message SCGameState {
repeated GameState List = 1;
}
//PACKET_CS_AUDIENCESIT
message CSAudienceSit{
int32 RoomId = 1; //房号
}
//PACKET_SC_AUDIENCESIT
message SCAudienceSit{
int32 RoomId = 1; //房号
OpResultCode_Game OpCode = 2; //操作码
}
//PACKET_CS_COMNOTICE
message CSRecordAndNotice{
int32 PageNo = 1; // 页码
int32 PageSize = 2; // 每页数量
int32 Opt = 3; // 操作 0查询公告 1 获取战绩列表 2 获取当日战绩
int64 StartTime = 4;
}
message CommonNotice {
int32 Sort = 1; //排序
string Title = 2; //标题
string Content = 3; //内容
string TypeName = 4;
int32 Type = 5;
int32 StartTime = 6;
int32 EndTime = 7;
string Platform = 8;
int32 CategoryType = 9; // 分类 3轮播 2跑马灯
string ImgUrl = 10;
int32 NoticeId = 11; // id
int32 IsLoop=12;
int32 LoopTime=13;
repeated string OnChannelName = 14;
string Url = 15;
int32 LoopCount = 16;
}
message PlayerRecord {
int32 GameFreeid = 1; // 游戏类型
string GameDetailedLogId = 2; // 游戏记录id
int64 TotalIn = 3; //本局投入
int64 TotalOut = 4; //本局产出
int32 Ts = 5; //记录时间
int32 MatchType = 6; //0.普通场 1.锦标赛 2.冠军赛 3.vip专属
}
//PACKET_SC_COMNOTICE
message SCRecordAndNotice{
OpResultCode_Game OpCode = 1; // 操作码
repeated CommonNotice List = 2; // 公告信息
repeated PlayerRecord Glist = 3; // 战绩
repeated int64 GlistTs = 4; // 战绩日期列表
}
// PACKET_SC_NoticeChange
message SCNoticeChange{}
//PACKET_CS_DESTROYROOM
message CSDestroyRoom{
}
//PACKET_SC_DESTROYROOM
message SCDestroyRoom{
int32 RoomId = 1; //房间编号
OpResultCode_Game OpRetCode = 2; //结果
int32 IsForce = 3; //是否强制销毁
}
//PACKET_CS_LEAVEROOM
//PACKET_CS_AUDIENCE_LEAVEROOM
//玩家离开房间,返回大厅
message CSLeaveRoom{
int32 Mode = 1; //离开方式 0:退出 1:暂离(占着座位,返回大厅)
}
//PACKET_SC_LEAVEROOM
message SCLeaveRoom{
OpResultCode_Game OpRetCode = 1; //结果
int32 Reason = 2;//原因 0:主动退出 1:被踢出
int32 RoomId = 3;//房间ID
int32 Mode = 4;
}
//PACKET_CS_FORCESTART
message CSForceStart{
}
//PACKET_SC_FORCESTART
message SCForceStart{
OpResultCode_Game OpRetCode = 1; //结果
}
//玩家设置标记
//PACKET_CS_PLAYER_SWITCHFLAG
message CSPlayerSwithFlag{
int32 Flag = 1;
int32 Mark = 2; //1:设置 0:取消
}
// PACKET_CSRoomEvent
message CSRoomEvent{
int32 Tp = 1; // 事件类型 1普通消息 2互动表情
string Content = 2; // 内容
repeated int32 Param= 4; // 参数 互动表情Id
}
message SCRoomEvent{
OpResultCode_Game OpCode = 1; // 操作码
int32 Tp = 2; // 类型
int32 Pos = 3; // 发送者位置
string Content = 4; // 内容
repeated int32 Param= 5; // 参数
int64 Ts = 6; // 时间戳
}
message ItemInfo{
int32 Id = 1; // id
int32 Num = 2; // 数量
}
enum DataType{
Zero = 0;
PrivateRoomList = 1; // 竞技馆房间列表 返回消息 PACKET_SC_GETPRIVATEROOMLIST
}
// PACKET_CSTouchType
// 每10秒发送一次,保持更新
message CSTouchType{
DataType Tp = 1; // 保持更新类型
// Tp: Params
// 1: 房间配置id
repeated int32 Params = 3;
}
message RoomConfigInfo{
int32 Id = 2; // 配置id
string Name = 3; // 配置名称
int32 RoomType = 4; // 房间类型id, RoomTypeInfo.Id
int32 On = 5; // 开关 1开启 2关闭
int32 SortId = 6; // 排序ID
repeated ItemInfo Cost = 7; // 进入房间消耗
repeated ItemInfo Reward = 8; // 进入房间奖励
repeated string OnChannelName = 9; // 开启的渠道名称
repeated int32 GameFreeId = 10; // 场次id
repeated int32 Round = 11; // 局数
repeated int32 PlayerNum = 12; // 人数
int32 NeedPassword = 13; // 是否需要密码 1是 2否 3自定义
int32 CostType = 14; // 消耗类型 1AA 2房主 3自定义
int32 Voice = 15; // 是否开启语音 1是 2否 3自定义
string ImageURI = 16; // 奖励图片
}
message RoomTypeInfo{
int32 Id = 1; // id
string Name = 2; // 类型名称
int32 On = 3; // 开关 1开启 2关闭
int32 SortId = 4; // 排序ID
repeated RoomConfigInfo List = 5; // 房间配置列表
}
// PACKET_CSRoomConfig
message CSRoomConfig{}
// PACKET_SCRoomConfig 竞技馆房间配置
message SCRoomConfig{
repeated RoomTypeInfo List = 1;
}
// 房间招募功能
// PACKET_CSRoomRecruit
message CSRoomRecruit{
int32 RoomId = 1; // 房间id
int32 On = 2; // 开关 1开启 2关闭
}
// PACKET_SCRoomRecruit
message SCRoomRecruit{
int32 RoomId = 1; // 房间id
int32 On = 2; // 开关 1开启 2关闭
}
// 邀请加入房间
// PACKET_CSInviteJoinRoom
message CSInviteJoinRoom{
}
// PACKET_SCInviteJoinRoom
message SCInviteJoinRoom{
int32 RoomId = 1; // 房间id
bool IsSystem = 2; // 是否为系统房间
int32 SnId = 3; // 邀请者id
string Name = 4; // 邀请者昵称
int32 UseRoleId = 5; // 邀请者人物模型id
string RoomName = 6; // 房间名称
}