Like noted in the similar function in wesnothd_connection (see 40441fecb437be413993106fdf98eca1c93a5fcc), this seems to
operate on a single buffer rather than a range of them.
asio::const_buffers_1 is deprecated as of 1.66. Its replacement (const_buffer) doesn't have begin() and end() functions.
However, since (unless I'm reading this code wrong), we're dealing with a single buffer at this point, we don't need the
range constructor and can just insert the data directly into the queue via internalizer list (this also allows us to remove
the push_front call).
If we do need a range call, I think we're supposed to now use asio::buffer_sequence_begin and asio::buffer_sequence_end.
The code handling #if(n)def and #if(n)have is largely the same in both
the normal and the negated paths, making two code paths redundant. This
commit unifies each pair as it should have been done from the beginning.
This commit also alters the implementation of #if(n)ver very slightly so
we do a single char check instead of comparing against a whole string a
second time (we definitely don't need to compare the full thing).
This allows us to drop the hard dependency on <algorithm>, <functional>,
and serialization/string_utils.hpp from filesystem.hpp, which should
make the latter less of a heavyweight include in places that otherwise
don't need those headers.
There are no performance concerns here because the class as a whole is
rarely used in general and never in performance-sensitive code.
This commit also addresses a few side-effects of other files
piggybacking on the filesystem.hpp dependencies.
These are dead code. set_team_colors() is used in a couple of places as
well as a unit test, but get_team_colors() is never used and neither is
the actual variable behind both. The documentation alluded to it being
used by the ~TC() image path function, but in reality that uses the team
API instead (team::get_side_color_range()).
This does raise a concern however -- the unit test that did use
set_team_colors() used it with trivial and predictable input, so it
wasn't actually testing it. Not sure how we would go about properly
testing ~TC() -- the image path function tests don't currently test
any single image mod's output correctness.
Adds '/roll N' command which gets a random number between 1 and N and prints it as "$username rolled a die [1 - $N] and got $value." to the game creation lobby chat or just to the sender otherwise (so not to flood the main chat).
The roll handler uses a uniform distribution generator, however with an additional mt rng from std library instead of the built-in wesnoth rng as the uniform distribution generator can use only a specially formatted rng engine.
Removes orb_status.hpp from an include-chain that lead to picture.hpp, however
that's unimportant. While orb_status.hpp was the first path from display.hpp to
picture.hpp, display.hpp later includes picture.hpp directly.
Mostly formatting and wording improvements. Also added a longer
description for the namespace explaining IPFs, image formats and the
image cache briefly.
Apparently, even on Boost 1.73 without Boost placeholders specialized as is_placeholder, they were somehow
getting used in the global namespace. Would explain all the "Boost placeholders in the global namespace is
deprecated" warnings I was getting after 23d1db043f9f8266c77c6270ed4ef3eafbc0cf67.
When testing with BOOST_BIND_NO_PLACEHOLDERS, even though I had `using namespace std::placeholders` in utils/functional.hpp,
compilation still failed in places. This confirms even more that Boost global placeholders were being used. Honestly,
it was simplest just to specify std::placeholders for everything. This also means we can remove the hack in utils/functional.hpp
designed to allow Boost placeholders to work with `std::bind`.
These methods are actually the compiler's defaults. We do need to keep
them around in some capacity because of the explicitly defined default
constructors, so just explicitly default them instead of keeping extra
redundant code around.