-
Notifications
You must be signed in to change notification settings - Fork 2
/
othello.proto
114 lines (92 loc) · 1.85 KB
/
othello.proto
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
// [START declaration]
syntax = "proto3";
package othello;
// import "google/protobuf/timestamp.proto";
// [END declaration]
// [START java_declaration]
option java_package = "com.bob.othello";
option java_outer_classname = "OthelloProtos";
// [END java_declaration]
// [START csharp_declaration]
option csharp_namespace = "Bob.Protobuf.Othello";
// [END csharp_declaration]
// google.protobuf.Timestamp last_updated = 5;
message ClntMsg {
enum ClntType {
PUT = 0;
}
ClntType type = 15;
uint32 point = 1;
}
message ServerMsg {
enum OrderType {
READY = 0;
START = 1;
TURN = 2;
ACCEPT = 3;
TIMEOUT = 4;
NOPOINT = 5;
GAMEOVER = 6;
ERROR = 7;
}
OrderType type = 15;
Start start = 1;
Turn turn = 2;
Accept accept = 3;
Timeout timeout = 4;
NoPoint nopoint = 5;
GameOver gameover = 6;
Error error = 7;
}
message Turn {
uint32 time_limit = 1;
List opponent_put = 2;
repeated List changed_points = 3;
repeated List available_points = 4;
// optional
OpponentStatus opponent_status = 5;
}
message Start {
InitState init_state = 1;
Color color = 2;
}
message Accept {
uint32 opponent_time_limit = 1;
}
message Timeout {
List auto_put = 1;
repeated List changed_points = 2;
}
message NoPoint {
List opponent_put = 1;
repeated List changed_points = 2;
// optional
OpponentStatus opponent_status = 3; // "timeout"은 가능. "nopoint"는 올 수가 없는게, 양 측 모두 no avail이면 game over다.
}
message GameOver {
Result result = 1;
// optional
List opponent_put = 2;
repeated List changed_points = 3;
}
message Error {
string msg = 1;
}
enum OpponentStatus {
NORMAL = 0;
TIMEOUT = 1;
NOPOINT = 2;
}
enum Color {
EMPTY = 0;
BLACK = 1;
WHITE = 2;
}
enum Result {
LOSE = 0;
WIN = 1;
DRAW = 2;
}
message List {
repeated uint32 item = 1;
}