_NetworkIdentityServer

Inherits: Node

Tracks identities for use over the network

Description

Internally, netfox sends packets that refer to specific nodes, e.g. to synchronize their state. Nodes are referenced based on their path in the scene tree. To save on bandwidth, node paths are replaced with numeric IDs when possible.

This class manages these numerical IDs and their broadcast among peers.

Each node that is to be referred to over the network must be registered using register_node(). It is best to deregister freed nodes using deregister_node().

Node registration and deregistration are done automatically by the high-level nodes ( like RollbackSynchronizer ), and usually doesn't need to be done manually.

Methods

Return Type Name
void register_node(Node node)
void deregister_node(Node node)
void clear()
bool queue_identifier_for(Node node, int peer)
void flush_queue()

Method Descriptions

void register_node ( Node node )

Register a node

Once a node is registered, it can be referred to over the network. The same node must be registered with the same node path on all peers.


void deregister_node ( Node node )

Deregister a node, freeing all identity data associated with it


void clear ( )

Clear all identities


bool queue_identifier_for ( Node node, int peer )

Queue sending the numeric ID of node to peer

This happens automatically when the node is first referred to in a packet. This method allows frontloading that, at a more feasible moment.

This method does not send any data. To force sending identifiers, use flush_queue().


void flush_queue ( )

Broadcast all identities queued for synchronization

Flushed automatically by default