-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathmessage.proto
140 lines (122 loc) · 2.19 KB
/
message.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
syntax = "proto3";
package Message_proto;
import "google/protobuf/timestamp.proto";
message ClientGameMessage {
int32 input_sequence_number = 1;
float time_elapsed = 2;
oneof message {
InitPlayer init_player_payload = 3;
MovePosition move_position_payload = 4;
Shoot shoot_payload = 5;
BuildWall build_wall_payload = 6;
UpdatePlayer update_player_payload = 7;
SetPosition set_position_payload = 8;
}
}
message Ping {
string ping = 1;
}
enum Direction {
UP = 0;
DOWN = 1;
LEFT = 2;
RIGHT = 3;
}
message SetPosition {
int32 id = 1;
float x = 2;
float y = 3;
}
message MovePosition {
int32 id = 1;
float dx = 2;
float dy = 3;
}
message InitPlayer {
int32 id = 1;
int32 client_id = 2; // Client send to server
float x = 3;
float y = 4;
string name = 5;
bool is_main = 6;
}
message Map {
repeated int32 block = 1;
int32 num_cols = 2;
int32 num_rows = 3;
float block_width = 4;
float block_height = 5;
}
message InitAll {
repeated InitPlayer init_player = 1;
Map init_map = 2;
}
message RemovePlayer {
int32 id = 1;
}
message RegisterClientID {
int32 client_id = 1;
}
message Shoot {
enum ShootType {
NORMAL = 0;
}
int64 id = 1;
int32 player_id = 2;
float x = 3;
float y = 4;
float dx = 5;
float dy = 6;
ShootType type = 7;
}
message BuildWall {
int32 id = 1;
int32 x = 2;
int32 y = 3;
}
message UpdatePlayer {
int32 id = 1;
float x = 2;
float y = 3;
float health = 4;
string name = 5;
bool is_destroy = 6;
}
message Player {
int32 id = 1;
float x = 2;
float y = 3;
float health = 4;
float size = 5;
int32 level = 6;
int32 score = 7;
string name = 8;
google.protobuf.Timestamp next_reload = 9;
bool is_destroy = 10;
int32 current_input_number = 11;
}
message ServerGameMessage {
int32 last_process_input = 1;
oneof message {
InitAll init_all_payload = 2;
InitPlayer init_player_payload = 3;
Player update_player_payload = 4;
Shoot init_shoot_payload = 5;
RemovePlayer remove_player_payload = 6;
RegisterClientID register_client_id_payload = 7;
}
}
message WallBlock {
float x = 1;
float y = 2;
}
message Bullet {
int32 player_id = 1;
float sx = 2;
float sy = 3;
float x = 4;
float y = 5;
float dx = 6;
float dy = 7;
float stime = 8;
}