It’s theoretically possible that different Micro AIs’ evaluation
functions store information in the same variable within self.data.
This would only happen if the CAs have the same score and while this
should generally be avoided when setting up a scenario, it is better to
ensure that it cannot cause conflicts (not in the stored data at least,
the MAIs might still interfere with each other in other respects).
There was some oversight when changes to factions, leaders and genders set
up were made and as a result, in some cases, things were seriously broken.
This is an attempt to fix existing major problems. Some minor problems still
need to be addressed.
Specifically, this commit should fix problems with showing different factions,
leaders and genders lists for non-host and host players for the same sides. And
it should also avoid a situation where non-host player sees a "Custom" faction
even if it should not appear.
this is similar to previous commit which adds a "party full"
notification
note: we don't check the notification preference as this should be done
in the notification function and not by the caller. however, it seems
this is only done with DBUS notifications currently? see previous commit
message...
this is played at the same time as the turn bell, it is effectively
the same as a chat message which will cause a desktop popup on
systems that we support this for.
note: we don't check notification preference, because this should
be done in the show_notification function, not the caller.
however, it seems that is only done with DBUS notifications? why
not others?
the party full bell code is moved back to the engine, and is
based on checking whether processing the most recent message
has made it now possible to start the game. this seems to be
the simplest logic that will do the right thing, it will now
make the bell play whenever the "I'm ready" button is active
this also addresses bug #21910.
note: the reason we don't check the "silent" flag is that it
causes the sound not to be played in some circumstances where
it should. multiplayer_connect_engine currently returns
value "true" for silent (the second part of result) in all
cases except when a player has been successfully assigned to
a side, in which case it is false. depending on the status of
allow_changes, that might be a time that we want to play the
"ready to start" bell.
Assume the following situation:
2 Players in the game (A (side 1), B (side 2)), and one Observer (C).
it's A's turn.
A has to do a decision (for example unit advanement), A leaves the game
and B decides to assign side 1 to C.
On Client B: When returning from process_network_data side 1 is now controlled by B,
and then gets then reassigned with the next call of
process_network_data, but that's too late becasue handle_generaic_event
already returned and B does the advancement decision for side 1.
Players C gets the the first [change_controller] (A -> B) and then gets
the second change cntroller (B -> C) before getting B's answer to the
user choice. So when C gets the second [change_controller] he does the
decision himself becasue its C's decision an it has not been received
yet. -> the same decision has been made twice -> OOS.
this fixes this problem, by making the host wait for the servers change
controller in this case
we now check during the start event whether the game is a mp game which
runs in deteministic mode and give an error in this case. This case
shouldn't cause OOS but it allows players to cheat. I don't do it
earlier because i cannot use the screen during prestart events, and i
don't know about the code earlier (mp_connect).
this typedef was a leftover from my original plan to pass functions to
run_in_synced_context. I decided to pass strings to
run_in_synced_context at some time.
we now disallow undoing actions that we already sended over the network.
We also disallow undoing moves when the rng was invoked like it's done
for recruits/recalls already.
Allows units other than Gweddry to find the gold, and triggers the
academy-finding dialogue when moving close to it, but not if Dacyn
already got there first.
When the prefix is empty, there is no name so directly return.
This with commit f941c700810199a585f446272d184fbabf0ed879 makes it
possible to undo recruitment of undead units.
This breaks compatibility so is not intended for backporting.