There are two different approaches here:
- in the AI code, the attack is queued, sent to the server and then
the attacking code waits for a new random seed o arrive, polling UI
events and syncing network in a loop.
- in the player code, the actual attak procedure is delayed until
after a new seed arrives by means of a callback that is called when
a seed message is received. This is potentially problematic as, for
example, commands need to be disabled across different scopes.
Added namespace 'rand_rng' to random.[ch]pp and changed callers
accordingly. Functions declared in random.[ch]pp are left in default
namespace.
This was part of a potential RNG bug hunt which turned up empty. The
namespace helps prevent some potential ambiguities as we have classes
declared using lower case and methods of the same name and case. The
namespace allows for non-ambiguous reference with the class.
This refactoring tries to fix that. It creates an own class for the
rng part of game_state that is used within race. This still needs to
be checked (Mordante will do that soon). If this commit causes all
kinds of weird problems (i don't think so, but you never know), feel
free to revert it.
* Wesnoth is distributed under the terms of the GPL version 2, made
that more explicit
* updated the copyright range to 2007
* updated Dave's email adress
...rather to keep them as siblings. The code is also easier to
understand now. This solves a problem with lots of get_random calls
resulting in [random] tags being nested so deeply that compressed save
files can't be made. Also there were a couple of files that didn't
have newlines after the last line that I corrected.
...only one [random] structure with a comma-separated list in 'value',
instead of nested structures. There is still some nesting when a
[results] structure is needed. This new scheme should reduce the size
of the replay and avoid hitting the nesting limit. It is supposed to
be backward-compatible, hence a bit of complexity.