Skip to content

player_added event triggered twice with different kwargs #1858

@avanwinkle

Description

@avanwinkle

When a player is added to MPF, game.py broadcasts a player_added event with the player number as the num kwarg:

{ "name": "player_added", "player": "<Player 2>", "num": 2, "cmd": "player_added" }

However the bcp_interface.py also emits directly a player_added event (bypassing the event manager) that with the player number as the player_num kwarg:

{ "player_num": 2, "cmd": "player_added" }

This can cause errors on BCP clients that subscribe to the player_added event because either kwarg may not be present.

The solution should be (probably) to remove the BCP event and rely on the event handler's event to broadcast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions