61519 Commits

Author SHA1 Message Date
gfgtdf
7fce000723 fixup 'less config reloads' 2015-06-18 21:33:00 +02:00
gfgtdf
e8723b9ebb mp connect should ignore extra_recruit
extra_recruit is a unit specific attribute like canrecruit, upkeep or
placement. It should not be related to factions recruitlist.
2015-06-18 19:49:05 +02:00
gfgtdf
f149990041 remove unused function 2015-06-18 19:46:50 +02:00
gfgtdf
aad571d0bd fix mp depcheck crashing
previously mp depcheck was initialized after refeshing the cache which
caused a missmatch betwen create_engine::mods_ and depcheck::depinfo_
2015-06-18 18:58:02 +02:00
gfgtdf
98fcd16ead add previous_save_id= in [side]
A feature for mp campaigns. previous_save_id lets you specify which user
of teh previous scenario should control this side. For example if
previous_save_id="Konrad" than the user that controlled the side with
the save_id "Konrad" in the previous scenario should control this side.

This also replaces the controller=<number> feature which had similar
intentions but was less flexible.
2015-06-18 18:35:18 +02:00
gfgtdf
6c97702c45 fix random leader gender in sp
http://gna.org/bugs/?23496
2015-06-18 17:19:31 +02:00
gfgtdf
46295cbde6 allow [options] in [campaign]
this makes more sense than puttng them into the first [scenario] because
those options usually apply to all scenarios of that campaign.
2015-06-18 16:21:33 +02:00
gfgtdf
a719d6e2ab remove unused function 2015-06-18 16:21:31 +02:00
gfgtdf
8fc40ae227 remove unused function 2015-06-18 16:21:30 +02:00
gfgtdf
c2e1d71fc2 less config reloads
This removes a config reload when opening multiplayer or singleplayer
campaign selection screen after playign a campaign.

To do this we must make sure the default era for sp and for mp have the
same id becasue otherwise we might get an id not found error.
2015-06-18 16:21:28 +02:00
gfgtdf
024c56459e option to disable most of spmp patch
adds a bool variable in game_config which comepltely disables the
configure_engine, and connect_engine in sp.

Using this should fix https://gna.org/bugs/?23629 and
https://gna.org/bugs/?23496 but some bugs of the spmp patch like the
additional config reload in the campaigns  menu are still present.
2015-06-18 00:24:57 +02:00
gfgtdf
5c99ab7e69 remove unused default value
we already set the default value earlier in
game_config_manager::load_game_config so 'force_lock_settings' s never
empty here
2015-06-18 00:24:56 +02:00
gfgtdf
3ffca3067e refactor debug notification
TODO: maybe translation marks should be added ?
2015-06-18 00:24:54 +02:00
Ignacio R. Morelle
b2738ffb2f Use looks_like_pbl() to disallow .pbl file inclusion (bug #23504)
This function is implemented using case-insensitive pattern matching,
unlike filesystem::ends_with(). I missed this when writing my original
fix, so the vulnerability still applied to .pbl files on a
case-insensitive filesystem (e.g. NTFS and FAT* on Windows) by using
different case to bypass the check.
2015-06-16 23:24:30 -03:00
gfgtdf
634d29020f dont make 4mp leader quick in campaigns by default
making 4mp leader automaticly quick is unexpected for a campaigns
designer. And the intention is make it easier to port sp campaigns to
mp.
To do this i ported the quick4 mp leader code to lua.

I also moved the lua code from eras.cfg to a new file eras.lua, this
makes is easier for an editor to detect lua syntax highlichting
automaticly.
2015-06-16 02:13:08 +02:00
gfgtdf
219bb24b30 disable turn over advantage for campaigns by default
For campaigns (sp and mp) which are usually coop campaigns you usually
don't want the turns over advantage message. So we disable it by default
for campaigns. It is still possible to (de-)activate is manually by
setting the wml variable show_turns_over_advantage to yes/no
2015-06-16 01:18:43 +02:00
gfgtdf
c2071fca13 Fix another OOS
Previously it could happen that moves of the previous turn were not
sended yet to other players during 'side X turn' and similar events.
This caused OOS because "change_controller_wml" could be sended before
the the moves of the previous turn.

I also removed a virtual froma function that didn't need to be virtual.
2015-06-15 14:42:05 +02:00
gfgtdf
99d88e0910 Fix an OOS
Previously it could happen that a client would wait for a remote user
imput while still having a non-empty undo stack. Becasue of this the
client would not send the move that issued the user input (because the
client thinks it is undoable) to the other clients which then never gave
the user input.

This resulted in a situation where the game could not proceed and had to
be aborted.

Fixed it by calling resources::undo_stack->clear() as soon as we know
that a remote user input is needed
(synced_context::set_is_simultaneously()). Also added some assertions to
guard against this situation.
2015-06-15 14:42:04 +02:00
gfgtdf
aad4e7d600 fixup 'disable most mp_configure settings when force_lock_settings=yes'
this was a merging error.
2015-06-15 14:42:02 +02:00
gfgtdf
4df00e47c5 fixup 2015-06-15 14:42:01 +02:00
gfgtdf
f42ea8097c fix [allow_undo] in menu event commands
This was disabled in a previous commit
2015-06-15 14:42:00 +02:00
Elvish_Hunter
6b28e1ae89 changelog entries 2015-06-15 12:06:44 +02:00
Elvish-Hunter
e79e86c580 Merge pull request #410 from Elvish-Hunter/master
Move [role] to lua (fix for bug #23630)
2015-06-15 11:30:22 +02:00
Elvish_Hunter
d4a3c76447 Improved the [role] unit test
A new unit test, called 'test_role_lua' was added, to ensure that the [role]
tag could be used from Lua.
Also, in the first unit test the types list is stored in a variable, to
ensure that variable substitution works as intended
2015-06-13 21:23:40 +02:00
Elvish_Hunter
79d44d0486 Bugfixes in [role] tag
The following fixes were applied:
* cfg.__shallow_literal -> helper.shallow_literal, to allow calling the tag
  from Lua as wesnoth.wml_actions.role
* added trim() to the for cycle
* deleted filter.role and filter.type after having copied their data, because
  when calling the tag from Lua they ended up being deleted too early
* unit.role = cfg.role -> unit.role = role
2015-06-13 21:19:56 +02:00
gfgtdf
e377f29125 simplyfy :unit
Moves the check for alignment string to the caller to we dont have to
pass a custom error_handler.

Also removed a comment about a segfault in older code.
2015-06-13 03:30:10 +02:00
gfgtdf
eab9a87028 fix typo in error message 2015-06-13 02:37:19 +02:00
gfgtdf
4ab3c8cf0f Merge pull request #411 from gfgtdf/no_configure
disable most mp_configure settings when force_lock_settings=yes
2015-06-13 02:26:28 +02:00
ln-zookeeper
b32580a3de Fixed timeline-wise nonsensical mention of Typhon 2015-06-13 01:53:55 +03:00
Ignacio R. Morelle
140b3762c6 Update changelog entries for bug #23504 2015-06-12 19:28:51 -03:00
Ignacio R. Morelle
c838e6e875 Update changelog entries for bug #23633 with latest information 2015-06-12 19:28:00 -03:00
Ignacio R. Morelle
9ea6357638 Add untar instructions for gzip tarballs 2015-06-12 18:25:01 -03:00
gfgtdf
b8f26c4542 disable most mp_configure settings when force_lock_settings=yes
When using force_lock_settings=yes that game now not only forces
use_map_settings to on, instead if doest show these options and doesn't
thouch those attributes in the scenario.
This implements http://gna.org/bugs/?23037
and might also fix some bugs related to spmp patch ( specially
https://gna.org/bugs/?23509) since force_lock_settings default to yes
for campaigns.
2015-06-12 21:58:48 +02:00
gfgtdf
e2bbe8422f fix compilation
The minus sign was a copypaste mistake (copied from another commits diff)
2015-06-12 18:10:50 +02:00
Ignacio R. Morelle
b80819be02 ANL: Work around recruit lists being overridden by factions (bug #23593)
This only seems to happen when Use Map Settings is enabled. Using
faction_lock in that case forces the "Custom" faction selection, which
offers all possible leaders from all factions and doesn't override the
recruit lists.

faction_from_recruit would limit the faction selection to Loyalists in
1.10, thus ensuring all leaders are Loyalists with Use Map Settings on,
but that doesn't seem to work right now either. It shouldn't matter for
this scenario anyway as long as the recruit lists are the ones defined
here rather than the faction's.
2015-06-12 06:04:14 -03:00
gfgtdf
b728d216ba fix turns slider in mp
fixes up 35e1391652
2015-06-12 00:17:03 +02:00
Elvish_Hunter
787bd1b9c5 Moved [role] to Lua
This fixes indirectly bug #23630
2015-06-10 22:36:08 +02:00
Elvish_Hunter
1b239aa3e6 Added a new unit test for [role] 2015-06-10 22:07:28 +02:00
gfgtdf
f290a865fc fix compilation
the previous code compiled only on msvc.
2015-06-10 15:36:47 +02:00
gfgtdf
9e1aae1f79 inform the server about turn changes by wml
The server uses this to display the current turn in the lobby.
2015-06-10 14:26:08 +02:00
gfgtdf
6aa3b3bc9a don't check team names on serverside
http://gna.org/bugs/?23028

previously clients could add a "team_name" to specific packages which
should only be redirect to sides in this team. But the serversided code
which calculated in which team a side was had some bugs:
1) It did not correctly handle sides that were in multiple teams
([side] team_name="team1,team2"...)
2) The serversided data about teams was not updated when wml changed the
teams, also the calculation which side was controlled by a human used
posssibly oudated information.

This commit moves this calculation to the sending client so that the
clients now must specify a list of sides to which the package should be
sended.
2015-06-10 14:26:07 +02:00
gfgtdf
15698bbea6 make wesnothd::send_to_many( .., pred, ...) a template
this is faster than the boost::function version. (also note that it's
still possible to pass a  boost::function to wesnothd::send_to_many)
2015-06-10 14:26:05 +02:00
Ignacio R. Morelle
f891446818 Disallow inclusion of .pbl files from WML (bug #23504)
Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files.
2015-06-09 06:19:17 -03:00
gfgtdf
e2df198e55 veryfy that synced user commands come from the correct client
Previously it was possible that (modified) clients send user commands
like recruit or move while its not their turn. To prevent this, we now
use the from_side check (that was previously only used for dependent
commands) also for normal synced commands.

The from_side check works like this:
The sending clients adds a from_side= attribute to its commands which
contains which side issued this command.
The server veryfies that that client actually controls that side
The recieveing clients veryfy that this is the side that can currently
issue commands (the currently plaing side).

For compability with older clients  it currently just gives a
ERR_REPLAY. Later it should be changed into a replay::process_error.
2015-06-08 17:22:05 +02:00
gfgtdf
b160462fb2 fix :shroud debug command 2015-06-07 21:27:15 +02:00
gfgtdf
c605f07a36 sync remaining debug commands
Debug commands that doesn't change the gamestate like :inspect or
:sunset don't need to be sync.
2015-06-07 20:26:49 +02:00
gfgtdf
bb74aad2f8 fixup 2015-06-07 20:26:47 +02:00
gfgtdf
cb0eda0c2e sync :turn :turn_limit debug commands 2015-06-07 20:26:46 +02:00
gfgtdf
035aa07506 sync :next_level command 2015-06-07 20:26:45 +02:00
gfgtdf
fb40721922 sync :lua debug command 2015-06-07 20:26:44 +02:00