fNSendGlobal

 

PURPOSE: Send passed in data to a destination receive function on any or all specified nodes from CoC_ClientList or CoC_PeerList arrays in one transfer.
 
SYNTAX: [destination(s):Array, data:Array, destTXFunc:String or Integer] call fNSendGlobal
 
RETURNSNothing

 
DESCRIPTION:   This function uses one shared network transfer to send to all nodes in the destination(s) list, making the transfer very efficient in terms of bandwidth, although limiting the types of data sent and not supporting success/failed local functions.  fNSendGLobal can transfer the same variable types as PublicVariable and PublicArray, as well as arrays and multidimensional arrays. String, and side data types are not supported in this type of global send.


The fNSendGlobal function will allow the transmission of the following data types to selected nodes (or all) via a single network exchange (as opposed to multiple point to point exchanges):


destination(s):Array
array with list of destination network node indexes from the CoC_ClientList or CoC_PeerList array
, index 0 of both arrays always refers to the server node, leave an empty array for all nodes to get the transfer ([]).

 

data:Array
data to send, this array of data will be sent across the network to each destination
network node and specific pre-processed receive function "
destTXFunc".


destTXFunc:String or Integer
The 2nd parameter
data:Array will be passed to this pre-processed function on the destination network node as input.  The destination function must be added to CoC_NSFunTable identically on all nodes and will be turned into an index from CoC_NSFunTable before teh transfer commences.  Optionally if a scripter is sure of the index, the function may be passed in as an Integer referring to the function's position in CoC_NSFunTable.
 


EXAMPLES:
(on all nodes call fNPrint function with [player,current daytime] as the input data)
[[],[player,daytime],"fNPrint"]call fNSendGlobal

 

(on server and node 2 call fTXarray with [0,false] as the input data)                                           

[[0,2],[0,false],"fTXarray"] call fNSendGlobal

 

HISTORY: CoC bn880 07/05/2004, rev. 22/08/04

DEPENDENCIES: CoC_LIBNUMSYS, CoC_LIBNETWORK