83183 Commits

Author SHA1 Message Date
gfgtdf
e3bf4dcb3f use play_controller member over resources:: 2024-04-09 00:41:41 +02:00
gfgtdf
638e37ddf8 remove unused replay_to_process_data_result() 2024-04-09 00:41:41 +02:00
gfgtdf
41554735ed Fix comments 2024-04-09 00:41:41 +02:00
gfgtdf
97c811432d simplify undoing moves message 2024-04-09 00:41:41 +02:00
gfgtdf
2638ce8afc Move some functions
Now its a bit easier to understand which functions are in play_controller adn which in playsingle_controller as all turn related functiosn are now in playsingle_controller
2024-04-09 00:41:41 +02:00
gfgtdf
c9fcce6be0 Don't reset turn statistics when reloading game 2024-04-09 00:41:41 +02:00
gfgtdf
0b08a426b7 Dont autosave on skipped turns
Previously when umc used [end_turn] in turn starte events
the game would still generate an autosave for that turn
2024-04-09 00:41:41 +02:00
gfgtdf
3959540bbc Remove unused function 2024-04-09 00:41:41 +02:00
gfgtdf
b6f9746891 add comments 2024-04-09 00:41:41 +02:00
gfgtdf
8ff6128f0f remove replay_network_sender
It didnt really make the code easier
2024-04-09 00:41:41 +02:00
gfgtdf
d3f52a0fc2 simplify [change_controller] handing on the client 2024-04-09 00:41:41 +02:00
gfgtdf
d99c7b5d59 Refactor when replay actions are sent
Previoulsy send_actions() was called at random
parts of the code in a "better safe than sorry"
manner, which made it hard to understand when
actions are sent or which of these calls is needed.
The new approach is:
- Chat, MapLabels and other unsynced messages are sent
  regularily as part of playmp_controller::play_slice()
- Synced actions are sent as soon as they are undoable:
  - which is immidiately in particular for end_turn and
    init_side
  - after every exceution of synced commands in the end
    of synced_context::run() actions are send if the
    actions cannot be undone.
2024-04-09 00:41:41 +02:00
gfgtdf
79a88266e4 add a synced_context::block_undo() function
Using this function lets te synced context know that the current
action cannot be undone, so that it will in particular send the
actions too all players as soon as possible. The intention is
less delay in networked games.

Currently there is some redundance between is_simultanious_
and is_undo_blocked_, maybe one of these will be removed
later.
2024-04-09 00:41:41 +02:00
gfgtdf
f2bf2dd465 Remove last part of turn_info class
(The files were not deleted because i dont know how to remove them from the various projectfiles)
2024-04-09 00:41:41 +02:00
gfgtdf
8d8643915e add comments 2024-04-09 00:41:40 +02:00
gfgtdf
0ec43a1730 add synced_context::ignore_undo() 2024-04-09 00:41:40 +02:00
gfgtdf
9bedcb298c refactor playmp_controller::process_network_data()
process_network_data() Now always 'procecesses'
synced choices, since they are never exceuted
anyways just put on the recorder. so chat_only=yes
now only delayes new actions. This allows us to implement
receive_actions() by just calling
process_network_data().

This change also make the game execute other unsynced
actions like map labels sooner, along with chat messages.
2024-04-09 00:41:40 +02:00
gfgtdf
5de8f2f3ae simplify playmp_controller::play_network_turn() 2024-04-09 00:41:40 +02:00
gfgtdf
ee47e3a38f refactor notify_next_scenario handling
We now handle the case that the player becomes host during
wait_for_upload() and make the code more robust in case
[notify_next_scenario] is received at a unexpected time.
2024-04-09 00:41:40 +02:00
gfgtdf
ad40e41e9a remove unneeded check in mp_controller::sync_network()
PROCESS_END_LINGER is never returned outside of linger mode
2024-04-09 00:41:40 +02:00
gfgtdf
0b472e8fae simplify playmp_controller::process_network_data() 2024-04-09 00:41:40 +02:00
gfgtdf
cda1d30809 fix linger mode when ending the scenario in end_turn event
I am not really sure whether this is actually needed or whether it
actually worked before for some other reason, in any case the new
code is simpler and safer.
2024-04-09 00:41:40 +02:00
gfgtdf
6ac17427c6 Remove special handling of linger mode in playmp_controller
To make the code simpler.

the sp linger function calls play_slice() which playmp_controller already overwrites, after a little fix of that we can remove a bit of code
2024-04-09 00:41:40 +02:00
gfgtdf
b79e305419 split process_network_data() into smaller functions 2024-04-09 00:41:40 +02:00
gfgtdf
9d7fd59cc8 remove turn_info class
All of its functions were moved to playmp_controller. Since they
were already so interconnected, this makes things a little easier.

Also it was always a bit confusing that this class was called
turn_info when all it did was to process network data.
2024-04-09 00:41:40 +02:00
gfgtdf
0b1cc36e51 small function reorder 2024-04-09 00:41:40 +02:00
gfgtdf
102ba5801e remove redundant error handling code in linger()
Since 1.18 linger() is called indirectly by play_scenario_main_loop()
and play_scenario() which already catches therse erros and offers the option to save the game then.

The special handlng of ingame_wesnothd_error was removed since it
was only added to fix the case of the host leaving resulting in the
game aborting (which should no loner be the case)
2024-04-09 00:41:40 +02:00
gfgtdf
c452f498de enable 'reveal_map' in sp
It defaults to false, the change is mostly to make the code simpler
2024-04-09 00:41:40 +02:00
gfgtdf
dd91316104 Remove wrong comment
The option to load a game is only disabled in networked
multiplayer not in local multiplayer
2024-04-09 00:41:40 +02:00
gfgtdf
69fc479cfa simplify sending of [turn] data
1) We remove the syncmp_handler class which was a
   bit too complicated for its rather simple task
2) We move network related stuff out of playsingle_controller
2024-04-09 00:41:40 +02:00
gfgtdf
4b287691ef remove unneeded sync_network call
this was added at some place in the past when games woudl end via a
game_end_exception, and is not needed anymore§
2024-04-09 00:41:40 +02:00
gfgtdf
38d95cc3ee don't reveal map after mp campaign games by default
It now matches the behavior in sp, this makers especially sense
as sp campaigns can also be played in mp mode.
2024-04-09 00:41:40 +02:00
Steve Cotton
8e59da9186 Clearer documentation for the ATTACK_AND_VALIDATE macro 2024-04-09 00:28:22 +02:00
Steve Cotton
71c2f65a82 Fix clicking on the sidebar going to the wrong trait
If the first trait of a unit has no name, then clicking on the units (other)
trait in the sidebar opened the wrong page in the help.

(cherry picked from commit f9af941f1ec7165ad135cba465717203a4007287)
2024-04-08 01:20:01 +02:00
Steve Cotton
2cb33bc4a2 updated German translation 2024-04-08 00:32:43 +02:00
Steve Cotton
63638278b3 Document why the Fog Clearer's traits show in help
Not mentioned here, but turning on debug mode also affects which units,
and therefore which units' traits, are shown in help.

Having looked back into the history while wondering why it was done this way
in e9603e6e01, back then we needed a fix that could be backported to 1.14,
so couldn't add a new attribute to [unit_type].
2024-04-07 21:53:34 +02:00
Steve Cotton
83288dc6f9 update German translation
s1m0n was in the credits for 1.16, but that was missed when his contributions
were copied to master. Fix that, along with adding his latest updates.

The fuzzy flag in -wof probably got readded by mistake when rebasing.
2024-04-07 12:35:34 +02:00
Steve Cotton
ac5f821729 Disable the Windows CI builds
Setting up vcpkg tries to build xz from source, which fails because the
entire xz repo has now been made private or taken down. The vcpkg team
have been advised not to switch to an alternative repo [1], so for now
our Windows builds will always fail.

Turn those builds off, so that we don't get familiar with seeing red
status markers on all PR's CI results.

[1] `https://github.com/microsoft/vcpkg/pull/37957` - second comment is
the vcpkg team's "We have been explicitly asked by security folks to not
change the upstream [to a different repo] for liblzma at this time."
2024-04-07 12:35:03 +02:00
Gunter Labes
bc5d69d35e
campaignd: Assign port 15019 to 1.19 2024-04-06 22:27:10 +02:00
Nils Kneuper
0657f19c6b updated Finnish translation 2024-04-06 15:07:02 +02:00
Nils Kneuper
f58a9d6422 updated Ukrainian translation 2024-04-06 15:04:10 +02:00
Nils Kneuper
d298d9e1de updated Bengali translation 2024-04-06 15:01:38 +02:00
Nils Kneuper
4f9c583024 updated Arabic translation 2024-04-06 15:00:38 +02:00
pentarctagon
fbaded8c01 Add another query to the MP Activity Report queries
count by map and era
2024-04-04 14:56:15 -05:00
newfrenchy83
57c8e0cce0
Fix attack::damage_type bug for ability resistance
When [damage_type] is used but the opponent uses the resistance ability
against the added type, the ability filter only detected the original type and
the new type was not affected.
2024-04-04 18:01:36 +02:00
OrekOrek
c66b6d6c85
"Sands" to "Sand" (#8443)
Rocky Sand to Gravel
Desert Sand back to Desert Sands
Beach Sand back to Beach Sands
2024-04-03 09:25:08 -05:00
Oleksii
578b67e243
Restore alphabetical order of Ukrainian translators 2024-04-03 12:50:20 +02:00
Oleksii
e052632a50 Ukrainian translators update about_i18n.cfg 2024-04-02 14:53:27 -05:00
pentarctagon
6607da7b89 simplify always true condition a bit 2024-04-02 14:21:44 -05:00
Steve Cotton
6f95b062cb wmlxgettext: Fix "fix invalid escape sequence"
The original code was probably meant to strip trailing whitespace, which
turned out to be a bug when 4be9aa85849010e93a9a3b0f0701d0630e7b9368
fixed the buggy regexp so that it started working. That has now been
removed.

Fixed handling of multiline plural strings, which was broken too.

One feature has been left unimplemented, and will cause wmlxgettext to error
out. For "long bracketed" strings, Lua allows the contents to start with a
newline, which is automatically stripped from the resulting string. Trying to
understand the original purpose lead me to this feature of Lua strings which we
don't use in Wesnoth; and I finally concluded that, if someone wants to use
that feature, it can be their problem to implement it.

This fixes commit 4be9aa85849010e93a9a3b0f0701d0630e7b9368.

(cherry picked from commit e4239634e5094410478fa6b1d91df3be4ddf1caf)
2024-04-02 16:12:23 +02:00