GOingTunneling/tuneller.proto
2024-08-30 19:07:56 +02:00

133 lines
2.5 KiB
Protocol Buffer

syntax = "proto3";
package goingtunneling;
option go_package = "./proto";
message Position {
int32 posX = 1;
int32 posY = 2;
}
message Player {
uint32 playerID = 1;
PlayerLocation location = 2;
}
message PlayerLocation {
Position position = 1;
uint32 orientation = 2;
}
message Bullet {
Position position = 1;
uint32 direction = 2;
Color color = 3;
uint32 id = 4;
bool super = 5;
}
message Color {
uint32 red = 1;
uint32 green = 2;
uint32 blue = 3;
uint32 alpha = 4;
}
message BulletParticle {
Position position = 1;
uint32 expirationTimer = 2;
Color color = 3;
uint32 id = 4;
}
message ServerInfo {
uint32 maxEnergy = 1;
uint32 maxAmmunition = 2;
uint32 maxShields = 3;
uint32 mapWidth = 4;
uint32 mapHeight = 5;
uint32 normalShotCost = 6;
uint32 superShotCost = 7;
uint32 reloadCost = 8;
uint32 movementCost = 9;
uint32 diggingCost = 10;
uint32 shootDiggingBonus = 11;
uint32 shootCooldown = 12;
uint32 rechargeCooldown = 13;
uint32 rechargeOpponentCooldown = 14;
uint32 repairCooldown = 15;
uint32 diggingCooldown = 16;
uint32 movementCooldown = 17;
uint32 movementCooldownNoEnergy = 18;
uint32 diggingCooldownNoEnergy = 19;
uint32 reloadCooldown = 20;
uint32 blastRadius = 21;
uint32 playerID = 22;
uint32 playerColorID = 23;
}
message PlayerUpdate {
uint32 energy = 1;
uint32 ammo = 2;
uint32 shields = 3;
}
message BaseLocation {
Position position = 1;
Player owner = 2;
Color color = 3;
}
message TileUpdate {
Position position = 1;
uint32 kind = 2;
}
message WorldUpdate {
repeated Player players = 1;
repeated BaseLocation base = 2;
repeated Bullet bullets = 3;
repeated BulletParticle bulletParticles = 4;
repeated TileUpdate tileUpdate = 5;
}
message ClientBound {
oneof clientBoundMessage {
ServerInfo serverInfo = 1;
PlayerUpdate playerUpdate = 2;
PlayerLocation playerLocationUpdate = 3;
WorldUpdate worldUpdate = 4;
PlayerStartResponse playerStartResponse = 5;
}
}
message DigBlock {
Position position = 1;
bool isShooting = 2;
}
message Shoot {
bool super = 1;
}
message PlayerAction {
oneof playerAction {
DigBlock digBlock = 1;
Shoot shoot = 2;
}
}
message PlayerStartRequest {
string version = 1;
}
message PlayerStartResponse {
string version = 1;
}
message ServerBound {
oneof serverBoundMessage {
PlayerLocation playerPosition = 1;
PlayerAction playerAction = 2;
PlayerStartRequest playerStartRequest = 3;
}
}