[Commits] [wesnoth/wesnoth] 3b01d9: refactor random seed server choices

GitHub noreply at github.com
Wed Jul 8 01:03:10 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 3b01d925471e7b256c9922e57b183f408b97d2f8
      https://github.com/wesnoth/wesnoth/commit/3b01d925471e7b256c9922e57b183f408b97d2f8
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2015-07-08 (Wed, 08 Jul 2015)

  Changed paths:
    M src/server/game.cpp
    M src/server/game.hpp
    M src/server/server.cpp
    M src/synced_context.cpp
    M src/synced_context.hpp

  Log Message:
  -----------
  refactor random seed server choices

we add a more generic server choice mechnism. The plan is to use it also
for controller changes by wml.


  Commit: 2d80c97b1359ba893e04c646cbad73894a6d055f
      https://github.com/wesnoth/wesnoth/commit/2d80c97b1359ba893e04c646cbad73894a6d055f
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2015-07-08 (Wed, 08 Jul 2015)

  Changed paths:
    M src/server/game.cpp
    M src/server/game.hpp
    M src/team.cpp

  Log Message:
  -----------
  use synced choices for controller changes by wml

Using synced_context::ask_server_choice has some advantages over the
previous implementation:

Instead of calculating which client controls a side separately on each
client, we now calculate that on the server and send the result to the
clients. This makes it more robust against calculation mismatches on the
clients (OOS).

The mechanism which notifies the server about controller changes is more
robust because previously only the currently active side sent that message
to the server, but now all clients send that information to the server (and
the server ignores non-first notifications). Specially this fixes the rare
case that none of the clients control the currently active client during
that event (which can for example happen if the currently active side
disconnected from the game after the action was invoked but before the side
was modified on that client.).

We automatically get non-undoability (just like for random seed requests)


  Commit: 2e05fd399216f5b077111facdebbf9a500982296
      https://github.com/wesnoth/wesnoth/commit/2e05fd399216f5b077111facdebbf9a500982296
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2015-07-08 (Wed, 08 Jul 2015)

  Changed paths:
    M src/config.hpp

  Log Message:
  -----------
  make config child_iterator a random access iterator

This is more efficient, specially when std::advance is used on these
iterators

Also this migth fix a bug related to
boost::iterator_range<config::const_child_iterator> on boost 1.57 and
later


Compare: https://github.com/wesnoth/wesnoth/compare/249aa23295f3...2e05fd399216


More information about the Commits mailing list