Files
networkzero/server/clientdata.proto

70 lines
1.0 KiB
Protocol Buffer
Raw Normal View History

2024-12-10 18:55:23 -05:00
syntax="proto3";
package main;
option go_package = "./pb";
message Coordinates {
double X=1;
double Y=2;
}
2024-12-10 18:55:23 -05:00
message ClientData {
int32 Id = 1;
string Address = 2;
string Name = 3;
Coordinates coordinates = 4;
2024-12-12 07:12:46 -05:00
bool hit = 5;
}
message ClientCoordinates {
string Name = 1;
Coordinates coordinates = 2;
}
message AllClients{
repeated ClientData Clients = 1;
}
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;
}