70899 Commits

Author SHA1 Message Date
Richard Kettering
b969940ba4 Added frames for a ne stalwart attack. 2018-01-17 23:03:00 -06:00
Charles Dang
b8703b4527 MP Create Game: fix game load functionality being broken (fixes #2340)
Regression from 175e64cfaa0a18c85b5387d4464256b6c8cdf1cf.
2018-01-18 13:15:17 +11:00
Jyrki Vesterinen
52e3772c86 Lua API: reject invalid WML tag names (#2375)
Tags that the WML parser rejects shouldn't be possible to create with Lua,
either. This ensures that a UMC author can't accidentally, or deliberately,
inject such tags into the game state and make saving the game impossible.

Fixes #2375.
2018-01-17 23:52:34 +02:00
Jyrki Vesterinen
1386e3945c Added unit tests about which WML tag names Lua API accepts 2018-01-17 23:23:13 +02:00
Jyrki Vesterinen
3bc36efa58 Refuse to save if game state can't be represented as valid WML (#2375)
Such a save file can't be loaded anyway.
This way, at least the player can't overwrite an existing, working save
with one that cannot be loaded.
2018-01-17 21:05:44 +02:00
Alexander van Gessel
5df406869a
Clarify lifetime of defines maps
Wrap the bare pointer in a unique_ptr and move it into the sink.
2018-01-16 22:58:46 +01:00
Alexander van Gessel
f453f1422b
Indicate ownership transfer using unique_ptr argument
Best practice according to GotW #91.
https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2018-01-16 13:37:01 +01:00
Alexander van Gessel
65dd884b50
Store pointers in unique_ptr 2018-01-16 11:32:17 +01:00
Gregory A Lundberg
bbdb5ad86a
Fix control reaches end of non-void function
This only compiles on MS Visual C++ version 12.0, or earlier (Visual Studio 2013, or earlier).
2018-01-13 11:20:43 -06:00
Gregory A Lundberg
312af6064f
Remove incorrect noexcept clause
Do not mark a function as not throwing exceptions when it plainly does.
2018-01-13 10:36:00 -06:00
newfrenchy83
ceec498904 Update changelog (#2361)
(updated by ai0867)
2018-01-13 10:46:34 -05:00
Jyrki Vesterinen
8731930402 Fix: canceling attempt to reconnect didn't close addon manager
Only happened if the player used the buttons in the addon list: the buttons
in the right panel worked fine. The problem was that the addon list caught
the addons_client::user_exit exception separately and didn't rethrow it
when necessary, unlike the addon manager itself.

I decided to simply throw a different exception instead.
2018-01-13 14:59:58 +02:00
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