70687 Commits

Author SHA1 Message Date
Jyrki Vesterinen
735c054bd3 Don't reconnect to server when the player cancels connecting to server
Requested by @loonycyborg.
2018-01-13 14:59:58 +02:00
Jyrki Vesterinen
c9ec111cf1 Addon client: close connection if the player cancels the download
This ensures that the game won't interpret the rest of the addon as a
response for the client's next request.

Fixes #2203.
2018-01-13 14:59:58 +02:00
Gunter Labes
03b6ad568c
Continue if there is an old executable
Chances are that the previous build works just as well.
We just need it for config file parsing which does not change often.
2018-01-12 19:14:41 +01:00
Sergey Popov
ed6ad71f48
Merge pull request #2329 from GregoryLundberg/GL_I2327
Implement MP Moderation
2018-01-12 17:50:19 +03:00
Charles Dang
8ae99bc86a Added some event unit tests by @Pentarctagon
Tests event execution order and events with variable names.
2018-01-11 13:12:28 -05:00
Charles Dang
88b0fe5953 Further reworking of event iteration interface
Fixes #2312. Turns out constructing a list of matching handlers breaks some undocumented
behavior, namely events being executed in the order they're added (usually the order in
which they appear in the WML). It also broke certain variable substitution by moving variable
interpolation wholly before any event execution, as opposed to between each event.

This commit implements an even simpler method: simply iterating through every registered
handler in order, checking for a name match on each one, and if it passes, immediately
executing the provided function. Cleanup will only occur once the toplevel call to
execute_on_events is completed.

This commit also removes the immediately cleanup upon removing a handler. This should
ensure (I didn't test explicitly, but from other incidental issues I'm sure this is the
case) the size of the main vector doesn't change during iteration.

