events.manager module

Provides event registration functionality.

class events.manager._EventManager[source]

Bases: dict

Stores Event names with all registered callbacks.

register_for_event(event_name, callback)[source]

Register the callback for the given event.

Parameters:
  • event_name (str) – The name of the event to register.
  • callback – The function to be called when the event is fired on the server.
from events.manager import event_manager

def function(game_event):
    # Code...

event_manager.register_for_event('player_death', function)

See also

Events for a list of supported events per game.

unregister_for_event(event_name, callback)[source]

Unregister the callback for the given event.

Parameters:
  • event_name (str) – The name of the event to unregister.
  • callback – The function to unregister from the event.
from events.manager import event_manager

def function(game_event):
    # Code...

event_manager.unregister_for_event('player_death', function)
events.manager.event_manager

The singleton object of the _EventManager class.