53508 Commits

Author SHA1 Message Date
Andrius Silinskas
40c7cc8dbd Use factions, leaders and genders manager in mp::connect. 2013-09-05 18:33:41 +01:00
Andrius Silinskas
54d776d236 Use factions, leaders and genders manager in mp::wait. 2013-09-05 18:33:41 +01:00
Andrius Silinskas
5d1406c30e Added a new class to handle factions, leaders and genders. 2013-09-05 18:33:41 +01:00
Andrius Silinskas
63beb77d11 Lock side configurations for non-first scenario with map settings off. 2013-09-05 18:33:41 +01:00
Andrius Silinskas
a011e6e894 Don't lock side configurations if map settings are not in use. 2013-09-05 18:33:40 +01:00
Andrius Silinskas
e9fad7130e Adjust faction combos lock according to the side recruits. 2013-09-05 18:33:40 +01:00
Andrius Silinskas
fe3224e9b4 Remove a side from carryover on all of its leaders loss.
These changes allow to pass a correct information about sides to
mp::connect.

Can be turned off by adding "remove_from_carryover_on_leaders_loss=no".
2013-09-05 18:33:40 +01:00
Andrius Silinskas
abaa3944d7 Update mp::connect tests. 2013-09-05 18:33:40 +01:00
Andrius Silinskas
84e07d5c1f Clean up of mp::connect/wait gotos in play_game(). 2013-09-05 18:33:39 +01:00
Andrius Silinskas
9f4fa26637 Disable SideWML "faction" attribute for non-first scenarios. 2013-09-05 18:33:39 +01:00
Andrius Silinskas
6474d69ba5 Force "Use map settings" if "side_configurations_lock" is set to "yes". 2013-09-05 18:33:39 +01:00
Andrius Silinskas
f719bdf731 Update mp_game_settings::saved_game after first scenario is played. 2013-09-05 18:33:39 +01:00
Andrius Silinskas
7511218586 Adjust faction combos lock for "side_configuration_lock" attribute. 2013-09-05 18:33:39 +01:00
Andrius Silinskas
2a333eac55 Add a lock attribute for [multiplayer] sides.
The new "side_configurations_lock" attribute is used as a default value for
gold, income, team and color locks. Later, it should be used to lock
factions and leaders combos as well.

The attribute's default values are "no" for the first scenario and "yes"
for all the other ones.
2013-09-05 18:33:38 +01:00
Andrius Silinskas
e9b442ffdc Allow "Custom" faction for empty recruit lists.
This allows to properly display faction combo and makes a non-hacky way
to specify a side without recruit list.
2013-09-05 18:33:38 +01:00
Andrius Silinskas
9ed8742143 Apply carryover before displaying mp::connect between scenarios. 2013-09-05 18:33:38 +01:00
Andrius Silinskas
25a0e4b444 Use "Custom" faction if "previous_recruits" not empty. 2013-09-05 18:33:38 +01:00
Andrius Silinskas
406d7bc573 Check if leader was carried over and is in [unit] tag (mp::connect). 2013-09-05 18:33:38 +01:00
Andrius Silinskas
8cf2c0c171 Allow user to select factions even if side recruit list was specified.
To force user to play with recruit list specified, the "faction"
attribute should be set to "Custom".
2013-09-05 18:33:38 +01:00
Andrius Silinskas
dd87783f9f Move the set up of default faction from gui to engine (mp::connect). 2013-09-05 18:33:37 +01:00
Andrius Silinskas
c1320fd9cd Reload game config when MP save game is selected.
This guarantees that global game config has all the necessary
information for the game.
2013-09-05 18:33:37 +01:00
Andrius Silinskas
4ef5a40f48 Use the same instance of game_state for MP screens and game.
These changes are towards the unification of MP scenario campaigns
initialization.
2013-09-05 18:33:37 +01:00
Andrius Silinskas
f557dfbeaa Move "level_to_gamestate()" to mp_game_utils.?pp. 2013-09-05 18:33:37 +01:00
Andrius Silinskas
bc9d5e5268 Separate mp::connect_engine from mp::connect.
The engine now should be created and then passed to mp::connect as a
constructor's parameter.

This is an initial step to prepare the engine to
be used outside of mp::connect screen context.
2013-09-05 18:33:37 +01:00
Andrius Silinskas
4bf5ca54f4 Add disallow copy and assign (mp::connect). 2013-09-05 18:33:37 +01:00
Andrius Silinskas
f2138a9530 Save reserved sides information only before updating game state.
Fixes a bug: if user joined a game, but cancelled "Choose a faction",
that user won't longer be available to join that game.
2013-09-05 18:33:37 +01:00
Andrius Silinskas
e7072da7cb Clean up of mp::connect(::engine).
Methods which were called only once was removed and their bodies were
used instead of a call to them.