I also changed the pre-add standardization code to only affect event names without variables.
Variable names are standardized later after variable substitution.
2018-01-11 13:12:28 -05:00
Gregory A Lundberg
395f8fac78
Fix doccomment 2018-01-10 18:02:44 -06:00
Jyrki Vesterinen
a65596e5b5 Fixed: label editor could create empty undoable action chain (#2306)
Empty action chains are not allowed, attempting to partially undo an empty
chain causes a fatal error.

This commit fixes some of the breakage reported in #2306, but not all.
2018-01-09 20:27:05 +02:00
Allefant
4de5cdc7d3 update the addon manager for "simple WML" 2018-01-09 09:23:50 +01:00
Gunter Labes
7cdec04c7f
only keep env vars upper case, add missing quotes 2018-01-09 02:06:04 +01:00
Gunter Labes
a535a3140c
Use a more generic default value 2018-01-08 23:36:10 +01:00
Celtic Minstrel
b069bdd16e
fixup a4e7cb01e81962ab313884ba9df6ecc35ebbe4a3 2018-01-07 23:12:46 -05:00
Gunter Labes
15059ec10c Revert network protocol change from 002b1a3c87
Best to keep compatible and also not introduce yet another format for
the userlist.
2018-01-08 02:04:16 +01:00
Gunter Labes
3fa5272737 Avoid useless user list sending 2018-01-08 02:04:04 +01:00
Jyrki Vesterinen
2288098cba Ensure that probability to be touched isn't negative
Should fix #2342. I can't verify the fix because it doesn't occur with
Visual Studio builds.
2018-01-07 20:41:56 +02:00
ln-zookeeper
80829106c1 AOI: New story art by Bhoren
I chose 2560x1440 as the size over 1920x1080 simply because when I tried both sizes at compression levels that produced a similar quality result, the difference in filesize was negligible.
2018-01-07 13:31:43 +02:00
pentarctagon
a4e7cb01e8 Fix formatting of invalid characters for #2043. 2018-01-06 17:18:24 -06:00
Gregory A Lundberg
44ed26dd00
Fix crash to desktop on no addons
If campaignd reports no addons, do not crash to desktop. Instead, go ahead and display the empty list.

Closes #2355
2018-01-04 11:39:01 -06:00
Gregory A Lundberg
fbc0a142b0
Send handshake in network byte order
The handshake value is 42. The server sends this on startup in response to a zero-length document.

Yes, that means the server replies with The Answer to The Ultimate Question of Life, the Universe, and Everything. It is unspecified whether the client properly interprets The Answer.
2018-01-03 20:09:55 -06:00
Gregory A Lundberg
5426c884dd
Persist bans
The bans were not being immediately written to the file when created or removed.

Note that the file is overwritten directly rather than saved to a temporary and moved into place. This creates a race condition: a crash while writing corrupts the file.
2018-01-03 19:53:11 -06:00
Gregory A Lundberg
ef0c3b615d
Implement kickban
Added the missing call to actually ban the IP before kicking the player.
2018-01-03 19:53:11 -06:00
Gregory A Lundberg
d9f9d83a6b
Stop hanging when banned
When a banned or connection-limited client attempts to log in, it hangs.

This is because the client does not understand that the server did not finish the handshake. This moves the check to a point just after the handshake has completed (when the server would normally ask for a version number). The client never checked for errors, so added a check.
2018-01-03 19:53:11 -06:00
Gregory A Lundberg
66f740840e
Implement max connections
The function was lost. Recovered from Git hitsory and cleaned up a bit.
2018-01-03 19:53:11 -06:00
Gregory A Lundberg
88545de4b0
Expire the ban when no longer needed.
Actually, we expire it just before checking for bans during login and for the /q bans (list current bans) command.
2018-01-03 19:53:11 -06:00
Gregory A Lundberg
745f8d29c3
Fix kban syntax error
The "Kick + Ban" button omitted the space between the command and the nick.
2018-01-03 19:53:08 -06:00
sigurdfdragon
a9e035ab25 Update changelogs 2018-01-03 18:47:40 -05:00
josteph
e135517393 Game Display: Show correct defense modifier for unreachable terrain.
Fixes #2353.
2018-01-03 13:04:10 -06:00
Jyrki Vesterinen
a4018faad1 ToD manager: ensure that there is at least one ToD
Complete lack of ToDs is an unsupported use case,
causing crashes and undefined behavior. See time_of_day::parse_times().

Fixes #2301.
2018-01-01 12:36:12 +02:00
sigurdfdragon
d3a58e9424 DiD S12: Allow campaign to end on the third repetition
As players who haven't figured out certain strategies might have too much
trouble beating the third repetition. Also waiting until the fourth
repetition may be too long and have players question what's going on.
2017-12-29 19:50:54 -05:00
sigurdfdragon
44bcd6ef90 DiD S07: Add note about scenario conditions 2017-12-29 19:50:54 -05:00
sigurdfdragon
ec6c174096 DiD: Clear variables when no longer needed and remove unused variable 2017-12-29 19:50:54 -05:00
sigurdfdragon
b0fc2708ae DiD S11: Fix & improve wose implementation
Bug was that a troll on 4,21 could move through the avoid area to attack
player at 11,22 which is a likely occurrence. Expanding the avoid area
further seems inappropriate as troll avoidance is more likely to be noticed.

New implementation ensures only player will trigger the wose, maintains
proper look to the player, no longer interferes with trolls attacking, and
simplifies code.
2017-12-29 19:50:54 -05:00
sigurdfdragon
8db9ec2777 DiD S01: Add the alternative objective to the scenario objectives 2017-12-29 19:50:54 -05:00
sigurdfdragon
cd9af67ff1 DiD S04: Fix dialog so it better fits with if malin_used_necromancy or not 2017-12-29 19:50:54 -05:00
sigurdfdragon
5fbd5affe2 DiD S03: Slightly change gameplay to better match objectives
Have player kill all enemy units in the cave instead of just the leaders.
2017-12-29 19:50:54 -05:00
sigurdfdragon
8b367a184a DiD S11: Have dialog fire if Mal Keshar is defender as well as attacker 2017-12-29 19:50:54 -05:00
Vasya Novikov
d21a79b011 document use_markup widget property 2017-12-28 14:29:43 -06:00
Gregory A Lundberg
f35d2d892d Misleading comment
'toward zero' is confusing since it can round up or down.

The correct comment is 'round half up, to the nearest integer'.

Closes #2330
2017-12-28 14:27:29 -06:00
Jyrki Vesterinen
d81f230680 Clear unit death animation after killing the unit
This is another and much better way to fix the unit halo remaining.
2017-12-28 12:02:29 +02:00
Jyrki Vesterinen
f50c7d3f2a Revert "Work around unit halo not disappearing with [kill] animate=yes"
This reverts commit 70b468070b71616aa3663088b6ad171391d0c4f0.

As I said in the commit message, the fix is not pretty, and
@CelticMinstrel said in IRC that a different fix would definitely be
better. I'll fix the problem by having an animation automatically
release the unit when done, instead (next commit).
2017-12-28 11:48:12 +02:00
Steve Cotton
1c2968c632 L S8 Give Harper a loyal overlay in Liberty's final scenario
He's been a silver-crowned hero until this scenario, and in
the final scenario he's still loyal with dialogue if he dies,
so make him easily visible to the player.
2017-12-26 08:30:01 -06:00
Jyrki Vesterinen
70b468070b Work around unit halo not disappearing with [kill] animate=yes
The problem was that the kill animation retained a reference to the unit.
Triggering a Lua garbage collection (which destroys the animation object)
fixes it, although it's definitely not a pretty fix.

Closes pull request #2313.
2017-12-25 18:35:01 +02:00
gfgtdf
9cd200032c
fix player not proceeding to next scenario in Low 22
reported on the forum
2017-12-23 20:39:20 +01:00
Rikard Falkeborn
557bbf36ea Make some functions static in display.{cpp,hpp} 2017-12-22 19:48:45 +02:00
Charles Dang
393ac9bd70 Game Events/Manager: refactor event iteration interface
Instead of trying to iterate over two lists at once, just construct a new list of matching
handlers. This should fix #2310 too, since it ensures any additional events added after
iteration begins don't get executed.
2017-12-22 04:14:35 -05:00
Jyrki Vesterinen
e0e59ac463 Fix exception when [harm_unit] is used without an attacking unit
Regression from commit 38e31aa61f60abed71bd266e6d2abe61035805b4.
In particular, it broke WML unit tests.
2017-12-21 20:24:48 +02:00
Wedge009
fd656b61c4
Merge pull request #2309 from jostephd/whiteboard-sp-undo-stack
whiteboard: Don't clear the undo stack in SP mode.
2017-12-21 16:34:37 +11:00
josteph
5858208cf8 whiteboard: Don't clear the undo stack in SP mode.
Fixes #2303.
2017-12-21 02:21:56 +00:00
Vasya Novikov
7be364f3b5 addon_manager: fix append_tag usage
Note that this still doesn't allow the --upload
functionality to work. After this fix,
wesnoth still complaints about unordered WML.

It is believed that this is a separate issue though,
happened because of the latest simple_wml changes.
2017-12-20 22:23:53 +02:00
Gunter Labes
0c4ee56eac
Merge pull request #2307 from vn971/not_executable_images
make images not executable
2017-12-20 21:01:08 +01:00