Serializer

Serializer

The Serializer is responsible for serializing the game world and its objects on the server, before they are sent to each client. On the client side the Serializer deserializes these objects.

Constructor

new Serializer()

Source:

Methods

(static) typeCanAssign(type) → {Boolean}

Checks if type can be assigned by value.

Parameters:
Name Type Description
type String

Type to Checks

Source:
Returns:

True if type can be assigned

Type
Boolean

addCustomType(customType)

Adds a custom primitive to the serializer instance. This will enable you to use it in an object's netScheme

Parameters:
Name Type Description
customType
Source:

registerClass(classObj, classId)

Registers a new class with the serializer, so it may be deserialized later

Parameters:
Name Type Description
classObj function

reference to the class (not an instance!)

classId String

Unit specifying a class ID

Source: