77785 Commits

Author SHA1 Message Date
Charles Dang
5e52e8b703 Removed spurious use of unique_ptr in enter_wait_mode 2020-12-07 02:41:01 +11:00
Charles Dang
3f53050064 Remove wesnothd_connection_ptr typedef 2020-12-07 02:40:03 +11:00
Charles Dang
601789efa0 Explicitly disable deprecated boost::asio APIs client-side 2020-12-07 02:08:23 +11:00
Charles Dang
de83a80d5e Network Asio: simplify split_buffers
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.
2020-12-07 02:07:28 +11:00
Charles Dang
40441fecb4 Wesnothd Connection: simplify send() implementation
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.
2020-12-07 01:54:58 +11:00
Charles Dang
33f60c16a9 Network Asio: conditionally remove use of buffer_cast 2020-12-07 01:19:11 +11:00
Charles Dang
5f959917e1 Conditionally use io_context type directly 2020-12-07 01:11:39 +11:00
Charles Dang
ef72a0c787 Conditionally use new resolve/connect callback interfaces 2020-12-07 01:05:21 +11:00
Charles Dang
da29dbd380 Conditionally use new interface for resolver::async_resolve 2020-12-07 01:03:38 +11:00
Charles Dang
799addef01 Simplify network connection code with boost::asio::async_connect
That function basically does what we were doing manually - walking through each possible endpoint and trying to connect to each one.
2020-12-07 00:40:00 +11:00
Elvish_Hunter
ab95662720 wmllint: warn about shroud terrain in map files
Just like _f (fog), _s (shroud) is allowed only inside mask files
2020-12-06 11:23:13 +01:00
Elvish_Hunter
5eadebeb3a wmllint: added four tags to the allowed children of [if]
They are [true], [false], [found_item] and [proceed_to_next_scenario]
2020-12-06 11:23:12 +01:00
Elvish_Hunter
7babdf3cec wmllint: added [elseif] and [wml_message] to the tags allowed inside [part] 2020-12-06 11:23:12 +01:00
Charles Dang
e69a9d5069 Network Asio: conditionally use io_context::restart on Boost >= 1.66
This is the replacement for the deprecated reset()
2020-12-06 19:06:53 +11:00
Charles Dang
b18503359f Rename io_service_ variables to io_context_
As of Boost 1.66 these are of type io_context, so it makes it clearer.
2020-12-06 10:39:56 +11:00
newfrenchy83
73b18717d3 fix invalide initialisation of preprocess_file in wml_equivalence 2020-12-05 14:15:31 -06:00
newfrenchy83
ba3d2ea989 update test.cpp in codeblock projectfiles 2020-12-05 14:12:41 -06:00
loonycyborg
c1ad27a0c4 Fix compile error in forum_user_handler due to mission asio #include 2020-12-05 17:07:59 +03:00
Charles Dang
bf1078c25e Fixed some typos 2020-12-06 00:41:06 +11:00
Charles Dang
b0426a4b36 Cleaned up boost::asio includes
No need to include the whole massive boost/asio.hpp header when not everything in it is needed.
2020-12-05 23:24:59 +11:00
Nils Kneuper
f1b9df1caf updated Portuguese (Brazil) translation 2020-12-05 12:51:16 +01:00
Charles Dang
50ed04319d FIlesystem: used scoped enums 2020-12-05 22:03:01 +11:00
Elvish_Hunter
351f7cafcc wmllint: added support for custom conditional tags with magic comments 2020-12-05 11:03:40 +01:00
Pentarctagon
ba89526cec
Put these checks in the same place. 2020-12-04 17:21:59 -06:00
Charles Dang
e9252bd9f2 Default to jpg screenshots by default 2020-12-05 09:31:04 +11:00
Charles Dang
6adc9ab76f Bump SDL_Image dependency to 2.0.2 and enable jpg screenshots unconditionally 2020-12-05 09:30:17 +11:00
Iris Morelle
237c9c34dd wml/preprocessor: Reduce code duplication in preprocessor conditionals
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).
2020-12-04 15:13:04 -03:00
Iris Morelle
acc8dc400d gettext: We don't need the entirety of Boost.Locale
This may seem unimportant, but the full thing is actually pretty big and
very few places use it.

(Yes, gettext.cpp needs it.)
2020-12-04 14:14:56 -03:00
Iris Morelle
5ab41ee9f9 fs: Un-inline non-trivial blacklist_pattern_list methods
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.
2020-12-04 13:45:31 -03:00
Iris Morelle
48bfa7abb8 image: Drop get/set_team_colors() functions
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.
2020-12-04 12:47:24 -03:00
Pentarctagon
48b5db9672
Only need errors. 2020-12-04 08:56:18 -06:00
Pentarctagon
fff15b9bd1
Fixup. 2020-12-04 08:54:54 -06:00
Pentarctagon
f23ea9e563
Make notification smaller. 2020-12-04 08:54:03 -06:00
Pentarctagon
a7bc07d5ee
Don't send notification for failed PRs. 2020-12-04 08:37:24 -06:00
kabachuha
f687be92bd update changelog 2020-12-04 16:30:55 +03:00
kabachuha
f84cfde76f remove doubled checks for game membership
If the player is a part of the game, their ptr is valid, so the is_member call is useless.
2020-12-04 14:17:45 +01:00
kabachuha
af579c6bf1 add '/roll N' command to games and game lobbies
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.
2020-12-04 14:17:45 +01:00
Steve Cotton
3bc5badbf3 Move get_orb_image() to the only .cpp file that calls it
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.
2020-12-04 13:10:41 +01:00
Charles Dang
460d7368eb GUI2/Window: used a scoped enum for status 2020-12-04 22:30:07 +11:00
Martin Hrubý (hrubymar10)
2673db12e4
Fix Xcode project 2020-12-04 11:44:37 +01:00
Charles Dang
1bfa81f50c GUI2: dropped some constructors marked deprecated
The common pattern is to pass the widget's builder to the ctor.
2020-12-04 20:34:22 +11:00
Pentarctagon
ff360d7d95 Don't show redundent details on push vs pull request. 2020-12-04 00:20:10 -06:00
Charles Dang
3b69456dd5 GUI2/Size Lock: pass builder_widget reference directly to finalize 2020-12-04 16:22:30 +11:00
Iris Morelle
9de5c60a72 image: Drop redundant include
Absolutely nothing here uses SDL 2 out in the open.
2020-12-04 02:19:47 -03:00
Iris Morelle
2f80397bd6 image: Doxygen documentation
Mostly formatting and wording improvements. Also added a longer
description for the namespace explaining IPFs, image formats and the
image cache briefly.
2020-12-04 02:19:47 -03:00
Iris Morelle
7d0e586eac image: Formatting
No code changes here.
2020-12-04 02:19:47 -03:00
Charles Dang
6e2f3e099e Removed utils/functional.hpp 2020-12-04 15:30:46 +11:00
Charles Dang
30c7a747ab Explicitly specify std::placeholders namespace for all bind placeholders
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`.
2020-12-04 15:28:15 +11:00
Charles Dang
472fba4e76 GUI2/Window: used a scoped enum for show_mode 2020-12-04 13:52:14 +11:00
Iris Morelle
4db2abcc9c addon/info: Simplify operator= methods
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.
2020-12-03 23:49:53 -03:00