IgeEntity

Method: streamControl

Gets / sets the stream control callback function that will be called each time the entity tick method is called and stream-able data is updated.
streamControl (Function method)
  • Functionmethod The stream control method.
Returns * "this" when arguments are passed to allow method chaining or the current value if no arguments are specified.

Set the entity's stream control method to control when this entity is streamed and when it is not

entity.streamControl(function (clientId) {
    // Let's use an example where we only want this entity to stream
    // to one particular client with the id 4039589434
    if (clientId === '4039589434') {
        // Returning true tells the network stream to send data
        // about this entity to the client
        return true;
    } else {
        // Returning false tells the network stream NOT to send
        // data about this entity to the client
        return false;
    }
});

Further reading: Controlling Streaming

© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point