Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NetworkIdCounter = atomic.Uint64{}
Functions ¶
func AddNetworkFilter ¶
func AddNetworkFilter(filter func(client *router.NetworkClient, entry *donburi.Entry) bool)
AddNetworkFilter accepts a callback that can be used to filter out entities that gets included in the snapshots sent to clients. By returning false in this filter function, the entity will be excluded.
func DoSync ¶
func DoSync() error
DoSync should be called by the server and will build world state and then attempt to network it out to all the peers. This is done by serializing all the components of the entity, and preparing a network bundle for the clients.
func NetworkSync ¶
func NetworkSync(world donburi.World, entity *donburi.Entity, components ...donburi.IComponentType) error
NetworkSync marks an entity and a list for network synchronization. This means that the esync package will automatically try to send state updates to the connected clients. Note that donburi tags are not supported for synchronization, as they contain no data. This will return an error if the entity does not have all the components being synced.
Types ¶
This section is empty.