forked from voxelize/voxelize
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessages.proto
More file actions
103 lines (88 loc) · 1.63 KB
/
messages.proto
File metadata and controls
103 lines (88 loc) · 1.63 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
syntax = "proto3";
package protocol;
message Geometry {
uint32 voxel = 1;
optional string faceName = 2;
repeated int32 at = 3;
repeated float positions = 4 [packed = true];
repeated float uvs = 5 [packed = true];
repeated int32 indices = 6 [packed = true];
repeated int32 lights = 7 [packed = true];
}
message Mesh {
int32 level = 1;
repeated Geometry geometries = 2;
}
message Chunk {
int32 x = 1;
int32 z = 2;
string id = 3;
repeated Mesh meshes = 4;
repeated uint32 voxels = 5 [packed = true];
repeated uint32 lights = 6 [packed = true];
}
message Peer {
string id = 1;
string username = 2;
string metadata = 3;
}
message Entity {
enum Operation {
CREATE = 0;
DELETE = 1;
UPDATE = 2;
}
Operation operation = 1;
string id = 2;
string type = 3;
string metadata = 4;
}
message Event {
string name = 1;
string payload = 2;
}
message Method {
string name = 1;
string payload = 2;
}
message Update {
int32 vx = 1;
int32 vy = 2;
int32 vz = 3;
uint32 voxel = 4;
uint32 light = 5;
}
message ChatMessage {
string type = 1;
string sender = 2;
string body = 3;
}
message Message {
enum Type {
INIT = 0;
JOIN = 1;
LEAVE = 2;
ERROR = 3;
PEER = 4;
ENTITY = 5;
LOAD = 6;
UNLOAD = 7;
UPDATE = 8;
METHOD = 9;
CHAT = 10;
TRANSPORT = 11;
EVENT = 12;
ACTION = 13;
STATS = 14;
}
Type type = 1;
string json = 2;
string text = 3;
Method method = 4;
ChatMessage chat = 5;
repeated Peer peers = 6;
repeated Entity entities = 7;
repeated Chunk chunks = 8;
repeated Event events = 9;
repeated Update updates = 10;
}