Commit ddb6ef6e authored by Chunchi Che's avatar Chunchi Che

update proto

parent e99641a1
Pipeline #17756 passed with stage
in 14 seconds
......@@ -31,38 +31,50 @@ message YgoStocMsg {
StocSelectHand stoc_select_hand = 7;
StocHandResult stoc_hand_result = 8;
StocSelectTp stoc_select_tp = 9;
StocDeckCount stoc_deck_count = 10;
StocDuelStart stoc_duel_start = 11;
}
}
// ----- CTOS -----
message CtosPlayerInfo { string name = 1; }
// 玩家信息
message CtosPlayerInfo {
string name = 1; // 玩家昵称
}
// 加入房间
message CtosJoinGame {
int32 version = 1;
int32 gameid = 2;
string passwd = 3;
int32 version = 1; // 客户端/前端版本号
int32 gameid = 2; // 0
string passwd = 3; // 房间密码
}
// 更新卡组
message CtosUpdateDeck {
repeated int32 main = 1;
repeated int32 extra = 2;
repeated int32 side = 3;
repeated int32 main = 1; // 主卡组
repeated int32 extra = 2; // 额外卡组
repeated int32 side = 3; // 副卡组
}
// 准备完毕
message CtosHsReady {}
// 取消准备
message CtosHsNotReady {}
// 选择开始游戏
message CtosHsStart {}
// 猜拳选择
message CtosHandResult { HandType hand = 1; }
// 先后攻选择
message CtosTpResult {
enum TpType {
UNKNOWN = 0;
FIRST = 1;
SECOND = 2;
FIRST = 1; // 先攻
SECOND = 2; // 后攻
}
TpType tp = 1;
......@@ -70,6 +82,8 @@ message CtosTpResult {
// ----- STOC -----
// 服务端告诉前端/客户端已成功加入房间,
// 附带上对局的信息
message StocJoinGame {
int32 lflist = 1;
int32 rule = 2;
......@@ -83,16 +97,19 @@ message StocJoinGame {
int32 time_limit = 10;
}
// 聊天信息
message StocChat {
int32 player = 1;
string msg = 2;
}
// 有玩家进入房间
message StocHsPlayerEnter {
string name = 1;
int32 pos = 2;
}
// 房间状态更新
message StocTypeChange {
enum SelfType {
UNKNOWN = 0;
......@@ -109,14 +126,15 @@ message StocTypeChange {
bool is_host = 2;
}
// 玩家状态更新
message StocHsPlayerChange {
enum State {
UNKNOWN = 0;
MOVE = 1;
READY = 2;
NO_READY = 3;
LEAVE = 4;
TO_OBSERVER = 5;
MOVE = 1; // 位置移动
READY = 2; // 准备完毕
NO_READY = 3; // 取消准备
LEAVE = 4; // 离开房间
TO_OBSERVER = 5; // 到观战席
}
State state = 1;
......@@ -124,18 +142,40 @@ message StocHsPlayerChange {
int32 moved_pos = 3;
}
message StocHsWatchChange { int32 count = 1; }
// 观战者更新
message StocHsWatchChange {
int32 count = 1; // 观战者数量
}
// 提示玩家进行猜拳选择
message StocSelectHand {}
// 双方的猜拳选择
message StocHandResult {
HandType meResult = 1;
HandType opResult = 2;
HandType meResult = 1; // 当前玩家的猜拳选择
HandType opResult = 2; // 对手的猜拳选择
}
// 提示猜拳胜利的玩家进行先后攻选择
message StocSelectTp {}
// 双方的卡组数量
message StocDeckCount {
int32 meMain = 1; // 当前玩家的主卡组数量
int32 meExtra = 2; // 当前玩家的额外卡组数量
int32 meSide = 3; // 当前玩家的副卡组数量
int32 opMain = 4; // 对手的主卡组数量
int32 opExtra = 5; // 对手的额外卡组数量
int32 opSide = 6; // 对手的副卡组数量
}
// 决斗开始!
message StocDuelStart {}
// ----- common structs ------
// 猜拳类型
enum HandType {
UNKNOWN = 0;
SCISSORS = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment