Fix the spelling in a comment.
Cleaned up an obsolete #include game_preferences.hpp in preferences.hpp
Changed LoW's highest difficult level from hard to challenging
fix whitespace
add command line option --unit, -u, to run scenario as a unit test

This is the initial commit for --unit, -u, unit test option.
This option is a modified version of --test, -t. Scenarios will
run in the same context essentially, but will terminate on
scenario end.

The exit code of wesnoth is 0 (PASS) if the scenario ended with
LEVEL_RESULT VICTORY, or LEVEL_RESULT NONE.

The exit code of wesnoth is 1 (FAIL) otherwise.

Higher exit codes may reflect a failure for a reason other than
the scenario ending in defate.
make unit tests run headlessly

specifying --unit is similar to --nogui. that is, this check is
essentially ||'d in at all places where --nogui would be checked
add WML macros for unit test scenarios

contains "generic_unit_test", "return" and "assert" macros
add WML unit test examples, and include the test directory

add some trivial tests, and the _main.cfg files to ensure they are included
add wml unit tests two and three

- test two tests a basic property of events
- test three tests unit placement on the map in
  case of a collision
add wml_unit_tests test aggregator script

This bash script runs a sequence of WML unit test scenarios.
If all pass the result is 0.
If any fails, the result is 1, and the std::cerr stored in "error.log".
We also add error.log to the .gitignore list.

It shows how --timeout and --validcache may be used in such a script
unit test timeouts: first attempt

use an SDL_Alarm to try to abort the process if it goes over time.
correct thread model for unit test timeouts

it seems that child threads can't terminate the whole process,
so we need to instead use a worker thread and make the
main thread the timer / return thread.
add --timeout to wml_unit_tests script

use the timeout feature as appropriate for automatic testing
add replay validation to unit tests

after unit tests play, then unless --noreplaycheck flag is used,
they save a replay at the end of the scenario (using autosave
code path), without compression. then they try to load it and
play it to completion.
this is the initial attempt.
a check for deterministic mode in mp.

we now check during the start event whether the game is a mp game which
runs in deteministic mode and give an error in this case. This case
shouldn't cause OOS but it allows players  to cheat. I don't do it
earlier because i cannot use the screen during prestart events, and i
don't know about the code earlier (mp_connect).
remove the 'only_attacks' random mode

i came to the conclusion, that the lag for asking the server for a new
seed is neglectable. So we don't need this mode.
fix host reassignes side during choice

Assume the following situation:
2 Players in the game (A (side 1), B (side 2)), and one Observer (C).
it's A's turn.
A has to do a decision (for example unit advanement), A leaves the game
and B decides to assign side 1 to C.
On Client B: When returning from process_network_data side 1 is now controlled by B,
and then gets then reassigned with the next call of
process_network_data, but that's too late becasue handle_generaic_event
already returned and B does the advancement decision for side 1.
Players C gets the the first [change_controller] (A -> B) and then gets
the second change cntroller (B -> C) before getting B's answer to the
user choice. So when C gets the second [change_controller] he does the
decision himself becasue its C's decision an it has not been received
yet. -> the same decision has been made twice -> OOS.
this fixes this problem, by making the host wait for the servers change
controller in this case
Merge pull request #147 from gfgtdf/sync_fix_2

fix host reassignes side during choice
revise lobby strings
fixup party full bell

the party full bell code is moved back to the engine, and is
based on checking whether processing the most recent message
has made it now possible to start the game. this seems to be
the simplest logic that will do the right thing, it will now
make the bell play whenever the "I'm ready" button is active

this also addresses bug #21910.

note: the reason we don't check the "silent" flag is that it
causes the sound not to be played in some circumstances where
it should. multiplayer_connect_engine currently returns
value "true" for silent (the second part of result) in all
cases except when a player has been successfully assigned to
a side, in which case it is false. depending on the status of
allow_changes, that might be a time that we want to play the
"ready to start" bell.