-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.proto
112 lines (93 loc) · 2.12 KB
/
game.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
syntax = "proto3";
package gameproto.v1;
option go_package = "proto";
message SessionRequest {
string username = 1;
string password = 2;
}
message SessionGrant {
string uuid = 1;
string reason = 2;
}
enum Types {
SYSTEM = 0;
MAP = 1;
CHAT = 2;
OTHER = 99;
}
message LookAroundRequest {
string myuuid = 1;
string otheruuid = 2;
Types type = 3;
}
message LookAroundAnswer {
repeated Object results = 1;
Types type = 2;
}
message ObjectAttribute {
string name = 1;
string currentvalue = 2;
string targetvalue = 3;
int32 ttl = 4;
}
message Object {
string uuid = 1;
int32 x = 2;
int32 y = 3;
repeated ObjectAttribute attributes = 4;
}
message EntityCreated {
uint32 timestamp = 1;
uint32 id = 2;
}
message EntityDestroyed {
uint32 timestamp = 1;
uint32 id = 2;
}
message Vector2 {
float x = 1;
float y = 2;
}
message Rotation {
uint32 timestamp = 1;
float angle = 2;
}
message EntityMotionState {
uint32 timestamp = 1;
uint32 id = 2;
Vector2 position = 3;
float rotation = 4;
Vector2 velocity = 5;
}
//Used to represent visual appearance of an object
message EntitySkin {
uint32 timestamp = 1;
uint32 id = 2;
uint32 skin = 3;
}
enum ActionType {
FIRE_PRIMARY = 0;
}
message ActionRecord {
uint32 timestamp = 1;
ActionType action = 2;
}
message Ack{
bool success=1;
}
message Timestamp{
uint32 value =1;
}
service Session {
rpc NewSession (SessionRequest) returns (SessionGrant);
rpc LookAround (stream LookAroundRequest) returns (stream LookAroundAnswer);
rpc CommandSetRotation (Rotation) returns (Ack);
rpc CommandSetMoveDirection (Rotation) returns (Ack);
rpc CommandStartMove (Timestamp) returns (Ack);
rpc CommandEndMove (Timestamp) returns (Ack);
rpc CommandStartAction (ActionRecord) returns (Ack);
rpc CommandEndAction (ActionRecord) returns (Ack);
rpc GetEntitySkin (Timestamp) returns (EntitySkin);
rpc GetMotionState (Timestamp) returns (EntityMotionState);
rpc GetMotionStateStream (Timestamp) returns (stream EntityMotionState);
}