This fully splits the wesnothd loading screen handling from the network_transmission dialog and
into wesnothd_connection. Much cleaner this way. I've also added wait_and_receive_data as a general
spin-and-wait-for-data-to-come-in function instead of having it local in open_connection.
This allows for compile-time verification of stage ID names, instead of leaving it until runtime.
It also allows the use of std::atomic for the current stage class variable since we're no longer
using a const-qualified type.
Previously, the use of the wesnothd_connect_dialog and wesnothd_receive_dialog wrappers meant
multiple loading screen instances were created when connecting to MP. This change means only
one (or two, if the config is reloaded) loading screen objects are created when connecting to
the server. It also ensures the entire connection process (ie, the extent of open_connection)
is done with a loading screen displayed.
fixes#1674
This fixed a problem where at game start the host sends first a [scenario_diff]
and then a [start_game] but then the host loads the scenario config and
wesnothd_connection::poll isn't called while the loadingscreen is showing. so
the other players receive the [start_game] with a lot delay since
wesnothd_connection won't send it before the the loadingscreen has finished.
This isn't finished yet. In particular i still have to figure out how to
handle (network) exceptions here.
[ci skip]
I ran the command used in 9b7b1751fdda, excluding results in lua/ and spirit_po/.
Also, once again, for some reason actions/vision.hpp gets registered as massively changed
(similar to f11fa0652af0) despite nothing really having changed at all.
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.
For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
And move its code in other files where it fits better.
This also moves some code from actions.cpp to the new file
advancements.cpp
This also removed a parameter from show_objectives and
menu_handler::objectives that was always gui_->viewing_side()
The main advantage is that the new code is much shorter and easier to
understand then the preivous one.
It currently still used the network::error class on some places
This also removed support for 'ping' packages, the plan is to replace it
with SO_KEEPALIVE
Also this temporaily breaks the gui2 lobby since it still uses the old
network code.
Most of the formatting has been done automatically, but some minor manual
polishing has been applied afterwards.
Also add .clang-format file containing the settings used for the
formatting.