This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Syncker::Master Functions

This set of functions is available when the Syncker is loaded.

Functions described below are specified in the Unigine::Syncker::Master namespace.

int init (string address, int udp_port = Unigine::Syncker::UDP_PORT, int tcp_port = Unigine::Syncker::TCP_PORT)

Initializes the Syncker in the master application using a given broadcast address.

Arguments

  • string address - Broadcast address.
  • int udp_port = Unigine::Syncker::UDP_PORT - UDP port. The default is 8890.
  • int tcp_port = Unigine::Syncker::TCP_PORT - TCP port. The default is 8891.

Return value

1 if the Syncker is intialized successfully; otherwise, 0.

int shutdown ()

Shuts down the Syncker in the master application and closes all opened sockets.

Return value

1 if the Syncker is shut down successfully; otherwise, 0.

int getNumSlaves ()

Returns the number of slave computers connected to the master.

Return value

Number of slaves.

string getSlaveName (int num)

Returns a name of a given slave computer. The default name is unknown (if not set).

Arguments

  • int num - Number of the slave computer.

Return value

Name of the slave computer.

string getSlaveAddress (int num)

Returns a network address of the given slave computer.

Arguments

  • int num - Number of the slave computer.

Return value

Network address of the slave computer.

void syncCAVE (Vec3 head)

Synchronizes position of the viewer's head.

Arguments

  • Vec3 head - Head position.

void syncFrame ()

Synchronizes frame data. This includes synchronization of:

void syncEnd ()

Notifies slave computers about the end of a frame over a UDP protocol. This function is required at the end of frame synchronization code on the master side.

void syncPlayer ()

Synchronizes the player:
  • Its transformation
  • A projection matrix
  • A viewport mask
  • A mask for reflections
  • Applied post-materials, if any

void syncRender ()

Synchronizes all render parameters: light scattering, occlusion, etc.

void syncMaterial (Material material)

Synchronizes all states and parameters of a given material.

Arguments

  • Material material - Material.

void syncMaterials (Material materials[])

Synchronizes all states and parameters of given materials.

Arguments

  • Material materials[] - Array of materials.

int createNode (Node node)

Synchronizes creation of the given node on all slaves over a TCP protocol.

Arguments

  • Node node - Node to create.

Return value

1 if the node is successfully created on all slaves; 0 - node creation is not supported.

void deleteNode (Node node)

Synchronizes deletion of the given node on all slaves over a TCP protocol.

Arguments

  • Node node - Node to delete.

void syncNode (Node node)

Synchronizes parameters of a given node over a UDP protocol.

Arguments

  • Node node - Node.

void syncNodes (Node nodes[])

Synchronizes parameters of given nodes over a UDP protocol.

Arguments

  • Node nodes[] - Array of nodes.

void systemSet (int mask, string name, int value)

Sets a system script variable value for slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, for which a variable should be set. To set variable for all of the slaves, send ~0.
  • string name - Name of the variable in the system script.
  • int value - Value to be set.

void systemGet (int mask, string name, int ret[])

Gets values of a system script variable from slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, from which variables should be get. To get variable for all of the slaves, send ~0.
  • string name - Name of the variable in the system script.
  • int ret[] - Array of values returned by slaves (in the order they connected to the master).

void worldSet (int mask, string name, int value)

Sets a world script variable value for slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, for which a variable should be set. To set variable for all of the slaves, send ~0.
  • string name - Name of the variable in the world script.
  • int value - Value to be set.

void worldGet (int mask, string name, int ret[])

Gets values of a world script variable from slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, from which variables should be get. To get variable for all of the slaves, send ~0.
  • string name - Name of the variable in the world script.
  • int ret[] - Array of values returned by slaves (in the order they connected to the master).

void editorSet (int mask, string name, int value)

Sets an editor script variable value for slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, for which variables should be set. To set variable for all of the slaves, send ~0.
  • string name - Name of the variable in the editor script.
  • int value - Value to be set.

void editorGet (int mask, string name, int ret[])

Gets values of an editor script variable from slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, from which variables should be get. To get variable for all of the slaves, send ~0.
  • string name - Name of the variable in the editor script.
  • int ret[] - Array of values returned by slaves (in the order they connected to the master).

void systemCall (int mask, string name, int args[])

Calls a system script function on slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function in the system script.
  • int args[] - Array of arguments to be passed (passing up to 6 arguments is supported).

void systemCall (int mask, string name, int args[], int ret[])

Calls a system script function on slaves defined in a mask and receives a return value via the TCP protocol.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function in the system script.
  • int args[] - Array of arguments to be passed (passing up to 6 arguments is supported).
  • int ret[] - Array of values returned by slaves defined in a mask (in the order they connected to the master).

void systemStream (int mask, string name, Buffer buffer)

Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function.
  • Buffer buffer - Buffer with states of the displays that need to be passed to the function.

void worldCall (int mask, string name, int args[])

Calls a world script function on slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function in the world script.
  • int args[] - Array of arguments to be passed (passing up to 6 arguments is supported).

void worldCall (int mask, string name, int args[], int ret[])

Calls a world script function on slaves defined in a mask and receives a return value via the TCP protocol.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function in the world script.
  • int args[] - Array of arguments to be passed (passing up to 6 arguments is supported).
  • int ret[] - Array of values returned by slaves defined in a mask (in the order they connected to the master).

void editorCall (int mask, string name, int args[])

Calls an editor script function on slaves defined in a mask.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function in the editor script.
  • int args[] - Array of arguments to be passed (passing up to 6 arguments is supported).

void editorCall (int mask, string name, int args[], int ret[])

Calls an editor script function on slaves defined in a mask and receives a return value via the TCP protocol.

Arguments

  • int mask - Mask that defines slaves, on which a function should be called. To call the function on all of the slaves, send ~0.
  • string name - Name of the function in the editor script.
  • int args[] - Array of arguments to be passed (passing up to 6 arguments is supported).
  • int ret[] - Array of values returned by slaves (in the order they connected to the master).
Last update: 2017-07-03
Build: ()