Programming‎ > ‎

Networking Core

Client holds the main client singleton. This is used primarily to connect to a server and to route messages.

Server holds the main server singleton. This accepts client connections and routes messages.

Server and Client both have a router. The routers allow you to subscribe to messages.
You should never have to fuck with this.

The world is divided into integer based groups. Every connection is by default subscribed only to group 0. In Rust the world is divided up using a grid, and each cell is a group. When sending messages they can be sent to a single or multiple groups.

A networkable can be thought of as a network entity. Networkables are usually contained in a single group.

A networkable can also contain a subscriber. A subscriber is usually a player - and can subscribe to groups. This means that when a message is sent to these groups anyone subscribed to them will get the message.

The server network code can provide UID's - which are unique unsigned integers. These are taken using TakeUID() and returned with ReturnUID().  These are used to represent networkable ids.