-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.proto
57 lines (46 loc) · 1.01 KB
/
command.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
syntax = "proto3";
option go_package = "dukonggs/protocol";
option java_multiple_files = true;
package protocol;
// The greeting service definition.
service DukongGS {
// Sends a greeting
rpc Login (LoginRequest) returns (stream CommandMessage) {}
rpc StartGame (StartGameRequest) returns (StartGameReply) {}
rpc StopGame (StopGameRequest) returns (StopGameReply) {}
rpc Chat (stream ChatMessage) returns (stream ChatMessage) {}
}
// Login
message LoginRequest {
string name = 1;
}
message CommandMessage {
string gameType = 1;
string session = 2;
string content = 3;
}
// StartGame
message StartGameRequest {
string name = 1;
string gameType = 2;
}
message StartGameReply {
bool success = 1;
string session = 2;
string message = 3;
}
// StopGame
message StopGameRequest {
string name = 1;
string gameType = 2;
string session = 3;
string content = 4;
}
message StopGameReply {
bool success = 1;
string message = 2;
}
message ChatMessage {
string name = 1;
string message = 2;
}