Commit Graph

25390 Commits (dc0591728739c2c8fa68dbfeb418239fbfb39383)
 

Author SHA1 Message Date
rubidium42 dc05917287 Add: [[nodiscard]] to std::string str_validate 3 years ago
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.
3 years ago
Rubidium ead30dc725 Cleanup: [Network] Remove variable from NetworkGameInfo that is only used during deserialisation 3 years ago
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.
3 years ago
rubidium42 72bd62fd70 Codechange: [Network] Use a single NetworkServerGameInfo object at server side and serialize that for the clients 3 years ago
translators 24e7cb4947 Update: Translations from eints
english (us): 1 change by 2TallTyler
russian: 1 change by Ln-Wolf
finnish: 4 changes by hpiirai
3 years ago
Loïc Guilloux 605bd24674
Cleanup: Leftover static const variable from a3b356e (#9194) 3 years ago
rubidium42 a432009f06 Cleanup: [Fluidsynth] Comply better with the coding style 3 years ago
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
3 years ago
Tyler Trahan 176d65b472
Change: Use gender-neutral pronouns in english.txt (#9189) 3 years ago
glx22 2feb801e56 Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops 3 years ago
glx22 983c7ade60 Codechange: Replace FOR_ALL_SEARCHPATHS with range-based for loops 3 years ago
glx22 34215f7faa Codechange: Replace FOR_ALL_TARS with range-based for loops 3 years ago
rubidium42 7bcc472f73 Add: [Network] Reading std::string from a packet 3 years ago
rubidium42 ba409e8c45 Add: [Network] Writing std::string to a packet 3 years ago
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
3 years ago
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.
3 years ago
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.
3 years ago
PeterN 0bc6f32346
Fix #9174: Don't update text effect if it has been reset. (#9183) 3 years ago
Jonathan G Rennison ece9a356dc
Fix #9113: Assertion failure when removing airport with order backup (#9182) 3 years ago
translators 1a1def99dc Update: Translations from eints
norwegian (bokmal): 24 changes by Anolitt
russian: 8 changes by Ln-Wolf
dutch: 46 changes by Afoklala
spanish: 43 changes by MontyMontana
french: 44 changes by arikover
3 years ago
Milek7 20762f9117
Codechange: Acquire video buffer before taking game state lock to prevent erratic fast forward behaviour (#9140) 3 years ago
Peter Nelson 756034fa27 Codechange: Validate custom station platform layout tiles are permitted values only. 3 years ago
Peter Nelson a3e49178d1 Codechange: Use std::vector for NewGRF station tile sprite layouts. 3 years ago
Peter Nelson bd1a20f6ee Codechange: Use std::vector for NewGRF station platform layouts.
This avoids the need to custom memory management and additional members.

This also resolves use-after-free if modifying copied layouts, so presumably nobody has ever done that.
3 years ago
Michael Lutz 1f159f79de Fix #9147: Delay making screenshots until the next draw tick as we may not access the video buffer from the game thread. 3 years ago
Michael Lutz 91b8ce073f Codechange: Generalise the delayed blitter change to a generic video driver command queue. 3 years ago
frosch 2cf5df2a50 Fix: [NewGRF] industry variable 66 and object variable 46 clamped the squared-euclidian distance to 16 bit, when they should not. 3 years ago
frosch 84aa17cea6 Fix: [NewGRF] industry variables 65 and 66 ignored the parameter, and always used the north tile. 3 years ago
rubidium42 56aa6d0edd Fix: [Network] Reading beyond the length of the server's ID when hashing password
Under normal circumstances the server's ID is 32 characters excluding '\0', however this can be changed at the server. This ID is sent to the server for company name hashing. The client reads it into a statically allocated buffer of 33 bytes, but fills only the bytes it received from the server. However, the hash assumes all 33 bytes are set, thus potentially reading uninitialized data, or a part of the server ID of a previous game in the hashing routine.
It is still reading from memory assigned to the server ID, so nothing bad happens, except that company passwords might not work correctly.
3 years ago
PeterN 18651dd8b1
Fix: Update text effect size when font zoom is changed. (#9174) 3 years ago
PeterN 256dbee255
Fix: Crash when extra viewport height is zero with sign in view. (#9175)
If a viewport sign straddles the top of a viewport, a crash will occur if the viewport height is zero. This is resolved by simply not attempting to draw the viewport in this situation, consistent with other widgets.
3 years ago
Peter Nelson 18fb1c3866 Codechange: Warn if randomaction2 group count is not a power of 2.
Previously noted by a comment, this does not need to be guarded against as non-powers of 2 will not cause issues beyond the choice of results being reduced.
3 years ago
Peter Nelson 6b0b1bb3de Cleanup: Use range iterator to evaluate DeterministicSpriteGroup. 3 years ago
Peter Nelson 913d8a7f28 Cleanup: Use std::vector in RandomSpriteGroup. 3 years ago
Peter Nelson 1aeaf39954 Cleanup: Use std::vector in DeterministicSpriteGroup. 3 years ago
Peter Nelson f785a70a2b Cleanup: Use std::vector in RealSpriteGroup. 3 years ago
rubidium42 e097c83c83 Codechange: move some OS abstraction method implementations out of the header 3 years ago
rubidium42 22720332eb Codechange: encapsulate network error handling 3 years ago
rubidium42 0eb17a70af Codechange: rename NetworkError to ShowNetworkError 3 years ago
Matt Kimber 67063ceeb3
Fix 3d7ab09: stopped trains not updating viewport hash when reversed for a second time (#9165) 3 years ago
Matt Kimber 520595ff87
Fix 3d7ab09: stopped trains not updating viewport hash when reversed for a second time (#9165) 3 years ago
rubidium42 05394d5216 Fix #6598: Prevent invalid memory accesses when abandoning a join from within a network game
One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list.
Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
3 years ago
rubidium42 83985fe26f Codechange: Move join information into a single structure 3 years ago
rubidium42 39c51c35f4 Fix #6598: Do not disconnect before company number validation
NetworkClientConnectGame already does a NetworkDisconnect, so no reason to do it here
3 years ago
rubidium42 3bd416bfdb Change: [Console] Show help when passing invalid company number 3 years ago
Loïc Guilloux 376f2509ad
Fix: Don't consider regression AIs when starting a random AI (#9164) 3 years ago
Loïc Guilloux 282d5d302d
Change: [Actions] Add a 2 minutes timeout for regression test (#9166) 3 years ago
rubidium42 0345f99180 Feature: make the town directory horizontally resizable 3 years ago
Loïc Guilloux 2985277bec
Fix d4f0b6f4: [CMake] CMAKE_PROJECT_VERSION_XXX are not in CMake 3.9 (#9154) 3 years ago