2024-12-10 18:55:23 -05:00
|
|
|
syntax="proto3";
|
|
|
|
|
|
|
|
|
|
package main;
|
|
|
|
|
|
2024-12-10 20:30:51 -05:00
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
message Coordinates {
|
|
|
|
|
double X=1;
|
|
|
|
|
double Y=2;
|
|
|
|
|
}
|
2024-12-10 18:55:23 -05:00
|
|
|
|
|
|
|
|
message ClientData {
|
2024-12-10 22:24:45 -05:00
|
|
|
int32 Id = 1;
|
|
|
|
|
string Address = 2;
|
|
|
|
|
string Name = 3;
|
|
|
|
|
Coordinates coordinates = 4;
|
2024-12-12 07:12:46 -05:00
|
|
|
bool hit = 5;
|
2024-12-10 20:30:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ClientCoordinates {
|
|
|
|
|
string Name = 1;
|
|
|
|
|
Coordinates coordinates = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message AllClients{
|
|
|
|
|
repeated ClientData Clients = 1;
|
2024-12-10 22:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ClientIdentity{
|
|
|
|
|
int32 Id = 1;
|
2024-12-12 07:12:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ClientEnvelope {
|
|
|
|
|
oneof Payload {
|
|
|
|
|
ClientCoordinates coordinates = 1;
|
|
|
|
|
SlapEvent slap = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message SlapEvent {
|
|
|
|
|
bool Slap = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ClientEvent {
|
|
|
|
|
int32 Id = 1;
|
|
|
|
|
bool Connected = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GameEvent {
|
|
|
|
|
int32 Instigator = 1;
|
|
|
|
|
int32 Target = 2;
|
|
|
|
|
bool Slap = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ServerEnvelope {
|
|
|
|
|
oneof Payload {
|
|
|
|
|
ClientIdentity identity = 1;
|
|
|
|
|
AllClients broadcast = 2;
|
|
|
|
|
ClientEvent event = 3;
|
|
|
|
|
GameEvent gameevent = 4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum MessageType {
|
|
|
|
|
MSG_TYPE_BROADCAST = 0;
|
|
|
|
|
MSG_TYPE_IDENTITY = 1;
|
|
|
|
|
MSG_TYPE_COORDINATES = 2;
|
|
|
|
|
}
|
|
|
|
|
|