game_sync/protocol/candy/candy.proto

111 lines
3.8 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 candy;
option go_package = ".;candy";
//糖果
enum CandyPacketID {
PACKET_CANDY_ZERO = 0; //弃用消息号
PACKET_SC_CANDY_ROOMINFO = 5240; //房间信息
PACKET_CS_CANDY_PLAYEROP = 5241; //玩家操作(客户->服务)
PACKET_SC_CANDY_PLAYEROP = 5242; //玩家操作(服务->客户)
PACKET_SC_CANDY_ROOMSTATE = 5243; //房间状态
PACKET_SC_CANDY_GAMEBILLED = 5244; //游戏结算
PACKET_SC_CANDY_GAMEJACKPOT = 5245; //奖池
PACKET_SC_CANDY_PLAYERHISTORY = 5246;//玩家操作记录
}
//操作结果
enum OpResultCode {
OPRC_Sucess = 0; //成功
OPRC_Error = 1; //失败
OPRC_CoinNotEnough = 2; //钱不够
}
message CandyPlayerData {
string Name = 1; //名字
int32 SnId = 2; //账号
int32 Head = 3; //头像
int32 Sex = 4; //性别
int64 Coin = 5; //金币
int32 HeadOutLine = 6; //头像框
int32 VIP = 7;
repeated string Params = 8; //其他数据 如:ip 等
}
//房间信息
message SCCandyRoomInfo {
int32 RoomId = 1; //房间id
int32 Creator = 2; //创建者SnId
int32 GameId = 3; //游戏id
int32 RoomMode = 4; //游戏模式
repeated int32 Params = 5; //规则参数
repeated int32 Cards = 6; //牌数据
int32 State = 7; //房间当前状态
repeated int64 BetLines = 8; //玩家下注选线数组
int32 Chip = 9; //当前选择的押注
repeated CandyPlayerData Players = 10; //房间内的玩家信息
int64 Jackpot = 11; //奖池金额
int64 SpinID = 12; //操作ID
repeated int32 ParamsEx = 13; //其他参数
int32 GameFreeId = 14;
GameBilledData BilledData = 15; //上一局结算信息,用于断线重连
}
//玩家操作
message CSCandyOp {
int32 OpCode = 1; //操作码 0:开始{0押注倍数,1-n选线} 1:玩家记录信息 2:大奖记录
repeated int64 Params = 2; //操作参数
}
//玩家操作返回
message SCCandyOp {
int32 SnId = 1; //玩家ID
int32 OpCode = 2; //操作码
repeated int64 Params = 3; //操作参数
OpResultCode OpRetCode = 4; //操作结果
}
//每条线的结算数据
message CandyLinesInfo {
int32 LineId = 1; //中奖线路20条线路中的一条[1,20]
int32 PrizeId = 2; //中奖Id(暂时忽略)
repeated int32 Position = 3; //中奖位置编号
int64 PrizeValue = 4; //线条奖金
}
message GameBilledData {
repeated int32 SlotsData = 1; //需要翻出的牌数字9个,如:[1, 2, 3, 4, 5, 6, 7, 8, 9,]
repeated CandyLinesInfo PrizeLines = 2; //中奖的结果数组,存每条线的情况
repeated CandyLinesInfo LuckyData = 3; //LuckyData中线数组
int64 TotalPrizeValue = 4; //中奖的总分数
int64 TotalPaylinePrizeValue = 5; //除了爆奖金额之外的线条奖金
int64 TotalJackpotValue = 6; //爆奖金额
int64 Balance = 7; //玩家余额
int64 Jackpot = 8; //奖池金额
int64 ResponseStatus = 9; //状态码
bool IsJackpot = 10; //是否爆奖
}
//发送给客户端的数据 结算
message SCCandyGameBilled {
int64 SpinID = 1; //操作ID
GameBilledData BilledData = 2;//结算信息
}
//房间状态
message SCCandyRoomState {
int32 State = 1; //房间当前状态
}
// 玩家操作记录信息
message CandyPlayerHistoryInfo{
string SpinID = 1; // 操作id
int64 CreatedTime = 2; // 时间
int64 TotalBetValue = 3; // 总下注
int64 TotalPriceValue = 4; // 总赢分
}
// 玩家押注记录
message SCCandyPlayerHistory{
repeated CandyPlayerHistoryInfo PlayerHistory = 1;
}