Skip to content

Instantly share code, notes, and snippets.

@LasseSkogland
Last active March 12, 2017 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LasseSkogland/5396de629489ceda26419c4dad9e90f0 to your computer and use it in GitHub Desktop.
Save LasseSkogland/5396de629489ceda26419c4dad9e90f0 to your computer and use it in GitHub Desktop.
Rust Mega Proto
// Hand-Written, not generated
syntax = "proto3";
message Vector3Serialized {
float x = 1;
float y = 2;
float z = 3;
}
message RaySerialized {
Vector3Serialized origin = 1;
Vector3Serialized direction = 2;
}
enum RespawnType {
SleepingBagType = 0;
BedType = 1;
}
syntax = "proto3";
import "imports.proto"; // Added post-generate
message InputMessage {
int32 buttons = 1;
Vector3Serialized aimAngles = 2;
}
message PlayerTick {
InputMessage inputState = 1;
Vector3Serialized position = 2;
ModelState modelState = 4;
uint32 activeItem = 5;
Vector3Serialized eyePos = 6;
}
message ModelState {
float waterLevel = 4;
Vector3Serialized lookDir = 10;
int32 flags = 11;
}
message EffectData {
uint32 type = 1;
uint32 pooledstringid = 2;
int32 number = 3;
Vector3Serialized origin = 4;
Vector3Serialized normal = 5;
float scale = 6;
uint32 entity = 7;
uint32 bone = 8;
uint64 source = 9;
}
message Entity {
BaseNetworkable baseNetworkable = 1;
BaseEntity baseEntity = 2;
BasePlayer basePlayer = 3;
WorldItem worldItem = 4;
BaseResource resource = 5;
BuildingBlock buildingBlock = 6;
Environment environment = 7;
Corpse corpse = 8;
ParentInfo parent = 10;
KeyLock keyLock = 11;
CodeLock codeLock = 12;
EntitySlots entitySlots = 13;
BuildingPrivilege buildingPrivilege = 14;
StorageBox storageBox = 15;
HeldEntity heldEntity = 16;
BaseProjectile baseProjectile = 17;
BaseNPC baseNPC = 18;
Loot loot = 19;
GenericSpawner genericSpawner = 20;
SleepingBag sleepingBag = 21;
LootableCorpse lootableCorpse = 22;
Sign sign = 23;
BaseCombat baseCombat = 24;
MapEntity mapEntity = 25;
ResearchTable researchTable = 26;
DudExplosive dudExplosive = 27;
MiningQuarry miningQuarry = 28;
PlantEntity plantEntity = 29;
Helicopter helicopter = 30;
Landmine landmine = 31;
AutoTurret autoturret = 32;
SphereEntity sphereEntity = 33;
StabilityEntity stabilityEntity = 34;
OwnerInfo ownerInfo = 35;
DecayEntity decayEntity = 36;
Spawnable spawnable = 37;
ServerGib servergib = 38;
VendingMachine vendingMachine = 39;
bool createdThisFrame = 100;
}
message BaseNetworkable {
uint32 uid = 1;
uint32 group = 2;
uint32 prefabID = 3;
}
message BaseEntity {
Vector3Serialized pos = 1;
Vector3Serialized rot = 2;
int32 flags = 3;
uint64 skinid = 5;
}
message BaseCombat {
int32 state = 1;
float health = 2;
}
message BaseNPC {
uint32 state = 1;
}
message EntitySlots {
uint32 slotLock = 1;
uint32 slotFireMod = 2;
uint32 slotUpperModification = 3;
}
message BaseResource {
int32 stage = 1;
float health = 2;
}
message Environment {
int64 dateTime = 1;
float clouds = 2;
float fog = 3;
float wind = 4;
float rain = 5;
}
message Corpse {
uint32 parentID = 1;
}
message LootableCorpse {
LootableCorpsePrivate privateData = 1; // Originally was Private, would cause errors
uint64 playerID = 2;
string playerName = 3;
}
message ParentInfo {
uint32 uid = 1;
uint32 bone = 2;
}
message BuildingBlock {
int32 grade = 2;
bool beingDemolished = 3;
float stability = 4;
uint32 buildingID = 5;
}
message WorldItem {
Item item = 1;
}
message KeyLock {
int32 code = 1;
}
message CodeLock {
CodeLockPrivate pv = 1; // Originally was Private, would cause errors
bool hasCode = 2;
bool hasGuestCode = 3;
}
message BuildingPrivilege {
repeated PlayerNameID users = 1;
}
message StorageBox {
ItemContainer contents = 1;
}
message HeldEntity {
uint32 itemUID = 1;
}
message Loot {
ItemContainer contents = 1;
}
message GenericSpawner {
repeated SpawnedEnt ents = 1;
}
message SleepingBag {
string name = 1;
SleepingBagPrivate privateData = 2; // Originally was Private, would cause errors
uint64 deployerID = 3;
}
message Magazine {
int32 capacity = 1;
int32 contents = 2;
int32 ammoType = 3;
}
message BaseProjectile {
Magazine primaryMagazine = 1;
}
message Sign {
uint32 imageid = 3;
}
message MapEntity {
repeated uint32 fogImages = 1;
repeated uint32 paintImages = 2;
}
message ResearchTable {
float researchTimeLeft = 1;
}
message DudExplosive {
float fuseTimeLeft = 1;
}
message ResourceExtractor {
ItemContainer fuelContents = 1;
ItemContainer outputContents = 2;
}
message MiningQuarry {
ResourceExtractor extractor = 1;
}
message PlantEntity {
int32 state = 1;
float age = 2;
int32 genetics = 3;
int32 water = 4;
float healthy = 5;
}
message Landmine {
uint64 triggeredID = 1;
}
message Helicopter {
Vector3Serialized tiltRot = 1;
Vector3Serialized leftGun = 2;
Vector3Serialized rightGun = 3;
Vector3Serialized spotlightVec = 4;
repeated float weakspothealths = 5;
}
message ServerGib {
string gibName = 1;
}
message AutoTurret {
Vector3Serialized aimPos = 1;
Vector3Serialized aimDir = 2;
uint32 targetID = 3;
repeated PlayerNameID users = 4;
}
message SphereEntity {
float radius = 1;
}
message StabilityEntity {
float stability = 1;
int32 distanceFromGround = 2;
}
message OwnerInfo {
uint64 steamid = 1;
}
message DecayEntity {
float decayTimer = 1;
}
message Spawnable {
uint32 population = 1;
}
message VendingMachine {
SellOrderContainer sellOrderContainer = 1;
}
message ItemContainer {
uint32 UID = 1;
int32 slots = 2;
float temperature = 3;
int32 flags = 4;
int32 allowedContents = 5;
int32 maxStackSize = 6;
int32 allowedItem = 7;
repeated int32 availableSlots = 8;
repeated Item contents = 100;
}
message Item {
uint32 UID = 1;
int32 itemid = 2;
int32 slot = 3;
int32 amount = 4;
int32 flags = 5;
float removetime = 6;
float locktime = 7;
uint32 worldEntity = 8;
InstanceData instanceData = 9;
uint32 heldEntity = 10;
ConditionData conditionData = 11;
string name = 14;
string text = 15;
uint64 skinid = 16;
ItemContainer contents = 100;
}
message BasePlayer {
string name = 1;
uint64 userid = 2;
PlayerInventory inventory = 3;
PlayerMetabolism metabolism = 4;
ModelState modelState = 6;
int32 playerFlags = 7;
uint32 heldEntity = 8;
float health = 9;
PersistantPlayer persistantData = 10;
float skinCol = 15;
float skinTex = 16;
float skinMesh = 17;
PlayerLifeStory currentLife = 20;
PlayerLifeStory previousLife = 21;
}
message PlayerMetabolism {
float health = 1;
float calories = 2;
float hydration = 3;
float heartrate = 4;
float temperature = 5;
float poison = 6;
float radiation_level = 7;
float wetness = 8;
float dirtyness = 9;
float oxygen = 10;
float bleeding = 11;
float radiation_poisoning = 12;
float comfort = 13;
float pending_health = 14;
}
message PlayerInventory {
ItemContainer invMain = 1;
ItemContainer invBelt = 2;
ItemContainer invWear = 3;
}
message PersistantPlayer {
repeated int32 unlockedItems = 3;
int32 protocolVersion = 100;
}
message PlayerLifeStory {
float secondsAlive = 100;
float metersWalked = 101;
float metersRun = 102;
float secondsSleeping = 103;
uint32 timeBorn = 104;
uint32 timeDied = 105;
DeathInfo deathInfo = 200;
}
message PlayerNameID {
string username = 1;
uint64 userid = 2;
}
message DemoHeader {
uint32 version = 1;
string level = 2;
uint32 levelSeed = 3;
uint32 levelSize = 4;
string checksum = 5;
uint64 localclient = 6;
}
message Approval {
string level = 2;
string hostname = 3;
bool modded = 4;
bool official = 5;
uint64 steamid = 6;
uint32 ipaddress = 7;
int32 port = 8;
uint32 levelSeed = 9;
uint32 levelSize = 10;
string checksum = 11;
}
message UpdateItemContainer {
int32 type = 1;
repeated ItemContainer container = 2;
}
message PlayerUpdateLoot {
uint32 itemID = 1;
uint32 entityID = 2;
repeated ItemContainer containers = 3;
}
message UpdateItem {
Item item = 1;
}
message TakeDamage {
float amount = 1;
Vector3Serialized direction = 2;
int32 type = 3;
}
message EntityList {
repeated Entity entity = 1;
}
message CreateBuilding {
uint32 entity = 1;
uint32 socket = 2;
bool onterrain = 3;
Vector3Serialized position = 4;
Vector3Serialized normal = 5;
RaySerialized ray = 6;
uint32 blockID = 7;
Vector3Serialized rotation = 8;
}
message Attack {
Vector3Serialized pointStart = 1;
Vector3Serialized pointEnd = 2;
uint32 hitID = 3;
uint32 hitBone = 4;
Vector3Serialized hitNormalLocal = 5;
Vector3Serialized hitPositionLocal = 6;
Vector3Serialized hitNormalWorld = 7;
Vector3Serialized hitPositionWorld = 8;
uint32 hitPartID = 9;
uint32 hitMaterialID = 10;
uint32 hitItem = 11;
}
message PlayerAttack {
Attack attack = 1;
int32 projectileID = 2;
}
message PlayerProjectileAttack {
PlayerAttack playerAttack = 1;
Vector3Serialized hitVelocity = 2;
float hitDistance = 3;
}
message PlayerProjectileRicochet {
int32 projectileID = 1;
Vector3Serialized hitPosition = 2;
Vector3Serialized inVelocity = 3;
Vector3Serialized outVelocity = 4;
}
message PlayerProjectileUpdate {
int32 projectileID = 1;
Vector3Serialized curPosition = 2;
}
message ProjectileShoot {
int32 ammoType = 1;
repeated Projectile projectiles = 2;
}
message ModuleMessage {
uint32 itemid = 1;
int32 moduleid = 2;
int32 type = 3;
bytes data = 4;
}
message RespawnInformation {
repeated SpawnOptions spawnOptions = 1;
PlayerLifeStory previousLife = 2;
bool fadeIn = 3;
}
message ClientReady {
repeated ClientInfo clientInfo = 1;
}
message LootableCorpsePrivate { // Originally was Private, would cause errors
repeated ItemContainer container = 1;
}
message CodeLockPrivate { // Originally was Private, would cause errors
string code = 1;
repeated uint64 users = 2;
repeated uint64 guests = 3;
string guestCode = 4;
repeated uint64 guestUsers = 5;
}
message SpawnedEnt {
uint32 uid = 1;
uint32 spawnPointIndex = 2;
bool mobile = 3;
}
message SleepingBagPrivate { // Originally was Private, would cause errors
uint64 deployerID = 1;
string deployerName = 2;
}
message SellOrder {
int32 itemToSellID = 1;
int32 itemToSellAmount = 2;
int32 currencyID = 3;
int32 currencyAmountPerItem = 4;
int32 inStock = 5;
}
message SellOrderContainer {
repeated SellOrder sellOrders = 1;
}
message InstanceData {
int32 dataInt = 1;
int32 blueprintTarget = 2;
int32 blueprintAmount = 3;
}
message ConditionData {
float condition = 1;
float maxCondition = 2;
}
message DeathInfo {
string attackerName = 1;
uint64 attackerSteamID = 2;
string hitBone = 3;
string inflictorName = 4;
int32 lastDamageType = 5;
}
message Projectile {
int32 projectileID = 1;
Vector3Serialized startPos = 2;
Vector3Serialized startVel = 3;
int32 seed = 4;
}
message SpawnOptions {
RespawnType type = 1;
uint32 id = 2;
string name = 3;
float unlockSeconds = 4;
}
message ClientInfo {
string name = 1;
string value = 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment