Fixes its help entry looking like this:
> --change-passphrase ADD-ON OLD NEW ADD-ON OLD NEW ADD-ON OLD NEW
> Change the passphrase for ADD-ON from OLD to NEW
When it really should look like this:
> --change-passphrase ADD-ON OLD NEW
> Change the passphrase for ADD-ON from OLD to NEW
Wesnoth 1.7.x and later use a GUI2 code path to display the [upload]
response message, which means GUI1 markup won't work with it. They do
not enable Pango markup either, and in any case, formatting messages
properly should be the client's responsibility, not the server's.
Perhaps later we should allow including a secondary message in the
response or something like that.
This copies the current contents of the dialog to clipboard. The button
currently lacks a tooltip because the tooltip has the potential to cause
map labels to glitch through the dialog when displayed (see commit
eab3e6fb646fda8cc6101a3e568c86c2b17b707f and bug #22176).
This functionality will be shared with a new Copy to Clipboard button
and its callback in the next commit, so it has to be refactored so that
we don't wind up with duplicate code. This is also why
gui2::tchat_log::model::stream_log() now has a 'raw' parameter which
defaults to 'false'.
I couldn't resist the temptation so I added some const specifications to
a few write-once variables, in particular those that ended up in
gui2::tchat_log::controller::calculate_log_line_range().
While I didn't change any existing behavior (to my knowledge, anyway), I
changed the algorithm for the 'count_of_pages' value as follows:
// Before:
count_of_pages = model_.count_of_pages() != 0
? model_.count_of_pages()
: 1;
// After:
count_of_pages = model_.count_of_pages() >= 1
? model_.count_of_pages()
: 1;
I don't believe model_.count_of_pages() can yield a value less than
zero, so this shouldn't alter the previous behavior in practice.
This allows game_board to unfriend both playsingle_controller
and replay_controller, without adding new methods to game_board.
This partially reverts commit
15ed9d186676c56db60e3bd9a3f147b6fdca85a4,
"refactor replay_controller in order to unfriend game_board"
This function required the use of resources::game_map, so properly
should be a method of game_map. This will help us to make sure that
such functions work when using either the editor or the play
controller, or the replay controller, and generally improve
encapsulation.
Currently, the editor does not generate game_board objects, and
leaves the pointer resources::gameboard null. This commit makes
map_location, reports, and tod_manager, three things used in
editor mode, use the display_context pointer instead of the
game_board pointer. We also move a function to display_context,
which finds a const unit * to a visible unit at a hex.
This should be removed soon, it is just a short term corrective
measure for an editor segfault introduced in prior commits. The
plan is to correct the segfaults, then refactor this away.
unit_map is modified in many places that don't normally include
map.hpp, so to avoid doing harm by adding this class, I am making
it hold a scoped pointer to the gamemap instead of an actual
gamemap. This results in very few changes.
- The implementation of game_board has to use the pointer.
- game_board must use copy and swap idiom
- lua get terrain function must pass strings to the game_board,
not enums, and we parse them as std::strings in game_board
instead of as c strings in lua api (which was a bit gross anyhow)
Refactors most of campaignd's code to ease future feature additions and
bug fixes, making the code slightly more organized and readable.
No behavior changes expected or observed from the state previous to this
merge.
Some old code used copies or read-write refererences for strings that
are never deliberately modified afterwards; and a bit of my own code
gets a (arguably tiny) WML config by value from a method that always
returns a read-only reference, missing out on a tiny optimization
opportunity by avoiding a config copy.
There was also a once-written int variable in handle_request_campaign().
Since 1.9.x, using lexical_cast to set config attributes is no longer
required and the engine will automatically try to cast string values to
a more "natural" type.
Thus, this commit incurs in no real behavior changes.
This replaces them with two methods that are part of the server class
itself.
These functions were always used in conjunction with
network::send_data() to send the generated WML object to a network
client. Because the config was created within the functions and not on
the callsite, this resulted in a call to the config copy constructor
that could be avoided by grouping the network::send_data() call together
with the WML generation.
These methods are tried and run in sequence by looking them up from a
request handler registry maintained as part of the server object. Since
every campaignd request is a single WML node with an identifying name, I
feel this approach makes things more readable than the previous massive
deeply-nested if-else-if chain approach, but that might be just me.
Check time() deltas instead of incrementing a counter variable forever.
This should allow to extract a bit of the run() logic into a separate
method later.