Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player_added event triggered twice with different kwargs #1858

Open
avanwinkle opened this issue Dec 19, 2024 · 0 comments
Open

player_added event triggered twice with different kwargs #1858

avanwinkle opened this issue Dec 19, 2024 · 0 comments

Comments

@avanwinkle
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant