Skip to main content

A caller for a method on the server.

TODO-DOC

Example

const method = new VOXELIZE.Method();

// Register the method caller with the network.
network.register(method);

// Call a method on the server.
method.call("my-method", { hello: "world" });

Implements​

Properties​

packets​

• packets: MessageProtocol<any, any, any, any>[] = []

An array of packets to be sent to the server. These packets will be sent to the server after every network.flush() call.

Implementation of​

NetIntercept.packets

Methods​

call​

▸ call(name, payload?): MessageProtocol<any, any, any, any>

Call a defined method on the server.

Parameters​

NameTypeDescription
namestringThe name of the method to call.
payloadanyThe JSON serializable payload to send to the server.

Returns​

MessageProtocol<any, any, any, any>

The queued packet. Callers that must know whether the command actually left the client can flush the network and then check the packet's absence from both this intercept's packets queue and Network.isPacketPendingSend.