They're still in the game_config namespace but are now in a more logical header.
game_config::version has been replaced with wesnoth_version.str(), save for one case
where it was replaced with wesnoth_version directly (it was a comparison against another
version_info object; no need to compare against a string...).
Also cleaned up a bunch of game_config.hpp includes.
For Campaigns, I needed to store the campaign name in the classification info.
For Eras, I repurposed the mp_era_addon_id key I added a year ago in d88f591eb5. It wasn't used anywhere
else, and having a better name for missing eras was the original reason to add it. I'm not sure why I
didn't think to use the name directly at the time; I do seem to have used addon_id for mod names too, but
that was changed in 5a55899b83 and again now (see below).
For Modifications, I added the relevant mod name to the server data. Why only this type of content
required a server change I'm not entirely sure. :/ This also finally properly fixes#1794.
This was basically an unnecessary stub class. It also allows us to
remove the unused soundsource::manager::to_config() function (write_sourcespecs()
did the actual job).
This commit removes the utility srt_cast() function and replaces its calls,
along with calls to lexical_cast<std::string>() (and its boost variant),
with std::to_string().
In a few cases where the input type isn't compatible with to_string,
lexical_cast<std::string> is still used.
In other cases where lexical_cast was operating on MAKE_ENUM enums, the
call has been replaced with ENUM::enum_to_string, which is faster.
This should fix the :cl list which previously did not show all scenarios.
Also it speeds up config reloading becasue previously the contents of every [scenario] were copied multiple times when reloading the game config.
I don't know why the [scenario]s were converted to [multiplayer] in the first place.
refactors out common expressions
game_classification::get_tagname/is_normal_mp_game()
Change some mp_configure defaults from mp campaigns to match the
defaults of sp campaigns (note that since campaigns have
force_lock_settings=yes by default this does not really matter)
Also we simplify how mp_wait reloads the game config.
Instead of creating an enum, the MAKE_ENUM macro now creates a struct
which holds an enum and provides functions for enum <-> string
conversion.
This has multiple advantages:
1) We don't need MAKE_ENUM_STREAM_OPS anymore.
2) The generated struct is much easier to use in templates
3) We don't allow implicit to int conversions anymore.
4) The enum values are now declared inside the structs scope.
The game sometimes does some checkup to test whether the calculated results in a replay match the ones calculated during the original game.
This data was stored in the replay inside the [command] for that action. The problem is that this doesn't work in networked mp because we often send the [command] before calculating the results.
I added an alternative mode that used get_user_choice to compare the results, this also works in networked mp but it causes a little more network traffic.
Added a new method, void create_engine::prepare_for_era_and_mods(),
which sets era and mod in game classification.
Prepare_for_[scenario, campaign] then set their respective defines and reload.
Conflicts:
changelog
src/gamestatus.cpp
src/gamestatus.hpp
Implemented reloading of configs with define= attributes in both mp_create and mp_wait::join_game().
Added myself to about.cfg and updated changelog.
Conflicts:
changelog
src/gamestatus.cpp
src/gamestatus.hpp
src/multiplayer_wait.cpp