-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy paths13s.Message.proto
More file actions
116 lines (114 loc) · 4.43 KB
/
s13s.Message.proto
File metadata and controls
116 lines (114 loc) · 4.43 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
syntax = "proto2";
package s13s;
enum SUBID
{
//客户端命令结构
SUB_C_MANUALCARDS = 1; // 手动摆牌 CMD_C_ManualCards
SUB_C_MAKESUREDUNHANDTY = 2; // 确定三墩牌型 CMD_C_MakesureDunHandTy
}
////////////////////////////////////////////////////////////////////////////////
//牌数据
message CardData
{
required bytes cards = 1;
}
////////////////////////////////////////////////////////////////////////////////
//单墩数据
message DunData
{
required int32 id = 1; //标记0-头/1-中/2-尾
required int32 ty = 2; //墩对应普通牌型
required int32 c = 3; //墩对应牌数c(3/5/5)
required bytes cards = 4; //墩牌数据(头敦3张牌/中墩和尾墩各5张牌)
}
////////////////////////////////////////////////////////////////////////////////
//一组墩(含头墩/中墩/尾墩)
message GroupDunData
{
required int32 start = 1; //从哪墩开始的
required int32 specialTy = 2; //总体对应特殊牌型
repeated DunData duns = 3; //[0]头敦(3)/[1]中墩(5)/[2]尾墩(5)
}
////////////////////////////////////////////////////////////////////////////////
//手牌数据
message HandCards
{
required bytes cards = 1; //一副13张手牌
required int32 specialTy = 2; //标记手牌特殊牌型
repeated GroupDunData groups = 3; //枚举几组最优墩(开元或得胜是给了3组,这里给了5组)
}
////////////////////////////////////////////////////////////////////////////////
//枚举牌型
message EnumCards
{
repeated bytes v123sc = 1; //所有同花色五张/三张连续牌(五张/三张同花顺)
repeated bytes v40 = 2; //所有铁支(四张)
repeated bytes v32 = 3; //所有葫芦(一组三条加上一组对子)
repeated bytes vsc = 4; //所有同花五张/三张非连续牌(五张/三张同花)
repeated bytes v123 = 5; //所有非同花五张/三张连续牌(五张/三张顺子)
repeated bytes v30 = 6; //所有三条(三张)
repeated bytes v22 = 7; //所有两对(两个对子)
repeated bytes v20 = 8; //所有对子(一对)
}
////////////////////////////////////////////////////////////////////////////////
//比牌对方
message ComparePlayer
{
required int32 chairId = 1; //座椅ID
required GroupDunData group = 2; //选择一组墩(含头墩/中墩/尾墩)
}
////////////////////////////////////////////////////////////////////////////////
//单墩比输赢
message CompareItem
{
required int32 winLost = 1; //输赢 -1输/0和/1赢
optional int32 score = 2; //赢分+/和分0/输分-
optional int32 ty = 3; //单墩牌型
optional int32 peerTy = 4; //对方单墩牌型
}
////////////////////////////////////////////////////////////////////////////////
//三墩比输赢
message CompareResult
{
repeated CompareItem items = 1; //items[DunMax]
optional int32 shoot = 2; //-1被打枪/0不打枪/1打枪
optional int32 score = 3; //三墩不考虑打枪总输赢 赢分+/和分0/输分-
}
////////////////////////////////////////////////////////////////////////////////
//桌椅玩家
message PlayerItem
{
required int32 chairId = 1; //座椅ID
repeated ComparePlayer peers = 2;//比牌对方
repeated CompareResult results = 3;//比牌结果
optional int32 allshoot = 4;//是否全垒打 -1被全垒打/0无全垒打/1全垒打
optional int32 deltascore = 5;//玩家两两比牌总输赢 赢分+/和分0/输分- 包括打枪/全垒打
}
////////////////////////////////////////////////////////////////////////////////
//游戏开始
message CMD_S_GameStart
{
required HandCards handCards = 1; //手牌数据
};
////////////////////////////////////////////////////////////////////////////////
//手动摆牌
message CMD_S_ManualCards
{
optional EnumCards enums = 1; //枚举牌型
optional int32 dt = 2; //客户端选择了哪一墩,标记0-头/1-中/2-尾
optional int32 ty = 3; //墩对应牌型
optional bytes cpy = 4; //剩余牌
}
////////////////////////////////////////////////////////////////////////////////
//手动摆牌
message CMD_C_ManualCards
{
optional int32 dt = 1; //客户端选择了哪一墩,标记0-头/1-中/2-尾
optional bytes cards = 2; //客户端选择了哪些牌,作为一墩,后端用余牌再计算枚举
}
////////////////////////////////////////////////////////////////////////////////
//确定牌型,所有玩家都确定牌型后比牌
message CMD_C_MakesureDunHandTy
{
required int32 groupindex = 1; //>=0从枚举的几组墩中选择一组,-1手动摆牌确认
}