Commit graph

33042 commits

Author SHA1 Message Date
Charles Dang
f105fa2036 Filesystem/Boost: formatting cleanup 2018-05-11 11:54:35 +11:00
David white
3886228447 added use_prng preference which adds a new experimental pseudo-RNG for casual campaign play 2018-05-11 11:23:01 +11:00
Charles Dang
b89b89abea Only redefine VOLUME_NAME_NONE if it's not previously defined 2018-05-11 11:22:25 +11:00
Charles Dang
41b436abd3 Fixup 497d58d (forgot to free the doc path) 2018-05-11 11:15:40 +11:00
Charles Dang
2a585118d8 Bump min required Windows version to 7
Technically, all this code should work on Vista, (including the recent switch to using
SHGetKnownFolderPath), but since we're also considering requiring Visual Studio 2017
for building, we need Windows 7.
2018-05-11 10:56:11 +11:00
Charles Dang
497d58df6f Convert use of deprecated SHGetFolderPathW to SHGetKnownFolderPath 2018-05-11 10:29:12 +11:00
Jyrki Vesterinen
8fa3f6a6d4 Fix #3065: unit halo remains after undoing a recall 2018-05-10 11:07:24 +03:00
Jyrki Vesterinen
ef60deaa2b Disallow units with negative HP
Damage calculation code can't tolerate presence of such units.

Fixes #3042.
2018-05-09 21:38:55 +03:00
Charles Dang
4c937c10c7 Fixed a crash when using certain invalid color= values
The specific case that brought this to our attention was color=100. In case such values
are used, the color reverts back to the default color for that side, as before.

The new codepath (team::get_side_color_id_from_config) is essentially the same as the old
one but more robust (range checking, for example, the lack of which was causing the crash
before).
2018-05-09 23:58:40 +11:00
Charles Dang
6a7bd05250 Revert "MP Lobby: reduced frequency of network polls (100ms -> 1000ms)"
This reverts commit 5fd833a91a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see #3046). It seems 100 ms was enough to mask this issue.
2018-05-09 23:58:40 +11:00
gfgtdf
a3decde67f more debug information in icompare 2018-05-09 03:32:10 -03:00
Jyrki Vesterinen
057e53a463 Partial case insensitivity for translation::icompare() fallback 2018-05-07 19:46:42 +03:00
Iris Morelle
871189cc36 i18n: Blind fix attempt for std::bad_cast being thrown on Windows
Several reports on Steam and our forums point at std::bad_cast being
thrown when accessing Preferences and the Multiplayer menu amongst
others. It's possible that the locale configuration on those systems is
not quite right, and compare() and icompare() are able to throw
std::bad_cast when this happens as they both use std::use_facet().

Note that much like the macOS/iOS version of icompare(), this stopgap
patch doesn't attempt to provide any form of case-insensitive fallback
and just uses a case-sensitive comparison instead.
2018-05-07 19:46:31 +03:00
Charles Dang
58ebc064e9 MP Lobby: bunch of small UI and text formatting tweaks 2018-05-07 11:42:11 +11:00
Charles Dang
79c9862129 MP Lobby: reduced frequency of network polls (100ms -> 1000ms)
This also affects MP Staging and MP Join Game.
2018-05-06 22:59:21 +11:00
Charles Dang
6d84ee70c5 MP Lobby: rearrange player list nodes and have Selected Game also expanded by default 2018-05-06 22:59:20 +11:00
Charles Dang
be580a1973 GUI2/Chatbox: attempt to send roomless messages to the active room first
Fixes #2775. Server messages in particular are roomless, so now they should appear in
whatever tab (PMs included) you have open.
2018-05-06 22:59:19 +11:00
Charles Dang
2769345f55 Increased in-game chat size. This makes it render more smoothly
Thanks to @ProditorMagnus for the suggestion. Note that here on master, this code isn't
really used right now, so it's mostly here for completeness if it turns out to be needed.
2018-05-06 22:59:18 +11:00
Charles Dang
fe10bc0315 MP Lobby: removed Refresh button
I'm not 100% sure about this change, but I think its presence was rather confusing and
it (hopefully) shouldn't ever be needed.
2018-05-06 22:59:17 +11:00
Lipka Boldizsár
7b5cf85461 Fix excessive mp lobby refreshing. 2018-05-06 22:42:33 +11:00
Lipka Boldizsár
8bd6646182 Revert "Fix excessive mp lobby refreshing."
This reverts commit 590fd3c4d5.
2018-05-06 13:02:56 +02:00
Lipka Boldizsár
590fd3c4d5 Fix excessive mp lobby refreshing. 2018-05-06 12:55:29 +02:00
Alexander van Gessel
6444ebde60 Reject bad data URIs 2018-05-06 07:13:21 -03:00
Iris Morelle
c0f160b351 fuh: Add NOTE on the status of glob bans
[ci skip]
2018-05-06 05:25:23 -03:00
Iris Morelle
80d6dbbaf9 mp: Add client-side localization support for user_handler bans 2018-05-06 05:25:16 -03:00
Iris Morelle
d48c84236c wesnothd/fuh: Check IP address bans before everything else
There isn't much point in doing more expensive ban look ups first.

(Also, yes, I am aware that as it is there's still two SELECT queries
that could be coalesced into a single one -- namely, the ones for the
user_email and user_id columns.)
2018-05-06 05:25:10 -03:00
Iris Morelle
749e684f03 wesnothd: Report different user_handler ban types
This enables reporting back to the client the specific type of ban that
affects the account. This information is already normally provided by
phpBB when trying to view a page while banned, so we are not leaking any
new information here.

There isn't an API to retrieve the (user-visible) ban reason from the
ban list yet. It's probably not worth worrying about it since affected
users can see it when navigating to forums.wesnoth.org anyway.
2018-05-06 05:25:06 -03:00
Iris Morelle
f2c06f0a4e wesnothd: Initial support for checking forum bans during login
This adds a user_is_banned() method to the user_handler classes that
returns whether a given username (and optionally IP address) is banned
by the user_handler platform. Obviously right now this is only intended
to work with forum_user_handler and phpBB.

Forum bans are checked against entries in the banlist table using
username (actually user id), IP address, and email address where
applicable. A user matching a ban on any of those three items will not
be permitted into the server *unless* they have the moderator flag set.
It might be worth making an exception for board founders as well,
although that is probably orthogonal to this patchset.

Right now there are a few missing items:

 * The server sends clients an error that allows them to try again with
   a different username/password combination immediately. Nothing stops
   them from causing noise in the server logs this way, so we probably
   need to ensure this counts as an authentication failure for the
   purpose of temporarily and automatically banning the IP address.

 * The user handler doesn't allow retrieving details about the ban, so
   all that the main server code can do is report back to the client as
   their nickname being banned, when this is not necessarily the case
   (email or IP address bans). I need to figure out a better API for
   retrieving this info.

 * Likewise, the server does not log the specifics about the matched ban
   yet unless the mp_user_handler log domain is set to the info log
   level.

 * There's no i18n support on the client side for the error message sent
   by the server -- which is going to change anyway.

 * Testing this patch uncovered an issue with the MP client not
   displaying messages sent during the login sequence, including the mod
   authentication notice.
2018-05-06 05:25:02 -03:00
Charles Dang
851b28e24b * MP Method Selection: clarified the account requirement for the official server
Also sets the tooltip type for this dialog back to bottom-of-the-screen ones instead
of floating ones. And some formatting cleanup to the C++.
2018-05-06 16:39:31 +11:00
Iris Morelle
d727cf2c99 gui2/unit_attack: Only display active specials on the weapons list
This fixes issues reported on the forums where the weapons list now
includes weapon specials even when they aren't active, a regression from
1.12.x.

Closes #3033.
2018-05-06 00:40:11 -03:00
gfgtdf
775f3ec995 wb: prevent unit id conflics
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
2018-05-06 06:30:55 +11:00
gfgtdf
8b745095ab add a comment 2018-05-06 06:30:53 +11:00
gfgtdf
cdb98f75a4 wb: fix 'insufficient movement' wanring when a move is interrupted 2018-05-06 06:30:52 +11:00
gfgtdf
2635c7014f wb: more detailed error message 2018-05-06 06:30:51 +11:00
gfgtdf
4725ba9f35 add todo 2018-05-06 06:30:50 +11:00
gfgtdf
aa3a357bfc wb: fix planned units under fog cannot be selected 2018-05-06 06:30:49 +11:00
gfgtdf
51189881dc wb: silence "Unable to build future map" warning 2018-05-06 06:30:48 +11:00
gfgtdf
5a3eec5398 fix comment 2018-05-06 06:30:47 +11:00
gfgtdf
14a0e3744f wb: fix rare OOS caused by recall action
previously having a planned recall action could change the order of
units in the recall list, which might for example change which unit is
recalled by a [recall].
2018-05-06 06:30:46 +11:00
gfgtdf
19e123e38b wb: fix recall actions changing gamestate
The firstproblem was that:
apply_temp_modifier adds the temp_unit_ to the map, then
remove_temp_modifier adds the temp_unit_ from the map to the recall
list, which resulted in the original recall unit beeing replaced by the
temp_unit_ of the recall_action We fix that by making sure that
temp_unit_ is always the same as athe recall unti not just a copy.

The second problem was that remove_temp_modifier reset the unit mp/ap to
a value differnt form the original mp/ap which could casue OOS later
since the ap/mp might be changed form that unsynced context, we fix that
by resetting the mp/ap in remove_temp_modifier
2018-05-06 06:30:45 +11:00
gfgtdf
97a5810f2d wb: fix moved becoming invalid after recruit is executed 2
turned out 8bdccca7 was not enough because the mapbuilder erroneously
reset the units movement to full directly before it was applied. Since
the `resetters_` code in mapbuilder.cpp does not apply to
recruited/recalled units, we also have to reset the units mp in
remove_temp_modifier.
2018-05-06 06:28:46 +11:00
loonycyborg
10ee2b2d29 wesnothd: add a check to prevent crash from accessing game owner not in player_connections_ 2018-05-05 15:09:49 +03:00
gfgtdf
c580156716 remvoe spammy debug message. 2018-05-05 18:10:54 +11:00
gfgtdf
8bdccca7e3 wb: fix moved becoming invalid after recruit is executed 2018-05-05 18:10:53 +11:00
Charles Dang
717578b8a3 MP Lobby: kept the titles of reloaded games with vacant slots yellow 2018-05-05 14:00:21 +11:00
Charles Dang
7983b283ce Yet even more additional supplementary additive fixup 2018-05-05 13:31:16 +11:00
Charles Dang
77922e5450 Fixup 18afe08 2018-05-05 13:00:10 +11:00
Charles Dang
d789c2e773 MP Lobby: fixed every single user name being bold
If everyone's registered... no one is. :P
2018-05-05 12:35:05 +11:00
Charles Dang
819947f95f MP Lobby: added status text for full games 2018-05-05 12:35:02 +11:00
Charles Dang
b17e9fa9b1 MP Lobby: restored Era info to main game display
Includes some slight spacing tweaks.
2018-05-05 12:35:00 +11:00