Skip to main content

offServerEvent

Unregister a listener function previously registered with onServerEvent.

Syntax

engine.network.offServerEvent(event, listener);

Parameters

NameTypeDescription
eventstringThe event name to unsubscribe.
listener(data?: NetworkEventData) => voidThe listener to remove from the event subscription.

Example

// subscribe
const listener = engine.network.offServerEvent('onDoorOpen', () => {
// ...
});

// unsubscribe
engine.network.offServerEvent('onDoorOpen', listener);

Available on: Client Server