Some methods for mp::connect UI update were merged for the sake of
readability and simplicity.
2013-09-05 18:33:37 +01:00
Andrius Silinskas
3416e305f5 Move side engine creation from gui to engine (mp::connect). 2013-09-05 18:33:36 +01:00
Andrius Silinskas
a99d1cfd9e Move and refactor teams initialization from gui to engine (mp::connect). 2013-09-05 18:33:36 +01:00
Andrius Silinskas
761575847b Use global variables for MP chat and gamelist.
As a desirable side effect, the mp::connect/wait screens now retain the
chat and gamelist over the campaign.
2013-09-05 18:33:36 +01:00
Andrius Silinskas
812afc7190 Add "Quit" option for mp::connect/wait when used in between scenarios. 2013-09-05 18:33:36 +01:00
Andrius Silinskas
8721cfa152 Fix side controller swapping on drop target (mp::connect). 2013-09-05 18:33:36 +01:00
Andrius Silinskas
084b9d1f1c Reserve sides for players who played them in previous scenario.
The information for the previous scenario's sides which have "save_id"
and a player ("player_id") assigned to them are now being recorded in
"mp_game_settings". This information is used in mp::connect for every
non-last scenario to reserve sides for previous players so that
they could easily join the game and be placed in the correct side.
2013-09-05 18:33:36 +01:00
Andrius Silinskas
c2eef81f8f Allow non-reloaded games to use "Reserved" option. 2013-09-05 18:33:36 +01:00
Andrius Silinskas
53dac1988d Minor clean-up of users related code (mp::connect). 2013-09-05 18:33:36 +01:00
Andrius Silinskas
752eaf73b5 Remove obsolete "simple server" related code (mp::connect).
As a result of this, 'connected_user' struct was no longer useful and
is now removed. Connected users information are now being hold in
std::set<std::string>, because only their unique usernames matter
in mp::connect.
2013-09-05 18:33:36 +01:00
Andrius Silinskas
0337835d97 Re-enable lobby to show reloaded game titles. 2013-09-05 18:33:35 +01:00
Andrius Silinskas
3c75c21583 Refactor users related code (mp::connect). 2013-09-05 18:33:35 +01:00
Andrius Silinskas
055caebcf2 Revert to a default login in case of an EMPTY_WRAPPED_STRING. 2013-09-05 18:33:35 +01:00
Andrius Silinskas
d562bdf475 Improve factions, leaders & genders related code. 2013-09-05 18:33:35 +01:00
Andrius Silinskas
0509d0c188 Unify leaders and genders set up between mp::connect and mp::wait.
The relevant functions from mp::connect were moved to mp::ui to enable
them to use by mp::wait as well. This is not the most elegant solution,
but in the future mp::connect and mp::wait should be merged into one,
and those functions could be moved back to where they were.

leader_list.?pp has been removed since it is no longer used.
2013-09-05 18:33:35 +01:00
Andrius Silinskas
b28a1fb6ab Move the init of leaders and genders list from mp::connect to mp::ui. 2013-09-05 18:33:35 +01:00
Andrius Silinskas
f7fa3c59b5 Display mp::wait (temporary dummy) in between mp::scenarios.
The screen is displayed only if '--campaign-screens' command line
option was specified. The same now goes for mp::connect screen for the
game's host.

Server has been modified to not immediately start the game after
'store_next_scenario', but to wait for explicit 'start_game'.

Minor changes to parameter passing inside multiplayer.?pp have been
made as well.
2013-09-05 18:33:34 +01:00
Andrius Silinskas
d94b36d58a Add unit tests for mp::connect. Work in progress. 2013-09-05 18:33:34 +01:00
Andrius Silinskas
ed0178adba Update Scons script to work with colorgcc. 2013-09-05 18:33:34 +01:00
Andrius Silinskas
56183cb79e Move network code from gui to engine (mp::connect). 2013-09-05 18:33:34 +01:00
Andrius Silinskas
d49e0877e4 Clean up & polish of mp::connect(::engine). 2013-09-05 18:33:34 +01:00
Andrius Silinskas
34672053f6 Second step of splitting mp::connect into gui and engine. 2013-09-05 18:33:33 +01:00
Andrius Silinskas
953306225c Refactor leaders and genders set up (mp::connect).
Many glitches related to leaders and genders should be fixed with this
commit.
2013-09-05 18:33:33 +01:00
Andrius Silinskas
530f126a66 Merge leader_list_manager with mp::connect.
The leader_list_manager was not too useful and didn't go well with the
changes of splitting the mp::connect gui and engine. Also, it was
accessing/modifying gui::combo directly, making it harder to maintain
the code.

mp::wait still uses leader_list_manager, because later mp::connect
should be used by both host and non-host players, making it unnecessary
to update mp::wait. However, if that won't happen, some duplicating
functions could be moved to some file, which could be accessed by both
MP screens.
2013-09-05 18:33:33 +01:00