Desync error after clicking "Prefer rookies/heros" buttons in military buildings

Bug #1208130 reported by Hans Joachim Desserud on 2013-08-04
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Medium
Unassigned

Bug Description

Steps to reproduce:
1. Start a new multiplayer game, play as a spectator.
2. Once one of the other players finish building a military building, click on it.
3. Click on the button to "Prefer heros" instead of rookies or vice versa.

Expected:
As a spectator, none of my actions should be able to affect the other players.

Actual:
When clicking on these buttons, they change. If you are playing with other human players, this will cause a desync error.

The buttons should likely be wrapped in whatever check prevents spectators from pressing other buttons in the UI.

r6695.

Related branches

wl-zocker (wl-zocker) wrote :

If I do the same thing in a replay, the game pauses and does not continue (r6691). The spectator/replay-watcher should be able to see the setting, but not be able to change it (e.g. buttons greyed out).

tags: added: replay
Hans Joachim Desserud (hjd) wrote :

Marking Confirmed based on your comment.

Changed in widelands:
status: New → Confirmed
Teppo Mäenpää (kxq) wrote :

This probably appeared when the radiobuttons were introduced.

SoldierList::set_soldier_preference(int32_t) modifies the molitary site directly, instead of using the message relaying mechanism; compare the new SoldierList method to void Building_Window::act_prefer_rookies() and Building_Window::act_prefer_heroes()

Teppo Mäenpää (kxq) wrote :

Please try:

https://code.launchpad.net/~widelands-dev/widelands/fix-bug-1208130

I cannot do network plays now :-(

Hans Joachim Desserud (hjd) wrote :

>I cannot do network plays now :-(

Hm, I should have posted the actual steps I did to reproduce this then.

1. Run ./widelands --double
2. In window A, go to multiplayer game and host a new local (LAN) game.
3. In window B, go to multiplayer game, and join the game (enter "localhost" in the textbox for server name).
4. Let one of the windows be a spectator and try to click on the legitimate player's buildings.

Teppo Mäenpää (kxq) wrote :

Without the above referred fix:

I see both spectator action and desync error, latter also with two "normal" human players.

After applying the above referred fix:

I see neither problem.

I removed the buttons entirely from a spectator. The other option would have been to keep the buttons, but make them non-functional, in which case the spectator would have been able to see the user's preference in addition to seeing the list of soldiers present.

cghislai (charlyghislain) wrote :

I made a commit so the radio is shown but disabled when not allowed to interact.
And I just realize now that it might be on purpose that you hid them, i didn't get that at first. I think it is nice to see that option for spectators, but obviously not for other players.

cghislai (charlyghislain) wrote :

Well, since the soldier list is not displayed while player is playing, i think you can safely always show the radio buttons.

Teppo Mäenpää (kxq) wrote :

Hi,

I see the desync issue very important, and also think that observers should not be able to affect the gameplay. Beyond that I do not have strong opinions.

I choose to not include the radiobuttons, as those should be confusing to some. For example, in the current implementation, the soldier list keeps updating, but the preferences stay wherever they were when the window was opened. I think that this is a question of taste, but I usually choose not to show some useful information at all, when the useful information is not correct.

cghislai (charlyghislain) wrote :

You are right it's useless as it is now. I revert the commit while people dont show interest for this.

Teppo Mäenpää (kxq) wrote :

I just realized that the end of my above comment ( #9 ) sounds more harsh than I intended. Preference becoming wrong over time is a corner case; "confusing to some" was better choice of words. I would kindly ask somebody to merge one of the fixes, I am happy with both versions.

SirVer (sirver) wrote :

The radiobuttons for ware priority are shown though - they contain information that the observer might be interested in. I would prefer to have this too for the soldier preference: to see what the player selected for the building.

cghislai (charlyghislain) wrote :

ok so i reintroduced the changes and overrode update

Teppo Mäenpää (kxq) wrote :

I changed the title, as I think that game crashing is more severe than observer altering gameplay. Now with the map contest ending soon, some might even try those using network play.

I still hope that someone would review the attached fix, and merge if no problems are found.

summary: - Spectators can click "Prefer rookies/heros" buttons in military
+ Desync error after clicking "Prefer rookies/heros" buttons in military
buildings
Nasenbaer (nasenbaer) wrote :

I checked and merged the branch. :)
Fix is in bzr rev. 6715

Changed in widelands:
status: Confirmed → Fix Committed
Teppo Mäenpää (kxq) wrote :

Thanks for the merge!

SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers