Rust Wiki

Protobuf

What Is It

In Rust a Protobuf class represents exactly what data will get sent when networking to and from the client.

Why Does It Exist

When we send network data about an entity we don't want to send EVERYTHING about it.

We want to send:

  • Position
  • Rotation
  • Health

We may not want to send:

  • Inventory
  • Temporary run-time data
  • Variables that never change

This can be to prevent cheaters from seeing data they don't need to or to limit the network load. Regardless, this is where Protobuf comes in.

Why Do I Care

Some hooks may pass a Protobuf class and it is important to take note of this.

Changing the Protobuf class will LIKELY NOT change the entity, however it can change what data will be sent or received. It's an important distinction because it's effect may not be instantly seen.