This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Slave Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Sim SDK edition to use it.
Inherits from: Syncker

This class represents the slave interface of the Syncker.

Notice
Syncker plugin must be loaded.

Slave Class

Members


int getMasterNodeID ( int slave_node_id ) #

Returns the ID of a dynamic node on the Master by its local ID on the Slave. A Slave does not create an exact copy of a node created on the Master, their IDs do not match. So, knowing an ID of a local copy of a node created on the Master, you can easily find its original on the Master. This can be used in user messages, when you need to apply some specific modifications to source node on the Master.

Arguments

  • int slave_node_id - Node's ID on the Slave.

Return value

ID of the node on the Master.

int getSlaveNodeID ( int master_node_id ) #

Returns the local ID of a dynamic node on the Slave by its ID on the Master. A Slave does not create an exact copy of a node created on the Master, their IDs do not match. So, if you created a node on the Master and then called the Syncker::Master::createNode() method, you can easily find its copy on the current Slave. This can be used in user messages, when you need to apply some specific modifications to a Slave's copy of a node, that was created on the Master.

Arguments

  • int master_node_id - Node's ID on the Master.

Return value

ID of the node on the Slave.

void addSyncNode ( Node node, int master_node_id ) #

Enables synchronization of parameters of the given node via the UDP protocol.
Notice
Scene nodes are not synchronized by default, this method is used to add a particular node to the synchronization queue.

Arguments

  • Node node - Node to synchronize.
  • int master_node_id - ID of the node on the Master.

void addSyncNodeID ( int slave_node_id, int master_node_id ) #

Enables synchronization of parameters of the given node via the UDP protocol.
Notice
Scene nodes are not synchronized by default, this method is used to add a particular node (by its id) to the synchronization queue.

Arguments

  • int slave_node_id - ID of the node on the Slave.
  • int master_node_id - ID of the node on the Master.

bool removeSyncNode ( Node node ) #

Removes the specified node from the synchronization queue.

Arguments

  • Node node - Node to be removed.

Return value

true if the node was successfully removed from the synchronization queue; otherwise, false.

bool removeSyncNodeID ( int slave_node_id ) #

Removes the node with the given number from the synchronization queue.

Arguments

  • int slave_node_id - Node number in the synchronization queue.

Return value

true if the node was successfully removed from the synchronization queue; otherwise, false.

long getID ( ) #

Returns the current ID of the Slave.

Return value

ID of the slave combined as follows: IP address (32 bits) + port number (16 bits).

void setSkipFlags ( int flags ) #

Sets the skip flags enabling you to ignore certain information from the Master.

Arguments

  • int flags - A combination of skip flags to be used, for example:
    Source code (UnigineScript)
    slave.setSkipFlags(SLAVE_GAME | SLAVE_WORLD_LOAD | SLAVE_USER_DATA);

int getSkipFlags ( ) #

Returns the current skip flags combination enabling you to ignore certain information from the Master.

Return value

A combination of currently used skip flags.

Variable addCallback ( int callback, Variable func ) #

Adds a callback of the specified type. Callback functions can be used to determine actions to be performed when sending or receiving user messages, as well as when changing settings on the Master or a Slave. The signature of the callback function can be one of the following:
Source code (UnigineScript)
// for the Syncker.Slave.SESSION_STARTED type
void callback_function_name(void);

// for the Syncker.Slave::SESSION_FINISHED type
void callback_function_name(void);

// for the Syncker.Slave.MASTER_CONNECTED type
void callback_function_name(void);

// for the Syncker.Slave.MASTER_DISCONNECTED type
void callback_function_name(string reason);

// for the Syncker.Slave.NODE_LOADED type
void callback_function_name(Node node);

Arguments

Return value

Number of the last added callback of the specified type, if the callback was added successfully; otherwise, -1.

bool removeCallback ( int callback, Variable func ) #

Removes a given callback from the list of callbacks of the specified type. Callback functions can be used to determine actions to be performed when sending or receiving user messages, as well as when changing settings on the Master or a Slave.

Arguments

Return value

true if the position callback with the given ID was removed successfully; otherwise false.

void clearCallbacks ( int callback ) #

Clears all added callbacks of the specified type. Callback functions can be used to determine actions to be performed when sending or receiving user messages, as well as when changing settings on the Master or a Slave.

Arguments

Last update: 2022-04-20
Build: ()