URL:
  <http://gna.org/patch/?1610>

                 Summary: improved synchronization framework for wml events
                 Project: Battle for Wesnoth
            Submitted by: icelus
            Submitted on: Saturday 04/10/10 at 03:27
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

As reported in bug #15560 OOS can occur at present in unstore_unit
advance=true

This patch does the following:
* Synchronization framework (prelimary)
** call classify_interactive_choice(event_info) to find out whether you can
do as you like but have to register it in the replay (LOCAL_MASTER), the
decision has been made already and you must replicate it (REMOTE_MASTER), or
the decision must be made without outside influence (SYNCED).
** call send_local_master_choice to register a choice in the replay
** call retrieve_remote_master_choice to get a choice from the replay
** call synchronized_choice to make the same decision on every host without
communication.
* Refactor dialogs::advance_unit
** It could never have been MP safe in its previous form, it had too much
autonomy.
** advance_unit has exactly the same behaviour, but WML events must call
advance_unit_dialog to get user input, and animate_unit_advancement to
perform an advancement. They must *not* call advance_unit itself.
** move the tests for whether a unit can advance to
unit_will_certainly_advance
* Fixes a latent bug in do_replay_handle
** when waiting for a choice previously, the wait was not handled correctly
in the case of "choose" following advance_unit.
** this code path is not exercised, but both elements (advance_unit/choose
sequence and do_replay_handle(.., waiting_for)) still exist.

Pitfalls in framework:
* This scheme is suitable for interactive input only. The existing "random"
code is not problematic, because it always SYNCED, which is the strongest
situation. Migrating that code to this framework would be a mistake.
* The "message" code might benefit from migration to this scheme, but "text"
input cannot be handled using these functions directly because they deal only
with numbers.
* In "preload", "prestart" and "start" the framework always identifies the
situation as SYNCED; there is in fact a GUI by the time of the "start" event,
but there is not an active replay. A possible future enhancement is to allow
"start" to have interactive elements.

Attached is a modification of the testcase posted for bug #15560 with three
transforms. It demonstrates that SYNCED elements workby transforming p2
leader in prestart. It demonstrates that LOCAL_MASTER and REMOTE_MASTER
elements work by upgrading p1 and the AI leader at the start of p1's turn. In
addition, p1 will have options for advancement displayed in a dialog.

I have been unable to replicate the originally reported bug in DA, so much
more testing is needed.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Saturday 04/10/10 at 03:27  Name: unstore_mp.patch  Size: 13kB   By:
icelus

<http://gna.org/patch/download.php?file_id=8888>
-------------------------------------------------------
Date: Saturday 04/10/10 at 03:27  Name: MPC_Sandbox-revised.zip  Size: 5kB  
By: icelus

<http://gna.org/patch/download.php?file_id=8889>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1610>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to