Commit Graph

25570 Commits

Author SHA1 Message Date
Patric Stout
fc91f1d1b2 Fix: don't do a network disconnect between two queries
This meant that on opening the Multiplayer window, if you had more
than one server configured, it would one by one cancel all pending
queries and send a new. Result: only the last server was updated.
2021-05-08 17:26:10 +02:00
Patric Stout
1b75a29d12 Fix: destroying a TCPConnecter that was still resolving made illegal writes
Basically, we should join the resolve thread before we destruct
the object.
2021-05-08 17:26:10 +02:00
Patric Stout
664a8c3e85 Codechange: move connection_string to private for TCPConnecter
The most common case never needs access to it anymore. Make the
one exception to this explicit. This means the fact that we
store it is now an implementation detail.
2021-05-08 17:26:10 +02:00
rubidium42
de940b1dbc Fix fdc11a9: Missing sprite count determined on the wrong file 2021-05-08 14:24:35 +02:00
Rubidium
fa6abe1646 Cleanup: remove the old FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
10e35ca8e4 Codechange: let NewGRF make use of SpriteFile instead of most of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
fdc11a9f94 Codechange: introduce SpriteFile to be used by the sprite loader instead of the global FIO slot functionality 2021-05-08 12:39:34 +02:00
Rubidium
0dd339ecd8 Codechange: lets music make use of RandomAccessFile instead of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
c097bc9d7d Codechange: let NewGRF sounds make use of RandomAccessFile instead of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
b144e56b2c Codechange: use the new RandomAccessFile as backend for the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
8e0b1b5d1a Add: concept of a RandomAccessFile to replace the FIO slot functions 2021-05-08 12:39:34 +02:00
PeterN
69e5da0b54
Codechange: Don't save unused NewGRF override mappings. (#9202) 2021-05-08 11:36:39 +01:00
William Davis
881e1da51d
Change: Use gender-neutral pronouns in console command messages (and comments) (#9203) 2021-05-08 11:02:30 +01:00
Patric Stout
f187708b3b
Fix f7e390bd: getpeername() doesn't work on closed sockets (#9213) 2021-05-08 11:57:41 +02:00
PeterN
8c3fa2a3bf
Fix #9209: Excessive time resizing highscore/news window when screen is too small. (#9210)
If the highscore/news window panel size, which is now scaled by GUI zoom, is larger than the screen size, a loop will be entered where the window is repeatedly resized.

This is resolved by removing the minimal size from the panel, as the window is always resized to cover the screen anyway. This means the screen size can never be too small.
2021-05-08 09:54:32 +01:00
Peter Nelson
dd41de8931 Codechange: Slider widget used different range for drawing vs setting.
Using the same range for setting means that no workaround for setting the extremes is necessary.
2021-05-08 09:54:14 +01:00
Peter Nelson
d8e06e590a Codechange: Make GetCurrentRect() conform to usual Rect bounds, and reuse it.
Similar code is already repeated in other locations.
2021-05-08 09:53:55 +01:00
Peter Nelson
52b16237ad Codechange: Don't update window contents if scrollbar position has not moved. 2021-05-08 09:52:54 +01:00
Peter Nelson
8321ef0061 Codechange: Set specific widgets dirty instead of window. 2021-05-08 09:52:54 +01:00
rubidium42
e2774354b4
Codechange: [Network] Change ChatMessage's message to std::string and simplify some code 2021-05-08 10:19:42 +02:00
embeddedt
a879996012
Fix: [Emscripten] Use non-XDG directories to simplify lolac storage (#9207) 2021-05-08 09:43:17 +02:00
translators
b56c03b120 Update: Translations from eints
dutch: 2 changes by Afoklala
2021-05-07 18:59:46 +00:00
Patric Stout
f7e390bdc0
Feature: use Happy Eyeballs to make network connections (TCP-only) (#9199)
Hostnames like "content.openttd.org" resolve into multiple IPv4 and IPv6.
It is possible that either of the IPs is not working, either due to
a poorly configured OS (having IPv6 but no valid route), broken network
paths, or a service that is temporary unavailable.

Instead of trying the IPs one by one, waiting for a 3s timeout between
each, be a bit more like browsers, and stack attempts on top of each
other with slight delays. This is called Happy Eyebells.

Initially, try the first IPv6 address. If within 250ms there is no
connection yet, try the first IPv4 address. 250ms later, try the
second IPv6 address, etc, till all addresses are tried.

If any connection is created, abort all the other (pending) connections
and use the one that is created. If all fail 3s after the last connect(),
trigger a timeout for all.
2021-05-06 23:13:35 +02:00
rubidium42
f1dfa661a1 Codechange: [Network] Use std::string for NetworkGameInfo 2021-05-06 21:45:36 +02:00
rubidium42
cb89d22cf2 Codechange: add DrawString(Multiline) that accepts std::string& 2021-05-06 21:45:36 +02:00
rubidium42
6bca9e090d Codechange: add SetDParamStr that accepts std::string& 2021-05-06 21:45:36 +02:00
translators
f313a539a5 Update: Translations from eints
portuguese: 1 change by azulcosta
2021-05-06 18:59:49 +00:00
rubidium42
3d91eee919 Codechange: [Network] Move connection string parsing away from C-strings 2021-05-06 20:33:26 +02:00
rubidium42
6c4a65eeb8 Codechange: [Network] Use std::string for NetworkAddress' host name 2021-05-06 20:33:26 +02:00
rubidium42
dcef3209a6 Codechange: [Network] Use new/delete instead of calloc/free for NetworkGameList 2021-05-06 20:33:26 +02:00
rubidium42
dc05917287 Add: [[nodiscard]] to std::string str_validate 2021-05-06 20:31:02 +02:00
Patric Stout
f94fb93779
Codechange: use connection_string in favour of NetworkAddress (#9197)
We now resolve the connection_string to a NetworkAddress in a much
later state. This means there are fewer places constructing a NetworkAddress.

The main benefit of this is in later PRs that introduce different types
of NetworkAddresses. Storing this in things like NetworkGameList is
rather complex, especially as NetworkAddress has to be mutable at all
times.

Additionally, the NetworkAddress is a complex object to store simple
information: how to connect to this server.
2021-05-05 23:21:14 +02:00
Rubidium
ead30dc725 Cleanup: [Network] Remove variable from NetworkGameInfo that is only used during deserialisation 2021-05-05 21:01:23 +02:00
rubidium42
e7581fd42d Change: [Network] Update server's NetworkServerGameInfo only when needed
Split the updating in a "static" version that only needs to be called when a new map is loaded or some settings are changed, and a "dynamic" version that updates everything that changes regularly such as the current game date or the number of spectators.
2021-05-05 21:01:23 +02:00
rubidium42
72bd62fd70 Codechange: [Network] Use a single NetworkServerGameInfo object at server side and serialize that for the clients 2021-05-05 21:01:23 +02:00
translators
24e7cb4947 Update: Translations from eints
english (us): 1 change by 2TallTyler
russian: 1 change by Ln-Wolf
finnish: 4 changes by hpiirai
2021-05-05 18:58:22 +00:00
Loïc Guilloux
605bd24674
Cleanup: Leftover static const variable from a3b356e (#9194) 2021-05-05 15:32:41 +01:00
rubidium42
a432009f06 Cleanup: [Fluidsynth] Comply better with the coding style 2021-05-05 16:03:34 +02:00
translators
fa206bf2e3 Update: Translations from eints
english (us): 1 change by 2TallTyler
estonian: 49 changes by siimsoni
korean: 1 change by telk5093
hungarian: 45 changes by baliball
finnish: 12 changes by hpiirai
spanish: 1 change by JohnBoyFan
2021-05-04 18:58:09 +00:00
Tyler Trahan
176d65b472
Change: Use gender-neutral pronouns in english.txt (#9189) 2021-05-04 13:28:01 +02:00
glx22
2feb801e56 Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops 2021-05-03 19:46:57 +02:00
glx22
983c7ade60 Codechange: Replace FOR_ALL_SEARCHPATHS with range-based for loops 2021-05-03 19:46:57 +02:00
glx22
34215f7faa Codechange: Replace FOR_ALL_TARS with range-based for loops 2021-05-03 19:46:57 +02:00
rubidium42
7bcc472f73 Add: [Network] Reading std::string from a packet 2021-05-03 17:56:05 +02:00
rubidium42
ba409e8c45 Add: [Network] Writing std::string to a packet 2021-05-03 17:56:05 +02:00
translators
8228021afe Update: Translations from eints
norwegian (bokmal): 1 change by Anolitt
spanish (mexican): 1 change by absay
korean: 1 change by telk5093
russian: 48 changes by Ln-Wolf
catalan: 1 change by J0anJosep
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by Vimerum
2021-05-03 15:50:01 +00:00
rubidium42
6bd7f8816d
Fix #9117, 04ce1f07: [Fluidsynth] Infinite wait when stopping song (#9181)
In FluidSynth 2.2.0 an extra state was added to denote stopping. To transition
from this state to a stopped state the rendering needs to be running. Since
04ce1f07 locking was added that skipped the rendering when something else held
a lock, so the state would never get to stopped and join would never return.
2021-05-03 16:40:19 +01:00
PeterN
08781d96ed
Fix: Query windows may be partially drawn initially. (#9184)
Query window was not marked dirty after being moved on init. It was then marked dirty once the white border flash completed.
2021-05-03 16:39:20 +01:00
PeterN
0bc6f32346
Fix #9174: Don't update text effect if it has been reset. (#9183) 2021-05-03 15:12:47 +01:00
Jonathan G Rennison
ece9a356dc
Fix #9113: Assertion failure when removing airport with order backup (#9182) 2021-05-03 15:03:25 +01:00