NetworkSet

Return to Introduction  Previous page  Next page

A NetworkSet is a class that represents an individual or group on the network.  You obtain a NetworkSet using the network class.

 

Properties

 

id

Returns the identifier (GUID string) for this NetworkSet.

 

Methods

 

send(commandstring)

Sends the script in 'commandstring' to everyone that's in this NetworkSet.

sendScreenCapture()

Sends a screenshot of the current player window to all members of this NetworkSet.

getDocumentArray()

Returns an array of NetworkSet classes that represent all of the different documents found in this group.  Will only work if the NetworkSet has a group identifier.

getInstanceArray()

Returns an array of NetworkSet classes that represent all of the different instances found in this NetworkSet.  Will work if the current NetworkSet is a group or document identifier.

 

Examples

 

var nsgroup = network.getNetworkSet(network.groupId); // Get a NetworkSet for this current document's group identifier.

var docs = nsgroup.getDocumentArray(); // Get an Array of NetworkSets for all different documents in this group.

var instances = nsgroup.getInstanceArray(); // Get an Array of NetworkSets for all diferrent player instances in this group.

print("This group contains "+docs.length+" different documents, and "+instances.length+" different player instances.");

nsgroup.send("print('hello!');"); // tell everyone in the group to print 'hello!' in the console.

for(var i=0;i<instances.length;i++)

{

       var ns = network.getNetworkSet(instances[i].id); // Get a NetworkSet to communicate with this individual player

       ns.send("print('I am player "+(i+1)+" of "+instances.length+"!')"); // Tell the player to say their index in this list

}

 

Remarks

 

An example of network usage can be found in the 'net_cabinet.dxstudio' and 'net_cabinet_controller' example files.

 

See Also

 

Script Reference



Copyright ©2004 Worldweaver Ltd. DX Studio Home