offServerEvent
Unregister a listener function previously registered with onServerEvent
.
Syntax
engine.network.offServerEvent(event, listener);
Parameters
Name | Type | Description |
---|---|---|
event | string | The event name to unsubscribe. |
listener | (data?: NetworkEventData) => void | The 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