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

Multiplayer lobby "join" and "observe" buttons enter the wrong game #2121

Closed
Samonella7 opened this issue Oct 25, 2017 · 1 comment
Closed
Assignees
Labels
Bug Issues involving unexpected behavior. MP Lobby Issues with the multiplayer lobby UI and its components.

Comments

@Samonella7
Copy link

Samonella7 commented Oct 25, 2017

For wesnoth 1.13.10:

In the multiplayer lobby, I can only enter the currently highlighted game. Clicking on different games changes which is highlighted, of course, but the "join" and "observe" for different games will enter the currently selected one.
lobby

@Vultraz
Copy link
Member

Vultraz commented Oct 25, 2017

Oh dear.

@Vultraz Vultraz self-assigned this Oct 25, 2017
@CelticMinstrel CelticMinstrel added Bug Issues involving unexpected behavior. MP Lobby Issues with the multiplayer lobby UI and its components. labels Oct 26, 2017
GregoryLundberg pushed a commit that referenced this issue Nov 30, 2017
This fixes #2121.

This code was an absolute mess. It relied entirely on finding games by-index, despite there also
being a simple function in lobby_data to get a game by id. I had even written code to take an id,
find a game_info ptr, then search the games vector for a match, get an index, and then use that
index to access the games vector later :| *facepalm*

Binding indices with callbacks meant  certain callbacks such as the list double click handler needed
to be constantly re-added. We also had no bounds checking in said callback. And for some reason, the
inline join/observe buttons were  handled by the same code as their global counterparts (#2121).

Just... a mess. Now we can directly handle joining by either index or game id directly. The former
is now only used for the global join/observe buttons' callback, but it could potentially be used
with the plugin context code, if applicable. It depends on whether the plugin data has an index key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. MP Lobby Issues with the multiplayer lobby UI and its components.
Projects
None yet
Development

No branches or pull requests

3 participants