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

                 Summary: MP campaign: new observers get OOS on second
scenario (bug #20217)
                 Project: Battle for Wesnoth
            Submitted by: faabumc
            Submitted on: Mon 08 Oct 2012 01:24:35 PM CST
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This is a proposal to fix bug #20217.

In the referenced bug report, we identify that two different methods are used
to cast the random seed from string to integer.
The method used in src/multiplayer_ui.cpp is keeping only the first digit of
the integer.

This patch is implementing the same casting than in src/savegame.cpp
([].to_int(42)). The table below is showing the seed for different connections
at different stages of the game:

+============+============+============+============+
| Stage      | Host       | Scenario 1 | Scenario 2 |
|            |            | observer   | observer   |
+============+============+============+============+
| Generate   | 9 digit    |     -      |     -      |
|   map      |   integer  |            |            |
|            | 495319315  |            |            |
+------------+------------+------------+------------+
| Scenario 1 | 10 digit   | 10 digit   |     -      |
|   start    |   integer  |   integer  |            |
|            | 1137179226 | 1137179226 |            |
+------------+------------+------------+------------+
| Scenario 2 | 9 digit    | 9 digit    | 9 digit    |
|   start    |   integer  |   integer  |   integer  |
|            | 573163703  | 573163703  | 573163703  |
+------------+------------+------------+------------+
| Scenario 2 | 9 digit    | 9 digit    | 9 digit    |
| save/reload|   integer  |   integer  |   integer  |
|   start    | 573163703  | 573163703  | 573163703  |
+============+============+============+============+


We see that after applying the patch the seed is never rounded to one digit
and that the seed for the host and observers are identical at all time.

Given that this patch changes the way the host is casting the seed from WML,
the resulting binary is not compatile with the current ones. For this reason
the patch should only be applied on trunk.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 08 Oct 2012 01:24:35 PM CST  Name: ui.diff  Size: 1kB   By: faabumc
Patch file against trunk at rev 55528
<http://gna.org/patch/download.php?file_id=16671>

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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