core.components.middleware module

This module contains the Tuxemon server middleware.

class core.components.middleware.Controller(game_server=None)[source]

This middleware will allow you to use the AsteriaServer for Multiplayer games and the mobile controller. When it receives KEYDOWN/KEYUP events, it will set the corresponding dictionary key in “network_events” to true or false. In your main game loop, you can then iterate through this dictionary and change the game accordingly.

Public functions: event_legal – Returns True for all events that pass the legal logic. Returns False for all events that

fail legal logic.

event_execute – Sets the game_server.network_events dictionary based on what key was pressed

event_execute(cuuid, euuid, event_data)[source]
class core.components.middleware.Multiplayer(game_server=None)[source]

This middleware will allow you to use the AsteriaServer for Multiplayer games and the mobile controller. When it receives KEYDOWN/KEYUP/NETKBD events, it will set the corresponding dictionary key in “network_events” to true or false. In your main game loop, you can then iterate through this dictionary and change the game accordingly.

Public functions: event_legal – Returns True for all events that pass the legal logic. Returns False for all events that

fail legal logic.

event_execute – Sets the game_server.network_events dictionary based on what key was pressed

event_execute(cuuid, euuid, event_data)[source]