2020-09-16 18:34:24 +02:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2020-09-18 15:51:15 +02:00
|
|
|
/*********** PARTIAL MESSAGES **************/
|
2020-09-18 13:57:38 +02:00
|
|
|
|
|
|
|
message PositionMessage {
|
|
|
|
int32 x = 1;
|
|
|
|
int32 y = 2;
|
|
|
|
enum Direction {
|
|
|
|
UP = 0;
|
|
|
|
RIGHT = 1;
|
|
|
|
DOWN = 2;
|
|
|
|
LEFT = 3;
|
|
|
|
}
|
|
|
|
Direction direction = 3;
|
|
|
|
bool moving = 4;
|
|
|
|
}
|
|
|
|
|
2020-09-18 17:47:18 +02:00
|
|
|
message PointMessage {
|
|
|
|
int32 x = 1;
|
|
|
|
int32 y = 2;
|
|
|
|
}
|
|
|
|
|
2020-09-18 13:57:38 +02:00
|
|
|
message ViewportMessage {
|
|
|
|
int32 left = 1;
|
|
|
|
int32 top = 2;
|
|
|
|
int32 right = 3;
|
|
|
|
int32 bottom = 4;
|
|
|
|
}
|
|
|
|
|
2020-09-18 15:51:15 +02:00
|
|
|
/*********** CLIENT TO SERVER MESSAGES *************/
|
|
|
|
|
|
|
|
message SetPlayerDetailsMessage {
|
|
|
|
string name = 1;
|
|
|
|
repeated string characterLayers = 2;
|
|
|
|
}
|
|
|
|
|
2020-09-18 13:57:38 +02:00
|
|
|
message UserMovesMessage {
|
|
|
|
PositionMessage position = 1;
|
|
|
|
ViewportMessage viewport = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*********** SERVER TO CLIENT MESSAGES *************/
|
|
|
|
|
|
|
|
message UserMovedMessage {
|
|
|
|
int32 userId = 1;
|
|
|
|
PositionMessage position = 2;
|
|
|
|
}
|
2020-09-18 15:51:15 +02:00
|
|
|
|
|
|
|
message SubMessage {
|
|
|
|
oneof message {
|
|
|
|
UserMovedMessage userMovedMessage = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message BatchMessage {
|
|
|
|
string event = 1;
|
|
|
|
repeated SubMessage payload = 2;
|
|
|
|
}
|
2020-09-18 17:47:18 +02:00
|
|
|
|
|
|
|
message GroupUpdateMessage {
|
|
|
|
int32 groupId = 1;
|
|
|
|
PointMessage position = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GroupDeleteMessage {
|
|
|
|
int32 groupId = 1;
|
|
|
|
}
|