Programming‎ > ‎

Networking Core

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

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

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

Groups
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.

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

Subscriber
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.

UID's
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.
Comments