261 lines
9.5 KiB
Protocol Buffer
261 lines
9.5 KiB
Protocol Buffer
syntax = "proto3";
|
||
package chesstitians;
|
||
option go_package = "mongo.games.com/game/protocol/chesstitians";
|
||
|
||
//操作结果
|
||
enum OpResultCode {
|
||
OPRC_Sucess = 0; //成功
|
||
OPRC_Error = 1; //失败
|
||
}
|
||
|
||
//tienlen
|
||
enum ChesstitiansPacketID {
|
||
PACKET_ChesstitiansZERO = 0;// 弃用消息号
|
||
PACKET_SCChesstitiansRoomInfo = 5470;//房间信息
|
||
PACKET_SCChesstitiansRoomState = 5471;//房间状态
|
||
PACKET_CSChesstitiansPlayerOp = 5472;//玩家操作
|
||
PACKET_SCChesstitiansPlayerOp = 5473;//玩家操作
|
||
PACKET_SCChesstitiansPlayerEnter = 5474;//玩家进入
|
||
PACKET_SCChesstitiansPlayerLeave = 5475;//玩家离开
|
||
PACKET_SCChesstitiansCard = 5476;//发牌
|
||
PACKET_SCChesstitiansGameBilled = 5477;//结算
|
||
PACKET_SCChesstitiansCurOpPos = 5478;//当前操作的玩家位置
|
||
PACKET_SCChesstitiansSmallGameBilled = 5479;//小结算
|
||
PACKET_SCChesstitiansUpdateMasterSnid = 5480;//房主更换
|
||
PACKET_SCChesstitiansUpdateAudienceNum = 5481;//推送观众人数
|
||
PACKET_SCChesstitiansAI = 5482;//AI消息
|
||
PACKET_SCChesstitiansFirstOpPos = 5483;//首出玩家
|
||
PACKET_SCChesstitiansCardTest = 5484;//测试数据
|
||
PACKET_CSChesstitiansPlayerDevOp = 5485;//玩家操作
|
||
PACKET_SCChesstitiansPlayerDevOp = 5486;//玩家操作
|
||
}
|
||
|
||
//玩家信息
|
||
message ChesstitiansPlayerData {
|
||
string Name = 1; //名字
|
||
int32 SnId = 2; //账号
|
||
int32 Head = 3; //头像
|
||
int32 Sex = 4; //性别
|
||
repeated string Params = 5; //其他数据 如:昵称 头像 性别 ip 等
|
||
int64 Coin = 6; //金币
|
||
int32 Pos = 7; //座位位置
|
||
int32 Flag = 8; //二进制标记 详见:数据字典
|
||
int32 Longitude = 9;//经度
|
||
int32 Latitude = 10;//纬度
|
||
string City = 11; //城市 例:伦敦
|
||
int32 LastOp = 12; //如上:玩家操作
|
||
int32 VIP = 13; //玩家VIP等级
|
||
int32 HeadOutLine = 14; //头像框
|
||
int32 NiceId = 15; //靓号[机器人用]
|
||
repeated int32 Cards = 16; //手牌
|
||
int64 CurRoundTotalBet = 17;//本轮押注已押的金币
|
||
int64 GameCoin = 18; //游戏内带入的金币
|
||
int32 RoleId = 19; //使用中的角色id
|
||
map<int32, int32>Items = 20;
|
||
int32 MatchRankId = 21;
|
||
int32 Lv = 22;
|
||
int32 CopySnid = 23;//比赛场机器人假snid
|
||
int32 CopyRoleId = 24;//比赛场机器人假角色
|
||
int32 IsBlack = 25; // 黑棋1 白棋0
|
||
int64 ChessGrade = 26; // 象棋积分
|
||
int32 IsWin = 27; //输赢 赢1 输2 平0
|
||
int32 WinTimes = 28; // 连胜次数
|
||
int32 OtherScore = 29; // 额外积分
|
||
int32 NextRank = 30; // 再赢几局可晋级
|
||
int32 WinScore = 31; // 本局积分
|
||
bool IsRob = 32; // 是否机器人
|
||
int64 WinCoin = 33; // 本局输赢金币
|
||
int64 OldChessGrade = 34; // 原来的象棋积分
|
||
int32 TotalTime = 35; // 下棋总时长,单位秒
|
||
int64 Level = 36; //玩家等级
|
||
int64 Exp = 37; //玩家经验值
|
||
}
|
||
|
||
message LastDelCard {
|
||
repeated int32 Cards = 1;
|
||
}
|
||
|
||
//房间信息
|
||
message SCChesstitiansRoomInfo {
|
||
int32 RoomId = 1; //房间id
|
||
int32 Creator = 2; //创建者SnId
|
||
int32 GameId = 3; //游戏id
|
||
int32 RoomMode = 4;//游戏模式
|
||
repeated int32 Params = 5; //规则参数
|
||
int32 BankerPos = 6;//庄家位置
|
||
int32 State = 7; //房间当前状态,如上
|
||
int32 TimeOut = 8; //等待剩余时间 单位:秒
|
||
repeated ChesstitiansPlayerData Players = 9; //房间内的玩家信息
|
||
int32 AudienceNum = 11; //当前观战人数
|
||
int32 CurOpIdx = 12; //当前等待操作的玩家
|
||
repeated LastDelCard LastDelCards = 13; //上两手出的牌
|
||
int32 NumOfGames = 14; //当前局数
|
||
int32 TotalOfGames = 15; //总局数
|
||
int32 MasterSnid = 16;//房主
|
||
int32 BaseScore = 17 ;//游戏底分
|
||
int32 MaxPlayerNum = 18 ;//最大游戏人数
|
||
repeated int32 WinSnids = 19 ;//已出完牌的玩家
|
||
// 比赛场相关
|
||
int32 IsMatch = 20;//0普通场 1锦标赛 2冠军赛
|
||
int32 Round = 22;//比赛当前轮数
|
||
int32 CurPlayerNum = 24;//当前游戏人数
|
||
int32 NextNeed = 25;//前多少名可以晋级下一轮
|
||
int32 MatchFinals = 26;//0晋级赛 1半决赛 2是总决赛
|
||
repeated string Chess = 27; // 棋盘数据
|
||
repeated int32 LastMove = 28; // 上一个操作
|
||
string Act = 29; // 该谁走 "w" | "b"
|
||
repeated bool Castling = 30; // 王车易位可行性 [KQkq]
|
||
int32 Enpassant = 31; // 过路兵idx
|
||
int32 ChessRound = 32; // 当前局回合数
|
||
int32 Variant = 33; // 棋类变体号,对应chess.go
|
||
repeated bool CambodianMove = 34; // 柬埔寨移动可行性 [DEde]
|
||
repeated bool Check = 35; // 将军 [0]w白方将军 [1]b黑方将军
|
||
repeated bool Checkmate = 36; // 将死 [0]w白方将军 [1]b黑方将军
|
||
int32 StepSnId = 37; // 残局计步,发起计步的玩家SnId(StepSnId为0时并且StepLimit大于0时为孤王计步状态)
|
||
int64 StepNum = 38; // 残局或孤王计步起始回合数
|
||
int64 StepLimit = 39; // 残局或孤王计步最大回合数
|
||
int32 DrawSnId = 40; // 玩家求和
|
||
int32 NextSnId = 41; // 再来一局玩家SnId
|
||
int32 GameFreeId = 42;
|
||
int32 SceneType = 43;
|
||
}
|
||
|
||
//房间状态更新
|
||
message SCChesstitiansRoomState {
|
||
int32 State = 1; //房间当前状态
|
||
repeated int64 Params = 2; //参数
|
||
}
|
||
|
||
//玩家操作
|
||
message CSChesstitiansPlayerOp {
|
||
// 1出牌
|
||
// 2过牌
|
||
// 3开始游戏
|
||
// 4投降操作
|
||
// 5测试
|
||
// 6计步操作(1 开始,0结束)
|
||
// 7求和(1请求求和 2拒绝求和 3同意求和 4撤销求和)
|
||
// 8再来一局
|
||
int32 OpCode = 1;
|
||
repeated int64 OpParam = 2;
|
||
}
|
||
message SCChesstitiansPlayerOp {
|
||
int32 OpCode = 1; //1出牌 2过牌 3开始游戏
|
||
repeated int64 OpParam = 2; //参数
|
||
int32 SnId = 3; //玩家位置
|
||
OpResultCode OpRetCode = 4; //返回错误码,详见:enums.proto
|
||
repeated bool Check = 5; // 将军 [0]w白方将军 [1]b黑方将军
|
||
repeated bool Checkmate = 6; // 将死 [0]w白方将军 [1]b黑方将军
|
||
int32 StepSnId = 7; // 残局计步,发起计步的玩家SnId(StepSnId为0时并且StepLimit大于0时为孤王计步状态)
|
||
int64 StepNum = 8; // 残局或孤王计步起始回合数
|
||
int64 StepLimit = 9; // 残局或孤王计步最大回合数
|
||
repeated int32 TotalTime = 10; // 下棋总操作时长,单位秒;第一个是当前玩家的操作时长,第二个是另一个玩家的
|
||
}
|
||
|
||
//玩家进入
|
||
message SCChesstitiansPlayerEnter {
|
||
ChesstitiansPlayerData Data = 1; //玩家数据
|
||
}
|
||
|
||
//玩家离开
|
||
message SCChesstitiansPlayerLeave {
|
||
int32 Pos = 1; //玩家位置
|
||
}
|
||
|
||
//结算结果
|
||
message ChesstitiansPlayerGameBilled {
|
||
int32 SnId = 1; //玩家
|
||
repeated int32 Cards = 2; // 手牌
|
||
int64 WinCoin = 3;//输赢金额
|
||
int64 GameCoin = 4;//结算后身上余额
|
||
int32 IsWin = 5; //输赢 赢1 输2 平0
|
||
int32 WinTimes = 6; // 连胜次数
|
||
int32 OtherScore = 7; // 额外积分
|
||
int32 NextRank = 8; // 再赢几局可晋级
|
||
int32 Score = 9; // 总积分
|
||
int32 WinScore = 10; // 本局积分
|
||
int64 OldChessGrade = 11; // 原来的象棋积分
|
||
}
|
||
|
||
message SCChesstitiansGameBilled {
|
||
repeated ChesstitiansPlayerGameBilled Datas = 1;
|
||
}
|
||
|
||
//小结算结果(炸的分)
|
||
message SCChesstitiansSmallGameBilled {
|
||
int32 WinPos = 1; //赢家
|
||
int64 WinPosCoin = 2;//结算后赢家身上余额
|
||
int32 LosePos = 3; //输家
|
||
int64 LosePosCoin = 4;//结算后输家身上余额
|
||
int64 WinCoin = 5;//赢金额
|
||
int64 LoseCoin = 6;//输金额
|
||
}
|
||
|
||
//发牌
|
||
message SCChesstitiansCard {
|
||
repeated int32 Cards = 1; //手牌
|
||
repeated string Chess = 2; // 棋盘数据
|
||
string Act = 3; // 该谁走 w b
|
||
repeated bool Castling = 4; // 王车易位可行性
|
||
int32 Enpassant = 5; // 过路兵位置
|
||
int32 ChessRound = 6; // 当前回合数
|
||
repeated bool CambodianMove = 7; // 王车易位可行性
|
||
repeated bool Check = 8; // 将军 [0]w白方将军 [1]b黑方将军
|
||
repeated bool Checkmate = 9; // 将死 [0]w白方将军 [1]b黑方将军
|
||
}
|
||
|
||
//测试数据
|
||
message SCChesstitiansCardTest {
|
||
map<int32, int32>Grades = 1;
|
||
int32 Type = 2;//1最小 2随机 3最大
|
||
int64 Totalin = 3; //投入
|
||
int64 Totalout = 4;//产出
|
||
double LoseRate = 5;//赔率
|
||
}
|
||
|
||
message SCChesstitiansCurOpPos{
|
||
int32 Pos = 1; //座位位置
|
||
bool IsNew = 2; //新一轮开始出牌
|
||
repeated int32 Cards = 3; //上家出的牌
|
||
int32 ExDelay = 4; //出牌额外延迟时间(s)
|
||
}
|
||
|
||
message SCChesstitiansUpdateMasterSnid{
|
||
int32 MasterSnid = 1;//房主
|
||
}
|
||
|
||
//PACKET_SCChesstitiansUpdateAudienceNum
|
||
message SCChesstitiansUpdateAudienceNum{
|
||
int32 AudienceNum = 1; //当前观战人数
|
||
}
|
||
message SCChesstitiansAIData {
|
||
int32 Bomb_num = 1; //炸弹数量
|
||
string Card_play_action_seq = 2; //出牌历史记录
|
||
string Last_move_0 = 3; //最后出牌
|
||
string Last_move_1 = 4; //最后出牌
|
||
string Last_move_2 = 5; //最后出牌
|
||
string Last_move_3 = 6; //最后出牌
|
||
int32 Num_cards_left_0 = 7;//剩余牌数
|
||
int32 Num_cards_left_1 = 8;//剩余牌数
|
||
int32 Num_cards_left_2 = 9;//剩余牌数
|
||
int32 Num_cards_left_3 = 10;//剩余牌数
|
||
string Other_hand_cards = 11;//其它人手牌
|
||
string Played_cards_0 = 12; //出过的牌
|
||
string Played_cards_1 = 13; //出过的牌
|
||
string Played_cards_2 = 14; //出过的牌
|
||
string Played_cards_3 = 15; //出过的牌
|
||
string Player_hand_cards = 16;//手牌
|
||
int32 Player_position = 17; //当前操作数置
|
||
}
|
||
|
||
//PACKET_SCChesstitiansFirstOpPos
|
||
message SCChesstitiansFirstOpPos {
|
||
int32 Pos = 1;//座位位置
|
||
}
|
||
|
||
//玩家操作
|
||
message CSChesstitiansPlayerDevOp {
|
||
int32 OpCode = 1; // 1重设棋盘
|
||
repeated string OpParamStr = 2; // 棋盘棋子状态
|
||
int32 curOpIdx = 3; // 当前谁操作
|
||
} |