scons: Fix imports
Merge branch 'master' of https://github.com/wesnoth/wesnoth-old
main catches and handles "std::exception" and "...", returning 1

The purpose of this is so that even when we request the program
to be terminated with "throw 42", the exception will still
propogate back to main and all destructors will be called along
the way. This way, if the program requested a socket for example,
the socket will still be released when we terminate unexpectedly,
so it might be slightly more convenient for testing.
Add also exception handlers for strings thrown as exceptions

From irc:

<gfgtdf> iceiceice: i tink you should also catch for char* there,
to give the correct message in case of
'throw "asdadsad"; 'statemant
campaignd: Rename and refactor campaign_server class into campaignd::server

This is the first refactoring step.

This moves the class declaration to a separate header file and switches
around some implementation details. Included in this commit are a few
minor documentation changes, a lot of whitespace and placement changes,
and the following API and behavior changes:

 * Reordered server class fields, keeping net_manager_ and
   server_manager_ as the last to initialize.
 * The campaignd hooks configuration (which hasn't been used in ages) is
   now done in the load_config() method rather than directly in the
   constructor.
 * Both read-only mode configuration and control socket set-up are now
   done in load_config() rather than the run() method.

Included as well are a few Doxygen documentation changes of varying
scope. Most notably, the description for the fire() method's return
value is gone since the method was made to not return a value some time
after its inception.

I also took the liberty to spatially-reorganize some of the involved
code except for the fire() method's body (which is massive and had to be
reindented anyway), in order to make the code more fluid and clean to
read.

Overall, there are deliberately no behavior changes in this step other
than the aforementioned minor bits, in order to make the next steps
easier to plan, perform, and debug.
Windows WML Tests: Add total duration to output
add end_play_signal type and visitors

This commit adds an "end_play_signal" type. It is meant to be used
in play_controller classes to prevent crashes due to bad exception
handling / collisions, and should help us to make assumptions more
easily about when networking operations will happen

It also adds some macros to avoid the proliferation of unreadable
try catch blocks. It is expected that many of these can be
expanded and simplified after the refactor.
push end_play exceptions down one level in playsingle_controller

This uses the macros introduced to handle game end exceptions.
It should be a strict refactor.

Rebased to accomodate conflict here: https://github.com/wesnoth/wesnoth/commit/516206a0ee2fc0826707da9d54b44ed051638050
Still a strict refactor.

Note:
If end_turn_exception propogates to the top of
playsingle_controller, there is no handler beyond that and the
program will terminate. If an end turn signal gets there, we
also will terminate. This commit adds an assertion failure with
a message clarifying what happened.
push end_play_exceptions one down in call stack, at "play_turn()"

Continues trend of previous commit. play_turn becomes no throw
with respect to these exceptions, and so we can switch calls to it
to use the "PROPOGATE_END_PLAY_SIGNAL" instead of "HANDLE_...".

It looks like by progressively doing this and unit testing at each
step, we will be able to successfully convert all of the functions
in play_controller to use PROPOGATE, which is a cheap if else and
not an exception handler, and increase the stability of the engine
by avoiding the use of exceptions for control flow. If we continue
this way, we could push all the throws into the event handler
and the replay module. Perhaps could continue from there, but
likely at some point the exceptions might be the simpler solution
esp. for breaking recursion in WML / lua or things like this.
remove unnecessary handler macro from events::raise_draw_event

After discussion on irc, it seems that this function doesn't
throw end level or end turn exceptions, and some play testing
suggests that removing the handler macros here is alright.
push end play exceptions out of play_controller::check_time_over
finish_turn() cannot throw end play exceptions, remove handlers
remove handler from finish_side_done

This function won't throw end level or end turn. game_event pump
will not throw these, although the SDL event pump may throw them
in response to keyboard / menu events.
push end play exceptions out of replay controller top level

This commit starts the process for replay_controller at the
play_replay_level function.
push end play exceptions out of replay_controller::play_replay

Returns a "possible_end_play_signal" now instead. This also
required changes to the header in hotkey/command_executor. This
seems pretty minor, and could perhaps be refactored later.
remove unnecessary pure virtual function definition

This is overrided differently in playsingle, playmp, and replay
controllers, and never is it called abstractly, which is what
this virtual declaration would suggest.
push end play exceptions out of play_side()

This changes both the playsingle and playmp implementations,
but not the replay_controller implementation which is separate.

( squashed: fixup an oversight in replay_controller::play_side )
replay_next_turn signals rather than throws, in replay_controller
replay_next_side signals rather than throws, in replay_controller
play_turn signals instead of throwing in replay_controller