Rust Wiki

Revision Difference

Protobuf#526549

<cat>Dev.Server Mods</cat>⤶ <cat>Dev.ServerMods</cat>⤶ <title>Protobuf</title> # This is a headline!⤶ ⤶ I am creating a page. I can press **ctrl+space** to preview my changes! ⤶ #Uploading Images⤶ ⤶ I can drag and drop images and videos here to upload them.⤶ ⤶ #Links⤶ ⤶ I can link to [external pages](http://www.google.com) and <page>Internal Pages</page> # 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.