offPlayerEvent
Unregister a listener function previously registered with onPlayerEvent
.
Syntax
engine.network.offPlayerEvent(event, listener);
Parameters
Name | Type | Description |
---|---|---|
event | string | The event name to unsubscribe. |
listener | (player: PlayerManager, data?: NetworkEventData) => void | The listener to remove from the event subscription. |
Example
// subscribe
const listener = engine.network.offPlayerEvent('onSayWelcome', player => {
// ...
});
// unsubscribe
engine.network.offPlayerEvent('onSayWelcome', listener);
Available on: Client Server