1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 17:49:10 +00:00

Compare commits

..

1429 Commits

Author SHA1 Message Date
Michael Lutz
c4e655b1d4 Remove: [Actions] Ubuntu Bionic and Debian Buster from release workflow. (#10115) 2022-10-31 22:37:01 +01:00
Michael Lutz
ac7780af96 Doc: Prepare for 13.0-beta1 release 2022-10-31 21:57:51 +01:00
Michael Lutz
b9635c4712 Doc: Forwardport changelog & doc changes from 12.x branch 2022-10-31 21:57:51 +01:00
translators
36084684ba Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
2022-10-31 18:56:54 +00:00
translators
bf8dc7b157 Update: Translations from eints
frisian: 60 changes by Bouke
tamil: 9 changes by merni-ns
2022-10-30 18:50:24 +00:00
translators
191ea087eb Update: Translations from eints
frisian: 9 changes by Bouke
2022-10-29 18:49:26 +00:00
Nicolas Chappe
8bf56f39f2 Fix #9708: [Linkgraph] Don't assume vehicles have a non-zero max speed 2022-10-29 18:39:03 +02:00
Nicolas Chappe
f8a7b76675 Fix #9665: [Linkgraph] Fix travel times of non-direct journeys 2022-10-29 18:39:03 +02:00
Nicolas Chappe
c5369caa45 Fix: [Linkgraph] possible rounding errors for travel times of low-capacity links 2022-10-29 18:39:03 +02:00
Nicolas Chappe
25b3ff6423 Cleanup: simplify LinkRefresher::RefreshStats 2022-10-29 18:39:03 +02:00
translators
b0fd51a5ef Update: Translations from eints
korean: 1 change by telk5093
german: 5 changes by MagnumSociety
2022-10-27 18:57:01 +00:00
translators
bfa155eb06 Update: Translations from eints
frisian: 91 changes by Bouke
dutch: 3 changes by Bouke
french: 9 changes by glx22
2022-10-25 19:25:45 +00:00
Artin Alavi
dd44f2139e Fix c536bde: Remove problematic inline specifier (#10109) 2022-10-25 04:41:27 +02:00
translators
845174914d Update: Translations from eints
frisian: 8 changes by Bouke
english (us): 1 change by 2TallTyler
dutch: 7 changes by Bouke
polish: 5 changes by pAter-exe
2022-10-24 19:08:45 +00:00
Loïc Guilloux
0afa6f2424 Codechange: [CMake] Auto-fill list of #include in script_window.hpp (#10103) 2022-10-24 12:35:58 +02:00
translators
4052feef1f Update: Translations from eints
english (au): 1 change by krysclarke
english (us): 1 change by 2TallTyler
russian: 1 change by Ln-Wolf
portuguese: 1 change by azulcosta
polish: 3 changes by pAter-exe
2022-10-23 18:58:18 +00:00
b04298f131 Fix #9087: NewGRF invalidation calls ReInitAllWindows with wrong parameter. (#10102) 2022-10-23 14:21:10 +01:00
Michael Lutz
3a11a2ed0e Fix a9a21e78: Depots aren't really stations. 2022-10-23 14:03:38 +02:00
Tyler Trahan
1e3e30c096 Fix a394be2: Spell Maintenance correctly (#10097) 2022-10-23 13:01:36 +01:00
ef8322ba25 Change: Add panel widget to waypoint GUI. 2022-10-23 00:07:15 +01:00
translators
e7a16f4514 Update: Translations from eints
english (au): 3 changes by krysclarke
vietnamese: 7 changes by KhoiCanDev
catalan: 7 changes by J0anJosep
2022-10-22 18:58:11 +00:00
Artin Alavi
c536bde19e Fix #8252: Remove duplicate functionality in screenshot.cpp 2022-10-22 20:51:02 +02:00
Nicolas Chappe
721d98a7d0 Feature: Constantly update destination of 'any depot' orders 2022-10-22 14:19:08 +02:00
Nicolas Chappe
a4052ca348 Codechange: Add VehicleOrderSaver::Restore() 2022-10-22 14:19:08 +02:00
Nicolas Chappe
7e7d943526 Codechange: [YAPF] Allow to retrieve the final tile of the calculated path 2022-10-22 14:19:08 +02:00
Nicolas Chappe
227626b0b7 Change: [YAPF] All compatible depots are targets for 'any depot' orders 2022-10-22 14:19:08 +02:00
Nicolas Chappe
a9a21e784d Codechange: Always set the ODATFB_NEAREST_DEPOT flag for 'any depot' orders 2022-10-22 14:19:08 +02:00
Tyler Trahan
4daad7f348 Change: Don't make wide rivers using original landscape generator 2022-10-22 12:16:56 +02:00
Henry Wilson
a394be2780 Feature: Airport construction GUI displays infrastructure cost 2022-10-22 12:16:46 +02:00
translators
30ff89cac0 Update: Translations from eints
frisian: 33 changes by Bouke
spanish (mexican): 10 changes by absay
english (us): 4 changes by 2TallTyler
korean: 7 changes by telk5093
dutch: 3 changes by Afoklala
2022-10-21 19:00:44 +00:00
Tyler Trahan
664771d085 Feature: Wide rivers 2022-10-20 21:17:35 +02:00
translators
520520c11c Update: Translations from eints
frisian: 82 changes by Bouke
russian: 10 changes by Ln-Wolf
portuguese: 3 changes by azulcosta
2022-10-20 19:08:43 +00:00
glx22
87d1bd895a Fix f6530f3c2: [Actions] set-output was not correctly converted 2022-10-20 19:22:01 +02:00
glx22
8ffe59373f Update: [Actions] use annotation-check v3 2022-10-20 19:22:01 +02:00
Loïc Guilloux
f6530f3c2d Codechange: [Actions] set-output is deprecated (#10089) 2022-10-19 21:05:11 +02:00
Nicolas Chappe
864771ca09 Feature: [Linkgraph] Show a tooltip with statistics when hovering a link 2022-10-18 22:03:39 +02:00
Nicolas Chappe
7c79a2a767 Change: Do not generate hover events at each frame 2022-10-18 22:03:39 +02:00
Nicolas Chappe
e660860d4b Codechange: Simplify logic of mouse loop 2022-10-18 22:03:39 +02:00
Nicolas Chappe
65530a76f6 Codechange: Allow use of SetDParam for tooltips 2022-10-18 22:03:39 +02:00
Bouke Haarsma
93d2d4590f Fix #9995: Adjust viewport zoom level for HiDPI displays
On HiDPI screens the zoom level is increased for detailed rendering. This causes hard-coded zoom levels to be off by this adjustment. To fix these default zoom levels, we scale the zoom level based on `_gui_zoom` to get the scaled zoom level.
2022-10-18 22:03:21 +02:00
Tyler Trahan
47a998fb0c Feature: Towns don't build parallel, redundant bridges 2022-10-18 22:02:45 +02:00
translators
252111512f Update: Translations from eints
frisian: 17 changes by Bouke
english (au): 1 change by krysclarke
russian: 1 change by Ln-Wolf
dutch: 4 changes by Bouke
portuguese: 4 changes by azulcosta
2022-10-18 19:05:11 +00:00
translators
35c1aeb6d1 Update: Translations from eints
english (au): 3 changes by krysclarke
english (us): 3 changes by 2TallTyler
russian: 3 changes by Ln-Wolf
2022-10-17 19:13:33 +00:00
Tyler Trahan
f7eb0ffc37 Feature: Purchase land multiple tiles at a time 2022-10-17 20:41:47 +02:00
Michael Lutz
8e6ed8d5e9 Fix db98cedb: Swap the tile parameter validation around as only the first TileIndex is automatically validated. 2022-10-17 07:54:58 +01:00
Michael Lutz
10daaca5ea Fix db98cedb: Swap parameters for CmdRemoveRailroadTrack, too. 2022-10-17 07:54:58 +01:00
krysclarke
a0342fb170 Fix: Typo and grammatical correction in CONTRIBUTING.md (#10085) 2022-10-17 07:52:14 +01:00
translators
3b071f47e4 Update: Translations from eints
vietnamese: 1 change by KhoiCanDev
2022-10-16 18:54:39 +00:00
Jonathan G Rennison
47456ac672 Change: Reduce number of instructions in AlphaBlendTwoPixels 2022-10-16 18:55:09 +02:00
Jonathan G Rennison
f9cdb5b610 Fix: Correctly set alpha of output in AlphaBlendTwoPixels
Match alpha behaviour of ComposeColourRGBA
2022-10-16 18:55:09 +02:00
glx22
da1a0d042e Fix: don't use animated SSE4 Draw() when animation is disabled 2022-10-16 18:55:09 +02:00
SamuXarick
c7505539af Fix #9869: remove docking tile when doing a clear square
Terraforming through objects placed on water didn't properly remove docking tiles as expected.

By moving some logic regarding removal of docking tiles into DoClearSquare, the issue is solved, while also simplifying code, avoiding repetition elsewhere.
2022-10-16 18:29:03 +02:00
SamuXarick
be7db78767 Add: ScriptCargo::GetWeight regression tests 2022-10-16 18:28:28 +02:00
SamuXarick
8d0d45c431 Add: ScriptCargo::GetWeight to get cargo weights 2022-10-16 18:28:28 +02:00
Tyler Trahan
3d45bc4abe Feature: Build objects by area 2022-10-16 18:28:08 +02:00
Michael Lutz
bd357656ba Codechange: [NewGRF] Replace magic number for default object size by a constant. 2022-10-16 18:28:08 +02:00
SamuXarick
e604b76d18 Fix: List a max of four share owners instead of three
An AI company may have four different share owners, but the company information window is limited to display a max of three. This commit increases that limit.
2022-10-16 18:27:54 +02:00
SamuXarick
3dda8c9bad Fix: ScriptRoad::HasRoadType really check for RoadType
Script::HasRoadType was only checking if the tile had the same RoadTramType as that of the RoadType provided.
Now it really checks RoadType against RoadType.
2022-10-16 18:27:23 +02:00
Bouke Haarsma
45d98f689a Fix #9993: Handle DPI changes on macOS and Windows 2022-10-16 16:52:14 +02:00
Bouke Haarsma
bda602f4b0 Fix: reduce framerate overhead on train ticks
Tick() is a noop for all but front-engine / crashed vehicles. Starting a framerate is rather cheap, but not free, and introduces a lot of overhead for such close loops.
2022-10-16 15:13:29 +02:00
frosch
f4e2a462fe Cleanup: Remove unused flag sprites. 2022-10-16 14:56:52 +02:00
5cc1a48db7 Change: Use NC_BIGFIRST in group window.
This means we no longer need to manually calculate the size of other
widgets in the window to determine how much space we need, as the widget
system will automatically fill as much as possible.
2022-10-16 14:56:34 +02:00
ba94efba87 Change: Add flag to apply resize to largest resize step first.
Resize step is normally allocated equally amongst all resizable widgets.
With this flag, we allocate as much as possible from the largest
resize step first.
2022-10-16 14:56:34 +02:00
dc1b84aa1e Cleanup: Text widgets are capable of drawing text without assistance.
Remove custom text drawing of some widgets in favour of standard text
widgets.
2022-10-16 14:24:51 +02:00
0e3400894f Cleanup: Remove redundant WWT_PANEL SetDataTips.
WWT_PANEL defaults to 0x0 data and no tooltip, so no need to declare
the same in the widget tree.
2022-10-16 14:24:51 +02:00
296af146fb Change: Default widget text colour to black.
TC_FROMSTRING really means blue, and we almost never actually use
blue text.
2022-10-16 14:24:51 +02:00
Tyler Trahan
db98cedb7e Fix #9883: Show cost/income float over end tile of rail or road construction 2022-10-16 14:15:31 +02:00
3e86f337a8 Change: Simplify graph's company key window. 2022-10-11 08:36:59 +01:00
ccb62c3a55 Change: Simplify industry-cargoes widgets. 2022-10-11 08:36:59 +01:00
edbf99ed17 Change: Use standard sizing for AI competitor limit buttons. 2022-10-11 08:36:59 +01:00
33704269bd Change: Simplify widget layout of settings window. 2022-10-11 08:36:59 +01:00
686204ff1c Change: Simplify widget layout of story book window. 2022-10-11 08:36:59 +01:00
e8edecf6b1 Change: Adjust layout of file windows to fix overlapping widgets. 2022-10-11 08:36:59 +01:00
fc944829e1 Change: Don't use zero-sized plane for World Generation window.
Use of zero-sized plane causes the window size calculation to change
depending on which plane is displayed. Instead use an empty plane so
that largest of the planes is taken into account for sizing.
2022-10-11 08:36:59 +01:00
Bouke Haarsma
887b760c88 Change: Strip symbols from bundles except macOS (#10072) 2022-10-10 13:42:54 +01:00
Charles Pigott
9059215b3b Fix #10073: Stop truncating output of list_ai and friends commands 2022-10-10 13:42:07 +01:00
Charles Pigott
24f3022ee0 Fix #10074: list_ai console commands and friends were missing help text 2022-10-10 13:42:07 +01:00
translators
c482f05616 Update: Translations from eints
english (au): 7 changes by krysclarke
2022-10-07 19:02:50 +00:00
Bouke Haarsma
d0dcb6547e Change: Don't strip symbols from bundles (#10071) 2022-10-07 12:56:45 +02:00
translators
633b903f16 Update: Translations from eints
turkish: 7 changes by kgecmen
2022-10-05 19:06:12 +00:00
Bouke Haarsma
c7f55a058b Fix: link overlay line width on HiDPI displays (#10064) 2022-10-04 11:58:58 +02:00
af6c4d50ce Change: Tidy up coverage area label widget layout.
Label is now centered properly and uses standard spacing.
2022-10-03 22:14:18 +01:00
8626090b24 Codechange: Draw station acceptance text in its own widget. 2022-10-03 22:14:18 +01:00
translators
f011a559d0 Update: Translations from eints
latvian: 1 change by lexuslatvia
2022-10-02 18:55:38 +00:00
Jonathan G Rennison
73e5c57e6b Fix 5e413c9d: Last sprite offset in GRF file was not recorded (#10062)
A line was missed when preparing PR #9988, as this had been added
in a commit prior to the one which the PR was immediately based on
2022-09-29 11:56:42 +02:00
Bouke Haarsma
f3fd9b5895 Codechange: typo in code comment (#10061) 2022-09-29 00:12:21 +01:00
translators
d843c8bd48 Update: Translations from eints
italian: 5 changes by Rivarossi
polish: 1 change by pAter-exe
2022-09-27 19:02:05 +00:00
translators
e5203f3409 Update: Translations from eints
vietnamese: 7 changes by KhoiCanDev
german: 6 changes by Wuzzy2
2022-09-26 18:59:27 +00:00
frosch
bdc17b18e1 Cleanup: The readme is for people building/packaging OpenTTD. Player-focussed manuals are in the Wiki. (#10026) 2022-09-26 18:17:36 +02:00
Tyler Trahan
faa382beda Doc: Add Discord link in README and CONTRIBUTING (#10043) 2022-09-26 18:17:08 +02:00
translators
761105aaa4 Update: Translations from eints
russian: 1 change by Ln-Wolf
catalan: 1 change by J0anJosep
2022-09-25 18:53:51 +00:00
b00e18fe9f Cleanup: Remove unused GetUnicodeGlyph() 2022-09-25 18:34:24 +01:00
2cdd8b7429 Change: Separate fontcache implementations. 2022-09-25 18:34:24 +01:00
f6ad8e1c9c Change: Rename some freetype things to fontcache.
The font cache supports more than just FreeType as a font provider, but still used freetype in some naming.

This now uses more suitable terms.
2022-09-25 18:34:24 +01:00
273988551d Fix: font_win32.cpp compile failure with WITH_FREETYPE 2022-09-25 18:34:24 +01:00
0c20a5f39f Fix: Open scenario editor date query once. (#10050)
Clearing `_left_button_clicked` causes the button callback to be fired
constantly while the mouse button is held.
2022-09-25 16:08:52 +01:00
Loïc Guilloux
93b711d70d Fix #10048: Don't relocate company HQ on the same exact location (#10049) 2022-09-24 21:56:23 +02:00
translators
70d33dc71f Update: Translations from eints
spanish (mexican): 1 change by absay
chinese (simplified): 1 change by XiaoJi-Game
korean: 1 change by telk5093
2022-09-24 18:54:01 +00:00
translators
2b29f1a181 Update: Translations from eints
english (us): 1 change by 2TallTyler
dutch: 15 changes by Bouke
portuguese: 1 change by azulcosta
2022-09-23 18:57:59 +00:00
d7ceb7efea Change: Use widget string parameters for face window. (#10046)
The face window previously drew the buttons of face settings itself.
Instead we can provide parameters for each widget and let the widget
system draw the buttons.
2022-09-23 17:09:35 +01:00
69527abb6f Fix 9aef7b8c: Don't dispatch hover event if already hovering. (#10042)
This fixes the timed tooltip window being (invisibly) destroyed and
reconstructed every frame.

This also affects the unused OnHover() window event.
2022-09-22 20:38:11 +01:00
translators
1f04cc62d9 Update: Translations from eints
welsh: 8 changes by Osian
korean: 6 changes by telk5093
2022-09-22 18:54:52 +00:00
607ef09fa5 Fix: File list mouse hover behaviour. (#10040)
Hover highlight was visible even if the mouse pointer was in a different
window. Resolved by using OnMouseOver() instead of OnMouseLoop().
2022-09-21 12:08:11 +01:00
dP
548f0496a9 Change: Make _tick_counter 64bit to avoid wrapping (#10035) 2022-09-21 12:42:29 +02:00
Tyler Trahan
164ec3ac07 Fix: Disable "turn around" button for other companies' road vehicles (#10033) 2022-09-21 12:39:56 +02:00
Tyler Trahan
07443969f9 Fix ca19a0d: Network hosts also use favorite face 2022-09-21 12:39:07 +02:00
Tyler Trahan
6d84b1e108 Fix ca19a0d: Send the proper network command when loading favorite face 2022-09-21 12:39:07 +02:00
Tyler Trahan
a4e00c5cb5 Fix #9989: Zero Net Profit is neither negative nor positive (#9991) 2022-09-21 12:38:03 +02:00
Jonathan G Rennison
5e413c9dcd Fix #9804: Only apply sprite_zoom_min setting when sprites available (#9988)
Only discard sprite zoom levels when a suitable higher zoom level is
defined in the same colour mode

This is to avoid placeholder or empty sprites being used, causing
visual artefacts
2022-09-21 12:37:11 +02:00
Jonathan G Rennison
20f7ff8ac0 Codechange: Fix unnecessary string reallocation in IConsoleLine constructor 2022-09-21 12:32:07 +02:00
Jonathan G Rennison
0a7ffae0d9 Fix #10010: Memory leak in IConsolePrint in non-dedicated case 2022-09-21 12:32:07 +02:00
0bac74ec2b Fix #10038: Missing upper bounds check when loading custom playlists (#10039) 2022-09-21 08:31:59 +01:00
f59f0195e3 Fix: Wrong string used to determine size of zoomed out station sign. (#10036) 2022-09-20 20:54:42 +01:00
fa5e2ca276 Cleanup: Tweak panel layout of Online Players window.
This ensures panel borders not hidden behind other widgets.
2022-09-20 07:51:25 +01:00
8e9ca5ebcb Fix: Online Players list mouse hover behaviour.
Hover highlight was visible even if the mouse pointer was in a different
window, and the window refreshed itself every frame if the mouse pointer
was not over its matrix widget.

Resolved by using OnMouseOver() instead of OnMouseLoop(), and only
redrawing if the hover position has changed.
2022-09-20 07:51:25 +01:00
translators
81388d9425 Update: Translations from eints
chinese (simplified): 7 changes by XiaoJi-Game
2022-09-17 18:56:59 +00:00
translators
0c8db77154 Update: Translations from eints
dutch: 6 changes by Afoklala
2022-09-16 19:03:57 +00:00
translators
b38051c9ad Update: Translations from eints
galician: 11 changes by pvillaverde
polish: 5 changes by pAter-exe
2022-09-15 18:58:38 +00:00
translators
984e0b1263 Update: Translations from eints
spanish (mexican): 5 changes by absay
catalan: 6 changes by J0anJosep
2022-09-14 18:59:16 +00:00
translators
d29289addb Update: Translations from eints
english (us): 6 changes by 2TallTyler
russian: 2 changes by Ln-Wolf
portuguese: 6 changes by azulcosta
2022-09-13 18:59:58 +00:00
Loïc Guilloux
57717a20d3 Fix #9966: workaround a VS2022 optimisation bug (#10029) 2022-09-13 12:27:49 +02:00
dP
64453cb134 Fix: Incorrect player name in online players window (#10013) 2022-09-12 09:18:41 +01:00
Stephan Sokolow
e5643c65c1 Change: Use the Simulation subcategory in openttd.desktop (#10015)
Add the XDG Menu Spec-defined Simulation "Additional Category" so launchers can subcategorize the Games menu/section more effectively.
2022-09-12 09:18:13 +01:00
Andy
129979acf7 Change: 'string' is spurious in 'Filter string:' labels for filter UI widgets (#10022) 2022-09-12 09:17:18 +01:00
Andy
039f90d05f Feature: add sticky pin to Object Selection UI panel (#10019) 2022-09-11 22:15:02 +02:00
frosch
e2c46fda3f Fix: [NewGRF] Ensure that stations always have an even number of sprite layouts.
The drawing code has a special fallbacks for zero layouts, but fails hard for one layout.
(odd numbers >= 3 are weird, but do not fail as badly as 1)
2022-09-11 21:26:06 +02:00
frosch
5c66de860d Fix: [NewGRF] Result bit 0 of callback 14 was not ignored in the GUI. 2022-09-11 21:26:06 +02:00
frosch
f7022925d3 Cleanup: [NewGRF] Callback 14 used a weird value for var10 in the GUI.
The value 0x2110000 probably originated from a mixup between callback 14 (sprite layout) and 24 (tile layout).
The latter does indeed use a var10 value like that.
2022-09-11 21:26:06 +02:00
Andy
a06d323f03 Feature: add shade widget to Object Selection UI panel (#10020) 2022-09-11 21:22:06 +02:00
f279fc5772 Fix: DrawStringMultiLine() could overdraw (#10014)
This function did not take the line height into account when checking text will fit before the bottom bounds.
2022-09-10 17:48:38 +01:00
translators
0355299639 Update: Translations from eints
dutch: 36 changes by Bouke
2022-09-08 19:01:47 +00:00
translators
0c848a9b3b Update: Translations from eints
dutch: 2 changes by Bouke
2022-09-07 18:59:13 +00:00
Bouke Haarsma
18c210b013 Fix: title positioning on HiDPI displays 2022-09-07 01:32:37 +02:00
2d2a5dd966 Fix: Change duration of news window scroll depending on GUI zoom. 2022-09-06 19:57:09 +01:00
8b989d4999 Fix: Update news window viewport if GUI zoom is changed. 2022-09-06 19:57:09 +01:00
translators
57fa8690df Update: Translations from eints
dutch: 1 change by Bouke
2022-09-05 18:56:06 +00:00
Patric Stout
8ac0ab47b0 Update: to all the friends we have lost and those we have gained (#10000) 2022-09-04 22:01:08 +02:00
Patric Stout
15f4d7c04c Remove: [GitHub] old configuration file for stale-bot (#9998)
This bot was deactivated months (years?) ago.
2022-09-04 21:42:08 +02:00
frosch
54ac304828 Fix: [NewGRF] Upper 16 random bits should be the same for all station tiles in callback 140. (#9992) 2022-09-03 22:37:03 +02:00
dP
c839950791 Cleanup: Remove duplicate command_type.h include (#9986) 2022-09-01 18:15:07 +02:00
frosch
9529703cab Codechange: When checking industry placement conditions, perform cheap checks first. (#9987)
1. Built-in checks on industry level.
2. Built-in checks on industry tiles.
3. NewGRF-defined checks on industry level.
4. NewGRF-defined checks on industry tiles.
2022-09-01 18:13:43 +02:00
Aaron Katzin
2fe8a257ac Add: [Actions] Ubuntu Jammy Jellyfish (22.04) build for releases (#9881) 2022-08-31 16:11:34 +02:00
Loïc Guilloux
31668b8f94 Fix #9914, 86818e5: prevent more useless pathfinder run for blocked vehicles (#9917) 2022-08-31 12:52:13 +02:00
Tyler Trahan
788b06fe0f Change: New player companies use favorite manager face, if saved (#9895) 2022-08-30 16:26:02 +02:00
Joel-Milligan
3937953f72 Fix #9363: Rebuild client list on reinit event (#9929) 2022-08-30 14:56:19 +02:00
Niels Martin Hansen
5a0dd7e322 Fix #9971: Don't assert that time moves forward 2022-08-27 22:59:36 +02:00
Niels Martin Hansen
4253db28fa Fix #9972: Add some missing fill/resize flags on Framerate window widgets 2022-08-27 22:20:01 +02:00
translators
db378e746b Update: Translations from eints
korean: 2 changes by telk5093
2022-08-27 18:56:07 +00:00
Niels Martin Hansen
e6aab701c9 Fix #9977: Use a deque rather than linked list for console buffer 2022-08-27 16:03:41 +02:00
Niels Martin Hansen
aaab0610eb Fix: Only apply debuglevel changes after successful parse 2022-08-27 09:17:09 +02:00
Niels Martin Hansen
c6953f13e4 Fix #9940: Print debuglevel parse errors to console when changed from console 2022-08-27 09:17:09 +02:00
translators
dcdc8d187c Update: Translations from eints
dutch: 1 change by Bouke
2022-08-26 18:58:27 +00:00
frosch
acf9d786f1 Fix: [NewGRF] Default value of RailVehicleInfo::railveh_type was inconsistent with other default properties. (#9967)
If a NewGRF assigned neither "power" nor "dual-headed" properties,
then "railveh_type" defaulted to "singlehead-engine", while "power=0" said "it's a wagon".
2022-08-26 20:50:33 +02:00
glx22
bba6ad1f4e Fix #9935: Use more selectivity when building SSE specific code 2022-08-26 19:36:18 +02:00
translators
e9507e7ffa Update: Translations from eints
latvian: 31 changes by lexuslatvia
2022-08-25 18:57:10 +00:00
translators
04911822c1 Update: Translations from eints
indonesian: 1 change by K4smun1
2022-08-24 19:01:19 +00:00
glx22
e3968cdf65 Fix #9974, aa5a8fe: strftime buffer maxsize is off by one
strftime() return value doesn't count NULL character, but buffer size must include it.
2022-08-23 17:53:59 +02:00
translators
882b8f45d9 Update: Translations from eints
hungarian: 31 changes by andrejmoltok
romanian: 27 changes by andrejmoltok
2022-08-22 18:57:23 +00:00
translators
417f9bb48d Update: Translations from eints
french: 1 change by glx22
hindi: 18 changes by baijuch
2022-08-21 18:53:43 +00:00
translators
88a046a76e Update: Translations from eints
korean: 7 changes by telk5093
2022-08-19 19:00:39 +00:00
translators
be352ce1b6 Update: Translations from eints
catalan: 11 changes by J0anJosep
2022-08-09 18:54:56 +00:00
translators
eb805b77b7 Update: Translations from eints
german: 1 change by SecretIdetity
2022-08-08 18:54:30 +00:00
SamuXarick
374f0c7d11 Fix 6fe445e: Removing rail station parts without ctrl pressed was also removing tracks
The behaviour of holding ctrl key is swapped
2022-08-07 10:58:43 +02:00
translators
6893135fef Update: Translations from eints
english (au): 536 changes by krysclarke
2022-08-06 18:54:39 +00:00
translators
5a404a17ee Update: Translations from eints
korean: 1 change by telk5093
polish: 1 change by pAter-exe
2022-08-02 18:53:52 +00:00
translators
6b4fd01eeb Update: Translations from eints
italian: 1 change by Rivarossi
2022-08-01 18:59:48 +00:00
translators
b7462934e2 Update: Translations from eints
dutch: 1 change by Afoklala
2022-07-31 18:52:44 +00:00
translators
ccb9d99880 Update: Translations from eints
arabic (egypt): 13 changes by AviationGamerX
persian: 16 changes by pooyana84
finnish: 33 changes by lanurmi
2022-07-29 18:55:22 +00:00
translators
e3759931e7 Update: Translations from eints
english (us): 1 change by 2TallTyler
arabic (egypt): 62 changes by AviationGamerX
turkish: 1 change by ahmetlii
2022-07-28 18:56:27 +00:00
translators
97d79c8e52 Update: Translations from eints
spanish (mexican): 1 change by absay
catalan: 1 change by J0anJosep
2022-07-27 18:54:03 +00:00
translators
d1d7e47896 Update: Translations from eints
russian: 1 change by Ln-Wolf
portuguese: 1 change by azulcosta
2022-07-25 18:56:07 +00:00
translators
77a8e3b649 Update: Translations from eints
polish: 1 change by pAter-exe
2022-07-24 18:55:01 +00:00
Nicolas Chappe
6d154e72dd Fix #8584: Vehicles with shared orders getting invalid or unexpected start dates 2022-07-24 09:28:01 +02:00
translators
67608350b6 Update: Translations from eints
finnish: 45 changes by lanurmi
portuguese (brazilian): 29 changes by rodigu
2022-07-23 18:52:50 +00:00
Jonathan G Rennison
67331fe946 Fix #9951: Scenario editor random industries button and persistent storage (#9952)
BasePersistentStorageArray::SwitchMode was not called
2022-07-21 16:21:38 +01:00
translators
8f772352ce Update: Translations from eints
italian: 1 change by Rivarossi
2022-07-20 18:57:16 +00:00
translators
b199779ad4 Update: Translations from eints
chinese (simplified): 26 changes by ZZY2357
korean: 1 change by telk5093
2022-07-19 18:55:56 +00:00
Patric Stout
77a85e9b4c Fix: CmdSetAutoReplace didn't validate group type and engine type match (#9950)
Basically, you could setup an auto-replace in a group for trains
to replace a ship with another ship.

Most of the code is surprisingly okay with this, it is only the
group statistics that doesn't like this.
2022-07-09 20:06:22 +02:00
Patric Stout
979704271b Fix: reverse train direction command did not validate the given vehicle properly (#9947)
You could give a wagon in the chain to reverse (which makes no
functional sense ofc). In result, only parts of the vehicle were
reversing, leading to weird crashes.
2022-07-09 12:28:20 +02:00
Patric Stout
055121df80 Fix: depot-related commands did not validate depot tiles properly (#9948)
The bug comes in two slices:

1) the functions never actually checked if "tile" was a depot tile.
   This allowed executing the function on tile 0, where are the
   things like shadows of aircrafts are.
2) BuildDepotVehicleList() first checked if a vehicle is in a depot
   before checking if it was a primary vehicle. This is invalid
   for aircraft.

Fixing the first hides the second, and fixing the second makes the
first non-exploitable. But, fixing both felt like the best thing
to do.
2022-07-09 12:28:09 +02:00
Patric Stout
100aca1848 Fix: CmdRemoveRoadStop didn't validate the height property properly (#9945)
Height was a unsigned 32bit integer, where TileAddWrap uses a
signed 32bit integer for the height. In result, there was an
implicit cast from unsigned to signed, messing things up.

But looking at it from a functional perspective, allowing such
large values is not sensible. In fact, width is restricted to
just a 8bit integer. By changing height to a 8bit integer too,
the implicit cast will never make a positive value negative anymore.
2022-07-09 12:27:58 +02:00
Patric Stout
9957675a66 Fix: autoreplace command did not validate the vehicle argument properly (#9946)
It first checked if the vehicle was in the depot, which for some types
is only a valid action for the primary vehicle. Afterwards, it checked
if the vehicle was a primary vehicle.
2022-07-09 11:25:17 +02:00
Patric Stout
4651ad94fe Fix: commands with a RoadType in their arguments were not validated properly (#9944)
Although it was checked that RoadType was not 63 (INVALID_ROADTYPE),
and all values lower than 63 are fine, it also allowed values higher
than 63. As the RoadType is a "byte", it could contain values up
to 255.
2022-07-09 10:03:57 +02:00
Patric Stout
6810d09c1b Fix: commands with Axis in their arguments were not validated properly (#9943)
When you don't type an Enum, it is a signed value. To validate
if an Axis is valid, it is checked to be lower than AXIS_END. Which
is the case for any value below 0.
2022-07-09 10:03:41 +02:00
Michael Lutz
dd93244853 Fix: The first tile in commands received from a client wasn't validated properly. 2022-07-08 22:37:41 +02:00
Jonathan G Rennison
19af139631 Fix #9937: Station industries_near incorrect after removing part moved sign
RecomputeCatchment was being called before moving the sign tile
instead of afterwards
2022-06-29 12:49:55 +02:00
translators
f72b9fa767 Update: Translations from eints
italian: 22 changes by Rivarossi
2022-06-28 18:54:28 +00:00
translators
ffd3c11ba7 Update: Translations from eints
italian: 8 changes by Rivarossi
spanish: 19 changes by MontyMontana
2022-06-24 18:48:39 +00:00
translators
68257e0d7d Update: Translations from eints
turkish: 1 change by jnmbk
spanish: 12 changes by MontyMontana
2022-06-23 18:50:06 +00:00
translators
f64cf8679d Update: Translations from eints
chinese (traditional): 6 changes by wpi3
italian: 2 changes by Rivarossi
turkish: 1 change by jnmbk
2022-06-21 18:47:23 +00:00
translators
278c1d06cf Update: Translations from eints
italian: 6 changes by Rivarossi
turkish: 37 changes by jnmbk
2022-06-20 18:48:32 +00:00
translators
79af42e992 Update: Translations from eints
czech: 9 changes by LubosKolouch
2022-06-19 18:45:14 +00:00
Jonathan G Rennison
4acccc232a Fix #9925: Industry tile layout validation for layouts of only one tile 2022-06-18 22:02:08 +02:00
translators
814c61a321 Update: Translations from eints
tamil: 20 changes by Aswn
2022-06-11 18:44:50 +00:00
Niels Martin Hansen
470c902bdc Fix #9918: Reset industy last production year on scenario start 2022-06-09 23:03:25 +02:00
Niels Martin Hansen
2cdb0cb084 Codechange: Factor out OnStartScenario function 2022-06-09 23:03:25 +02:00
translators
0d3756818f Update: Translations from eints
korean: 1 change by telk5093
2022-06-07 18:48:01 +00:00
translators
8cdf303e72 Update: Translations from eints
indonesian: 30 changes by indrabagus
2022-06-06 18:49:24 +00:00
translators
0a3d5f5ff8 Update: Translations from eints
italian: 1 change by Rivarossi
2022-06-02 18:51:19 +00:00
glx22
aeeee9f18e Fix #9909, 13528bf: Left-over unused parameter breaks overload resolution 2022-06-01 19:24:48 +02:00
glx22
675cf7a8ee Fix 6fe445e: [Script] Respect joining adjacent when building an airport 2022-05-31 23:14:47 +02:00
translators
9fca8af586 Update: Translations from eints
spanish (mexican): 7 changes by absay
2022-05-31 18:49:21 +00:00
translators
a59c19c6c2 Update: Translations from eints
chinese (traditional): 24 changes by Tetrapod1206
italian: 6 changes by Rivarossi
2022-05-30 18:48:34 +00:00
Niels Martin Hansen
5587e439a9 Fix: Industry layouts with zero regular tiles should be invalid 2022-05-29 16:34:30 +02:00
translators
578bb6638f Update: Translations from eints
chinese (traditional): 120 changes by wpi3
vietnamese: 2 changes by KhoiCanDev
2022-05-28 18:47:05 +00:00
translators
e3a4524133 Update: Translations from eints
chinese (traditional): 130 changes by Tetrapod1206, 10 changes by wpi3
italian: 6 changes by Rivarossi
2022-05-27 18:52:21 +00:00
glx22
906613e83a Change: [CMake] Disable newgrf scan for regression check 2022-05-27 19:57:50 +02:00
glx22
ed1457dca3 Fix 55170ae: [Script] Building two-way signals could end up one-way 2022-05-27 19:57:50 +02:00
translators
992c72c0cb Update: Translations from eints
chinese (traditional): 365 changes by wpi3
2022-05-26 18:50:37 +00:00
translators
57230c559b Update: Translations from eints
swedish: 18 changes by joeax910
vietnamese: 26 changes by KhoiCanDev
2022-05-25 18:51:33 +00:00
translators
d89e7484c8 Update: Translations from eints
swedish: 15 changes by joeax910
2022-05-24 18:51:54 +00:00
translators
59f16b1a38 Update: Translations from eints
korean: 5 changes by telk5093
russian: 12 changes by Ln-Wolf
2022-05-23 18:50:50 +00:00
translators
8d8f45f0dd Update: Translations from eints
russian: 25 changes by Ln-Wolf
2022-05-22 18:48:51 +00:00
translators
3a2c0531b6 Update: Translations from eints
italian: 1 change by Rivarossi
polish: 2 changes by pAter-exe
2022-05-21 18:48:45 +00:00
translators
b1e24a0ae3 Update: Translations from eints
italian: 22 changes by Rivarossi
2022-05-20 18:50:57 +00:00
translators
9d979a6d23 Update: Translations from eints
spanish (mexican): 1 change by absay
german: 25 changes by SecretIdetity
2022-05-18 18:48:29 +00:00
translators
9842e8b762 Update: Translations from eints
spanish (mexican): 8 changes by absay
czech: 18 changes by adamek0202
russian: 1 change by Ln-Wolf
catalan: 5 changes by J0anJosep
2022-05-17 18:46:43 +00:00
translators
f8c6034b93 Update: Translations from eints
spanish (mexican): 21 changes by absay
italian: 1 change by Rivarossi
russian: 12 changes by Ln-Wolf
2022-05-16 18:50:05 +00:00
translators
fd1aa154f4 Update: Translations from eints
italian: 1 change by Rivarossi
russian: 16 changes by Ln-Wolf
2022-05-15 18:47:13 +00:00
translators
adc76cca54 Update: Translations from eints
catalan: 2 changes by J0anJosep
2022-05-14 18:48:27 +00:00
Frazer Smith
9bdc1e8f04 Update: bump peter-evans/repository-dispatch from 1 to 2 2022-05-14 16:58:10 +02:00
Frazer Smith
19b838dd60 Update: bump actions/download-artifact from 2 to 3 2022-05-14 16:58:10 +02:00
Frazer Smith
9162ac9d37 Update: bump actions/checkout from 2 to 3 2022-05-14 16:58:10 +02:00
Frazer Smith
2a2f80bb71 Update: bump actions/cache from 2 to 3 2022-05-14 16:58:10 +02:00
Frazer Smith
33dabc42bb Update: bump actions/upload-artifact from 2 to 3 2022-05-14 16:58:10 +02:00
benda
6540948ace Fix: Company values do not properly account for shares (#9770)
Co-authored-by: Charles Pigott <charlespigott@googlemail.com>
2022-05-14 16:57:47 +02:00
Tyler Trahan
fa562ba041 Fix #9712: Cap town bridge length at original 11-tile limit (#9890) 2022-05-14 16:55:39 +02:00
Tyler Trahan
37d318c410 Fix #9870: Don't update infrastructure totals when overbuilding object on canal 2022-05-14 16:54:36 +02:00
translators
24d7697acc Update: Translations from eints
spanish: 1 change by frosch123
2022-05-14 12:03:15 +00:00
translators
1eed52f294 Update: Translations from eints
swedish: 7 changes by translators
norwegian (bokmal): 1 change by translators
spanish (mexican): 41 changes by translators
japanese: 28 changes by translators
english (us): 4 changes by translators
vietnamese: 7 changes by translators
estonian: 60 changes by translators
korean: 9 changes by translators
greek: 4 changes by translators
hungarian: 2 changes by translators
indonesian: 5 changes by translators
italian: 12 changes by translators, 1 change by Rivarossi
german: 33 changes by translators
romanian: 11 changes by translators
russian: 4 changes by translators
finnish: 2 changes by translators
ukrainian: 5 changes by translators
slovak: 9 changes by translators
catalan: 14 changes by translators
turkish: 1 change by translators
danish: 1 change by translators
latvian: 5 changes by translators
dutch: 5 changes by translators
spanish: 98 changes by translators
portuguese: 6 changes by translators
portuguese (brazilian): 2 changes by translators, 1 change by marlondantas
polish: 13 changes by translators
2022-05-14 11:39:04 +00:00
translators
84aec4fcb8 Update: Translations from eints
english (us): 2 changes by 2TallTyler
italian: 2 changes by Rivarossi
russian: 5 changes by Ln-Wolf
dutch: 2 changes by Afoklala
french: 25 changes by glx22
portuguese: 2 changes by azulcosta
2022-05-13 18:49:07 +00:00
Tyler Trahan
ebc76a4200 Change: Use an indent, not a dash, to list train capacity 2022-05-12 16:59:52 +02:00
translators
646d160c38 Update: Translations from eints
italian: 3 changes by Rivarossi
2022-05-11 21:23:39 +00:00
translators
273b33b087 Update: Translations from eints
swedish: 5 changes by joeax910
2022-05-11 18:48:28 +00:00
translators
8d51156150 Update: Translations from eints
spanish (mexican): 20 changes by absay
italian: 7 changes by Rivarossi
2022-05-10 18:48:56 +00:00
translators
867f6a5964 Update: Translations from eints
spanish (mexican): 9 changes by absay
polish: 3 changes by pAter-exe
2022-05-09 18:50:02 +00:00
translators
9c58ea7a37 Update: Translations from eints
swedish: 2 changes by joeax910
spanish (mexican): 62 changes by absay
korean: 25 changes by telk5093
polish: 72 changes by pAter-exe
2022-05-08 18:45:02 +00:00
translators
5e5f864990 Update: Translations from eints
english (us): 1 change by 2TallTyler
italian: 1 change by Rivarossi
2022-05-07 18:44:57 +00:00
Niels Martin Hansen
0dce7bf85d Add: Commandline option to skip NewGRF scanning 2022-05-07 10:17:26 +02:00
Niels Martin Hansen
588fee5473 Codechange: Document the _ship_subcoord table 2022-05-06 22:56:01 +02:00
translators
c6e4fa7df1 Update: Translations from eints
italian: 11 changes by Rivarossi
dutch: 24 changes by Afoklala
2022-05-06 18:47:14 +00:00
Charles Pigott
146827c458 Fix #9877: GS could trigger 'Cost: 0' cost message (#9878) 2022-05-05 19:51:56 +01:00
translators
142321da79 Update: Translations from eints
spanish (mexican): 1 change by absay
russian: 4 changes by Ln-Wolf
catalan: 20 changes by J0anJosep
french: 1 change by glx22
portuguese: 1 change by azulcosta
2022-05-05 18:47:52 +00:00
translators
1ed212775c Update: Translations from eints
galician: 27 changes by pvillaverde
2022-05-04 18:48:05 +00:00
Owen Rudge
5a6ea11ead Feature: [Actions] Package builds for the Windows Store automatically 2022-05-04 11:40:49 +01:00
Niels Martin Hansen
5b86bce7b2 Change: Log video driver info string instead of just name in crashlog 2022-05-03 21:03:30 +02:00
Niels Martin Hansen
345dcd3c7b Add: Show current video driver info in Options window 2022-05-03 21:03:30 +02:00
translators
be72f1e54b Update: Translations from eints
spanish (mexican): 18 changes by absay
italian: 30 changes by Rivarossi
russian: 17 changes by Ln-Wolf
portuguese: 25 changes by azulcosta
2022-05-03 18:51:46 +00:00
translators
b8565d8cac Update: Translations from eints
spanish (mexican): 10 changes by absay
english (us): 23 changes by 2TallTyler
russian: 22 changes by Ln-Wolf
french: 24 changes by glx22
2022-05-02 18:52:18 +00:00
translators
e5c1865e76 Update: Translations from eints
swedish: 5 changes by joeax910
spanish (mexican): 3 changes by absay
korean: 3 changes by telk5093
italian: 56 changes by Rivarossi
german: 3 changes by danidoedel
romanian: 1 change by ALEX11BR
ukrainian: 8 changes by StepanIvasyn
2022-05-01 18:45:22 +00:00
Loïc Guilloux
7331149dde Codechange: [CMake] Pass API files list via a file to minimise command line length (#9874) 2022-05-01 00:39:59 +02:00
glx22
fb1ac307a4 Fix 44f2ef1: [strgen] Allow gender for {CARGO_SHORT} 2022-04-30 20:38:35 +02:00
Tyler Trahan
ec90fb4c99 Fix #6544: Don't join AI company when loading network game in singleplayer 2022-04-30 19:36:09 +02:00
Andrew Zhou
5ea55f3948 Fix: Prevents crash when no industries are present 2022-04-30 19:29:03 +02:00
Andy
1cfdbb4dea Change: increase vehicle sprite stack from 4 layers to 8 (#9863) 2022-04-26 19:07:44 +02:00
Tyler Trahan
41de69c5b7 Feature: Improved Finance window 2022-04-25 21:51:51 +02:00
Tyler Trahan
f4ca94d3f6 Codechange: Revenue is not the same as Income
Income is revenue minus costs. Let's name things correctly (without breaking the script API).
2022-04-25 21:51:51 +02:00
Tyler Trahan
e79724ea22 Feature: Alternative linkgraph colour schemes (#9866) 2022-04-25 19:32:55 +02:00
Jonathan G Rennison
b3893878bb Fix #9867: Industry::stations_near not filled at industry creation 2022-04-25 19:32:22 +02:00
translators
ed0b0b80d3 Update: Translations from eints
spanish (mexican): 84 changes by absay
italian: 16 changes by Rivarossi
2022-04-23 18:51:15 +00:00
translators
4e09dbc86e Update: Translations from eints
spanish (mexican): 137 changes by absay
italian: 10 changes by Rivarossi
2022-04-22 18:52:06 +00:00
translators
cc4186410b Update: Translations from eints
spanish (mexican): 8 changes by absay
italian: 13 changes by Rivarossi
2022-04-21 18:55:24 +00:00
translators
869b645708 Update: Translations from eints
italian: 33 changes by Rivarossi
polish: 5 changes by pAter-exe
2022-04-20 18:48:43 +00:00
translators
6c161ad18a Update: Translations from eints
italian: 2 changes by Rivarossi
2022-04-19 18:52:14 +00:00
Nik Nyby
44713a68ed Add: [CMake] support rpm for fedora and rhel (#9861) 2022-04-19 02:11:42 +02:00
Nik Nyby
6204020b6a Fix: CMake error message grammar (#9860) 2022-04-19 01:33:29 +02:00
translators
6cb668955e Update: Translations from eints
italian: 7 changes by Rivarossi
2022-04-18 18:52:51 +00:00
translators
585e49a597 Update: Translations from eints
italian: 2 changes by Rivarossi
2022-04-17 18:51:06 +00:00
Joan Josep
bcf26f8ec0 Doc: Fix some spelling mistakes (to->two, tileindex->TileIndex). (#9857) 2022-04-17 19:00:00 +02:00
translators
98bdf01967 Update: Translations from eints
italian: 5 changes by Rivarossi
romanian: 7 changes by alexban011
2022-04-16 18:49:12 +00:00
Loïc Guilloux
ef4b699f40 Fix #9853, 648ee88: incorrect merge of guiflags and flags for osk_activation (#9855) 2022-04-15 22:57:47 +02:00
translators
a24ba6c264 Update: Translations from eints
italian: 2 changes by Rivarossi
2022-04-15 18:51:10 +00:00
translators
3cf0e95f6e Update: Translations from eints
italian: 1 change by Rivarossi
2022-04-12 18:50:59 +00:00
translators
7c40967c1f Update: Translations from eints
polish: 14 changes by pAter-exe
2022-04-11 18:52:50 +00:00
translators
385c2f1381 Update: Translations from eints
polish: 4 changes by pAter-exe
2022-04-10 18:48:55 +00:00
translators
49b8eac2dc Update: Translations from eints
chinese (simplified): 3 changes by HansKaffee
italian: 30 changes by Rivarossi
polish: 14 changes by pAter-exe
2022-04-09 18:48:36 +00:00
translators
1ae34ca62d Update: Translations from eints
catalan: 4 changes by J0anJosep
dutch: 5 changes by Afoklala
polish: 43 changes by pAter-exe
2022-04-08 18:51:47 +00:00
translators
bd6531d0d0 Update: Translations from eints
vietnamese: 4 changes by KhoiCanDev
2022-04-07 18:50:52 +00:00
translators
5dd9400fe2 Update: Translations from eints
english (us): 4 changes by 2TallTyler
2022-04-06 18:48:53 +00:00
translators
ee105257ff Update: Translations from eints
russian: 4 changes by Ln-Wolf
french: 4 changes by glx22
2022-04-05 18:51:24 +00:00
translators
a6ada35259 Update: Translations from eints
portuguese: 4 changes by azulcosta
2022-04-04 18:51:31 +00:00
translators
c36fc98137 Update: Translations from eints 2022-04-03 18:49:03 +00:00
Tyler Trahan
1c580d1612 Change: Improve "local authority rating" setting name and helptext 2022-04-02 22:50:28 +02:00
Tyler Trahan
f92cf38ab5 Feature: Allow disabling local authority control of company actions 2022-04-02 22:50:28 +02:00
Patric Stout
8537fa7206 Fix: [Actions] Remove Ubuntu:groovy from release pipeline (#9845)
It no longer exists upstream. Let's focus on LTS only for now.
2022-04-02 12:36:15 +02:00
Aaron Katzin
148695c571 Fix #9736: Duplicate multiplayer window opens upon canceling password entry (#9842) 2022-04-02 10:37:07 +02:00
Owen Rudge
1bfbcff71e Change: [Actions] Switch back to primary source for 'gon' in macOS build job
This reverts commit 7a97a33598.
2022-03-31 13:00:35 +01:00
Owen Rudge
7a97a33598 Fix: [Actions] Switch source for 'gon' in macOS build job 2022-03-28 21:56:24 +01:00
ALEX11BR
61c6fd3055 Fix: correct some mistaken Romanian real towns 2022-03-26 09:08:46 +01:00
Michael Lutz
8d54f76539 Fix #9837, 46bd2f1c: Road build with wrong half-tile ends. 2022-03-20 12:56:03 +01:00
Dave Shifflett
0d9fdeda8e Feature: Allow Shift+Insert as paste in edit box (#9836) 2022-03-15 22:33:22 +01:00
Loïc Guilloux
1a17b6c8f6 Change: [Actions] Remove VS2017 and restore VS2019 for CI (#9835) 2022-03-13 16:05:24 +01:00
Michael Lutz
08a5478a93 Add: [NewGRF] Map seed as global variable.
This is useful to provide a feature-agnostic, stable random value that differs between games.
One of the possible uses is to e.g. use it to create pseudo-random regions for towns or industries.
2022-03-13 14:20:23 +01:00
Patric Stout
68ec2a7877 Fix: removing long roads doesn't prioritize refusal of local authority over other errors (#9831) 2022-03-11 16:18:09 +01:00
Tyler Trahan
d220debc6c Change: Don't pay Property Maintenance on stations when Infrastructure Maintenance is disabled (#9828) 2022-03-10 22:34:03 +01:00
Tyler Trahan
fbbc80f79e Fix #9020: Update station coverage highlight when adding/removing tiles 2022-03-10 20:54:45 +01:00
Rubidium
c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 2022-03-09 18:05:12 +01:00
Tyler Trahan
2bfceea762 Doc: Fix broken links to Bootstrap CONTRIBUTING guide and doc license 2022-03-08 17:46:48 +01:00
translators
0d8fbf647b Update: Translations from eints
latvian: 4 changes by lexuslatvia
2022-03-03 18:45:52 +00:00
translators
acaea776eb Update: Translations from eints
finnish: 2 changes by RedJimi
2022-02-28 18:49:10 +00:00
Rubidium
1c256a4be7 Fix: do not let shares in the company taking over another company disappear 2022-02-24 20:25:31 +01:00
Tyler Trahan
89dba56782 Fix e740c24: Use correct command flag, not just DC_EXEC 2022-02-23 01:36:24 +01:00
translators
22f6502b14 Update: Translations from eints
chinese (traditional): 3 changes by benny30111
galician: 9 changes by mgtrad, 1 change by NicoSGF64
indonesian: 14 changes by bsuseno
2022-02-22 18:50:00 +00:00
dP
36bee83864 Change: Deliver cargo to the closest industry first (#9536) 2022-02-19 19:08:23 +01:00
Niels Martin Hansen
e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2022-02-15 20:01:10 +01:00
Niels Martin Hansen
41c40f130b Fix: Original music playback rate was slightly too fast
Found a new tempo value experimentally. The new value gives a timing error of less than 0.01 second per minute.
2022-02-10 22:09:51 +01:00
translators
81adc38176 Update: Translations from eints
japanese: 9 changes by Azusa257
2022-02-09 18:49:48 +00:00
frosch
8028794bee Fix #9811, 9156d7b: Use the NewGRF-defined vehicle center when dragging ships and aircraft. (#9812)
The alignment using the total-width of the vehicle-chain was meant for articulated trains and road vehicles only.
2022-02-08 23:08:03 +01:00
translators
a83cd9b4f5 Update: Translations from eints
turkish: 1 change by AlphenLLC
2022-02-07 18:48:47 +00:00
translators
83b6defbfb Update: Translations from eints
korean: 1 change by telk5093
turkish: 5 changes by AlphenLLC
2022-02-05 18:38:53 +00:00
Tyler Trahan
7f0efbe00e Feature: Remember the last-used signal between games (#9792) 2022-02-02 21:26:46 +00:00
Dave Shifflett
25ae42ae8a Feature: Add/extend console commands to enable screenshot automation (#9771)
* Add: `zoomto` console command for main viewport

Similar in spirit to `scrollto`, `zoomto` takes an absolute zoom level
from the user and sets the main viewport to that level while respecting
both the absolute minimum and maximum zoom levels supported by the game
and any limitations imposed by the local client settings.

* Add: optional `instant` flag for `scrollto` command

Using this flag has two effects:

- if the user has smooth scrolling enabled, the scroll action will take
  place as if it were not enabled
- the viewport is redrawn immediately, so any successive `screenshot`
  command will actually work correctly

The original positional arguments are processed like same before.
2022-02-02 21:24:29 +00:00
glx22
b6c5f49379 Change: add a timestamp in name of crash files 2022-02-02 21:32:01 +01:00
J0anJosep
d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 2022-02-02 21:30:15 +01:00
translators
09b71c97aa Update: Translations from eints
belarusian: 35 changes by KorneySan
2022-02-02 18:47:18 +00:00
translators
b59acc7e2c Update: Translations from eints
thai: 122 changes by phetoffux
2022-02-01 18:45:41 +00:00
translators
4ad6b1e58d Update: Translations from eints
thai: 8 changes by phetoffux
2022-01-31 18:45:33 +00:00
translators
30da75941b Update: Translations from eints
swedish: 15 changes by joeax910
slovak: 5 changes by FuryPapaya
thai: 15 changes by phetoffux
2022-01-30 18:44:28 +00:00
Jonathan G Rennison
6ccf020dc2 Fix #9802: Assertion failure in BuildRailWaypointWindow constructor 2022-01-30 11:20:00 +01:00
translators
61abfc9050 Update: Translations from eints
korean: 2 changes by telk5093
slovak: 14 changes by FuryPapaya
thai: 107 changes by phetoffux
2022-01-29 18:54:25 +00:00
translators
9e47df298f Update: Translations from eints
italian: 61 changes by denialmac
2022-01-22 18:44:46 +00:00
Andy
b8a8891a86 Add: [Script] IndustryType::ResolveNewGRFID to resolve industry id from grfid and grf_local_id 2022-01-22 18:15:12 +01:00
Andy
26ac0c48f0 Add: [Script] ObjectType::ResolveNewGRFID to resolve object id from grfid and grf_local_id 2022-01-22 13:12:10 +01:00
translators
f6775a2d55 Update: Translations from eints
irish: 2 changes by temuchie
2022-01-21 18:45:35 +00:00
translators
5239018878 Update: Translations from eints
tamil: 24 changes by Aswn
2022-01-16 18:48:47 +00:00
translators
15c9191568 Update: Translations from eints
tamil: 19 changes by Aswn
2022-01-15 18:48:55 +00:00
translators
8ac3f9a6e1 Update: Translations from eints
vietnamese: 28 changes by chupper100
2022-01-14 18:50:22 +00:00
translators
93e8d4871d Update: Translations from eints
croatian: 67 changes by srekoslav
2022-01-09 18:49:57 +00:00
translators
ad54d08abd Update: Translations from eints
croatian: 6 changes by srekoslav
thai: 2 changes by sanotti
2022-01-08 18:50:03 +00:00
translators
32a4212ef1 Update: Translations from eints
norwegian (bokmal): 2 changes by tmn
2022-01-06 18:49:39 +00:00
translators
8032423bf1 Update: Translations from eints
romanian: 18 changes by Gisterecis
2022-01-05 18:52:23 +00:00
Joan Josep
54ce5b28a4 Codechange: Make RoadScopeResolver constructor inlineable (#9780) 2022-01-05 12:25:22 +00:00
Matthijs Kooijman
5777649ac4 Fix: [CMake] openttd.32.bmp wasn't installed but used by SDL (#9772)
This file is used to set the SDL application icon, but it was no longer
installed since the switch to CMake.
2022-01-05 13:24:35 +01:00
Tyler Trahan
ffa688a432 Doc: Fix broken link to GitHub docs (#9769) 2022-01-05 13:23:16 +01:00
Loïc Guilloux
d62c5667cf Fix #9766: Don't write uninitialised data in config file (#9767) 2022-01-04 22:12:05 +01:00
Michael Lutz
57b992717b Codechange: Extend DrawSpriteToRgbaBuffer to work with 8bpp blitters. 2022-01-01 12:19:30 +01:00
Michael Lutz
69c8ed9965 Codechange: [OSX] Simplify touchbar button data definition. 2022-01-01 12:19:30 +01:00
Michael Lutz
b351cbe490 Fix #9743: [OSX] Only (re-)create touchbar sprites when requested by the main loop. 2022-01-01 12:19:30 +01:00
Michael Lutz
f40e82a19d Fix #9743: [OSX] Don't try to render touchbar sprites with invalid zoom level. 2022-01-01 12:19:30 +01:00
Michael Lutz
80fc5fb46c Change: [OSX] Allow touchbar usage on all supported OS versions.
Touchbar support was introduced in 10.12.2. There's no need to limit
support to 10.15+, as the convenience class NSButtonTouchBarItem is
easily replicated.
2022-01-01 12:19:30 +01:00
Jonathan G Rennison
4844268d1c Fix #9774: CmdBuildRoadStop updated station acceptance in estimate mode 2021-12-30 20:39:10 +01:00
translators
21f85cac87 Update: Translations from eints
chinese (traditional): 25 changes by Tetrapod1206
italian: 12 changes by federico1564S
2021-12-29 18:48:51 +00:00
Loïc Guilloux
c85557e553 Fix: [MinGW] Disable ASLR for x64 Debug builds (#9773) 2021-12-28 21:08:09 +01:00
translators
3ed7910cfe Update: Translations from eints
portuguese (brazilian): 2 changes by Vimerum
2021-12-28 18:48:50 +00:00
translators
a97bce51c2 Update: Translations from eints
czech: 6 changes by vladoschreiner
hungarian: 5 changes by pnpBrumi
2021-12-22 18:49:56 +00:00
benda
30d0f06890 Doc: use only double quotes for cmake command line example in COMPILING.md (#9758)
While powershell happily accepts single quotes, it's not the case for cmd.
2021-12-22 19:32:48 +01:00
trautamaki
f6e6b2c917 Doc: fix broken links to Open{GFX,SFX,MSX} in README.md (#9759) 2021-12-22 15:26:45 +01:00
translators
afb817fe19 Update: Translations from eints
norwegian (bokmal): 4 changes by Anolitt
2021-12-21 18:49:51 +00:00
Michael Lutz
b11bd185e3 Fix #9756: Network command unpack proc was not generated in all cases.
The case where the callback proc takes all command results but not any of
the command parameters was not handled properly.
2021-12-20 23:32:23 +01:00
Tyler Trahan
9c18236f2c Fix: Suppress vehicle age warnings for stopped vehicles 2021-12-20 22:13:37 +01:00
Michael Lutz
e67124e174 Change: [Admin] Bump admin port protocol due to command changes.
docs/admin_network.md promised that information in an admin packet
is never removed. It does allow the possibility of using a new packet type
for changed data in combination with a bump of the admin port version.

As the recent command handling changes modified the contents of
ADMIN_PACKET_SERVER_CMD_LOGGING, do exactly that.
2021-12-20 19:30:27 +01:00
Michael Lutz
3fede15940 Codechange: [Script] Prettify squirrel call helpers by using C++17. 2021-12-20 19:25:10 +01:00
Jonathan G Rennison
e08a6e2014 Fix #9735: Fix OrderBackup::Reset in non-GUI case 2021-12-19 16:53:10 +01:00
Joan Josep
e890e7db76 Cleanup #9725: Clean up Doxygen docs and fix typo. (#9753) 2021-12-19 16:51:45 +01:00
Michael Lutz
afc3d71fd0 Codechange: Don't generate CommandPacket unpack functions for invalid cmd/callback combinations.
If the arguments of the callback proc don't match with the command parameters,
we can't do the proper command execution anyway. As such, don't even generate
an unpack function in the first place, saving a bit of unnecessary code bloat.

Validate on receive that the cmd/callback combination is supported, rejecting
clients that try to send invalid values.
2021-12-16 22:28:32 +01:00
Michael Lutz
c521b965bd Codechange: Don't use a global for the terrforming error tile. 2021-12-16 22:28:32 +01:00
Michael Lutz
2e39637db2 Codechange: Don't use a global for the 'not enough cash' message. 2021-12-16 22:28:32 +01:00
Michael Lutz
41fa16f325 Codechange: Don't use globals for return values from vehicle command procs. 2021-12-16 22:28:32 +01:00
Michael Lutz
57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 2021-12-16 22:28:32 +01:00
Michael Lutz
3e85e833a7 Codechange: Add support for additional command result values. 2021-12-16 22:28:32 +01:00
Michael Lutz
8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 2021-12-16 22:28:32 +01:00
Michael Lutz
d85348b1d1 Codechange: Template the command callback function type to allow unpacked arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz
13528bfcd0 Codechange: Un-bitstuff all remaining commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
c6d7b98808 Codechange: Un-bitstuff landscape commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
e6e69d5289 Codechange: Un-bitstuff goal and story page commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
1a42a8a5d5 Codechange: Un-bitstuff town-related commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
55170ae703 Codechange: Un-bitstuff rail commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
2637c06f88 Codechange: Un-bitstuff timetable commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
211c630cbe Codechange: Un-bitstuff order commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
de45a8729c Codechange: Add DoCommand::Post specialization for commands that take no TileIndex.
This adds a new Post overloads that still take a TileIndex which
is used to place any error windows or text effects.
2021-12-16 22:28:32 +01:00
Michael Lutz
4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 2021-12-16 22:28:32 +01:00
Michael Lutz
ccefa76a46 Codechange: Template DoCommandPInternal. 2021-12-16 22:28:32 +01:00
Michael Lutz
6691ee3b96 Codechange: Template script command calls. 2021-12-16 22:28:32 +01:00
Michael Lutz
eab18f06a4 Codechange: Pass additional data as byte stream to command callbacks. 2021-12-16 22:28:32 +01:00
Michael Lutz
0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz
e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz
c88b104ec6 Codechange: Use wrapper struct to automatically manage command depth tracking. 2021-12-16 22:28:32 +01:00
Michael Lutz
996b16de70 Codechange: Use lambdas instead of CommandContainer to manage station picker commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
a05fd7aa50 Change: [Network] Transfer command data as serialized byte stream without fixed structure.
The data will be transmitted as the length followed by the serialized data. This allows the command
data to be different for every command type in the future.
2021-12-16 22:28:32 +01:00
Michael Lutz
b0990fcff7 Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
2021-12-16 22:28:32 +01:00
Michael Lutz
4fc055d6e9 Codechange: Align parameter order of command callbacks to command handlers. 2021-12-16 22:28:32 +01:00
Michael Lutz
123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 2021-12-16 22:28:32 +01:00
Michael Lutz
7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz
33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
Michael Lutz
5ddfdc8516 Codechange: Declare our custom enum operators as constexpr. 2021-12-16 22:28:32 +01:00
Michael Lutz
a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2021-12-16 22:28:32 +01:00
Michael Lutz
549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Michael Lutz
b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
Michael Lutz
39e8783f4b Fix: Template syntax error when using 'span' with a container type. 2021-12-16 22:28:32 +01:00
translators
0c90326ada Update: Translations from eints
swedish: 1 change by joeax910
chinese (traditional): 160 changes by Tetrapod1206
galician: 21 changes by pvillaverde
irish: 5 changes by temuchie
polish: 2 changes by pAter-exe
2021-12-14 18:49:17 +00:00
frosch
bc22e9333e Fix: if vehicles only refit to cargo-slots >= 32, the default cargo was wrong. (#9744) 2021-12-12 17:35:41 +01:00
Jonathan G Rennison
762b656b53 Fix #9740: Fix loading of gamelog change items from savegame ver >= 294 2021-12-10 22:46:16 +01:00
Rubidium
ad89601c49 Codechange: do not use all upper case enumerators in a scoped enum 2021-12-05 21:41:43 +01:00
Patric Stout
ea4f6bb8b2 Fix #9730: [Network] connections can use an invalid socket due to a race condition
A race condition happens when an IPv6 connection takes more than
250ms to report an error, but does return before the IPv4 connection
is established.
In result, an invalid socket might be used for that connection.
2021-12-04 20:56:05 +01:00
Patric Stout
9c36c12c85 Codechange: ensure OnConnect() always gets called with a valid socket (#9729)
This should already be the case, but now assert()s will tell us
if this isn't.
2021-12-04 18:32:06 +01:00
Tyler Trahan
802ca4e722 Fix: Don't try to rename OWNER_DEITY signs in-game (#9716) 2021-11-28 15:16:42 +01:00
translators
6953df7b5e Update: Translations from eints
galician: 265 changes by pvillaverde
indonesian: 8 changes by indrabagus
spanish: 7 changes by MontyMontana
2021-11-27 18:47:35 +00:00
translators
e0a91d7325 Update: Translations from eints
galician: 17 changes by pvillaverde
2021-11-26 18:48:29 +00:00
translators
ad7bdeb73a Update: Translations from eints
chinese (simplified): 2 changes by kurax
2021-11-22 18:48:48 +00:00
Michael Lutz
20a30825a0 Fix: Insufficient input validation for CmdIndustryCtrl. (#9711) 2021-11-20 23:27:45 +01:00
translators
793de48e89 Update: Translations from eints
vietnamese: 2 changes by KhoiCanDev
2021-11-20 18:49:33 +00:00
dP
ad90e88ebd Change: Make pf.yapf.rail_firstred_twoway_eol on by default (#9544) 2021-11-19 00:08:06 +00:00
dP
54951e39a1 Fix #8797: Use logical rail length when placing signals (#9652) 2021-11-19 00:07:22 +00:00
nchappe
2cb6351af5 Fix: Update last servicing dates when using the date cheat (#9694) 2021-11-19 00:04:22 +00:00
Bernard Teo
0533b666b7 Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704) 2021-11-19 00:03:52 +00:00
translators
f6886754ff Update: Translations from eints
greek: 2 changes by dionisis84
german: 2 changes by danidoedel
2021-11-18 18:47:13 +00:00
Jonathan G Rennison
fc58ed9987 Codechange: Remove CargoSpec::multipliertowngrowth which is unused (#9701)
This is set by cargo property 19.
This property is only implemented in TTDPatch.
2021-11-16 22:48:21 +00:00
Charles Pigott
cf16f452da Fix #9680: Recalculating aircraft positions before map array updates caused crashes (#9699) 2021-11-15 13:39:41 +00:00
Patric Stout
0cbe94256e Change: [Emscripten] update to 2.0.34 and use Release over RelWithDebInfo (#9696)
It turns out that having "-g" in the compile-statement causes
Emscripten to pick -g3, which makes for very big binaries. This
is very likely not your intention when building Emscripten, as
smaller really is better.

For comparison, with RelWithDebInfo the binary is ~80MB. With
Release it is ~7.4MB.
2021-11-14 16:59:49 +01:00
frosch
5f6303f985 Fix: don't complain when the sprite font is missing glyphs. (#9692)
Silently auto-pick a suitable font.
2021-11-13 21:01:16 +01:00
translators
f8efab4653 Update: Translations from eints
japanese: 1 change by akaregi
dutch: 3 changes by Afoklala
2021-11-12 18:46:13 +00:00
Owen Rudge
2f72eb0657 Add: Specify minimum version for macOS (#9689) 2021-11-11 20:06:31 +01:00
translators
62795a2e6d Update: Translations from eints
russian: 2 changes by Ln-Wolf
2021-11-11 18:48:27 +00:00
translators
4bcbcbc58f Update: Translations from eints
tamil: 2 changes by Aswn
2021-11-10 18:52:03 +00:00
Owen Rudge
7d40cc9291 Change: Explicitly specify SHA1 for legacy code signing on Windows 2021-11-10 10:26:33 +00:00
Tyler Trahan
48c1c7f221 Cleanup: Fix typo in overflowsafe_type comment 2021-11-09 20:51:38 +01:00
translators
236f71640c Update: Translations from eints
english (us): 2 changes by 2TallTyler
arabic (egypt): 49 changes by AviationGamerX
korean: 17 changes by telk5093
catalan: 2 changes by J0anJosep
danish: 4 changes by nielsmh
french: 2 changes by glx22
portuguese: 2 changes by azulcosta
2021-11-09 18:50:34 +00:00
translators
0ad40ee868 Update: Translations from eints
arabic (egypt): 35 changes by AviationGamerX
2021-11-08 18:50:01 +00:00
Tyler Trahan
e9cb9c1135 Fix #9579: Object and HQ construction is Construction cost, not Property Maintenance (#9673) 2021-11-08 08:12:15 +00:00
Guillaume Renoult
c38af72978 Update: add setting to hide news about competitors vehicle crash (#9653) 2021-11-07 19:54:50 +01:00
Tyler Trahan
b4bd7b367e Feature: Ctrl-click to remove fully autoreplaced vehicles from list (#9639) 2021-11-07 19:53:54 +01:00
Tyler Trahan
08cb5ba2cd Fix: Don't show screenshot GUI in screenshots (#9674) 2021-11-07 17:41:24 +01:00
J0anJosep
d0655a48ba Fix: Do not redraw vehicle lists when skip order command is tested. 2021-11-07 13:23:29 +01:00
Michael Lutz
8c558d74a5 Fix 55a11710: Curly braces need to be double-escaped for (std::)fmt. 2021-11-06 20:21:07 +01:00
translators
73001ae1a9 Update: Translations from eints
english (au): 3 changes by LordAro
2021-11-06 18:47:14 +00:00
Michael Lutz
95c8467670 Fix 65cbde4b: Writing to uninitialized string when loading a currency NewGRF. 2021-11-06 19:15:29 +01:00
Loïc Guilloux
6ff0858b38 Fix #9669, cbe00ec: Only try valid reverse directions (#9672) 2021-11-06 17:32:37 +01:00
Dmitry Erlikh
33ef34189e Fix #9648: add missing commas in crash message 2021-11-03 22:10:21 +01:00
dP
80e3397f85 Fix 3a1a915: Every 16th client never reconnects after server restart 2021-11-03 21:33:38 +01:00
translators
9edb75ec0b Update: Translations from eints
arabic (egypt): 7 changes by AviationGamerX
2021-11-02 18:49:30 +00:00
translators
00a6287f97 Update: Translations from eints
arabic (egypt): 2 changes by AviationGamerX
2021-11-01 18:49:20 +00:00
translators
ccf70fc4b3 Update: Translations from eints
dutch: 2 changes by Afoklala
2021-10-29 18:49:23 +00:00
translators
edf7b02ddb Update: Translations from eints
german: 2 changes by Wuzzy2
2021-10-28 18:48:40 +00:00
translators
488cf26406 Update: Translations from eints
swedish: 44 changes by joeax910
japanese: 1 change by clzls
chinese (simplified): 2 changes by clzls
2021-10-27 18:50:25 +00:00
translators
4487ad1a5e Update: Translations from eints
korean: 1 change by telk5093
polish: 2 changes by pAter-exe
2021-10-25 18:49:13 +00:00
translators
a0831cec39 Update: Translations from eints
swedish: 1 change by joeax910
2021-10-24 18:46:47 +00:00
translators
279fe11b03 Update: Translations from eints
indonesian: 2 changes by hadyatmo
2021-10-23 18:47:57 +00:00
frosch
e8bff0ad03 Change: Suppress panning in intro game, while user is interacting with the GUI. (#9645) 2021-10-23 15:13:39 +02:00
frosch
111a47af0d Codechange: rename 'info_view' to 'rotor_in_gui', because it is only used by helicopters. 2021-10-23 14:45:08 +02:00
frosch
bc984d9af5 Codechange: remove redundant 'info_view' parameter, it can be derived from 'image_type'. 2021-10-23 14:45:08 +02:00
translators
bf0210229c Update: Translations from eints
english (us): 2 changes by 2TallTyler
vietnamese: 2 changes by KhoiCanDev
catalan: 2 changes by J0anJosep
portuguese (brazilian): 2 changes by Vimerum
2021-10-22 18:53:01 +00:00
Joan Josep
b2e83b4da6 Fix: Draw rotor in cursor when dragging helicopters. (#9612) 2021-10-22 19:39:47 +02:00
Loïc Guilloux
08c048e0a1 Fix #9643, 95386dc: Incorrect determination of screenshot format (#9644) 2021-10-22 16:34:48 +02:00
translators
ae340f415e Update: Translations from eints
russian: 2 changes by Ln-Wolf
2021-10-21 18:47:48 +00:00
Loïc Guilloux
f2c03a77f0 Change: Don't store not to be activated newGRFs in savegames (#9627) 2021-10-20 22:14:23 +02:00
Loïc Guilloux
bc1b84cbbb Fix #9630: intro game could zoom in/out more than allowed by settings (#9633)
Also fixes #9622
2021-10-20 22:08:08 +02:00
translators
b043d58b92 Update: Translations from eints
swedish: 4 changes by joeax910
spanish: 1 change by MontyMontana
2021-10-20 18:49:34 +00:00
Loïc Guilloux
eed49d7792 Fix #9626, ddafc0d: Incorrect loading of script saved data (#9629) 2021-10-20 12:23:16 +02:00
translators
e68a51eced Update: Translations from eints
korean: 3 changes by telk5093
french: 2 changes by glx22
portuguese: 2 changes by azulcosta
2021-10-19 18:47:37 +00:00
glx22
1c0700e0c0 Fix #9624: compilation with RANDOM_DEBUG 2021-10-19 09:05:00 +01:00
glx22
14429bbe8a Change: [Actions] Also check desync debug 2021-10-19 09:05:00 +01:00
translators
6289b4dd81 Update: Translations from eints
greek: 2 changes by dionisis84
russian: 1 change by Ln-Wolf
finnish: 2 changes by hpiirai
tamil: 88 changes by Aswn
2021-10-18 18:48:12 +00:00
Charles Pigott
53e17d07d2 Fix #9595: Always use plural forms of cargo for subsidy strings (#9619) 2021-10-18 09:43:14 +01:00
Patric Stout
5bcdf16dc5 Fix 01603d9e: [Preview] publishing preview failed due to recent changes (#9621)
Since 01603d9e we run under root, not under github user. In result,
the location of "aws" binary changed.
2021-10-17 22:42:29 +02:00
Patric Stout
01603d9e47 Fix 3046a6ce: [Preview] building preview failed to patch LZMA (#9620)
The job was started under a non-priv user, which did not have
permission to patch the emscripten files required to make LZMA
work.
2021-10-17 21:59:50 +02:00
Charles Pigott
86c295bb3b Change: Ignore refresh_rate setting when vsync is enabled 2021-10-17 19:25:03 +01:00
Charles Pigott
e09f251fc6 Fix #9614: Refresh rate dropdown was still active when vsync was enabled 2021-10-17 19:25:03 +01:00
Charles Pigott
0853c1979b Feature: Button to toggle showing advanced signal types (#9617) 2021-10-17 19:24:50 +01:00
Charles Pigott
3b7daca832 Change: Don't use 'server address' string in server list when displaying an invite code (#9615) 2021-10-17 18:14:25 +01:00
Patric Stout
78eece71d9 Codechange: "set but not used" warning when disabling assert() (#9613)
DebugCheckSanity() is unused when asserts are disabled. While at it,
use WITH_ASSERT over NDEBUG, as that means we also run this code
during beta/RC.
2021-10-16 22:06:08 +02:00
translators
d66dea5d83 Update: Translations from eints
indonesian: 9 changes by bsuseno
2021-10-15 18:47:17 +00:00
translators
4b96244b4d Update: Translations from eints
romanian: 6 changes by kneekoo
2021-10-12 18:47:28 +00:00
glx22
cbe00ec651 Fix: Try all possible reverse directions when a ship reaches a dead end 2021-10-11 21:11:13 +02:00
glx22
207cf7bbdd Change: Reverse ship when leaving docks if a better path exists 2021-10-11 21:11:13 +02:00
translators
d0092925c9 Update: Translations from eints
romanian: 9 changes by kneekoo
2021-10-11 18:48:06 +00:00
translators
7d831be3ab Update: Translations from eints
indonesian: 6 changes by bsuseno
2021-10-10 18:46:33 +00:00
translators
8b157c9bdf Update: Translations from eints
romanian: 1 change by kneekoo
2021-10-06 18:47:23 +00:00
translators
d2bc32e94a Update: Translations from eints
korean: 1 change by telk5093
romanian: 15 changes by kneekoo
2021-10-04 18:48:34 +00:00
Loïc Guilloux
46123742f5 Change: [Actions] Use macOS-11 image for releases (#9605) 2021-10-03 21:14:59 +02:00
translators
340a36bf1f Update: Translations from eints
romanian: 8 changes by kneekoo
irish: 55 changes by temuchie
2021-10-03 18:46:14 +00:00
Patric Stout
3046a6ce39 Change: upgrade Emscripten to 2.0.31 and enable LZMA by default (#9604) 2021-10-03 16:20:05 +02:00
SamuXarick
e404d16929 Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594) 2021-10-03 12:54:19 +02:00
Patric Stout
e4ad632989 Add: [Network] Keep the refresh button in lowered state while refreshing (#9600)
This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
2021-10-03 11:02:28 +02:00
Loïc Guilloux
2144cd98a3 Fix: Incorrect Romanian own name (#9598) 2021-10-03 09:49:03 +01:00
Loïc Guilloux
a53cfeef13 Fix #9548, e5fedcd: [Squirrel] Crash during engine cleanup after reaching memory limit on realloc (#9592) 2021-10-02 21:08:42 +02:00
translators
a2cf81e722 Update: Translations from eints
romanian: 38 changes by kneekoo
2021-10-02 18:46:31 +00:00
dP
585ad9bcab Cleanup: Swap comments for IConsoleModes (#9587) 2021-10-02 16:33:28 +02:00
Loïc Guilloux
ccd586a736 Fix #9588, 140a96b: [Squirrel] Reaching memory limit during script registration could prevent further script detections (#9589)
Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
2021-10-02 15:13:58 +02:00
translators
78d66b7732 Update: Translations from eints
romanian: 145 changes by kneekoo
2021-10-01 18:45:29 +00:00
translators
41094b6a4a Update: Translations from eints
spanish: 14 changes by MontyMontana
2021-09-30 18:48:12 +00:00
translators
e89be8d97a Update: Translations from eints
indonesian: 28 changes by bsuseno
romanian: 49 changes by kneekoo
2021-09-29 18:47:12 +00:00
translators
b4bacff4fe Update: Translations from eints
hungarian: 4 changes by pnpBrumi
indonesian: 41 changes by bsuseno
italian: 28 changes by CoderLel
romanian: 46 changes by kneekoo
slovak: 18 changes by ApplePie420
danish: 279 changes by nielsmh
2021-09-28 18:47:22 +00:00
translators
7a48b5597d Update: Translations from eints
czech: 40 changes by LubosKolouch, 27 changes by CzechRepublic98
hungarian: 1 change by pnpBrumi
turkish: 13 changes by ahmetlii
2021-09-27 18:49:51 +00:00
Niels Martin Hansen
5e3ed3a05e Add: Console command to list search directories for various things 2021-09-26 23:39:45 +02:00
translators
7aacb2ed8e Update: Translations from eints
japanese: 18 changes by akaregi, 10 changes by clzls
slovenian: 17 changes by Matej1245
czech: 33 changes by CzechRepublic98
chinese (simplified): 27 changes by clzls
arabic (egypt): 17 changes by AviationGamerX
luxembourgish: 99 changes by phreeze83
hungarian: 24 changes by pnpBrumi, 6 changes by baliball
serbian: 107 changes by nkrs
romanian: 16 changes by kneekoo, 2 changes by ALEX11BR
irish: 229 changes by temuchie
ukrainian: 113 changes by StepanIvasyn
latvian: 8 changes by lexuslatvia
lithuanian: 41 changes by devbotas
polish: 1 change by yazalo
2021-09-26 18:47:33 +00:00
Loïc Guilloux
38a64eb2aa Change: Allow all tiles around docks to be docking tiles (#9578) 2021-09-26 19:31:55 +02:00
Loïc Guilloux
11dece205c Revert 7ca1793: Using Trackdir keyed node is not required, Exitdir keyed node still have the correct trackdir (#9576) 2021-09-26 18:41:41 +02:00
r-a-sattarov
14ad424470 Add: use of Intel Intrinsics & RDTSC on e2k (MCST Elbrus 2000) (#9575)
MCST e2k (Elbrus 2000) architecture has half native / half software support of most Intel/AMD SIMD
e.g. MMX/SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2/AES/AVX/AVX2 & 3DNow!/SSE4a/XOP/FMA4

E2K - this is VLIW/EPIC architecture, like Intel Itanium (IA-64) architecture.
Ref: https://en.wikipedia.org/wiki/Elbrus_2000

Co-authored-by: Alexander Troosh @troosh, Konstantin Ivlev @sse4 and Dmitry Shcherbakov @crypto-das
2021-09-26 11:12:35 +02:00
translators
9b1651a267 Update: Translations from eints
swedish: 8 changes by Abbin44
norwegian (bokmal): 14 changes by Anolitt
chinese (traditional): 6 changes by SiderealArt
slovenian: 4 changes by Matej1245
vietnamese: 14 changes by KhoiCanDev
luxembourgish: 24 changes by phreeze83
hungarian: 1 change by baliball
serbian: 29 changes by nkrs
german: 1 change by SecretIdetity
russian: 2 changes by SecretIdetity, 1 change by Ln-Wolf
catalan: 1 change by J0anJosep
turkish: 1 change by ahmetlii
french: 1 change by glx22
2021-09-25 18:46:38 +00:00
Patric Stout
394c749b6b Change: Heading for 13 now (#9573) 2021-09-25 13:48:03 +02:00
dP
39662aabef Add: allow gamescripts to build neutral objects (#9568) 2021-09-25 13:39:40 +02:00
translators
66c7d9b8ed Update: Translations from eints
dutch: 4 changes by Afoklala
spanish: 4 changes by MontyMontana
polish: 9 changes by pAter-exe
2021-09-24 18:48:15 +00:00
Tyler Trahan
4aa63ce8f3 Fix: Changing raw industry funding method redraws GUI (#9572) 2021-09-23 21:07:54 +02:00
Danny de Bruijne
753b1d7e15 Feature: Add selected toolbar buttons to MacBook Pro Touch Bar 2021-09-23 21:03:00 +02:00
translators
16aac9c341 Update: Translations from eints
english (us): 1 change by 2TallTyler
2021-09-23 18:48:02 +00:00
translators
909a83758c Update: Translations from eints
spanish (mexican): 8 changes by absay
portuguese (brazilian): 14 changes by Vimerum
2021-09-22 18:47:46 +00:00
translators
7c6b39e189 Update: Translations from eints
korean: 4 changes by telk5093
greek: 1 change by dionisis84
russian: 2 changes by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by azulcosta
2021-09-21 18:50:15 +00:00
translators
b5e8b36b5b Update: Translations from eints
chinese (traditional): 19 changes by benny30111
german: 3 changes by Wuzzy2
catalan: 3 changes by J0anJosep
2021-09-20 18:47:59 +00:00
SamuXarick
45edd9f326 Fix: Incorrect error messages on placing water on scenario editor (#9560)
Additionally changes the behaviour of placing sea on sea/river/canal and placing canal/river on canal to (over)build, instead of disallowing it
2021-09-19 23:14:07 +02:00
dP
31cf9e888b Add: [Network] external chat messages for remote admins (#9563) 2021-09-19 23:09:06 +02:00
Patric Stout
d9f8ed7bdf Add: [Network] On join, log the ClientID + IP + Name clearly (#9558)
Additionally, reword the disconnect to match connect / join messages.

Co-authored-by: Berbe <4251220+Berbe@users.noreply.github.com>
2021-09-19 21:52:46 +01:00
7e70ead396 Fix #9562: Handle case of invalid action2 with zero results. (#9564) 2021-09-19 21:52:08 +01:00
Patric Stout
b8f9e24189 Fix #9484: update locale currencies settings mapping (#9559) 2021-09-19 22:44:28 +02:00
translators
0babadfbe4 Update: Translations from eints
english (us): 3 changes by 2TallTyler
greek: 3 changes by dionisis84
finnish: 3 changes by hpiirai
french: 3 changes by glx22
portuguese: 4 changes by azulcosta
2021-09-19 18:47:36 +00:00
translators
28d9181d5d Update: Translations from eints
korean: 4 changes by telk5093
finnish: 4 changes by hpiirai
irish: 151 changes by temuchie
french: 11 changes by glx22
2021-09-18 18:46:53 +00:00
Patric Stout
cd03bac3dd Fix: add back 'Spectate' option to company toolbar menu (#9556)
This was removed in ce7406f88b, but people used this to quickly
mark themselves as away.

Co-authored-by: dP <dp@dpointer.org>
2021-09-18 20:27:56 +02:00
Patric Stout
7acdaaaf2f Fix: Prevent train reversing when wholly inside a train depot (#9557)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2021-09-18 15:56:23 +02:00
SamuXarick
18247bb3b8 Fix #9521: Don't load at just removed docks that were part of a multi-dock station (#9524) 2021-09-18 13:25:07 +02:00
SamuXarick
b335b0501c Fix: wrong error message when building canals over ship depots / locks
IsTileType() also considers ship depots and locks water. IsWaterTile() does the right thing.
2021-09-18 13:24:49 +02:00
SamuXarick
6ce74b2a1b Fix: reduce cost of building canals over objects on sea
It is not like we will drain the sea first, to put water back in it after.
Besides, the cost for draining the sea isn't calculated for all other cases either.
2021-09-18 13:24:49 +02:00
Bernard Teo
20717ededf Feature: Button to open order window from VL_SHARED_ORDERS window 2021-09-18 11:17:49 +02:00
Bernard Teo
6a6dbbaad2 Feature: Ctrl-Clicking GB_SHARED_ORDERS vehicle list opens order window 2021-09-18 11:17:49 +02:00
translators
ff6c934916 Update: Translations from eints
english (us): 4 changes by 2TallTyler
greek: 10 changes by dionisis84
german: 4 changes by MagnumSociety
dutch: 4 changes by Afoklala
spanish: 66 changes by MontyMontana
polish: 10 changes by pAter-exe
2021-09-17 18:45:40 +00:00
translators
a53c4f0fb7 Update: Translations from eints
japanese: 30 changes by scabtert
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
catalan: 4 changes by J0anJosep
portuguese: 4 changes by azulcosta
2021-09-16 18:47:49 +00:00
translators
19a6513607 Update: Translations from eints 2021-09-15 18:49:54 +00:00
SamuXarick
a57c2b073a Feature: Display icon/text whether vehicle is lost in vehicle (list) window (#9543) 2021-09-14 22:10:00 +02:00
SamuXarick
37de878129 Feature: [AI/GS] Missing water related functions and objects (#8390) 2021-09-14 22:06:55 +02:00
translators
c6035158ca Update: Translations from eints
german: 5 changes by Wuzzy2
2021-09-14 18:47:07 +00:00
translators
c8ab5e58f9 Update: Translations from eints
portuguese: 6 changes by azulcosta
2021-09-13 18:49:03 +00:00
Patric Stout
928e6a04e2 Doc: update multiplayer documentation with latest changes (#9552)
Although several places were fixed during the PR making the change,
not all made it in this document.

While at it, removed all kinds of Markdown warnings by an excessive
usage of spacebar in this document.
2021-09-12 22:26:04 +02:00
translators
d757aa7591 Update: Translations from eints
swedish: 5 changes by joeax910
finnish: 5 changes by hpiirai
latvian: 67 changes by lexuslatvia
2021-09-12 18:48:50 +00:00
Niels Martin Hansen
6bd3106681 Feature: Multiple rotating views on title screen 2021-09-12 19:46:48 +02:00
Vít Šefl
710b758b81 Fix #9241: Grove and forest tree brushes also create rainforests (#9542) 2021-09-12 08:42:24 +02:00
Charles Pigott
d4588df9f9 Fix #9527: Crash when trying to place multitile objects at map edge 2021-09-11 23:10:50 +01:00
Charles Pigott
16dca0d7bc Codechange: Object non-zero dimension check was not logically correct 2021-09-11 23:10:50 +01:00
translators
ceaff9c9f2 Update: Translations from eints
korean: 6 changes by telk5093
2021-09-11 18:48:07 +00:00
Michael Lutz
ee57afc285 Fix #9463: [Win32] Try to work around XAudio2 crashes by catching SEH exceptions.
If an exceptions is thrown during context creation, just declare the XAudio
driver as unusable. The driver logic will try to find an alternative for us.
2021-09-11 15:42:34 +02:00
Patric Stout
a8641ea44a Add: support filtering content entries for patchpacks (#9541)
This changes nothing for us, but allows patchpacks to add the
right pieces of code to start filtering content entries on patchpack
only entries.
2021-09-11 15:34:46 +02:00
translators
9e85f40733 Update: Translations from eints
spanish (mexican): 4 changes by absay
english (us): 6 changes by 2TallTyler
russian: 6 changes by Ln-Wolf
catalan: 6 changes by J0anJosep
dutch: 6 changes by Afoklala
2021-09-10 18:47:58 +00:00
translators
7107e63f8c Update: Translations from eints
korean: 6 changes by telk5093
hungarian: 34 changes by pnpBrumi
indonesian: 16 changes by dimaspaf14
latvian: 94 changes by lexuslatvia
polish: 2 changes by pAter-exe
2021-09-09 18:49:31 +00:00
Tyler Trahan
66620b497b Fix #8603: Don't give focus to text filter when opening Object GUI (#9547) 2021-09-09 18:30:03 +02:00
Jonathan G Rennison
6e3d023e69 Fix #9535: Maintain a reverse dependency map of network content (#9538)
Fixes performance issues with dependency lookup when retrieving
content list from the content server.
2021-09-09 18:06:00 +02:00
Tyler Trahan
7469f00c5b Feature: Hide block signals in GUI by default (#8688) 2021-09-05 20:22:27 +02:00
Patric Stout
f656b0ae96 Fix: use-after-free after ClientNetworkCoordinatorSocketHandler::CloseAllConnections() (#9534)
The function clears all stun-handlers. This causes all of those
objects to be destroyed.
A handler can have a pending connecter, which was only killed in
case CloseConnection() was called. This is never the case when
the object is destroyed. In result, the connecter could finish
and cause a use-after-free by calling into the (now deleted)
handler.
2021-09-05 18:17:39 +02:00
Patric Stout
9c74dc2468 Codechange: validate that all STR_NNN strings are defined and used (#9518) 2021-09-02 22:32:10 +02:00
Rubidium
92559e6f3a Fix #9388: thread unsafe use of NetworkAdminConsole/IConsolePrint 2021-09-01 22:40:44 +02:00
Patric Stout
63116bd59f Fix a2051bad: SendCmdNames only sent one name per packet (#9528) 2021-08-31 21:40:38 +02:00
Patric Stout
2c05412d72 Fix #9407: desync when founding a town nearby a station (#9526)
"stations_near" wasn't updated when founding a town near
a station. As this variable is not saved, any client joining
after the town is founded has a different value for
"stations_near", potentially causing desyncs.

As the intention of this if() statement was to skip an expensive
calculation when there are clearly no stations, better to move
that check inside the function, so other places also enjoy
the speedup.
2021-08-31 14:31:37 +02:00
Niels Martin Hansen
69e9acd702 Add: Larger size renderings of the logo/icon (#8961) 2021-08-31 10:25:51 +02:00
Patric Stout
f87fe395a7 Fix: pathfinders always tried to avoid docking tiles (even if nothing was on them) (#9522)
When coming across any docking tile (for example, all tiles around
an oilrig are docking tiles), it always at least added a penalty
of 3 times a normal tile, even when there are no ships on them.

In result, the pathfinder got suggested to always go around docking
tiles. This was most likely not the intention of the change made in
31db4f8d5e.
2021-08-31 09:57:44 +02:00
translators
219598a90b Update: Translations from eints
vietnamese: 6 changes by myquartz
2021-08-30 18:51:16 +00:00
translators
80231975e5 Update: Translations from eints
greek: 121 changes by dionisis84
2021-08-29 18:48:25 +00:00
Patric Stout
d8e870c50c Fix: when DNS didn't resolve any IPs, the debug message was misleading (#9519) 2021-08-28 21:19:53 +02:00
Patric Stout
13b53e1290 Codechange: remove unused strings (#9516) 2021-08-28 21:09:07 +02:00
translators
20ff6fd3f1 Update: Translations from eints
arabic (egypt): 21 changes by AviationGamerX
finnish: 2 changes by hpiirai
turkish: 59 changes by ahmetlii
2021-08-28 18:47:10 +00:00
Patric Stout
8ab267496b Codechange: reference a string by its name, not with "another + 1" (#9517)
It is wrong anyway, as "TINY" normally is at -1. Just weird code.
2021-08-28 17:08:01 +02:00
Loïc Guilloux
8d2162ba2d Fix b6a116a: convert server_advertise to server_game_type in config file (#9515) 2021-08-28 14:41:07 +02:00
translators
aa83488fde Update: Translations from eints
swedish: 2 changes by joeax910
spanish (mexican): 7 changes by absay
slovenian: 2 changes by Yeznick
greek: 60 changes by dionisis84
german: 7 changes by Wuzzy2
dutch: 2 changes by Afoklala
2021-08-27 18:48:25 +00:00
translators
56d4749ac9 Update: Translations from eints
norwegian (bokmal): 5 changes by buzzCraft, 2 changes by Anolitt
english (us): 7 changes by 2TallTyler
russian: 2 changes by Ln-Wolf
2021-08-26 18:50:32 +00:00
translators
e9f3ddb6ba Update: Translations from eints
greek: 28 changes by dionisis84
portuguese: 2 changes by azulcosta
2021-08-25 18:49:22 +00:00
translators
ef3c4a8737 Update: Translations from eints
greek: 17 changes by dionisis84
catalan: 4 changes by J0anJosep
portuguese (brazilian): 2 changes by Vimerum
2021-08-24 18:48:45 +00:00
translators
52d57b17b0 Update: Translations from eints
swedish: 8 changes by joeax910
2021-08-23 18:50:19 +00:00
Patric Stout
dc5b7b996c Fix: [Network] show query errors in the server listing instead of error popup (#9506)
When you are query several servers at once, it is rather unclear
for which server you got a popup. Instead, show any errors on the
server itself.

This is only true for the query-part. Joining a server still gives
an error popup to tell you about any issue.
2021-08-23 20:16:22 +02:00
Patric Stout
e31b5d3870 Fix #9490: [Network] a full server couldn't be queried either (#9508)
You can now still query a full server, as long as the maximum
amount of allowed connections isn't reached. This means that as
long as there are not 255 clients connected to a server, you can
always connect to query.
2021-08-23 19:38:02 +02:00
Patric Stout
b2f0491a90 Fix #9501: [Network] crash when more than one game-info query was pending (#9502) 2021-08-23 19:37:51 +02:00
Patric Stout
47ce306085 Fix c4b700f1: remove left-over debug statement (#9510) 2021-08-23 14:05:37 +02:00
Patric Stout
0d26359b5b Fix: [Network] don't show GameScript " (v0)" for old servers (#9507)
Old servers don't tell the GameScript they are running, so nothing
should be shown.
All values in NetworkGameInfo initialize as 0/empty, except for GS
version. Someone has to be different from the rest, I guess.
2021-08-23 12:41:20 +02:00
frosch
93fd42b0c3 Doc: guidelines on english.txt or translation changes in PRs. (#9505) 2021-08-22 14:27:48 +02:00
translators
f939f48cd2 Update: Translations from eints
indonesian: 32 changes by dimaspaf14
russian: 2 changes by Ln-Wolf
2021-08-21 18:48:45 +00:00
Patric Stout
4066a07d8f Fix: [Network] crash when last-joined server that is no longer available (#9503)
If you update the server-list while not having last-joined selected
and it is no longer available, the game crashed.
2021-08-21 11:56:29 +02:00
Nicolas Chappe
b83820e723 Change: [Linkgraph] Delete links only served by vehicles stopped in depot
A stale link is not deleted if the link refresher finds a vehicle that still serves it.
This commit excludes vehicles stopped in depot for a very long time from the link refresher,
so that their stale links can be deleted.
2021-08-20 22:37:03 +02:00
translators
dd3acccb1b Update: Translations from eints
korean: 5 changes by telk5093
dutch: 5 changes by Afoklala
portuguese (brazilian): 3 changes by AKANexus
polish: 5 changes by pAter-exe
2021-08-20 18:49:51 +00:00
Patric Stout
778e196b55 Doc: Prepare for 12.0-beta2 release (#9489) 2021-08-19 21:21:37 +02:00
translators
07f98f9234 Update: Translations from eints
italian: 13 changes by CoderLel
russian: 1 change by Ln-Wolf
french: 2 changes by glx22
2021-08-19 18:46:20 +00:00
Michael Lutz
fff09a4af2 Fix d9c1d18f2: Wrong format string for console disconnect message. 2021-08-19 19:56:00 +02:00
translators
a7fe82c646 Update: Translations from eints
finnish: 3 changes by hpiirai
portuguese: 2 changes by azulcosta
2021-08-18 18:53:42 +00:00
Joan Josep
cc38a42b07 Fix 659989af45: Set appropriate town window dirty when building/removing airports. (#9497) 2021-08-18 14:33:32 +02:00
Joan Josep
b38712a302 Fix a18188a: "Meaningful" is misspelled in landscape grid documentation. (#9498) 2021-08-18 13:15:01 +01:00
translators
335a2392e7 Update: Translations from eints
finnish: 2 changes by hpiirai
portuguese: 1 change by azulcosta
2021-08-18 10:13:13 +00:00
Patric Stout
c4b700f1b0 Fix #9492: show for what server a relay session is being created (#9494)
Currently it says "the server" which is a bit ambigious. Be more
specific.
2021-08-18 12:06:14 +02:00
Patric Stout
996ae28989 Fix #9491: reword "no connection" error message (#9495) 2021-08-18 12:00:36 +02:00
Patric Stout
5da60cef46 Fix: typo in the word "spectator" (tnx Heiki) (#9496) 2021-08-18 12:00:17 +02:00
Nicolas Chappe
de28817d9f Fix 977604ef: [Linkgraph] Add a special case for unknown travel times on link update 2021-08-18 01:48:11 +02:00
translators
325d031082 Update: Translations from eints
catalan: 2 changes by J0anJosep
french: 1 change by glx22
2021-08-17 18:54:07 +00:00
Patric Stout
5c776f21e7 Fix 6acf204d: crash when showing coordinator-error-messages (#9488) 2021-08-17 19:42:46 +02:00
translators
04e9df47d9 Update: Translations from eints
russian: 1 change by Ln-Wolf
2021-08-17 13:47:15 +00:00
Nicolas Chappe
977604ef08 Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo
Passengers usually prefer fast paths to short paths.
Average travel times of links are updated in real-time for use in Dijkstra's algorithm,
and newer travel times weigh more, just like capacities.
2021-08-17 14:57:59 +02:00
Patric Stout
6acf204d14 Fix: report reuse of invite-code and switch to local game-type (#9487)
This prevents two servers battling for the same invite-code. Now
the last one wins.
2021-08-17 13:35:29 +02:00
translators
b531a0c1cf Update: Translations from eints
chinese (simplified): 1 change by goodspeed34
2021-08-16 18:55:59 +00:00
Frédéric Simonis
ac4a7d02c7 Codechange: Improve LineCache queries (#9417)
Adds the support to query the linecache without copying the string.
This uses a custom transparent comparator in conjunction with
a query type using a std::string_view.
2021-08-16 11:18:47 +02:00
dP
2e6a77a78a Fix: connecting with the same name thrice hangs the server (#9485) 2021-08-16 11:09:54 +02:00
translators
d212505dcf Update: Translations from eints
chinese (simplified): 82 changes by goodspeed34
french: 2 changes by glx22
portuguese: 1 change by azulcosta
portuguese (brazilian): 2 changes by Vimerum
2021-08-15 18:48:50 +00:00
Patric Stout
b2eafcc720 Fix: [Actions] changelog assumed major.minor.patch versioning (#9482)
We now use major.minor versioning, so it failed to pick up the
correct information.
2021-08-15 14:14:13 +02:00
Patric Stout
b67ef1e5b8 Fix: [Actions] Ubuntu 18.04 by default has a compiler too old for OpenTTD (#9481) 2021-08-15 13:08:58 +02:00
translators
cb9a2dec0d Update: Translations from eints
portuguese: 1 change by azulcosta
2021-08-15 11:06:15 +00:00
Patric Stout
43c4c9d560 Doc: Prepare for 12.0-beta1 release 2021-08-15 12:28:51 +02:00
Patric Stout
eca73a810c Change: rebrand 1.12.0 to 12.0
One question that keeps popping up: "when do we release 2.0?".
NewGRF will force that at least 1.16 will be 2.0, but to not wait
for this, let's drop the "1." and be for ever done with that
conversation.

We are following in the footstep of giants here.
2021-08-15 12:28:51 +02:00
Michael Lutz
ee333a9549 Fix 2183fd4d: [NewGRF] Use divide instead of right shift for signed numbers. (#9480)
"For negative a, the value of a >> b is implementation-defined (in most implementations, this performs arithmetic right shift, so that the result remains negative)."
2021-08-15 12:14:53 +02:00
Vít Šefl
2183fd4dab Feature: [NewGRF] Maximum curve speed modifier for rail vehicles (#9346) 2021-08-15 11:17:05 +02:00
Patric Stout
579f393374 Add: open Online Players GUI on starting/joining a server (#9479) 2021-08-15 00:17:10 +02:00
Patric Stout
1ef4d3cf19 Remove: COMPANY_INFO packets and related code (#9475) 2021-08-14 23:24:02 +02:00
Patric Stout
3d55ea2d4d Feature: make "join game" button join the game, instead of first showing a lobby window (#9467)
Nobody really paid attention to the lobby window, and it completely
missed its purpose. Most people don't even wait for companies to
show up, but just hit "New Company".
This in turn means people create a lot of unneeded companies, while
they "just want to watch the game" or join another company.

Instead, "Join Game" now just joins the game as spectators.
2021-08-14 23:07:18 +02:00
Patric Stout
db13eebf29 Fix 508e465b: network servers didn't show invite-code / connection-type in Online Players GUI (#9478)
The selector selects the first widget, which by accident was now only
the server visibility.
2021-08-14 21:00:30 +02:00
translators
c3d43d7b1c Update: Translations from eints 2021-08-14 18:48:37 +00:00
Patric Stout
e599f6efb4 Doc: Forwardport changelog & doc changes from 1.11 branch (#9476) 2021-08-14 13:07:02 +02:00
Patric Stout
132c540d58 Fix: name the Online Players caption the same as in the menu (#9473)
Referring to one window in two ways is a bit annoying.
2021-08-14 10:19:47 +02:00
Patric Stout
508e465b59 Add: synchronize server name to clients and display in Online Players GUI (#9472) 2021-08-14 10:19:40 +02:00
Patric Stout
65b8614d26 Add: mention you are a spectator in the status bar (if you are, ofc) (#9471) 2021-08-14 10:19:32 +02:00
SamuXarick
120d216b0b Add: [AI] Get the number of vehicles in a given group (#9462) 2021-08-12 21:29:03 +02:00
SamuXarick
26f7f592cd Fix #8316: Make sort industries by production and transported with a cargo filter possible (#8468) 2021-08-11 19:25:59 +02:00
SamuXarick
76b8343777 Fix #9392: Return a valid value with GetBuildWithRefitCapacity when AIs are maxed out in vehicles (#9393) 2021-08-11 19:21:34 +02:00
Michael Lutz
b14681891d Fix 8706dcd9: [Script] Byte-swap grfids to match normal expectations. 2021-08-10 21:35:17 +02:00
translators
580dd118cb Update: Translations from eints 2021-08-10 18:56:17 +00:00
Patric Stout
4c1ea4020d Change: remove the ability to control "max spectators" (#9466)
Soon we will make "join game" join the game as spectator first,
so limiting the amount of spectators makes no sense anymore in
that context. Not sure it ever did make sense.
2021-08-10 20:03:13 +02:00
Loïc Guilloux
8a083cd7f8 Fix 68f2213: Don't use GetPoolSize() for end of pool iterator (#9461) 2021-08-10 19:03:15 +02:00
Loïc Guilloux
4eb368c786 Fix 14f197c: [Script] int64 values don't fit into int (#9465) 2021-08-10 19:00:54 +02:00
Michael Lutz
8706dcd9c1 Add: [Script] Basic information about loaded NewGRFs for scripts. (#9464)
Currently, scripts use various heuristics to detect loaded NewGRFs that are inherently unreliable.
The list of loaded NewGRFs is easily accessible to a human player, and thus giving
scripts the same information is consistent with the current approach to not give scripts
more information than a human player.
2021-08-09 23:34:50 +02:00
translators
d58772ecda Update: Translations from eints
vietnamese: 28 changes by KhoiCanDev
2021-08-07 18:49:22 +00:00
translators
2dd46b964a Update: Translations from eints
latvian: 13 changes by osprinkis
2021-08-05 18:56:58 +00:00
translators
b681935fc8 Update: Translations from eints
norwegian (bokmal): 28 changes by Anolitt
2021-08-04 19:00:04 +00:00
translators
1838726985 Update: Translations from eints
french: 12 changes by glx22
2021-08-02 18:51:35 +00:00
Rubidium
d83647f9a7 Fix #9440: negative cargo payments not being handled right
Cargo payments were stored as unsigned integer, but cast to int64 during
application of inflation. However, then being multiplied with a uint64
making the result uint64. So in the end the payment that should have been
negative becomes hugely positive.
2021-08-02 20:44:53 +02:00
dP
c1d79398d5 Fix: Use of unstable sort when distributing cargo production can cause desyncs 2021-08-01 07:43:49 +02:00
translators
6fce05689c Update: Translations from eints
portuguese (brazilian): 6 changes by Vimerum
2021-07-31 18:51:38 +00:00
translators
8380ff8dd0 Update: Translations from eints
dutch: 13 changes by Afoklala
2021-07-30 18:53:15 +00:00
translators
9df60a2759 Update: Translations from eints
slovak: 39 changes by ApplePie420
2021-07-29 18:53:22 +00:00
translators
dea999566d Update: Translations from eints
finnish: 14 changes by hpiirai
2021-07-28 18:52:35 +00:00
translators
476c039332 Update: Translations from eints
german: 10 changes by Wuzzy2
2021-07-27 18:51:08 +00:00
translators
d17e4f7d29 Update: Translations from eints
german: 4 changes by danidoedel
romanian: 23 changes by ALEX11BR
portuguese (brazilian): 6 changes by jpsl00
2021-07-26 18:51:36 +00:00
translators
7409e6fea1 Update: Translations from eints
romanian: 17 changes by ALEX11BR
2021-07-25 18:50:47 +00:00
translators
cab212258f Update: Translations from eints
swedish: 9 changes by joeax910
russian: 1 change by Ln-Wolf
2021-07-24 18:52:09 +00:00
translators
333de9f15d Update: Translations from eints
russian: 9 changes by Ln-Wolf
catalan: 25 changes by J0anJosep
2021-07-23 18:52:46 +00:00
translators
72737a91f3 Update: Translations from eints
spanish (mexican): 13 changes by absay
2021-07-22 18:53:58 +00:00
Rubidium
ba29edb0b3 Cleanup: remove some references to the old master-server 2021-07-21 22:28:51 +02:00
Patric Stout
9cc706847c Fix: crash when joining a server again after a TCP disconnect (#9453)
"my_client" wasn't always free'd when a game ended. "my_client"
keeps a reference inside the PT_NCLIENT pool. The rest of the
code assumes that when you are not in a game, it can freely
reset this pool.
In result: several ways to trigger a use-after-free.
2021-07-21 21:55:30 +02:00
translators
99d0d9be6b Update: Translations from eints
english (us): 15 changes by 2TallTyler
korean: 12 changes by telk5093
russian: 3 changes by Ln-Wolf
portuguese: 12 changes by azulcosta
polish: 98 changes by pAter-exe
2021-07-21 18:51:59 +00:00
Charles Pigott
6c33b4ed28 Fix #8335: Race condition in music mixer (#9450) 2021-07-21 10:32:33 +01:00
translators
dd54e4c835 Update: Translations from eints
swedish: 1 change by joeax910
romanian: 36 changes by ALEX11BR
2021-07-20 18:51:39 +00:00
Patric Stout
fa1e27994d Feature: allow the use of TURN to connect client and server together
TURN is a last resort, used only if all other methods failed.
TURN is a relay approach to connect client and server together, where
openttd.org (by default) is the middleman.

It is very unlikely either the client or server cannot connect to
the STUN server, as they are both already connected to the Game
Coordinator. But in the odd case it does fail, estabilishing the
connection fails without any further possibility to recover.
2021-07-20 19:57:23 +02:00
Patric Stout
8a36134003 Fix: [Network] rework when to close connections and inform Game Coordinator if needed 2021-07-20 19:57:23 +02:00
Charles Pigott
f1dfc2f482 Codechange: Make OverflowSafeInt constexpr 2021-07-20 10:42:03 +01:00
Charles Pigott
549a58731f Codechange: Remove (unused) ability to specify min/max of OverflowSafeInt 2021-07-20 10:42:03 +01:00
Charles Pigott
e6e2a67aa1 Codechange: Use GCC/clang builtins for overflow safety when supported 2021-07-20 10:42:03 +01:00
Charles Pigott
3d0d9edafd Fix: OverflowSafeInt could underflow
Notably, a company with an extremely negative amount of money would
suddenly become very rich
2021-07-20 10:42:03 +01:00
Charles Pigott
1e439979f7 Fix: OverflowSafeInt negation not handling INT64_MIN
INT64_MIN negated is above INT64_MAX, and would overflow.
Instead, when negating INT64_MIN make it INT64_MAX.
This does mean that -(-(INT64_MIN)) != INT64_MIN.
2021-07-20 10:42:03 +01:00
Loïc Guilloux
9b0bb21f3b Fix 57734fd: Don't enable rename button for network clients in build vehicle window (#9452) 2021-07-19 22:38:36 +02:00
translators
d1cf56609d Update: Translations from eints
german: 1 change by danidoedel
2021-07-19 18:53:13 +00:00
Charles Pigott
1e529e1632 Fix: [Fluidsynth] Crash when debug output enabled (#9446) 2021-07-19 10:36:35 +01:00
translators
9421cb1e2c Update: Translations from eints
estonian: 1 change by siimsoni
russian: 20 changes by Ln-Wolf
2021-07-18 18:50:19 +00:00
Rubidium
386ef4dac3 Feature: [Game Coordinator] Send NewGRF names to the client 2021-07-18 19:36:38 +02:00
rubidium42
3eaa470632 Feature: [Network] Optionally send NewGRF names with NewGRFs in GameInfo
Before 8a2da49 the NewGRF names were synchronized using UDP packets, however
those have been removed. With this a new version of the GameInfo packet is
introduced that allows to specify the type of serialisation happens for
NewGRFs. Either only the GRF ID and checksum, or those two plus the name of
the NewGRF.
On this request for local servers will send the NewGRFs names.
The Game Coordinator will get the names on the first registration, and after
that only the GRF ID and checksum.
2021-07-18 19:36:38 +02:00
rubidium42
5dd524139f Fix c921f6d: [Network] Documentation of Game Info packet was not updated 2021-07-18 11:42:25 +02:00
rubidium42
09a7825d1e Remove: the concept of UnknownGRFs
These were filled with "<Unknown>" (before 8a2da49) and later their name would get filled via UDP requests to the server. These UDP packets do not exist anymore, so they will always remain "<Unknown>".
Remove that logic and just use the generic translated error GRF UNKNOWN string instead.
2021-07-18 11:42:25 +02:00
translators
3479e59eea Update: Translations from eints
korean: 2 changes by telk5093
catalan: 3 changes by J0anJosep
french: 17 changes by glx22
portuguese: 1 change by azulcosta
portuguese (brazilian): 15 changes by Vimerum
2021-07-17 18:50:07 +00:00
Patric Stout
ab601115a9 Fix 75b6051b: removing items from the ini could leave the group in a bad state (#9445) 2021-07-17 17:26:50 +02:00
Loïc Guilloux
460991ecf4 Feature: Persistant rotation of numbered auto/netsave after restart (#9397)
It was always starting from 0 on openttd restart.
Now the most recent auto/netsave number will be used as a base to generate the next filename.
2021-07-17 12:48:35 +02:00
glx22
16abdd5254 Change: [Win32] Set the console codepage to UTF-8 2021-07-16 23:01:08 +02:00
glx22
afea5e85ae Fix 433f74e: GetString() requires a language pack 2021-07-16 23:01:08 +02:00
translators
96add9c36d Update: Translations from eints
spanish (mexican): 1 change by absay
dutch: 15 changes by Afoklala
portuguese: 1 change by azulcosta
2021-07-16 18:51:17 +00:00
Patric Stout
29cceb59a5 Doc: explain in a bit more detail how we implemented STUN 2021-07-16 19:50:29 +02:00
Patric Stout
8adade26ed Feature: allow the use of STUN to connect client and server together
This method doesn't require port-forwarding to be used, and works for
most common NAT routers in home setups. But, for sure it doesn't work
for all setups, and not everyone will be able to use this.
2021-07-16 19:50:29 +02:00
Patric Stout
55eed246b8 Codechange: allow Connect() to bind to a local address 2021-07-16 19:50:29 +02:00
translators
695e1493c9 Update: Translations from eints
swedish: 14 changes by joeax910
2021-07-15 18:49:29 +00:00
Patric Stout
c921f6d817 Add: inform clients what game-script a server is running (#9441)
Co-authored-by: The Dude <thedude@novapolis.net>
2021-07-14 21:23:44 +02:00
translators
333cba6a61 Update: Translations from eints
spanish (mexican): 1 change by absay
finnish: 14 changes by hpiirai
2021-07-14 18:53:00 +00:00
translators
e9b157f1f5 Update: Translations from eints
korean: 1 change by telk5093
portuguese: 1 change by azulcosta
2021-07-13 18:52:35 +00:00
translators
80f4e42627 Update: Translations from eints
spanish (mexican): 4 changes by absay
english (us): 13 changes by 2TallTyler
korean: 5 changes by telk5093
german: 13 changes by Wuzzy2
portuguese: 4 changes by azulcosta
hindi: 6 changes by ritwikraghav14
2021-07-12 18:51:48 +00:00
Rubidium
c71f06e59b Feature: parse the console settings the same way as config settings
Now you can use things like `set server_game_type public` instead of having to
guess the number, which would not be written into the configuration file nor
would it be shown when doing `set server_game_type`.
2021-07-11 23:11:05 +02:00
Patric Stout
dd7f69be6e Fix: "Search LAN games" used the socket after it was closed (#9437)
Every outgoing connection, either TCP or UDP, triggered
NetworkInitialize(), which triggered NetworkUDPInitialize() which
first closes all connections.

Now the problem was that "Search LAN games" found a server, added
it to the list, after which (over TCP) it queries the server. This
closes all UDP sockets (as that makes sense, I guess?), while the
UDP was still reading from it.

Solve this by simply stop initializing UDP every time we make an
outgoing TCP connection; instead only do it on start-up.
2021-07-11 22:37:14 +02:00
Rubidium
178ea3196b Remove: includes to network/core/config.h from headers when only three cpp files need it 2021-07-11 22:13:59 +02:00
Patric Stout
b6a116a247 Add: allow setting your server visibility to "invite-only" (#9434)
In this mode you do register to the Game Coordinator, but your
server will not show up in the public server listing. You can give
your friends the invite code of the server with which they can
join.
2021-07-11 21:57:05 +02:00
translators
8bb9c3f646 Update: Translations from eints
spanish (mexican): 29 changes by absay
czech: 11 changes by JustImagine436
korean: 9 changes by telk5093
portuguese: 9 changes by azulcosta
hindi: 28 changes by ritwikraghav14
2021-07-11 18:50:16 +00:00
Patric Stout
e4d216e44b Feature: join servers based on their invite code
This removes the need to know a server IP to join it. Invite codes
are small (~7 characters) indentifiers for servers, which can be
exchanged with other players to join the servers.
2021-07-11 20:38:42 +02:00
Patric Stout
1baec41542 Change: groundwork to allow ServerAddress to use invite codes
Normally TCPConnecter will do a DNS resolving of the connection_string
and connect to it. But for SERVER_ADDRESS_INVITE_CODE this is different:
the Game Coordinator does the "resolving".

This means we need to allow TCPConnecter to not setup a connection
and allow it to be told when a connection has been setup by an external
(to TCPConnecter) part of the code. We do this by telling the (active)
socket for the connection.

This means the rest of the code doesn't need to know the TCPConnecter
is not doing a simple resolve+connect. The rest of the code only
cares the connection is established; not how it was established.
2021-07-11 20:38:42 +02:00
Patric Stout
cee8174d02 Codechange: track servers with a ServerAddress instead of a NetworkAddress
This allows future extensions to have different ways of referencing
a server, instead of forcing to use IP:port.
2021-07-11 20:38:42 +02:00
Patric Stout
f4dd2d88c7 Feature: raise the maximum NewGRF limit to 255 2021-07-11 12:16:07 +02:00
Patric Stout
6f0c6fb2ae Fix a4987233: NewGRFs could no longer be loaded from the NewGRF folder.
This statement was removed by accident, as it felt it could be removed.
But it is used to know if the NewGRF is from the baseset folder or
from the NewGRF folder.
2021-07-11 12:16:07 +02:00
rubidium42
a498723345 Remove: arbitrary limit on number of statically loaded NewGRFs (#9431) 2021-07-11 11:23:47 +02:00
Rubidium
f6955a304c Fix: ensure no more than the allowed number of NewGRFs are loaded from the configuration 2021-07-11 11:20:07 +02:00
Rubidium
e99134654b Feature: allow setting (game) coordinator and content server connection strings using environment variables
OTTD_COORDINATOR_CS for the game coordinator defaults to coordinator.openttd.org:3976
OTTD_CONTENT_SERVER_CS for the content server defaults to content.openttd.org:3978
OTTD_CONTENT_MIRROR_CS for the content mirror server defaults to binaries.openttd.org:80
2021-07-10 23:09:45 +02:00
Rubidium
3e4d327451 Codechange: use the C++ std::getenv over the POSIX/C getenv
The C++ std::getenv is guaranteed thread-safe by the C++11 specification,
whereas the POSIX/C getenv might not be thread-safe by the C11 specification.
2021-07-10 22:55:46 +02:00
translators
d158eba72c Update: Translations from eints
spanish (mexican): 74 changes by absay
vietnamese: 62 changes by KhoiCanDev
2021-07-10 18:49:56 +00:00
Patric Stout
de7ab2eb1c Cleanup: remove unused optional ctor parameter for NetworkGameList 2021-07-10 20:17:07 +02:00
Patric Stout
6212d0a8da Remove: unused UDP protocol parts 2021-07-10 20:17:07 +02:00
Patric Stout
8a2da49413 Remove: old server listing via Master Server
This removes all UDP from the game except for a local broadcast
to find LAN games.

So long Master Server, and tnx for all the fish!
2021-07-10 20:17:07 +02:00
Patric Stout
61fdef8457 Remove: old server announcement to Master Server
As we now use the Game Coordinator for announcements, there is no
longer a need to use the Master Server for this.
2021-07-10 20:17:07 +02:00
Patric Stout
aa93d76223 Add: use Game Coordinator to get latest public server listing 2021-07-10 20:17:07 +02:00
Patric Stout
b1280fd17e Add: use Game Coordinator to annouce public servers 2021-07-10 20:17:07 +02:00
Patric Stout
e1e2212e0e Codechange: track version of network servers to prune once out-of-date 2021-07-10 20:17:07 +02:00
Patric Stout
cbaac5609f Codechange: use UpdateNetworkGameWindow() over manually marking window dirty 2021-07-10 20:17:07 +02:00
Loïc Guilloux
92cdfffbd1 Doc: explain the binary structure of scripts custom data (#9425) 2021-07-10 18:38:28 +02:00
Tyler Trahan
8b1737f680 Doc: Add appstore links to README (#9426) 2021-07-10 18:37:45 +02:00
Loïc Guilloux
ddb6024bc6 Codechange: Don't explicitly unset _generating_world outside of genworld.cpp (#9418) 2021-07-10 14:59:17 +02:00
Rubidium
85faa218ff Remove: logically dead code in graph UI 2021-07-10 11:27:09 +02:00
Rubidium
0d0375c019 Remove: logically dead code from font cache
The outer if statement checks for 'aa' being false, so within the inner
statements anything checking aa will have a known result and the other
branch from there will be dead code.
2021-07-10 11:27:09 +02:00
Rubidium
1c0c4637d2 Fix 11ab3c4: [NewGRF] Overflow when determining cargo mask for string code 9A 1E
9A 1E: Print unsigned word as name of a cargo type (translated for GRF version >= 7).
2021-07-10 10:51:00 +02:00
Rubidium
ede3f79475 Codechange: use the name string in SaveLoad for the name of the Setting as well 2021-07-09 22:53:30 +02:00
Rubidium
01139d3368 Codechange: access the name of a setting via an accessor function 2021-07-09 22:53:30 +02:00
Rubidium
94881f5a34 Codechange: name a few unnamed settings as to not to have to check for that being empty 2021-07-09 22:53:30 +02:00
Stephan
a70aa5df49 Add #9188: netsave now keeps multiple version around, similar to autosave (#9395) 2021-07-09 21:44:02 +02:00
glx22
ce813ce644 Cleanup: Remove now unused FOR_EACH_SET_BIT_EX macro 2021-07-09 21:36:09 +02:00
glx22
49b66ea504 Codechange: Remove FOR_EACH_SET_TRACK 2021-07-09 21:36:09 +02:00
glx22
a543a4b7bb Codechange: Remove FOR_EACH_SET_CARGO_ID 2021-07-09 21:36:09 +02:00
glx22
89ab8b79a5 Codechange: Remove FOR_EACH_SET_BIT 2021-07-09 21:36:09 +02:00
glx22
5844027eb8 Codechange: Remove FOR_ALL_SORTED_STANDARD_CARGOSPECS 2021-07-09 21:36:09 +02:00
glx22
87eb997be0 Codechange: Remove FOR_ALL_TILES_IN_HEIGHT 2021-07-09 21:36:09 +02:00
Patric Stout
8f5d0ecde3 Codechange: split settings.ini over several files (#9421)
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.

Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
2021-07-09 21:16:03 +02:00
translators
d9ca9ca555 Update: Translations from eints
spanish (mexican): 44 changes by absay
italian: 2 changes by CoderLel
2021-07-09 18:53:08 +00:00
translators
a5add82600 Update: Translations from eints
spanish (mexican): 54 changes by absay
2021-07-08 18:51:52 +00:00
Patric Stout
c1f13e0372 Fix: reduce the amount of debug messages on -dsl=2 (#9420)
LoadCheck makes it sound like something is really broken while
loading savegames, while it really is perfectly normal, as most
chunks do not implement LoadCheck.
2021-07-08 19:31:00 +02:00
Patric Stout
852e056d6f Fix 9e32c618: network revision was always empty (#9419)
Shadowing the variable you intend to write in tends to do that ;)
2021-07-08 12:29:16 +02:00
translators
a7fabe497c Update: Translations from eints
spanish (mexican): 6 changes by absay
2021-07-07 18:51:22 +00:00
glx22
7bcc7e11ff Codechange: Use a common sub-class for NewGRFMapping chunks 2021-07-06 22:29:08 +02:00
glx22
6e627f35ac Cleanup: Remove now unneeded ChunkHandler members 2021-07-06 22:29:08 +02:00
glx22
2c941cd8b3 Codechange: Use ChunkHandlers sub-classes 2021-07-06 22:29:08 +02:00
glx22
c1a9fe6fbd Codechange: Use static array of references to ChunkHandler 2021-07-06 22:29:08 +02:00
glx22
f371a5ad70 Codechange: Preparation for ChunkHandler subclassing 2021-07-06 22:29:08 +02:00
Rubidium
7e7a4aad72 Codechange: split off the settings saveload code from the main settings handling logic 2021-07-06 21:32:47 +02:00
rubidium42
25ca6a75bc Codechange: split off the settings table and all the callbacks from the main settings handling logic 2021-07-06 21:32:47 +02:00
glx22
b4aedc8bee Codechange: ensure xxx_setting_tables are initialised after their content 2021-07-06 21:32:47 +02:00
Loïc Guilloux
ddafc0de05 Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit (#9415) 2021-07-06 21:09:08 +02:00
translators
8913ae9ba8 Update: Translations from eints
portuguese (brazilian): 1 change by Vimerum
2021-07-06 18:50:32 +00:00
translators
faea943a9b Update: Translations from eints
hindi: 26 changes by ritwikraghav14
2021-07-05 18:50:45 +00:00
translators
511c1081af Update: Translations from eints
catalan: 1 change by J0anJosep
2021-07-04 18:49:29 +00:00
Michael Lutz
10d8c17236 Codechange: Add CMake source group for the saveload compat tables.
While at it, fix the not-working OpenGL sub-group.
2021-07-04 16:31:59 +02:00
translators
05bdfadcb6 Update: Translations from eints
norwegian (bokmal): 1 change by Anolitt
japanese: 1 change by scabtert
2021-07-03 18:49:50 +00:00
Loïc Guilloux
0fa2007560 Fix cdb3dd049: GOAL chunk was not using the header for loading (#9409) 2021-07-03 18:26:24 +02:00
rubidium42
d38ad7d80c Cleanup: remove declaration of undefined function 2021-07-03 11:26:13 +02:00
rubidium42
979783f90e Codechange: replace InjectDParam/ShiftParameters by setting the right parameter values in the first place 2021-07-03 11:26:13 +02:00
Patric Stout
1d9912134d Doc: guidelines for network-compatible patch-packs that want to add fields to existing chunks 2021-07-02 22:21:58 +02:00
Patric Stout
3e3049fd0e Codechange: make savegame-version checks more obvious in SlCompanyLiveries::Load
num_liveries indirectly contained the same information, but this
makes reading these things pretty difficult. So use IsSavegameVersionBefore()
like everywhere else instead.
2021-07-02 22:21:58 +02:00
Patric Stout
4e645ce749 Codechange: using "until" in function names can be confusing
IsSavegameVersionUntil() did a [0, N] check, not [0, N) as the
name suggests.

Until can be a confusing word, where people consider it to be
including the upperbound. Dictionary states it means "before",
excluding the upperbound. There are long debates about who is right.

So, simply remove away from this ambiguity, and call it "before"
and "before or at". This makes the world easier for everyone.
2021-07-02 22:21:58 +02:00
Patric Stout
9643a1b80a Doc: explain the binary structure of our (new) savegames 2021-07-02 22:21:58 +02:00
Patric Stout
1ed2405907 Cleanup: remove SLE_NULL and friends
We no longer need them. If you want to remove a field .. just
remove it! Because of the headers in the savegame, on loading,
it will do the right thing and skip the field.

Do remember to bump the savegame version, as otherwise older
clients can still load the game, but will reset the field you
have removed .. that might be unintentially.
2021-07-02 22:21:58 +02:00
Patric Stout
3826703bc3 Add: store headers for chunks with SL_STRUCTLIST 2021-07-02 22:21:58 +02:00
Patric Stout
cdb3dd0493 Add: store headers for most savegame chunks
When a header is added, the chunk changes from CH_ARRAY type to
CH_TABLE type.
2021-07-02 22:21:58 +02:00
Patric Stout
7dd5fd6ed4 Feature: framework to make savegames self-descriptive
We won't be able to make it fully self-descriptive (looking at you
MAP-chunks), but anything else can. With this framework, we can
add headers for each chunk explaining how each chunk looks like
in detail.

They also will all be tables, making it a lot easier to read in
external tooling, and opening the way to consider a database
(like SQLite) to use as savegame format.

Lastly, with the headers in the savegame, you can freely add
fields without needing a savegame version bump; older versions
of OpenTTD will simply ignore the new field. This also means
we can remove all the SLE_CONDNULL, as they are irrelevant.

The next few commits will start using this framework.
2021-07-02 22:21:58 +02:00
translators
513641f9ba Update: Translations from eints
english (us): 1 change by 2TallTyler
german: 1 change by Wuzzy2
dutch: 1 change by Afoklala
2021-07-02 18:50:57 +00:00
Patric Stout
75b6051b7a Change: move sensitive information to secrets.cfg and private information to private.cfg
We often ask people for their openttd.cfg, which now includes their
passwords, usernames, etc. It is easy for people to overlook this,
unwillingly sharing information they shouldn't.

By splitting this information over either private.cfg or secrets.cfg,
we make it more obvious they shouldn't be sharing those files, and
hint to what is inside them.
2021-07-02 14:30:14 +02:00
Patric Stout
4f3bf84af4 Codechange: simplify SaveVersionInConfig()
Clearly someone really wanted to generalize the function, but
in reality it makes it a lot longer than needed. Let's keep it
simple.
2021-07-02 14:30:14 +02:00
Patric Stout
66dc0ce196 Codechange: C++-ify the usage of IniFile in settings.cpp
Instead of creating the object on heap and use a pointer, create
the object on stack and use a guaranteed-not-null pointer.
The size of IniFile doesn't warrent the forcing to heap.

Additionally, use a subclass instead of a function to do some
initial bookkeeping on an IniFile meant to read a configuration.
2021-07-02 14:30:14 +02:00
Patric Stout
a42251fc72 Codechange: move network-related settings out of settings.ini
This to prepare the code to split up network-related settings
into private / secrets / generic.
2021-07-02 14:30:14 +02:00
Rubidium
9c7a7b53a1 Codechange: use a contructor for NewsItem to set the values
And use std::unique_ptr to manage the memory of the allocated data
2021-07-01 19:04:38 +02:00
rubidium42
9a7750f14e Codechange: use the constructor for CompanyNewsItem to fill the data instead of a separate function 2021-07-01 19:04:38 +02:00
rubidium42
aa9818db90 Codechange: create a type for the "free_data" of NewsItems and (de)allocate it with new and delete 2021-07-01 19:04:38 +02:00
translators
df601b8559 Update: Translations from eints
finnish: 1 change by hpiirai
2021-06-30 18:53:37 +00:00
Patric Stout
d38079d053 Fix f7e390bd: freeaddrinfo() is not guaranteed to handle a nullptr graceful (#9404) 2021-06-29 23:02:25 +02:00
Loïc Guilloux
b6fb020388 Change: [strgen] Change warnings for translations into infos (#9406)
Unless invoked with -w, --warning ("print a warning for any untranslated strings") or -t, --todo ("replace any untranslated strings with '<TODO>'").

Eints normally fixes the warnings after a Pull Request, so it is not really useful information for the developer to see as a warning.
2021-06-29 22:19:24 +02:00
translators
8336d21b25 Update: Translations from eints
swedish: 27 changes by joeax910
korean: 4 changes by telk5093
russian: 1 change by Ln-Wolf
portuguese: 1 change by azulcosta
2021-06-29 18:52:43 +00:00
translators
c539343ba9 Update: Translations from eints
swedish: 1 change by joeax910
2021-06-28 19:00:24 +00:00
TELK
f9b4a3a5e6 Add: Show the number of clients and companies in the online players window (#9376) 2021-06-28 18:42:23 +02:00
embeddedt
883e4ea325 Change: [Emscripten] set default scrolling mode to non-pointer-locking (#9191) 2021-06-28 18:39:09 +02:00
SamuXarick
003b6a0c85 Fix ea9715d: not all setting values were clamped properly (#9401) 2021-06-28 00:58:54 +02:00
translators
59e96cd56a Update: Translations from eints
swedish: 6 changes by joeax910
finnish: 1 change by hpiirai
catalan: 9 changes by J0anJosep
2021-06-27 18:50:30 +00:00
Loïc Guilloux
87eb0e4fce Fix #9402, 2e136285: Crash when founding town using default name (#9403) 2021-06-27 17:18:21 +02:00
translators
da7621cc55 Update: Translations from eints
swedish: 1 change by joeax910
2021-06-26 18:50:34 +00:00
rubidium42
98e653dacc Fix #9386: compilers failing to compile with LTO by using variants instead of new + unique_ptr
With std::variant all memory can be figured out at compile time, so the compiler needs to keep track of fewer elements. It also saves out a unique_ptr and its memory management, over a slight impact for resolving a setting.
2021-06-26 20:28:34 +02:00
rubidium42
f35e6c1c7f Codechange: use C-style strings instread of std::string in the SettingDesc constructor
This as using std::string causes much more variables to be tracked, potentially causing problemes for certain compilers in certain situations
2021-06-26 20:28:34 +02:00
rubidium42
c93fcbcb28 Codechange: introduce helper to convert from the iterated type to the actual SettingDesc 2021-06-26 20:28:34 +02:00
rubidium42
f7f1d530b8 Codechange: instead of "naked" initializer lists, declare the type in the saveload macros
This to help variant's constructor to be able to resolve the constructor of the setting
2021-06-26 20:28:34 +02:00
rubidium42
f029fd0f3b Codechange: remove overloading on UpdateServiceInterval
One UpdateServiceInterval has two parameters to update the service interval for a vehicle type, the other for all vehicle types at once. Rename the latter to help with function resolution for the introduction of variants.
2021-06-26 20:28:34 +02:00
rubidium42
cdf9caf8ea Codechange: [Network] Remove overload on NetworkValidateClientName
Rename the zero-parameter NetworkValidateClientName to NetworkValidateOurClientName to make it clearer it is performed on our client name, and to make it a non-overloaded function to aid with the variant being added a few commits later
2021-06-26 20:28:34 +02:00
Patric Stout
0013673faf Change: prevent palette updates during copying to the video driver
ThreadSanitizer rightfully notices that the game-thread could
update the palette while the draw-thread is copying it for local
use. The odds of this are very small, but nevertheless, it does
carry a very good point.

It wouldn't hurt the application in any way, but it might cause
visual glitches on the screen.
2021-06-26 20:28:05 +02:00
Patric Stout
74186998a2 Codechange: use _cur_palette the same in all the drivers
It was a bit of a mixed bag. With this change, gfx.cpp is in
control who accesses _cur_palette from the video-drivers.
2021-06-26 20:28:05 +02:00
Patric Stout
1ed7afc0a8 Change: [GitHub] use an issue form to let people fill in bug report / crashes (#9400) 2021-06-26 13:51:29 +02:00
translators
95a94dcf90 Update: Translations from eints
swedish: 1 change by joeax910
dutch: 9 changes by Afoklala
2021-06-25 18:50:57 +00:00
Michael Lutz
37116a7575 Codechange: [OSX] Remove old code that has no effect on current OSX versions. 2021-06-22 21:09:37 +02:00
Michael Lutz
883e21dbb7 Codechange: [OSX] We use OpenGL even if Apple doesn't like it. 2021-06-22 21:09:37 +02:00
Michael Lutz
0d5d3083bd Codechange: [OSX] Use more exact enum names where introduced with the 10.12 SDK.
The enum values still have the exact same numerical values, but the 10.12
SDK introduced more explicit names (e.g. like NSEventTypeApplicationDefined
instead of NSApplicationDefined) for several enum constants.
Use them when available.
2021-06-22 21:09:37 +02:00
translators
8c1b89e107 Update: Translations from eints
english (us): 9 changes by 2TallTyler
2021-06-22 18:55:02 +00:00
translators
6a05839d8d Update: Translations from eints
swedish: 1 change by kustridaren
korean: 1 change by telk5093
2021-06-20 18:53:19 +00:00
Jonathan G Rennison
8a33e98834 Fix #8169: nullptr dereference when autoreplacing vehicle with no orders (#9387) 2021-06-19 23:31:23 +02:00
translators
052f6b5d9f Update: Translations from eints
swedish: 12 changes by joeax910
2021-06-19 18:53:27 +00:00
ce7ef4d824 Fix: Wrong cargo line position in IndustryCargo window. (#9383)
Resolved by changing calculation to determine the offset based on centring the cargo lines in the available space.
2021-06-17 23:34:59 +01:00
SamuXarick
1e6a2163a5 Fix #9358: Don't skip empty files in tar (#9367) 2021-06-18 00:08:49 +02:00
Patric Stout
cf865597f8 Fix: don't propagate shift/ctrl state till next game-tick (#9381)
When the game-loop is very slow, it was easily possible to start
the loop with _shift_pressed being false, but end with
_shift_pressed being true. This doesn't hurt the game as such,
but for the user this can be very weird: I pressed "Buy Vehicle",
pressed shift a bit later, and I still get a cost indication.
2021-06-17 20:22:57 +02:00
Patric Stout
b45c006ab9 Fix: on startup, NewGRF scan could case race-condition (#9382)
Creating a thread was not thread-safe. The irony.

The video-driver has a function GameLoopPause() which first checks
if the thread is the game-thread or not. For this it needs access
to this->game_thread. This variable is set in StartNewThread().

However, due to timing, it is well possible GameLoopPause() is
called from the thread well before this->game_thread is assigned.

And so we have a race-condition!

Simply solve this by preventing a thread to start till we are
done with our bookkeeping.
2021-06-17 20:10:40 +02:00
Patric Stout
c12a152ec9 Fix: thread safety issue during exiting the game (#9380)
_exit_game is read by the draw-thread to know when to exit, but
most of the time written by the game-thread.
2021-06-17 18:58:59 +02:00
Rubidium
281a65b3e1 Cleanup: simplify some boolean expressions 2021-06-17 16:18:30 +02:00
Rubidium
357af686dc Cleanup: use true/false instead of 1/0 where applicable 2021-06-17 16:18:30 +02:00
Rubidium
f904aef176 Cleanup: use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
Rubidium
a9774f3e34 Cleanup: [Squirrel] Use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
Rubidium
3237e97b35 Cleanup: [Script] Use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
Rubidium
930bb22416 Cleanup: remove lines from station_base.h that are already included in includes base_station_base.h 2021-06-17 16:18:30 +02:00
translators
b560620eb9 Update: Translations from eints
spanish: 3 changes by MontyMontana
hindi: 28 changes by ritwikraghav14
2021-06-15 18:57:22 +00:00
Patric Stout
8e91527251 Codechange: mark chunks that are not stored as CH_READONLY
This makes it easier to spot chunks that have a save_proc that
is a nullptr, but also prevents confusion, where it looks like
the CH_ type of a chunk has influence on how it is being read.
It is not, it is only used for saving.
2021-06-15 19:36:15 +02:00
Patric Stout
4c4b55ecbd Change: rework GLOG chunk to be more like the rest
Basically it is very similar to Vehicles, where there first is
a type field, followed by data of that type. So this commit makes
it looks like how Vehicles solved that.
This removes a lot of custom "keeping track of length" stuff.
2021-06-15 19:36:15 +02:00
Patric Stout
88edfd4ef1 Change: rework several CH_RIFF chunks to use CH_ARRAY instead
This adds two byte extra to those chunks, and might feel a bit
silly at first. But in later changes we will prefix CH_ARRAY with
a table header, and then this change shines.

Without this, we could still add headers to these chunks, but any
external reader wouldn't know if the CH_RIFF has them or not. This
way is much more practical, as they are now more like any other
chunk.
2021-06-15 19:36:15 +02:00
Patric Stout
b9ab9e4d05 Codechange: add the ability to save/load a std::vector
std::vector<bool> is not possible, as .. that is a nice special
case in C++.

This new type will be used in next commit.
2021-06-15 19:36:15 +02:00
Patric Stout
97b94bdc9a Change: prefix SL_ARR with the length of the array
This means that during loading we can validate that what is saved
is also that what is expected. Additionally, this makes all list
types similar to how they are stored on disk:
First a gamma to indicate length, followed by the data.
The size still depends on the type.
2021-06-15 16:45:04 +02:00
Patric Stout
f67af5cbe5 Codechange: make it more obvious SlArray supports SLE_VAR_NULL
In the end, the code was already doing the right thing, but a few
functions deep, and not really obvious. When validating what objects
can handle SLE_VAR_NULL, it is nicer to just have this obvious.
2021-06-15 16:45:04 +02:00
Patric Stout
d5cda58158 Codechange: use SL_NULL if you want to store null-bytes or load to nothing
Using SL_ARR for this gives us a bit of trouble later on, where we
add a length-field to SL_ARR. This of course is not the intention
of SLE_CONDNULL. So better seperate it.
2021-06-15 16:45:04 +02:00
Patric Stout
0d2e3437e3 Change: switch SL_DEQUE and SL_REFLIST length field to a gamma
The current SaveLoad is a bit inconsistent how long a length field
is. Sometimes it is a 32bit, sometimes a gamma. Make it consistent
across the board by making them all gammas.
2021-06-15 16:45:04 +02:00
Patric Stout
75e7451151 Change: indicate in the savegame if a SL_STRUCT contains any data
This helps external tooling to understand if a SL_STRUCT should
be skipped when reading. Basically, this transforms an SL_STRUCT
into a SL_STRUCTLIST with either 0 or 1 length.
2021-06-15 16:45:04 +02:00
Patric Stout
a146bcfe93 Change: store length of SL_STRUCTLIST in the savegame
This wasn't consistently done, and often variables were used that
were read by an earlier blob. By moving it next to the struct
itself, the code becomes a bit more self-contained and easier to
read.

Additionally, this allows for external tooling to know how many
structs to expect, instead of having to know where to find the
length-field or a hard-coded value that can change at any moment.
2021-06-15 16:45:04 +02:00
SamuXarick
d0bcb9839a Fix: you could join an AI company in multiplayer via the GUI (#9369) 2021-06-15 14:00:50 +02:00
Rubidium
d31a535c87 Cleanup: remove some unneeded c_str() calls 2021-06-15 06:13:00 +02:00
rubidium42
05005dcdfa Codechange: [Network] Use std::string instead of char[] for the name of the file that is downloading 2021-06-15 06:13:00 +02:00
rubidium42
981cd0197a Codechange: [Network] Use std::string for the client name in the network server 2021-06-15 06:13:00 +02:00
rubidium42
a8b3afb236 Codechange: [Network] Use string_view for network compatability check 2021-06-15 06:13:00 +02:00
rubidium42
49dcf0c772 Codechange: [Network] Simplify constructing the HTTP request with fmt 2021-06-15 06:13:00 +02:00
rubidium42
53b4786037 Codechange: [Network] Let NetworkError return its std::string instead of a C-string 2021-06-15 06:13:00 +02:00
rubidium42
667301e3ec Codechange: [Network] Make hostname/client IP return strings instead of a C-string 2021-06-15 06:13:00 +02:00
rubidium42
a91e29b656 Codechange: [Network] Let IsInNetmask use std::string 2021-06-15 06:13:00 +02:00
rubidium42
36705f1dc0 Codechange: [Network] Simplify formatting of network addresses to string 2021-06-15 06:13:00 +02:00
rubidium42
9e32c618f9 Fix: [Network] Determining GetNetworkRevisionString could overflow and underflow its buffer
Tagged releases are not affected
2021-06-14 23:05:18 +02:00
Patric Stout
7b135a8269 Codechange: use SLE_STRUCT(LIST) for Linkgraph chunks 2021-06-14 21:58:05 +02:00
Patric Stout
5cd0c65787 Codechange: move Save/Load functions of same chunk next to each other 2021-06-14 21:58:05 +02:00
Patric Stout
af3aba7a88 Codechange: use SLE_STRUCT(LIST) for GameScript chunks 2021-06-14 21:58:05 +02:00
Patric Stout
aa02bf27f6 Codechange: use as much of STNN code for STNS as possible
There was a lot of code duplication for no real reason. Now with
SLEG_STRUCT support, we can just re-use the code, hopefully making
it easier for future-us to make changes to this, without breaking
everything for old games.
2021-06-14 21:58:05 +02:00
Patric Stout
0bdca02bdf Codechange: use SLE_STRUCT(LIST) for Station chunks 2021-06-14 21:58:05 +02:00
Patric Stout
af43fc3d62 Codechange: use SLE_STRUCT(LIST) for Company chunks 2021-06-14 21:58:05 +02:00
Patric Stout
0bb1d2fa8e Codechange: use SLE_STRUCT(LIST) for Town chunks 2021-06-14 21:58:05 +02:00
Patric Stout
4e4720f217 Codechange: remove the special station/vehicle code from SaveLoad
With the new SLEG_STRUCT it is much easier to embed a struct
in a struct, where the sub-struct has limitations on when it is
being used.
This makes both the code easier to read (less magic) and avoids
the SaveLoad needing to know all these things about Stations
and Vehicles.
2021-06-14 21:58:05 +02:00
Patric Stout
4600d289b5 Codechange: ability to store structs and list of structs in savegames
The commits following this will use this new functionality.

Currently, a few places do this manually. This has as drawback that
the Save() and Load() code need to be in sync, and that any change
can result in (old) savegames no longer loading. In general, it is
annoying code to maintain.

By putting everything in a description table, and use that for
both Save() and Load(), it becomes easier to see what is going on,
and hopefully less likely for people to make mistakes.
2021-06-14 21:58:05 +02:00
translators
909f3f25bd Update: Translations from eints
spanish (mexican): 9 changes by absay
portuguese (brazilian): 9 changes by Vimerum
2021-06-14 18:54:53 +00:00
7385e780ac Cleanup: nested_array should not be accessed directly.
Replace accesses with GetWidget() as documented.
2021-06-14 17:49:01 +01:00
rubidium42
c811d42d0c Fix a99ac62: fmt's include of cassert breaks our assert logic 2021-06-13 21:02:17 +02:00
translators
721c3fdfb4 Update: Translations from eints
vietnamese: 2 changes by KhoiCanDev
german: 9 changes by Wuzzy2
finnish: 1 change by hpiirai
portuguese: 9 changes by azulcosta
2021-06-13 18:55:51 +00:00
rubidium42
fc63432a11 Codechange: improve style/writing of IConsolePrint strings 2021-06-13 15:25:31 +02:00
rubidium42
75afd25e16 Change: do not print the '-' in front of help messages and make help messages more uniform 2021-06-13 15:25:31 +02:00
rubidium42
eb6cdadc4d Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
2021-06-13 15:25:31 +02:00
rubidium42
d9c1d18f2b Change: improve some of the console messages related to networking (make them more uniform) and convert to fmt 2021-06-13 15:25:31 +02:00
rubidium42
b280a3a0ed Cleanup: remove IConsoleWarning/IConsoleError helpers
Both did not support format parameters, so in many places IConsolePrint(CC_ERROR, "message") was used with a style different from what IConsoleError would do.
2021-06-13 15:25:31 +02:00
rubidium42
efd4ba4797 Change: unify the style of console error messages and convert to fmt
Always start with a capital, do not add "ERROR: " in front of it.
2021-06-13 15:25:31 +02:00
rubidium42
de49727ae8 Change: not performing a command is worthy of an error, not a warning
If a command cannot be executed for whatever reason, it makes no sense to call it a warning. Something has been done wrong.
Also make writing of these error message consistent while changing their "type".
2021-06-13 15:25:31 +02:00
rubidium42
121b037054 Codechange: remove single use IConsoleDebug 2021-06-13 15:25:31 +02:00
rubidium42
6b757c716a Codechange: add an IConsolePrint overload that does formatting with fmt 2021-06-13 15:25:31 +02:00
Patric Stout
1e432fbd71 Fix 81062163: for (really) old games, station bus/truck station cache was not updated (#9366) 2021-06-13 13:48:40 +02:00
Loïc Guilloux
f86c66cbd7 Codechange: [Actions] Improve MSYS2 setup time (#9360) 2021-06-13 13:26:45 +02:00
rubidium42
7d79180040 Codechange: use fmt in DebugPrint where applicable 2021-06-13 12:45:45 +02:00
rubidium42
352dbdd570 Cleanup: remove old DEBUG macro and debug function 2021-06-13 12:45:45 +02:00
rubidium42
55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
rubidium42
a99ac62c1a Codechange: use the fmt library for simpler debug formats 2021-06-13 12:45:45 +02:00
rubidium42
662d8dfc30 Add: minimal set of headers from {fmt} 7.1.3 to 3rdparty 2021-06-13 12:45:45 +02:00
rubidium42
845fded2a0 Fix #9361, a2051ba: [Network] Off by one in CanWriteToPacket
Previously it did not allow writing a byte to a packet that was of size limit - 1 anymore.
2021-06-13 10:31:02 +02:00
rubidium42
bf500c39c9 Codechange: make the name of SettingDesc a std::string 2021-06-13 10:26:58 +02:00
rubidium42
e588923bff Codechange: add std::string accepting SetDParamStr to ErrorMessageData 2021-06-13 10:26:58 +02:00
rubidium42
ca9c50607e Codechange: use StrStartsWith/StrEndsWith when finding settings 2021-06-13 10:26:58 +02:00
rubidium42
fed3e3305f Codechange: add function to determine whether are string starts or ends with a given other string 2021-06-13 10:26:58 +02:00
TELK
2d0abf5a76 Fix #9362: Hover in online players window was slightly too big (#9364)
This causes graphical glitches at the bottom of the window.
2021-06-13 10:06:50 +02:00
Michael Lutz
418e0ea85f Codechange: Use dynamic string list for contents of land info window. 2021-06-12 22:30:38 +02:00
translators
8dd846bad4 Update: Translations from eints
norwegian (bokmal): 10 changes by Anolitt
korean: 9 changes by telk5093
russian: 9 changes by Ln-Wolf
finnish: 10 changes by hpiirai
spanish: 8 changes by MontyMontana
french: 9 changes by glx22
2021-06-12 18:56:05 +00:00
rubidium42
71f3c35288 Fix #9353: [Script] Garbage collecting on priority queues could crash the game 2021-06-12 19:58:14 +02:00
40cec34836 Change: Skip creating a RealSpriteGroup when there is only one result.
This avoids checking RSG for empty sets every time they are evaluated.
This might alter behaviour in cases of a malformed NewGRF file.
2021-06-12 08:05:59 +01:00
f1328db063 Codechange: Deduplicate ResolveReal() for resolvers that don't use real sprite groups.
This may change behaviour when multiple loading/loaded stages are provided, as the various copies checked in different orders, however only one result is expected in these cases anyway.
2021-06-12 08:05:59 +01:00
translators
c562b4c527 Update: Translations from eints
hindi: 67 changes by ritwikraghav14
2021-06-11 18:54:52 +00:00
Loïc Guilloux
16ebf7861f Fix 4079c47: Missed a file when removing generated .sq files from the repo (#9350) 2021-06-11 16:59:19 +02:00
Loïc Guilloux
ee5f23382d Fix: [Script] doxygen_filter is very strict about DOXYGEN_API usage (#9351) 2021-06-11 16:40:04 +02:00
Patric Stout
ef25afd55a Fix #9348, 4d74e51: don't try to sell shares of spectators (#9349)
"new_owner" can be INVALID_OWNER, and as INVALID_OWNER ==
COMPANY_SPECTATORS, we could end up trying to sell shares of
nobody.
2021-06-11 00:18:20 +02:00
Loïc Guilloux
acb6348ba6 Add: [Actions] msys2/MinGW CI (#8698) 2021-06-10 23:54:52 +02:00
Tyler Trahan
d09210e1c6 Feature: Configurable subsidy duration 2021-06-10 23:26:16 +02:00
glx22
c2db408d5d Fix aa5a8fe28: [MinGW] Wrong define tested (WIN32 vs _WIN32) 2021-06-10 23:17:29 +02:00
glx22
d485b50813 Fix: [MinGW] Ignore wglGetProcAddress() cast warnings 2021-06-10 23:17:29 +02:00
glx22
744a9e4745 Codechange: [WIN32] Add a wrapper around GetProcAddress() 2021-06-10 23:17:29 +02:00
glx22
15f66329c2 Fix: [MinGW] Silence 2 cast warnings 2021-06-10 23:17:29 +02:00
glx22
00e3fddd0c Fix: [MinGW] Unused squirrel code triggering a warning 2021-06-10 23:17:29 +02:00
glx22
b7250a42e1 Fix: [MinGW32] Linking error 2021-06-10 23:17:29 +02:00
glx22
2df48a78cc Fix: [MinGW32] Can't convert lambda to stdcall 2021-06-10 23:17:29 +02:00
glx22
3ca0239985 Fix: [MinGW32] SHGFP_TYPE_CURRENT is now present in win32api 2021-06-10 23:17:29 +02:00
glx22
5d05c4919b Codechange: [WIN32] Reduce manual dynamic loading as WinXP is the minimum version 2021-06-10 23:17:29 +02:00
glx22
f4c7d5577e Codechange: [WIN32] Use VersionHelpers where appropriate 2021-06-10 23:17:29 +02:00
Patric Stout
ed3946e295 Add: '-X' option to ignore global folders in the search path (#9341)
This is extreme useful for automated testing. Without this, OpenTTD
will always look in your personal-dir (like ~/.local/share/openttd
or %USER%\Documents\OpenTTD). For most users this is exactly what
we want, that there is a shared place for all their files.

However, for automated testing this is rather annoying, as your
local development files influence the automated test. As such,
'-X' counters this, and only gives the local folders. This is
especially useful in combination with '-x' and '-c'.
2021-06-10 23:13:34 +02:00
Loïc Guilloux
076f3d26c2 Fix #9329: [CMake] FindVersion.cmake relied on internal cmake variable (#9330) 2021-06-10 22:14:08 +02:00
rubidium42
2924ac48c5 Fix: [Script] Ensure the saved script strings are properly validated and terminated when being read from the savegame 2021-06-10 22:03:23 +02:00
rubidium42
bb8fd00760 Cleanup: [Network] Remove C-string Recv_string and its last use 2021-06-10 21:53:19 +02:00
rubidium42
ab9b937ab7 Codechange: [Network] Use std::string to get a NewGRF's name 2021-06-10 21:53:19 +02:00
Patric Stout
849a10520c Change: allow pause/unpause console command in single player too (#9342) 2021-06-10 20:11:50 +02:00
rubidium42
e2417193c9 Cleanup: [ContentInfo] Remove some functions that are not needed anymore 2021-06-10 20:09:44 +02:00
rubidium42
e3717ae903 Codechange: [ContentInfo] Use std::string instead of string buffers 2021-06-10 20:09:44 +02:00
rubidium42
df181bb641 Codechange: [ContentInfo] Use a vector for dependencies instead of custom allocation 2021-06-10 20:09:44 +02:00
rubidium42
9c424ab741 Codechange: [ContentInfo] Use StringList for tags instead of custom allocations 2021-06-10 20:09:44 +02:00
rubidium42
dfb89f3891 Codechange: [ContentInfo] Do not use memset/memcpy to make it possible to use vector/string 2021-06-10 20:09:44 +02:00
rubidium42
6bb3f034e4 Cleanup: [ContentInfo] Remove unused function 2021-06-10 20:09:44 +02:00
Patric Stout
37ae6b8ae3 Add: adhere the autosave_on_exit setting for Null videodriver (#9343)
This is especially useful for automated-testing, to make a save
when the game quits while using "-vnull:ticks=N".
2021-06-10 19:34:53 +02:00
Patric Stout
174952440a Codechange: rework CHTS-chunk save/load to be more like the others 2021-06-10 19:18:24 +02:00
Patric Stout
8f323855b1 Codechange: rename SL_LST to SL_REFLIST to highlight the "reference" part
You can easily mistake SlList / SL_LST to be a list of SL_VAR, but
it is a list of SL_REF. With this rename, it hopefully saves a few
people from "wtf?" moments.
2021-06-10 19:18:24 +02:00
Patric Stout
aa6443d57a Codechange: refactor SlList to use SlStorageHelper 2021-06-10 19:18:24 +02:00
Patric Stout
23857af693 Codechange: refactor SlDequeueHelper to work with unsigned and be more generic
Future additions will start using it for std::list too.
2021-06-10 19:18:24 +02:00
Patric Stout
a2147d437e Codechange: use wrappers to get Var[Mem|File]Type, instead of GB() 2021-06-10 19:18:24 +02:00
Patric Stout
fba86f711f Codechange: move GetVariableAddress inside SlObjectMember
Also move it to static, as nobody else is using it.
2021-06-10 19:18:24 +02:00
Vít Šefl
f899772ec2 Fix 2e136285: Crash when CTRL-clicking on a sign (#9345) 2021-06-10 15:49:25 +02:00
translators
37b285ad83 Update: Translations from eints
spanish (mexican): 2 changes by absay
2021-06-09 19:13:47 +00:00
translators
12de256b72 Update: Translations from eints
german: 1 change by Wuzzy2
spanish: 1 change by ilyabakhlin
2021-06-08 19:22:42 +00:00
Patric Stout
f997eb6ca4 Fix: compatible NewGRFs in crash-log reported wrong md5 (#9340)
The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.
2021-06-08 20:30:44 +02:00
Patric Stout
1e564b333f Codechange: make [Save|Load]Settings() behave more like other Save/Load code (#9335)
Prepare the full description and send it to SlObject. This does
require some code to be able to read to a SLE_VAR_NULL, like strings
etc, as there is no way to know their length beforehand.
2021-06-07 23:03:12 +02:00
Patric Stout
648ee88a02 Codechange: merge guiflags and flags in settings .ini files
It was rather confusing which one was for what, especially as some
SaveLoad flags were settings-only. Clean up this mess a bit by
having only Setting flags.
2021-06-06 21:45:01 +02:00
Patric Stout
264991dfa5 Codechange: move SLF_NO_NETWORK_SYNC into settings
It is a settings-only flag, so don't pollute SaveLoad code with it.
2021-06-06 21:45:01 +02:00
Patric Stout
414e12d26b Codechange: move SLF_NOT_IN_SAVE into settings
It is a settings-only flag, so don't pollute SaveLoad code with it.
2021-06-06 21:45:01 +02:00
Patric Stout
7572603c9d Codechange: remove the unused SLF_HEX flag 2021-06-06 21:45:01 +02:00
translators
d835a42c05 Update: Translations from eints
english (us): 1 change by 2TallTyler
catalan: 5 changes by J0anJosep
2021-06-06 19:37:57 +00:00
glx22
c27afdf3f6 Codechange: Remove FOR_ALL_CHUNK_HANDLERS
Co-Authored-By: Patric Stout <truebrain@openttd.org>
2021-06-06 19:35:06 +02:00
translators
3559e55b91 Update: Translations from eints
spanish (mexican): 1 change by absay
latvian: 2 changes by osprinkis
2021-06-05 19:36:47 +00:00
translators
ea23a9cdb6 Update: Translations from eints
korean: 1 change by telk5093
dutch: 1 change by Afoklala
french: 1 change by MalaGaM
2021-06-04 20:11:37 +00:00
translators
d816ff0361 Update: Translations from eints
korean: 1 change by telk5093
2021-06-03 20:24:19 +00:00
Patric Stout
5e44da3010 Fix ef991b17: server was trying to free() a packet created with "new CommandPacket()" (#9334) 2021-06-03 22:07:44 +02:00
Patric Stout
feb2ddbefa Codechange: rename SettingGuiFlag to SettingFlag (#9332)
It is a lovely organicly grown enum, where it started off with
GUI-only flags, and after that a few flags got added that can be
considered GUI-only (the GUI disables/enables based on them), to
only have flags added that has nothing to do with the GUI.

So be less confusing, and rename them to what they do.

Additionally, I took this opportunity to rename 0ISDISABLED to
reflect what it really does.
2021-06-03 21:18:29 +02:00
Patric Stout
28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
Patric Stout
f8dd5dd00a Codechange: remove unused assert_msg() macro 2021-06-03 17:30:00 +02:00
translators
48ecc481ee Update: Translations from eints
swedish: 1 change by joeax910
2021-06-01 20:58:39 +00:00
Vít Šefl
30f5938eed Fix b791ffc6: use the correct name in CmdPlantTree 2021-06-01 18:26:35 +02:00
Vít Šefl
c936f8b769 Fix b791ffc6: use the correct parameter in CmdSignalTrackHelper 2021-06-01 17:12:06 +02:00
Patric Stout
9fff00ba20 Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either:
1) "SaveLoadTable" if a list of SaveLoads was meant
2) "SaveLoad &" if a single entry was meant

As added bonus, this removes SL_END / SLE_END / SLEG_END. This
also adds core/span.hpp, a "std::span"-lite.
2021-05-31 22:26:44 +02:00
translators
956d761e3e Update: Translations from eints
japanese: 1 change by scabtert
2021-05-31 20:18:35 +00:00
Patric Stout
921ab68a48 Codechange: use AsIntSetting()->Read() wrapper if possible (#9324) 2021-05-31 10:56:06 +02:00
translators
043a544248 Update: Translations from eints
korean: 2 changes by telk5093
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by Vimerum
2021-05-30 19:56:14 +00:00
Rubidium
5ded596c80 Fix #9320, 2e136285: nullptr could not be converted to string 2021-05-30 19:59:49 +02:00
rubidium42
4613ababd3 Fix #9316, 64eddaeb: at about 250.000 inhabitants the bridge length limit check overflows 2021-05-30 15:09:18 +02:00
Patric Stout
0c96884700 Codechange: add a wrapper function to find all settings based on prefix (#9312) 2021-05-30 10:55:52 +02:00
Patric Stout
e9e4588db1 Codechange: use setting name instead of index for HandleOldDiffCustom() (#9311) 2021-05-30 10:40:59 +02:00
Patric Stout
bcd7a7aafe Codechange: rename _SQ64 into POINTER_IS_64BIT (#9313) 2021-05-30 10:40:03 +02:00
rubidium42
8c273ed598 Codechange: [Network] Let admin-console use std::string(_view) 2021-05-30 10:15:22 +02:00
rubidium42
e58581f1f8 Codechange: [Network] Let admin-game script use std::string 2021-05-30 10:15:22 +02:00
rubidium42
29f2bd27c4 Codechange: [Game] Pass the length instead of '\0' terminating (and undoing that) in the middle of a C-string 2021-05-30 10:15:22 +02:00
rubidium42
8a918ce170 Codechange: [Network] Make admin name and version std::string 2021-05-30 10:15:22 +02:00
rubidium42
97c461d1e7 Fix: limit heightmap sizes to something reasonable to prevent crafted heightmaps to OOM-crash the game 2021-05-30 09:50:38 +02:00
rubidium42
e3c9ed4d15 Codechange: [Network] Use std::string to determine an unique name for clients 2021-05-30 00:01:49 +02:00
rubidium42
806f78aa04 Codechange: [Network] Use std::string to send the client name and rcon commands 2021-05-30 00:01:49 +02:00
rubidium42
fd95736bac Codechange: [Network] Use std::string for server side logic of kicking and banning clients 2021-05-30 00:01:49 +02:00
rubidium42
f0e1cd0129 Codechange: [Network] Let server rcon result use std::string 2021-05-30 00:01:49 +02:00
rubidium42
8b9f1147df Codechange: [Network] Let server changing a client name use std::string 2021-05-30 00:01:49 +02:00
Patric Stout
d70fb74ac6 Codechange: use setting name instead of index for CmdChange(Company)Setting (#9306)
This is mostly done as there are now constraints on settings.ini you might not
expected. For example, conditional settings always have to come last, as otherwise
they would influence the index.
2021-05-29 23:27:01 +02:00
glx22
5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
glx22
994bf19aef Fix f6d5c01: Delay deletion when closing windows 2021-05-29 21:08:25 +02:00
rubidium42
ef991b1772 Codechange: [Network] Use std::string in CommandPacket 2021-05-29 19:02:18 +02:00
rubidium42
2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
rubidium42
661728558e Codechange: let IsUnique.* functions accept std::string 2021-05-29 19:02:18 +02:00
rubidium42
b4aedef848 Codechange: add std::string variant of Utf8StringLength 2021-05-29 19:02:18 +02:00
Vít Šefl
0125ba82e8 Fix: Do not send vehicles towards incomplete PF nodes
YAPF could end up in a situation where it sets the best intermediate node
to a node whose construction is never finalized (i.e. it is never added to
the open list). The content of the node would be overwritten in the next
round, potentially sending the vehicle to an unwanted location.
2021-05-29 19:00:47 +02:00
Patric Stout
7713c3e3cc Codechange: move casting a "const char *" to "char *" to the caller
It is not nice to have your definition say you won't change a value
while in fact the whole reason for your existance is to change it.
2021-05-29 16:23:59 +02:00
Patric Stout
665e3c1f45 Fix: ScriptObject::DoCommand could modify "text" while defined "const"
This could have unwanted side-effects, as it could change the
source for ever and ever.
2021-05-29 16:23:59 +02:00
Patric Stout
b0f44d7eb1 Doc: describe what each settings-file is about 2021-05-29 11:27:00 +02:00
Patric Stout
e58046c947 Codechange: move all settings.ini files to table/settings 2021-05-29 11:27:00 +02:00
Patric Stout
ca9a7df752 Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
2021-05-29 11:21:38 +02:00
Patric Stout
4d74e51907 Fix #9281: acquire a company uses special bookkeeping to make you rich (#9300)
When you buy-out a company, you got your shares back. This is
based on company-value, which includes values for the vehicles etc.
In other words, you not only got the vehicles, but you also got
paid to get them back.

Additionally, you also got the loan of the company, but not the
money for the loan (as that is subtracted from the company-value).

Solve this by changing the rules of a buy-out: don't sell your
shares, get the loan AND the balance and get the infrastructure.
2021-05-29 11:21:30 +02:00
rubidium42
4c0e083128 Cleanup: set the base in the setting templates, instead of defining the base for every setting
This has the added benefit of not getting mistaken that multiple bases can be used for the same SettingTable
2021-05-29 10:32:32 +02:00
rubidium42
4144e949ed Fix: [Network] Prevent an empty server name to be set anywhere 2021-05-29 10:07:30 +02:00
rubidium42
08308d808c Codechange: use separate pre and post callbacks for int settings 2021-05-29 10:07:30 +02:00
rubidium42
e2f5d9e561 Codechange: use separate pre and post callbacks for string settings 2021-05-29 10:07:30 +02:00
rubidium42
ea9715d970 Codechange: split Write_ValidateSetting to get separate functions for making ints valid and writing ints 2021-05-29 10:07:30 +02:00
rubidium42
208952f2ba Codechange: split Write_ValidateSetting to get separate functions for making strings valid and writing strings 2021-05-29 10:07:30 +02:00
translators
ce1c60699a Update: Translations from eints
norwegian (bokmal): 3 changes by Anolitt
dutch: 3 changes by Afoklala
portuguese (brazilian): 3 changes by Vimerum
2021-05-28 19:53:19 +00:00
translators
7b5c0b4236 Update: Translations from eints
chinese (traditional): 9 changes by benny30111
english (us): 3 changes by 2TallTyler
2021-05-27 19:38:25 +00:00
Patric Stout
7648483364 Change: by default, make "unload all" leave stations empty (#9301) 2021-05-27 18:56:39 +02:00
rubidium42
8372c679e3 Codechange: add helper functions to read an int setting value 2021-05-27 18:49:43 +02:00
rubidium42
86c9ef8134 Codechange: remove SettingDescType in lieu of the actual classes 2021-05-27 18:49:43 +02:00
rubidium42
e666a962b1 Codechange: let OneOfMany and ManyOfMany be their own classes as well 2021-05-27 18:49:43 +02:00
rubidium42
860003458f Codechange: make BoolSettingDesc its own sub class 2021-05-27 18:49:43 +02:00
rubidium42
72ec81325b Cleanup: remove unneeded temporary variables and casts 2021-05-27 18:49:43 +02:00
rubidium42
0d6597a9e6 Codechange: move bits of SettingDesc down to the appropriate sub classes
And by doing so remove the hack where ints were put into pointers so "def" could either be an int or a string
2021-05-27 18:49:43 +02:00
rubidium42
f58611298e Codechange: use IntSettingDesc in the settings GUI 2021-05-27 18:49:43 +02:00
rubidium42
f6723b53da Codechange: make parsing of IniItems overridable functions of SettingDesc 2021-05-27 18:49:43 +02:00
rubidium42
1f8ff0e4f9 Codechange: make Write_ValidateSetting a function of StringSettingDesc 2021-05-27 18:49:43 +02:00
rubidium42
be28c95b30 Codechange: make Write_ValidateSetting a function of IntSettingDesc 2021-05-27 18:49:43 +02:00
rubidium42
024e584904 Cleanup: use (config) formatting for console settings functions 2021-05-27 18:49:43 +02:00
rubidium42
c3cd4a683d Codechange: make formatting of values into strings a method of SettingDesc 2021-05-27 18:49:43 +02:00
rubidium42
d8125fa46e Codechange: make sub classes of SettingDesc for the different types of settings 2021-05-27 18:49:43 +02:00
rubidium42
91b3d697c5 Codechange: make SettingDesc an instance in the setting table to allow for sub classes 2021-05-27 18:49:43 +02:00
rubidium42
cf6b91f30f Codechange: do not use SettingDescBase directly when not needed 2021-05-27 18:49:43 +02:00
rubidium42
3bb6ce8827 Codechange: use initializer_lists for the settings tables
Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
2021-05-27 18:49:43 +02:00
rubidium42
425d50372f Codechange: let SettingDesc extend SettingDescBase 2021-05-27 18:49:43 +02:00
rubidium42
ac99a38175 Cleanup: remove and/or fix some confusing comments
The comments for SettingDescType; it is a byte, so not 4 bytes and since it is not a flag there are about 250 other possibilities left instead of 9.
SettingGuiFlag is uint16 so has 2 bytes allocated.
SettingDescGlobVarList and related comments imply that global vars cannot be used elsewhere, but they are used for settings just fine. Even then the type is not used anywhere else but the definition of the table.
2021-05-27 18:49:43 +02:00
rubidium42
8ffb4122df Codechange: just pass the SettingDesc to SetSettingValue and remove distinction between (non)company 2021-05-27 18:49:43 +02:00
rubidium42
db54e20825 Change: mark copy-assignment as deleted for classes with a copy-constructor that is not trivial
This to prevent the default copy-assignment getting used when during the assignment also some other memory needs to be allocated as that would otherwise be freed.
2021-05-27 18:30:56 +02:00
rubidium42
9197de39e4 Cleanup: remove unused copy-constructor without copy-assignment 2021-05-27 18:30:56 +02:00
rubidium42
6fe4d4ad7b Codechange: linkgraph always iterates with NodeIDs over the Size(), so make Size() the same type to prevent infinite loops 2021-05-27 18:30:56 +02:00
rubidium42
ed9e38221a Cleanup: remove dead code; ++ on ostreambuf_iterator is a no-op 2021-05-27 18:30:56 +02:00
rubidium42
b280f16316 Codechange: remove unneeded comparison and casts
Division by resize_y is already yielding an unsigned number, so when clicking in the WD_FRAMERECT_TOP you would already get a huge value, so sel would never be negative. So, leave sel an unsigned number and remove the <= check.
2021-05-27 18:30:56 +02:00
rubidium42
b9797a81c0 Codechange: pass large parameter by reference instead of value, especially in a recursive function 2021-05-27 18:30:56 +02:00
rubidium42
b791ffc6de Fix: do not hide parameter by local variable with the same name 2021-05-27 18:30:56 +02:00
rubidium42
eaa3df1e8e Fix: part of a tile might not be marked dirty upon terraforming 2021-05-27 18:30:56 +02:00
translators
35dbd53682 Update: Translations from eints
russian: 3 changes by Ln-Wolf
slovak: 3 changes by FuryPapaya
spanish: 3 changes by MontyMontana
2021-05-26 19:32:03 +00:00
Owen Rudge
3ce7e31f64 Feature: Sign Windows builds 2021-05-26 13:40:44 +01:00
translators
c96945fa2b Update: Translations from eints
swedish: 27 changes by joeax910
spanish (mexican): 1 change by absay
korean: 4 changes by telk5093
german: 3 changes by Wuzzy2
finnish: 3 changes by hpiirai
french: 3 changes by glx22
portuguese: 3 changes by azulcosta
2021-05-25 19:16:10 +00:00
translators
6b24cd2516 Update: Translations from eints
swedish: 50 changes by joeax910
2021-05-24 19:18:21 +00:00
milek7
7607277380 Fix: Network on Haiku, remove old code for BeOS 2021-05-24 08:56:18 +02:00
milek7
886f5c104a Fix: Workarounds for BeMidi driver to work properly on Haiku 2021-05-24 08:56:18 +02:00
milek7
36bcd2956a Fix: Building on Haiku 2021-05-24 08:56:18 +02:00
glx22
7c0762da65 Change: Show what is affected by "wagon removal" toggle 2021-05-23 21:51:58 +02:00
glx22
e99352a5d9 Change: Unhide Ctrl effect for group replace protection 2021-05-23 21:51:58 +02:00
translators
64be66216c Update: Translations from eints
chinese (traditional): 3 changes by benny30111
2021-05-23 19:20:55 +00:00
Jonathan G Rennison
a896753ecc Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing 2021-05-23 21:05:55 +02:00
Vít Šefl
33d99d27f4 Fix: Encountering two-way red signals could prune unrelated branches.
The intermediate node branch is now only pruned if the node is on the
path leading to the two-way red signal.
2021-05-23 20:19:39 +02:00
Michael Lutz
97722931a9 Fix: [OpenGL] Increase timeout when waiting for the GPU to be done with the drawing buffer.
The old timeout could be too short if v-sync was on on lower refresh rates.
2021-05-23 12:22:59 +02:00
translators
4f7d6cf1ba Update: Translations from eints
japanese: 4 changes by akaregi
korean: 2 changes by telk5093
2021-05-22 19:12:46 +00:00
translators
7b58bfaf6c Update: Translations from eints
japanese: 42 changes by akaregi
2021-05-21 19:16:19 +00:00
translators
08e71eed8b Update: Translations from eints
japanese: 74 changes by akaregi
2021-05-20 19:11:15 +00:00
Patric Stout
3477405e86 Change: [Actions] use newly created Actions instead of custom shell-scripting (#9284) 2021-05-20 19:12:33 +02:00
translators
ca9f9b84d3 Update: Translations from eints
japanese: 239 changes by akaregi, 18 changes by scabtert
2021-05-19 19:09:28 +00:00
translators
145f2fc43a Update: Translations from eints
indonesian: 14 changes by NinjaQuince
2021-05-18 19:10:56 +00:00
translators
7caceb26f7 Update: Translations from eints
korean: 1 change by telk5093
indonesian: 55 changes by NinjaQuince
2021-05-17 19:08:25 +00:00
rubidium42
e2dc5aa83e Codechange: [Network] Use C++ string functions to generate company password hash 2021-05-17 16:09:10 +02:00
translators
e2e06633c9 Update: Translations from eints
norwegian (bokmal): 1 change by Anolitt
slovak: 1 change by FuryPapaya
2021-05-16 19:07:45 +00:00
rubidium42
4d246cda73 Codechange: [Network] Let NetworkClientInfo use std::string 2021-05-16 10:07:51 +02:00
rubidium42
83679c0e57 Codechange: [Network] Use std::string to populate the client list for company stats 2021-05-16 10:07:51 +02:00
rubidium42
e90b2649b6 Codechange: [Network] Let NetworkCompanyInfo use std::string 2021-05-16 10:07:51 +02:00
Rubidium
5c01f9ea52 Fix #9267, 47a99bb: [Squirrel] Heap use after free
Due to 47a99bb the order of elements in the garbage collection chain has
changed causing the class to be finalised before the instances of that class.
Since the instance's array of member values depends on the size of the values
in the class, the class finalisation resetting that size to 0 causes not all
finalisations to run, which subsequently causes a heap use after free. So,
just set the SQObjectPtrs to 'null' during the finalisation of the SQClass
so the SQInstance can release all instance variables during its finalisation.
2021-05-16 10:07:38 +02:00
glx22
e66e25ff71 Fix #9269, f6d5c01: Hide windows without abusing WC_INVALID 2021-05-15 21:08:49 +02:00
translators
2e43f91891 Update: Translations from eints
estonian: 1 change by siimsoni
indonesian: 39 changes by w13
2021-05-15 19:05:41 +00:00
rubidium42
fab120ee83 Codechange: [Network] Let chat communication use std::string 2021-05-15 10:20:50 +02:00
rubidium42
ae85af98eb Codechange: Use std::string GetString where convenient 2021-05-15 10:20:50 +02:00
rubidium42
2e0297b0fa Add: GetString that returns std::string instead of filling a passed buffer 2021-05-15 10:20:50 +02:00
rubidium42
e6703eac68 Codechange: [Network] Let NetworkTextMessage use std::string 2021-05-15 10:20:50 +02:00
rubidium42
44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
rubidium42
ddaedaf32a Fix: empty undocumented branches 2021-05-15 10:16:10 +02:00
Rubidium
bb9121dbd4 Fix: comparison of narrow type to wide type in loop (potential for infinite loops) 2021-05-15 10:16:10 +02:00
Rubidium
031e91de6e Fix: [Network] Check on CIDR for netmask check considered everything valid 2021-05-15 10:16:10 +02:00
Rubidium
e6f0d63e25 Codechange: comparison result is always the same due to earlier check
Practically the length of the handlers not being equal to the number of
features is the problem as it means something was forgotten when adding
a new feature, so static assert to that and let the existing check on
the feature number take care of invalid data from the NewGRFs.
2021-05-15 10:16:10 +02:00
rubidium42
aa5a8fe28a Codechange: use thread safe time functions
Functions like localtime, gmtime and asctime are not thread safe as they (might) reuse the same buffer. So use the safer _s/_r variant for localtime and gmtime, and use strftime in favour of asctime.
2021-05-14 23:22:29 +02:00
rubidium42
297d6e20bf Codechange: [Network] Pass passwords as std::string to the network code 2021-05-14 23:22:04 +02:00
rubidium42
ebe32ad912 Codechange: [Network] Use std::string for the internal handling of admin/rcon passwords 2021-05-14 23:22:04 +02:00
rubidium42
6db52d52d0 Codechange: [Network] Use std::string for the internal handling of server passwords 2021-05-14 23:22:04 +02:00
rubidium42
1de5cdeab8 Codechange: [Network] Use std::string for the internal handling of company passwords 2021-05-14 23:22:04 +02:00
rubidium42
98283116fa Codechange: [Network] Make company state password std::string 2021-05-14 23:22:04 +02:00
frosch
1da0ba95b2 Feature: Define refittability of default vehicles using cargo classes.
This ensures that default vehicles can transport any NewGRF defined cargos, albeit with weird graphics and vehicle names.
This also changes the refittability of default vehicles with default industries.
2021-05-13 23:28:43 +02:00
frosch
9f8d0b1bee Fix: Resolve cargo-types of default vehicles via their cargo label.
Default vehicles now behave as if they had a cargo translation table. This fixes default vehicles carrying seemingly random cargos, if NewGRF industry sets are present.
This behavior is disabled, when a NewGRF touches any of the cargo-type or refitting properties. In that case it's up to the NewGRF to define its own cargo translation table.
2021-05-13 23:28:43 +02:00
frosch
a9ff296c3d Codechange: add constant for number of original cargoes. 2021-05-13 23:28:43 +02:00
rubidium42
0f062b3882 Codechange: clean up C-string support from settings 2021-05-13 23:13:17 +02:00
rubidium42
a032714dc4 Codechange: move script settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
95386dc2b8 Codechange: move misc settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
77330d09fd Codechange: move font settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
65cbde4b30 Codechange: move currency settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
2022e34824 Codechange: move locale settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
16437b7c0d Codechange: move client name in settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
02fdb5b210 Codechange: move server name/id in settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
cc6c078dec Codechange: move hostnames in settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
c73d64adf9 Codechange: move passwords in settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
f219354f89 Change: further support for std::string in settings 2021-05-13 23:13:17 +02:00
translators
423a5034ee Update: Translations from eints
french: 2 changes by glx22
2021-05-13 19:09:30 +00:00
Patric Stout
a403653805 Codechange: [Network] split CloseSocket and CloseConnection more clearly (#9261)
* Codechange: [Network] split CloseSocket and CloseConnection more clearly

- CloseSocket now closes the actual OS socket.
- CloseConnection frees up the resources to just before CloseSocket.
- dtors call CloseSocket / CloseConnection where needed.
2021-05-13 11:46:51 +02:00
embeddedt
86741ad489 Fix: [Emscripten] Force secure WebSockets over HTTPS (#9248) 2021-05-13 10:13:34 +02:00
Paweł Świątkowski
56a46f5cae Fix: Correct name of Golub-Dobrzyn 2021-05-13 10:05:07 +02:00
Paweł Świątkowski
6ee8690b47 Fix: Replace Susz with Leszno
Susz is masculine, not neuter, so it should result in "Susz Mazowiecki",
"Susz Morski", and not "Susz Mazowieckie" or "Susz Morskie". However,
because order of the names whould not be changed, it was replaced with
Leszno, which is neuter.
2021-05-13 10:05:07 +02:00
Rubidium
187a3f20bf Codechange: remove pointless close call due to resolving virtual functions statically in destructors
In the destructors of many of the network related classes Close() is called, just like the
top class in that hierarchy. However, due to virtual functions getting resolved statically
in the destructor it would always call the empty Close() of the top class.
Document the other cases where a virtual call is resolved statically.
2021-05-13 10:03:26 +02:00
Rubidium
7755f81bb8 Codechange: make explicit that virtual functions in a con/destructor are resolved statically
This as during construction the sub class has not been initialized yet, and
during destruction the sub class has already been destroyed, so the overriding
virtual function would be accessing uninitialized data.
2021-05-13 10:03:26 +02:00
Patric Stout
d7ce61f106 Fix #9255: [Network] TCPConnecter crashes when hostname not found (#9259) 2021-05-13 08:13:48 +02:00
glx22
38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 2021-05-13 00:13:54 +02:00
frosch
5bd8144853 Fix #9256, 12e43c697d: invalid read after free. (#9258)
This also changes ScriptEventVehicleAutoReplaced when replacing wagons:
The event is now only spawned, if the head engine changes, so only if the VehicleID of the consist changes.
Previously replacing wagons spawned an event with OldVehicleID==NewVehicleID.
2021-05-12 23:40:03 +02:00
frosch
f6d5c0136e Codechange: make Window destruction not rely on undefined behavior. 2021-05-12 23:22:41 +02:00
frosch
f96f113951 Codechange: use IterateFromBack/Front only if the order is important.
Use Iterate if the order does not matter.
2021-05-12 23:22:41 +02:00
frosch
22567a1f43 Codechange: use iterators instead of 'subranges' when iterating from a specific window.
Using iterators makes it easier to include or exclude the start window in the iteration.
2021-05-12 23:22:41 +02:00
frosch
aba239479b Codechange: remove excessive templating in favour of a single const_cast.
The const_cast will be removed again in a later commit.
2021-05-12 23:22:41 +02:00
frosch
95abdfdef9 Cleanup: remove unneeded labels and gotos.
The window list supports deletion of arbitrary windows, while iterating over it.
2021-05-12 23:22:41 +02:00
ba193f2e23 Fix #9186: Fix incorrect bounding box height causing station sprite glitch. (#9187)
Increased height of small station building bounding box to cover the build rather than just the platform.
2021-05-12 21:35:48 +01:00
translators
3e7e2d9ca3 Update: Translations from eints
romanian: 38 changes by kneekoo
slovak: 19 changes by FuryPapaya
catalan: 1 change by J0anJosep
turkish: 191 changes by Anceph
2021-05-12 19:08:38 +00:00
b972ed8604 Fix #9242: Tree tick handler did not scale by map size. (#9246)
This means that random tree generation density is higher on small maps and lower on large maps. This difference is enough to make the Lumber Mill impractical to use on large maps.

This change skips ticks on maps smaller than 256x256 and increases iterations or shortens the interval on maps larger than 256x256.
2021-05-12 18:17:57 +01:00
7b7dbbc935 Fix #9063: Caption of news window incorrectly aligned. (#9252) 2021-05-12 17:43:35 +01:00
Patric Stout
b136e65cf9 Change: reworked the debug levels for network facility (#9251)
It now follows very simple rules:
0 - Fatal, user should know about this
1 - Error, but we are recovering
2 - Warning, wrong but okay if you don't know
3 - Info, information you might care about
4 -
5 - Debug #1 - High level debug messages
6 - Debug #2 - Low level debug messages
7 - Trace information
2021-05-12 16:34:02 +02:00
Patric Stout
56050fc96f Fix 91b8ce07: dedicated servers could no longer create screenshots (#9232)
Although most commands are not useful on a dedicated server,
screenshot commands should be dequeued.
2021-05-12 16:31:31 +02:00
3d9436bd75 Fix #9202: Invalid test for unset NewGRF override mapping. (#9226) 2021-05-12 09:11:14 +02:00
Loïc Guilloux
c0a0d85d20 Fix: [Actions] Annotations not shown for MSVC (#9247) 2021-05-11 21:43:43 +02:00
translators
1dfc148613 Update: Translations from eints
korean: 1 change by telk5093
slovak: 149 changes by ApplePie420
2021-05-11 19:03:10 +00:00
Patric Stout
d0eb3e4bc4 Fix: [Network] mark server as offline when no longer reachable (#9244) 2021-05-11 19:19:37 +02:00
rubidium42
0968d009c8 Fix #9243: [Network] For a dedicated server use a fallback client and server name
Also warn when the client or server name has not been set and provide pointers on how to set them
2021-05-11 19:09:04 +02:00
Patric Stout
9e7e87ce3e Fix: [Network] don't rebuild the host-list during iterating the list (#9240)
Additionally, only rebuild it when we added a new manual server,
as otherwise it is a noop anyway.
2021-05-11 12:32:27 +02:00
Patric Stout
9841ebb0bd Fix: [Network] don't mark the last-joined server as manual (#9239) 2021-05-11 12:26:30 +02:00
Patric Stout
36e22f3a7b Fix: [Network] clients leaving because of broken connections was not broadcasted (#9238)
The code mixed up "client has quit but we already told everyone"
with "client lost connection, handle this".

Split up those two signals:
- CLIENT_QUIT means we told everyone and the connection is now dead
- CONNECTION_LIST means we should tell everyone we lost a client
2021-05-11 12:26:16 +02:00
translators
2e429ee485 Update: Translations from eints
german: 2 changes by Wuzzy2
2021-05-10 19:04:28 +00:00
Rubidium
495d73a67f Fix: leaking file descriptors 2021-05-10 16:03:31 +02:00
Rubidium
296194ad36 Fix: memory leak due to assigning result of strdup to a std::string 2021-05-10 16:03:31 +02:00
Rubidium
79fc094c54 Cleanup: [Fluidsynth] Remove fluid_player_join
The function fluid_player_join in the library is broken beyond compare for the
usecases it was used for (see their #872). It does not wait until it is safe
to delete the player, so it is up to the end user to ensure that.

For OpenTTD we acquire a lock before fluid_synth_write_s16 and we acquire the
same lock in the stop function. So, only one of the functions can be doing its
thing, meaning we do not need to wait for the player to be stopped as it
cannot be doing anything as we prevent that by the lock.
2021-05-10 16:03:16 +02:00
Loïc Guilloux
c53d9991ee Add: [Actions] Check CI annotations to detect compile warnings (#9217) 2021-05-10 14:48:04 +02:00
Patric Stout
8f4a612a7c Change: reworded many of the network errors during connect/listen (#9230)
Also changed some levels to 0, as a failing listen() is something
we should tell the user about. Hiding this information is a bit
evil.
2021-05-10 13:40:28 +02:00
translators
b7dd602dcd Update: Translations from eints
finnish: 1 change by hpiirai
2021-05-09 18:57:07 +00:00
Patric Stout
583011bca0 Fix: lobby window doesn't close if no connection could be established (#9223) 2021-05-09 18:48:21 +02:00
Loïc Guilloux
e162d0a55c Fix: [MinGW] Reapply 48fd7b27 to fix launch on Windows 7 x64 (#9225) 2021-05-09 18:28:47 +02:00
330a305c99 Fix: Apply unscaled padding to Viewport inside WWT_INSET. (#9219)
Since pixel dimensions in SetPadding() are scaled by GUI size, padding for inset viewports was excessive.

Instead, automatically apply padding for WWT_INSET at widget level. This applies to all widgets inside a WWT_INSET, which in all instances is a NWID_VIEWPORT.
2021-05-08 21:01:16 +01:00
Patric Stout
b9ab3bd6b3 Fix: only query a manually added server if it isn't there yet
But always mark it as manually, no matter if it was there or not.
2021-05-08 17:26:10 +02:00
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
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
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
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
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
52b16237ad Codechange: Don't update window contents if scrollbar position has not moved. 2021-05-08 09:52:54 +01:00
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
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
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
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
2021-05-02 18:15:54 +00:00
Milek7
20762f9117 Codechange: Acquire video buffer before taking game state lock to prevent erratic fast forward behaviour (#9140) 2021-05-02 19:10:07 +01:00
756034fa27 Codechange: Validate custom station platform layout tiles are permitted values only. 2021-05-02 17:15:27 +01:00
a3e49178d1 Codechange: Use std::vector for NewGRF station tile sprite layouts. 2021-05-02 17:15:27 +01:00
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.
2021-05-02 17:15:27 +01:00
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. 2021-05-02 17:57:24 +02:00
Michael Lutz
91b8ce073f Codechange: Generalise the delayed blitter change to a generic video driver command queue. 2021-05-02 17:57:24 +02:00
frosch
2cf5df2a50 Fix: [NewGRF] industry variable 66 and object variable 46 clamped the squared-euclidian distance to 16 bit, when they should not. 2021-05-02 13:45:43 +01:00
frosch
84aa17cea6 Fix: [NewGRF] industry variables 65 and 66 ignored the parameter, and always used the north tile. 2021-05-02 13:45:43 +01:00
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.
2021-05-02 11:51:28 +02:00
18651dd8b1 Fix: Update text effect size when font zoom is changed. (#9174) 2021-05-02 10:43:14 +01:00
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.
2021-05-02 10:21:27 +01:00
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.
2021-05-02 09:41:01 +01:00
6b0b1bb3de Cleanup: Use range iterator to evaluate DeterministicSpriteGroup. 2021-05-02 09:41:01 +01:00
913d8a7f28 Cleanup: Use std::vector in RandomSpriteGroup. 2021-05-02 09:41:01 +01:00
1aeaf39954 Cleanup: Use std::vector in DeterministicSpriteGroup. 2021-05-02 09:41:01 +01:00
f785a70a2b Cleanup: Use std::vector in RealSpriteGroup. 2021-05-02 09:41:01 +01:00
rubidium42
e097c83c83 Codechange: move some OS abstraction method implementations out of the header 2021-05-01 19:36:22 +02:00
rubidium42
22720332eb Codechange: encapsulate network error handling 2021-05-01 19:36:22 +02:00
rubidium42
0eb17a70af Codechange: rename NetworkError to ShowNetworkError 2021-05-01 19:36:22 +02:00
Matt Kimber
67063ceeb3 Fix 3d7ab09: stopped trains not updating viewport hash when reversed for a second time (#9165) 2021-05-01 18:15:22 +01:00
Matt Kimber
520595ff87 Fix 3d7ab09: stopped trains not updating viewport hash when reversed for a second time (#9165) 2021-05-01 18:14:50 +01:00
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.
2021-05-01 18:30:08 +02:00
rubidium42
83985fe26f Codechange: Move join information into a single structure 2021-05-01 18:30:08 +02:00
rubidium42
39c51c35f4 Fix #6598: Do not disconnect before company number validation
NetworkClientConnectGame already does a NetworkDisconnect, so no reason to do it here
2021-05-01 18:30:08 +02:00
rubidium42
3bd416bfdb Change: [Console] Show help when passing invalid company number 2021-05-01 18:30:08 +02:00
Loïc Guilloux
376f2509ad Fix: Don't consider regression AIs when starting a random AI (#9164) 2021-05-01 16:19:14 +02:00
Loïc Guilloux
282d5d302d Change: [Actions] Add a 2 minutes timeout for regression test (#9166) 2021-05-01 16:18:41 +02:00
rubidium42
0345f99180 Feature: make the town directory horizontally resizable 2021-05-01 13:30:27 +02:00
Loïc Guilloux
2985277bec Fix d4f0b6f4: [CMake] CMAKE_PROJECT_VERSION_XXX are not in CMake 3.9 (#9154) 2021-05-01 11:11:07 +01:00
rubidium42
40528db993 Fix #9152, Fix #9153: screenshot command showed error messages when successful 2021-05-01 11:54:41 +02:00
9c6c0a0966 Codechange: Scale sprite font height once on init instead of every call to GetHeight().
Scaling is not expensive, but it does not change either, and this avoids the need for a virtual method call. This cascades back to all GetCharacterHeight(FS_xxx) and FONT_HEIGHT_xxx calls.
2021-05-01 10:41:39 +01:00
ce55cd0ce7 Cleanup: Use GetDefaultFontHeight() call instead of direct access.
This makes this part of font size setup in FreeTypeFontCache consist with OSX and Windows variants.
2021-05-01 10:41:39 +01:00
49aa392440 Fix: Cargo legend blob in cargo payment rate window did not rescale. 2021-04-30 17:08:15 +01:00
055067c49c Fix: Scale cargo lines in industry chain window.
Replaces constant pixel values with values scaled based on font size.
This allows the industry chain to maintain a consistent look across
different sizes. Previously all except cargo line height were fixed.
2021-04-30 17:08:15 +01:00
254ffe9dcc Fix: Scale industry chain legend blob by font size. 2021-04-30 17:08:15 +01:00
957beaaefc Fix: Improved scaling and spacing of sign list window.
Both company icon sprite and text now centred within each row, and extra
padding added to avoid the sprites running into each other.
2021-04-30 17:08:15 +01:00
617e85cc65 Fix: Scale legend blobs in Fund new industry window. 2021-04-30 17:08:15 +01:00
5434d63f91 Fix: Scale smallmap legend 'blob' to fit text. 2021-04-30 17:08:15 +01:00
af70195e44 Fix: Tidy up sizing of sprite aligner window sprite list. 2021-04-30 17:08:15 +01:00
1df510c297 Fix: Company Key window scaling. 2021-04-30 17:08:15 +01:00
09206be054 Fix: Use unscaled values for padding OSK 2021-04-30 17:08:15 +01:00
56a6f66903 Codechange: Use text lines instead of pixel height of font for link graph widgets. 2021-04-30 17:08:15 +01:00
63cc340dc1 Codechange: Apply minimum size to toolbar widgets 2021-04-30 17:08:15 +01:00
d32df00b5c Codechange: No longer necessary to manually resize volume sliders. 2021-04-30 17:08:15 +01:00
4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 2021-04-30 17:08:15 +01:00
6fe5353da2 Cleanup: Set unchanging scrollbar properties in constructor. 2021-04-30 17:08:15 +01:00
03a43b8247 Cleanup: Call SetMinimalSize instead of setting min_y directly. 2021-04-30 17:08:15 +01:00
f5569763c9 Fix: Specify width when width is required instead of top. 2021-04-30 17:08:15 +01:00
2efa390a7d Codechange: Simplify calling of DrawCharCentered() 2021-04-30 17:08:15 +01:00
4f93dd95e4 Cleanup: Tidy up resize, fill and minimal size on widgets in town list window. 2021-04-30 17:08:15 +01:00
4c6cca459a Cleanup: Remove fairly redundant DrawDropdown() function. 2021-04-30 17:08:15 +01:00
5153e1b6e3 Cleanup: Horizontal widget size is commonly width rather than length. 2021-04-30 17:08:15 +01:00
3dbd6475fe Codechange: Use C++ features for train wagon overrides. (#9141)
This removes the need for C-style array management and allows use of iterators to perform wagon override lookups.
2021-04-30 12:03:07 +01:00
Patric Stout
665a3928e2 Remove: performance measurements in YAPF
YAPF was constantly measuring its performance, but only at
certain debug-levels this information was shown.

Now after years, I sincerely wonder if anyone still knows about this
feature and who still use it. Especially with the new framerate window,
this detailed performance is not as meaningful anymore as it once
was.
2021-04-30 12:48:41 +02:00
Patric Stout
e162aff7a3 Cleanup: remove weird left-over comment in yapf.hpp 2021-04-30 12:48:41 +02:00
Patric Stout
69118d063f Change: use TCP for everything except for master-server and initial server scan (#9130)
This means that pressing Refresh button and adding servers manually
now uses TCP.

The master-server and initial scan are still UDP as they will be
replaced by Game Coordinator; no need to change this now.

If we query a server that is too old, show a proper warning to the
user informing him the server is too old.
2021-04-30 11:34:47 +02:00
rubidium42
f00564eeb2 Fix: String validation could leave invalid Utf8 encoded strings (#9096)
In case a character was encoded in multiple bytes, but required fewer bytes to be encoded, the first byte would be copied to the output leaving an invalid Utf8 encoded string. Later uses of the validated string would use the same decode logic, which would yield a question mark and just read a single byte, so nothing dangerous happened.
Furthermore, because the next byte would not be a first byte of an encoded Utf8 character, the last few valid characters could be removed by the validation as well.
2021-04-29 23:16:41 +01:00
f018471b36 Cleanup: Remove old FiosList helper methods. (#9139) 2021-04-29 22:46:42 +01:00
glx22
9a8756d7ed Codechange: Replace FOR_ALL_CARGOSPECS with range-based for loops 2021-04-29 21:08:24 +02:00
glx22
14e92bd8e2 Codechange: Replace window related FOR_ALL with range-based for loops 2021-04-29 21:08:24 +02:00
rubidium42
a61696d6c5 Change: [Network] Encapsulate logic about the connection string to the network code (#23) 2021-04-29 20:12:11 +02:00
Patric Stout
be37a2cab8 Codechange: use NetworkAddress instead of two host/port variables where possible
This also means we no longer need last_host/last_port, but can
just use a single last_joined setting.
2021-04-29 20:12:11 +02:00
Patric Stout
99f998805b Codechange: use std::string over stack-based strings if possible 2021-04-29 20:12:11 +02:00
Patric Stout
a8afbe74bf Cleanup: remove write-only variable "hostname" in NetworkGameList 2021-04-29 20:12:11 +02:00
0b460bf4a1 Fix: 'Cache' top and bottom lines of textfile viewer to avoid overdraw. (#9131)
* Fix: 'Cache' top and bottom lines of textfile viewer to avoid overdraw.

The text file viewer calculated the number of lines required to set the scrollbar, but did not retain this information, so this was recalculated on every draw operation. This includes overdrawing text outside the bounds of the current scroll position.

With this change the top and bottom lines for each line of text are remembered, and reflowing is avoided where possible. Text outside the current scroll bounds is not drawn.
Additionally the scroll interval is now based on text lines instead of pixel lines, which increases the text capacity depending on the font size.

* Fix: Limit text viewer to showing 64k lines.

Text files with more than 64k wrapped lines would exceed the scrollbar capacity and cause an assert. This is harder to reach now that the scrollbar counts lines instead of pixels.
2021-04-29 18:58:26 +01:00
translators
72a05921b0 Update: Translations from eints
norwegian (bokmal): 16 changes by Anolitt
finnish: 2 changes by hpiirai
2021-04-29 17:52:22 +00:00
Loïc Guilloux
356bbbb90a Fix: [MinGW] Set minimum OS version to Windows XP (#9135) 2021-04-29 14:26:08 +02:00
20ac0b4148 Cleanup: Replace FOR_ALL_SORTED_CARGOSPECS macro with range iterator. 2021-04-28 23:54:31 +01:00
de81afdf4b Cleanup: Replace FOR_ALL_SORTED_ROADTYPES macro with range iterator. 2021-04-28 23:54:31 +01:00
3b3d80c8ef Cleanup: Replace FOR_ALL_SORTED_RAILTYPES macro with range iterator. 2021-04-28 23:54:31 +01:00
ae7f07de74 Fix: Incorrect vertical alignment of icon and text in DropDownListIconItem. (#9133)
This happens if the bounding dimensions are changed so that each item is the same size, as happens on the railtype/roadtype dropdown lists, as the vertical offset was calculated before this dimension is changed.
2021-04-28 22:32:43 +01:00
Patric Stout
96dc0d04ec Fix b3003dd1: swap SERVER_GAME_INFO with CLIENT_GAME_INFO (#9129)
The idea is that if you query an older server that does not support
this packet yet, the client receives an error. The assumption was
that on every "illegal packet" the connection would be closed. This
turns out to be false.

Now CLIENT_GAME_INFO aligns with the old PACKET_CLIENT_NEWGRFS_CHECKED,
which does a pre-check (which fails), and an error is sent back
and the connection is closed.

This is not a nice solution, but it is the best we got.
2021-04-28 23:09:03 +02:00
Milek7
8e9eca6ddd Codechange: Use __attribute__ access none to silence GCC 11 -Wmaybe-uninitialized warnings (#9124) 2021-04-28 22:06:47 +01:00
translators
267703c14b Update: Translations from eints
spanish (mexican): 40 changes by absay
english (us): 1 change by 2TallTyler
korean: 3 changes by telk5093
german: 1 change by danidoedel
finnish: 1 change by hpiirai
catalan: 1 change by J0anJosep
portuguese: 45 changes by azulcosta
portuguese (brazilian): 44 changes by Vimerum
2021-04-28 17:53:26 +00:00
Milek7
a341852cd5 Fix: missing <limits> include in network/core/packet.h (#9123) 2021-04-27 23:22:03 +01:00
Patric Stout
31f1db2d3a Change: no longer use UDP when entering the lobby of a server
The lobby of a server requested some parts via UDP and some via
TCP. This is strictly seen fine, but for future extensions it
is a lot easier if just one protocol is used.
2021-04-27 20:18:53 +02:00
Patric Stout
b57d845e55 Codechange: refactor CheckGameCompatibility() from existing function
Later commits use this function in other places too.
2021-04-27 20:18:53 +02:00
Patric Stout
b3003dd163 Add: ability to retrieve game info from server over TCP 2021-04-27 20:18:53 +02:00
Patric Stout
84c75a7b9a Codechange: be explicit in pointer comparisons 2021-04-27 20:18:53 +02:00
Patric Stout
cb2ef1ea4b Codechange: move all NetworkGameInfo related functions to a single file
It currently was a bit scattered over the place. Part of
NetworkGameInfo is also the GRF Identifiers that goes with it.
2021-04-27 20:18:53 +02:00
Patric Stout
8fa53f543a Change: [Network] lower TCP connect() timeout to 3s (#9112)
Currently we use default OS timeout for TCP connections, which
is around 30s. 99% of the users will never notice this, but there
are a few cases where this is an issue:

- If you have a broken IPv6 connection, using Content Service is
  first tried over IPv6. Only after 30s it times out and tries
  IPv4. Nobody is waiting for that 30s.
- Upcoming STUN support has several methods of establishing a
  connection between client and server. This requires feedback
  from connect() to know if any method worked (they have to be
  tried one by one). With 30s, this would take a very long time.

What is good to mention, is that there is no good value here. Any
value will have edge-cases where the experience is suboptimal. But
with 3s we support most of the stable connections, and if it fails,
the user can just retry. On the other side of the spectrum, with 30s,
it means the user has no possibility to use the service. So worst case
we annoy a few users with them having the retry vs annoying a few
users which have no means of resolving the situation.
2021-04-27 20:18:43 +02:00
rubidium42
015e3b412e Cleanup: remove #ifdefs for compiling the old content server 2021-04-27 19:58:03 +02:00
translators
b89dba7e4e Update: Translations from eints
japanese: 26 changes by scabtert
catalan: 43 changes by J0anJosep
2021-04-27 17:53:43 +00:00
rubidium42
31c87ba908 Fix: truncating strings in settings could leave invalid Utf8 characters 2021-04-27 19:41:51 +02:00
rubidium42
0e449f20dc Codechange: writing and string validation to its own functions 2021-04-27 19:41:51 +02:00
rubidium42
b54d8a49fb Feature: allow non-ASCII currency separators 2021-04-27 19:41:51 +02:00
rubidium42
4880ec29e4 Change: [Network] Safeguard from using errno/strerror for handling network errors
They are likely not working as expected on Windows, so prevent their usage.
Winsock does not set errno and strerror does not return anything useful for Winsock error numbers.
2021-04-27 18:17:34 +01:00
rubidium42
8c2e3a004e Codechange: [Network] Do not leak os_abstraction.h via base_media_func.h 2021-04-27 18:17:34 +01:00
rubidium42
84985c1223 Codechange: [Network] Do not leak os_abstraction.h via fios.h 2021-04-27 18:17:34 +01:00
rubidium42
cbad518bf3 Codechange: [Network] Do not leak os_abstraction.h via network_func 2021-04-27 18:17:34 +01:00
rubidium42
cf8c1aa860 Change: [Network] Use string error messages instead of numeric error numbers that need to be looked up 2021-04-27 18:17:34 +01:00
rubidium42
65c5a64719 Fix: [Network] errno and strerror do not handle network errors on Windows 2021-04-27 18:17:34 +01:00
Chris
a934dfe0be Fix: [NewGRF] Errors with severity ERROR also display a pop-up window (#9119) 2021-04-27 17:57:53 +01:00
translators
8ea06128be Update: Translations from eints
english (us): 39 changes by 2TallTyler
korean: 44 changes by telk5093
german: 43 changes by danidoedel
russian: 7 changes by Ln-Wolf
finnish: 39 changes by hpiirai
2021-04-26 17:53:20 +00:00
Charles Pigott
43b6f6915b Fix 8a95fee4: Missing initialiser in Packet constructor 2021-04-26 06:45:37 +02:00
rubidium42
5afb090082 Change: [Network] Remove now defunct savegame transfer packet limiter 2021-04-25 21:29:23 +02:00
Rubidium
a3c9eca722 Change: use 32 KiB packets to send requests to the content server 2021-04-25 21:27:54 +02:00
Rubidium
21f58ab437 Change: use 32 KiB packets to transfer the savegame 2021-04-25 21:27:54 +02:00
Rubidium
d6000c2ec5 Codechange: differentiate between UDP, TCP and compatibility MTU values 2021-04-25 21:27:54 +02:00
Rubidium
8b302761d4 Codechange: allow different limits in packet sizes 2021-04-25 21:27:54 +02:00
Charles Pigott
97288bc286 Fix #9109: Malformed STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD in Japanese lang (#9110) 2021-04-25 20:11:59 +01:00
224625942c Fix: Count engine details text in lines rather than pixels. (#9107)
This allows the details panel to scale correctly for different zoom levels.
2021-04-25 19:34:16 +01:00
Tyler Trahan
27031b396f Change: [Actions] Reword bug/crash report instructions (#9104) 2021-04-25 19:27:30 +01:00
translators
b721787c7f Update: Translations from eints
norwegian (bokmal): 4 changes by Anolitt
spanish (mexican): 3 changes by absay
japanese: 60 changes by scabtert, 38 changes by Azusa257
english (us): 3 changes by 2TallTyler
korean: 3 changes by telk5093
russian: 4 changes by Ln-Wolf
finnish: 3 changes by hpiirai
slovak: 20 changes by FuryPapaya
2021-04-25 18:04:52 +00:00
rubidium42
65818db1f4 Fix: [Network] Prevent stalling save game transfer when compression is slow 2021-04-25 19:54:21 +02:00
f158957a4e Fix: Use width of tiny arrow string instead of scaled pixels in ship/aircraft list. (#9102) 2021-04-25 17:51:03 +01:00
2TallTyler
9d6ff1c780 Fix: Missing 'Town names:' colon in map gen GUI 2021-04-25 08:47:50 +02:00
Michael Lutz
f4d5c8d99e Fix: [OpenGL] Main loop expects to start with the video buffer unmapped. (#9100) 2021-04-25 00:43:38 +02:00
fbc232569c Fix #9097: Upper 16 bits of cargo base payment rate were discarded. (#9098)
NewGRF spec says that base payment rate is 32 bits, but it was loaded into a 16 bit variable. This value is loaded into Money variable after inflation is applied.
2021-04-24 22:27:47 +01:00
Patric Stout
fda1a590f6 Change: use icons to indicate you/host in Online Players GUI 2021-04-24 21:43:58 +02:00
Patric Stout
a924b2ff81 Add: move "New Company" inside the Online Players GUI 2021-04-24 21:43:58 +02:00
Patric Stout
c2e116a3d3 Change: track hover position on Online Players GUI
Especially if there are many players online, trying to chat with
the right one can be a visual challenge. This can be solved by
highlighting the row you are on. This visual cue is often enough
for humans to find the right row.
2021-04-24 21:43:58 +02:00
Patric Stout
54f69deb0c Add: ask for confirmation on admin actions in network games 2021-04-24 21:43:58 +02:00
Patric Stout
ff708c2c65 Add: admin menu for companies in multiplayer games
You can now easily do:
- a password reset (unlock)
- remove an empty company (reset company)
2021-04-24 21:43:58 +02:00
Patric Stout
5266359424 Feature: rework in-game Online Players GUI
The GUI now more clearly shows some basic information about the
server you joined, your client name (and the ability to change it),
and what players are in which company.

It also contains useful buttons to press to join companies, chat
with other people, and for admins to kick/ban people.

Additionally, renamed "advertised" to "visibility"; this has to
do with future additions, but also because it is more clear in
wording.
2021-04-24 21:43:58 +02:00
glx22
aca20092aa Fix: [CMake] Check nforenum and grfcodec return value 2021-04-24 21:16:06 +02:00
glx22
e62ecbff16 Fix: [CMake] Incorrect dependency checks for GRF 2021-04-24 21:16:06 +02:00
Rubidium
75386873b7 Codechange: use std::vector instead of a fixed size array for Packets 2021-04-24 20:42:01 +02:00
Rubidium
450178d780 Codechange: add accessor for the packet type to Packet and make the internal state of Packet private 2021-04-24 20:42:01 +02:00
Rubidium
3abefdf561 Codechange: remove public access to the next pointer in Packet 2021-04-24 20:42:01 +02:00
Rubidium
f71fb0f54a Codechange: encapsulate reading the size of a Packet 2021-04-24 20:42:01 +02:00
Rubidium
6f161f6559 Codechange: encapsulate the logic about how many bytes can be sent from a buffer in to a Packet 2021-04-24 20:42:01 +02:00
Rubidium
38d15fc9b7 Codechange: move the logic shrinking of the packets into the Packet itself 2021-04-24 20:42:01 +02:00
Rubidium
d4f027c03b Codechange: encapsulate writing data from Packets into sockets/files/buffers to prevent packet state modifications outside of the Packet 2021-04-24 20:42:01 +02:00
Rubidium
98aa561cf7 Codechange: encapsulate reading data from sockets into Packets to prevent packet state modifications outside of the Packet 2021-04-24 20:42:01 +02:00
Rubidium
a2051bad50 Codechange: move logic whether there is enough space in a packet to write data into the Packet 2021-04-24 20:42:01 +02:00
Rubidium
c545cc9d70 Codechange: move more logic about packet size validity and reading into Packet 2021-04-24 20:42:01 +02:00
translators
470d8b6637 Update: Translations from eints
korean: 2 changes by telk5093
russian: 3 changes by Ln-Wolf
finnish: 1 change by hpiirai
spanish: 1 change by MontyMontana
polish: 1 change by pAter-exe
hindi: 62 changes by ss141309
2021-04-24 17:53:56 +00:00
Leif Linse
3b9b177b36 Update: Developer credits (#9091) 2021-04-24 17:49:37 +01:00
Patric Stout
2e39ac5ba2 Add: [GitHub] use issue templates to make it more clear what we expect from users (#9092) 2021-04-24 17:03:19 +02:00
Loïc Guilloux
888389c28d Codechange: Use std::string in console commands/aliases registration, and std::map instead our sorted linked list (#9057)
* Codechange: Use std::string in console commands and aliases registration

* Codechange: Use std::map to register console commands

* Codechange: Use std::map to register console aliases

* Cleanup: Remove now unused function
2021-04-24 15:19:57 +02:00
Andy
d0e40ab314 Doc: provide a visual representation of the company colour ranges (#8546)
Co-authored-by: rubidium42 <rubidium42@users.noreply.github.com>
2021-04-24 13:19:13 +02:00
rubidium42
2999d301ad Add: [Network] Validate the client name when receiving one from the server
This so names from other clients are known valid in the client as well, instead allowing some compromised/bad server to potentially crash clients upon certain expectations.
2021-04-24 08:02:54 +02:00
rubidium42
e1cebe0ea0 Add: [Network] Validate the client name server side, so no clients with invalid names can actually join 2021-04-24 08:02:54 +02:00
rubidium42
2e0f3799a8 Change: [Network] Prevent invalid client names being sent to the server when changing it using the console/settings 2021-04-24 08:02:54 +02:00
rubidium42
bfb0ab3e2f Feature: [Network] Ensure players fill in a name instead of defaulting to "Player" 2021-04-24 08:02:54 +02:00
rubidium42
5202869f0f Add: String functionality to trim spaces from C-style strings 2021-04-24 08:02:54 +02:00
rubidium42
b14f412117 Codechange: [Network] Introduce function to validate the client name 2021-04-24 08:02:54 +02:00
translators
dc0efd5f2e Update: Translations from eints
spanish (mexican): 1 change by absay
english (us): 1 change by 2TallTyler
2021-04-23 22:11:02 +00:00
frosch
57b4cc64b7 Add: Hindi translation. 2021-04-23 22:57:00 +02:00
frosch
8dda2c2c17 Change: move all 'unstable' language into 'stable'. 2021-04-23 22:57:00 +02:00
translators
c52a1154ed Update: Translations from eints
dutch: 6 changes by Afoklala
2021-04-23 17:55:37 +00:00
a05bc04b63 Feature: Per-group wagon removal flag. 2021-04-22 22:57:00 +02:00
c56fce70b4 Codechange: Replace CMD_SET_GROUP_REPLACE_PROTECTION with generic CMD_SET_GROUP_FLAG. 2021-04-22 22:57:00 +02:00
27a956ba62 Codechange: Replace Group::replace_protection with Group::flags 2021-04-22 22:57:00 +02:00
frosch
37222c3fa2 Change: treat languages as finished, if translations are 75% completed.
Unfinished translations are not auto-picked from the locale.
In release builds, unfinished translations are not offered in the GUI.
Unfinished translations are available in non-release builds, or by editing openttd.cfg.
2021-04-22 22:16:56 +02:00
frosch
a9740cef82 Add: show completion progress of languages in the language dropdown for non-release builds. 2021-04-22 22:16:56 +02:00
Michael Lutz
d1dd997f07 Change: [Win32] Limit the OpenGL video driver to OpenGL 3.2 or newer on Windows. 2021-04-22 21:04:04 +02:00
Michael Lutz
ef80baf75c Codechange: [Win32] Try getting an OpenGL 4.5 context first before aiming at 3.2. 2021-04-22 21:04:04 +02:00
9fa38f5d0f Codechange: Scale rating minigraphs on station window list. (#9075)
Minigraphs did not adjust size to accomodate large text, either by font size or font zoom, leading to cropped labels.
Minigraphs and spacing are now scaled by font zoom, as this seems to behave better than gui zoom in this instance.
2021-04-22 16:42:40 +01:00
994ffaa382 Codechange: Use alignment feature in company finances window. 2021-04-22 16:42:04 +01:00
c361246bec Codechange: Replace face window custom drawing with new widget features. 2021-04-22 16:42:04 +01:00
9aa64b7885 Codechange: Use new widget features on chat message box. 2021-04-22 16:42:04 +01:00
51b4bd6c38 Codechange: Add widget text colour override property. 2021-04-22 16:42:04 +01:00
636e37d183 Codechange: Add internal widget alignment property, along with widget part. 2021-04-22 16:42:04 +01:00
2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
2021-04-21 23:12:10 +02:00
Patric Stout
96b78bc2cd Doc: indicate the most common options for CMake 2021-04-21 22:48:11 +02:00
Patric Stout
69355293aa Doc: split up which libraries are used for which situation 2021-04-21 22:48:11 +02:00
Patric Stout
e3150d0a85 Doc: fix OpenGFX / OpenSFX / OpenMSX links in README 2021-04-21 22:48:11 +02:00
Patric Stout
91644df491 Doc: update the supported platforms to match current master 2021-04-21 22:48:11 +02:00
Michael Lutz
e53313391a Fix: [OpenGL] Check maximum supported texture size against screen resolution. 2021-04-21 22:44:59 +02:00
5ff15443e9 Cleanup: Replace single-use Pair struct with std::pair.
This struct is defined in geometry_type but not used by any geometry-related
code, only for subsidy code where both parameters are cast from int to
NewsReferenceType.
2021-04-21 21:39:00 +02:00
Rubidium
bf4fe19a66 Codechange: merge duplicated logic to scroll in lists by key into a single function 2021-04-21 21:12:08 +02:00
translators
b3495f1a13 Update: Translations from eints
spanish (mexican): 2 changes by absay
2021-04-21 17:51:39 +00:00
Loïc Guilloux
d4f0b6f434 Fix: [CMake] Auto-fill version details in rev.cpp and ottres.rc (#9066) 2021-04-20 21:38:46 +02:00
translators
fe3cd185d7 Update: Translations from eints 2021-04-20 17:50:52 +00:00
Loïc Guilloux
8395c6532e Fix 799eb31: [CMake] Don't include regression AIs in bundles (#9068) 2021-04-20 18:46:15 +02:00
Patric Stout
ce6a744278 Doc: server name doesn't need to be advertised to be valid
Strictly seen the comment is true, as it says 'e.g.', but it is
misleading. The server name is just that: the name of the server
as configured. No need to mention advertising.
2021-04-20 17:34:04 +02:00
Patric Stout
cd757d53ca Codechange: remove always-empty "address" from NetworkContentSocketHandler
When ever you saw this debug lines (which you never should), they
showed an empty address. It is also not very useful to have, as it
always points to a known server anyway.
2021-04-20 17:34:04 +02:00
Patric Stout
31897eaa7d Codechange: split ParseConnectionString into two functions
One also looks for a company, the other doesn't. There were more
uses of the latter than the first, leaving very weird code all
over the place.
2021-04-20 17:34:04 +02:00
Patric Stout
05612d60ae Remove: "language" field from server/client
The original idea was that people could find a server they could
talk in their native language on. This isn't really used in that
way. There are several reasons for removing this:

- the client also sends his "language" to the server, but nothing
  is doing anything with this.
- flags are a bad way to represent languages, and over the years
  we had several (rightfully) complaints about this.
- most servers have their language set to "All", and prefix the
  servername with the language it is about. This is a much more
  efficient way to do the same.

All in all, this feature should go back to the drawing board.
Maybe it could work in another form, but this form is not it.
2021-04-20 17:24:38 +02:00
Patric Stout
f4bd3fff5e Remove: "map_name" from server announcements / listing
The idea back in the days was nice, but it never resulted in
anything useful. Most servers either read "(loaded game)" or
"Random Map", neither being useful. It was meant for heightmaps,
so you could find a server that was using a specific one .. but
there are many things wrong with that idea. Mostly, servers tend
to save and load savegames from time to time, after which the
original heightmap used was lost.

All in all, removing map_name all together is just better.
2021-04-20 17:24:38 +02:00
translators
17d00537a1 Update: Translations from eints
chinese (simplified): 52 changes by clzls
2021-04-19 17:50:20 +00:00
translators
f757d07bb3 Update: Translations from eints
swedish: 3 changes by DonaldDuck313
spanish: 39 changes by MontyMontana
2021-04-18 17:49:06 +00:00
dP
7c7c6cde03 Fix: Do not unlock railtypes when enabling wagons with GameScript 2021-04-17 22:26:11 +02:00
Rubidium
e5fedcd6da Fix #6322: [Script] Try to let the script die when no memory can be allocated instead of crashing the whole game 2021-04-17 22:24:52 +02:00
Rubidium
4400bbfa96 Change: [Script] Let Script_FatalError use std::string instead of const char * 2021-04-17 22:24:52 +02:00
3248a6c12b Fix #9042: Make multiplayer server list height auto-fill window.
#9042 did not fix all combinations of scaling options. This additional
change makes the server list automatically fill available height.
2021-04-17 22:23:43 +02:00
195cf31cb9 Fix: Inconsistent button sizing on AI/GS setting window depending on scale settings. (#9044) 2021-04-17 19:20:22 +01:00
Milek7
aade177d79 Fix: Corrupted savegame could cause heap corruption by writing outside link graph edge matrix. (#9046) 2021-04-17 19:19:37 +01:00
Milek7
da55286c2c Fix: Corrupted savegame could crash the game by providing invalid gamelog enums. (#9045) 2021-04-17 19:19:18 +01:00
8e539ce293 Change: Improve layout and spacing of vehicle group widgets. (#9041)
Existing layout included a blank widget above the group list to align with the vehicle list, however since then an additional sort-by row was added.
Group list size tweaks to match normal row size (at least with normal gui and text size.)
Removed reduction of 2 rows in the group list <- main culprit of odd sizing.
Removed fill attribute on buttons which gave strange sizes, and put it on the group info widget instead.
Tweaked various soft-padding values to line up (centreing text with a 1px offset does not make centred text.)
2021-04-17 19:19:06 +01:00
Rubidium
44d1b964bf Fix #7513: recursive array/class/table release caused stack overflow 2021-04-17 19:18:51 +01:00
Rubidium
47a99bb676 Fix #7513: recursive garbage collection caused stack overflow 2021-04-17 19:18:51 +01:00
translators
6c49ae9cd7 Update: Translations from eints
chinese (simplified): 3 changes by clzls
spanish: 1 change by MontyMontana
polish: 6 changes by Milek7
2021-04-17 17:50:40 +00:00
cb9f56df0c Feature: Show previous chat history when the chat message box is open 2021-04-16 20:25:46 +02:00
fbef63822c Codechange: Use std::deque for chat history instead of fixed array 2021-04-16 20:25:46 +02:00
837994034d Fix: Sizing of Multiplayer server list incorrect when GUI zoom doesn't match Font zoom.
The server information panel was scaled by GUI scale, which could result in a panel that is longer than the server list. This height difference is then maintained when the window is resized to fill the screen.
Instead, specify the minimum size by number of text lines and (summed total) padding.
2021-04-16 20:24:08 +02:00
translators
a4db7c844d Update: Translations from eints
korean: 6 changes by telk5093
portuguese (brazilian): 2 changes by Greavez
2021-04-16 17:52:24 +00:00
translators
010d977b16 Update: Translations from eints
hungarian: 5 changes by nemesbala
catalan: 2 changes by J0anJosep
tamil: 3 changes by Saran-S-Menon
2021-04-15 17:52:17 +00:00
translators
3e0a16c027 Update: Translations from eints
romanian: 57 changes by kneekoo
russian: 3 changes by Ln-Wolf
spanish: 3 changes by MontyMontana
portuguese: 7 changes by azulcosta
2021-04-14 17:49:26 +00:00
Milek7
4cd9e0f41b Fix: Add virtual destructor to link graph Path.
Classes derived from Path were freed through base class pointer, but no virtual destructor was present.
2021-04-13 20:48:49 +02:00
Michael Lutz
433602b072 Fix #9028: [OpenGL] Clear cursor cache on destroying the OpenGL backend. 2021-04-12 22:40:40 +02:00
Rubidium
468b1c6c5d Fix: [win32] buffer_locked state not initialised, causing _screen.dst_ptr to be potentially not set 2021-04-12 21:14:01 +02:00
Rubidium
8562395413 Fix: [Video] fast forward boolean states not initialised, potentially causing unstoppable fast forward 2021-04-12 21:14:01 +02:00
Rubidium
64e8305874 Fix: [SDL] buffer_locked state not initialised, causing _screen.dst_ptr to be potentially not set 2021-04-12 21:14:01 +02:00
Rubidium
4fb1e34b1e Change: add some hints about the getaddrinfo warning to the troubleshooting part of the documentation 2021-04-12 21:10:21 +02:00
Rubidium
d2fe8c2842 Change: warn the user about the resolving of an address being extra very slow 2021-04-12 21:10:21 +02:00
Rubidium
7597740bff Fix: split the UDP blocking of sockets to only the socket involved, and when another thread is busy do not attempt to process the packets of that socket 2021-04-12 21:10:21 +02:00
Rubidium
ca6b9ad8b0 Change: move some things only relevant to UDP from network.cpp to network_udp.cpp 2021-04-12 21:10:21 +02:00
rubidium42
c4bccd4f70 Fix #8874: show a warning when a NewGRF scan is requested multiple times from the console (#9022) 2021-04-12 20:53:04 +02:00
translators
e722ea89f0 Update: Translations from eints
norwegian (bokmal): 2 changes by Anolitt
english (us): 2 changes by 2TallTyler
korean: 3 changes by telk5093
german: 2 changes by danidoedel
romanian: 35 changes by kneekoo
finnish: 2 changes by hpiirai
spanish: 4 changes by MontyMontana
french: 3 changes by glx22
portuguese: 4 changes by azulcosta
2021-04-12 17:51:14 +00:00
translators
e5b960eaeb Update: Translations from eints
korean: 23 changes by telk5093
romanian: 1 change by kneekoo
russian: 1 change by Ln-Wolf
french: 1 change by glx22
2021-04-11 17:50:00 +00:00
Wim Leflere
9aebfca083 Fix: clang-cl build (#9018)
Remove macro redefinitions
Add final and fallthrough attributes for clang-cl
2021-04-11 14:15:37 +01:00
31c5b8fe0f Fix: Invalidate cached vehicle colourmaps when changing liveries setting. (#9006) 2021-04-11 14:30:13 +02:00
Michael Lutz
5644c00482 Fix: Check for a validly mapped OpenGL screen buffer during driver init. (#9007) 2021-04-11 14:28:29 +02:00
Patric Stout
d50b934bb4 Change: reworked how the Game Option display options are drawn
"Hardware acceleration" was not aligned with its checkbox. So instead
of drawing the labels left and the options right, now draw settings
one by one with a spacer between label and option to get the right
spacing.

Also, use SetPIP instead of repeating a SetPadding for all but
last element.
2021-04-11 14:26:00 +02:00
Patric Stout
f0f2073006 Feature: allow a toggle to enable/disable vsync
Vsync should be off by default, as for most players it will be
better to play without vsync. Exception exist, mainly people who
play in fullscreen mode.
2021-04-11 14:26:00 +02:00
56f982fa7f Fix #9015: Don't set free space value if not requested. (#9016) 2021-04-11 13:07:08 +01:00
rubidium42
df045b92ea Fix #9008: Validate starting year given on the command line. (#9014)
An invalid starting year causes all sorts of weird behaviour and crashes in map generation.

Now just set the appropriate setting via IConsoleSetSetting so the validation
and, if needed, clamping is performed on the starting year value.
2021-04-11 13:52:55 +02:00
TELK
fdc8230dfa Cleanup: Fix comment for only one form (#9012) 2021-04-11 11:48:51 +01:00
f9460c0c8b Fix #8981: Don't attempt to re-reserve path if already entering/entered depot. 2021-04-11 00:11:41 +02:00
59b6e46bce Fix: Adjust scrolling interval of credits to account for text line height 2021-04-10 22:36:30 +02:00
Jonathan G Rennison
39b7ef31f8 Fix: Data races on cursor state in OpenGL backends 2021-04-10 18:31:42 +02:00
Jonathan G Rennison
fbd0a2e65a Fix: Thread unsafe use of sprite cache in OpenGLBackend::DrawMouseCursor
See also: #8870
See also: #8977
2021-04-10 18:31:42 +02:00
frosch
c6781cbd44 Fix d4c3d01d: add plural form 14 to strgen. (#8999) 2021-04-10 18:09:04 +02:00
translators
0e01a7a431 Update: Translations from eints 2021-04-10 15:48:34 +00:00
Nicolae Crefelean
d4c3d01d07 Add: new plural form for Romanian translation (#8936) 2021-04-10 17:33:27 +02:00
translators
5a14bf3a6c Update: Translations from eints
korean: 1 change by telk5093
spanish: 1 change by MontyMontana
2021-04-10 15:24:45 +00:00
Charles Pigott
c506263197 Fix #8956: Industry disaster news messages showed the wrong location (#8992) 2021-04-10 13:44:17 +01:00
Didac Perez Parera
47c0403320 Change: do not disable NewGRF window apply button if dev tools are enabled (#8975)
enabled
2021-04-10 12:55:49 +02:00
Patric Stout
8a944c88c9 Change: [DorpsGek] also announce Discussion creation/comments from GitHub (#8991) 2021-04-10 11:47:17 +02:00
Niels Martin Hansen
c800dcaff8 Fix: [Win32] Font glyphs of certain widths broke
Font glyphs between 33 and 39 pixels wide, in the Win32 font system, used wrong alignment and caused glyphs to appear broken.
When in the 33 to 39 pixel range, glyphs without AA were rounded down to 32 pixel pitch, instead of up to 64 pixel pitch.
2021-04-10 11:39:28 +02:00
Didac Perez Parera
0cb99c5523 Codechange: nullptr deletion in DeleteWindowById (#8941) 2021-04-10 10:19:14 +01:00
Loïc Guilloux
c64b0946e8 Fix e0561dbde: [MinGW] use ofstring(wchar_t*) as ofstring(wstring) doesn't exist (#8985) 2021-04-10 10:15:47 +01:00
Patric Stout
ff6924f122 Fix 70bc55cfd6: snow line height was set while calculating desert line (#8989)
Seems I liked copy/pasting just a tiny bit too much.
2021-04-10 10:14:55 +01:00
translators
e98aed8b48 Update: Translations from eints
swedish: 3 changes by DonaldDuck313
korean: 2 changes by telk5093
portuguese (brazilian): 4 changes by brunodelara-cloudcrm
2021-04-09 17:46:40 +00:00
Michael Lutz
96d33ab46a Fix #8930: [Win32] Don't handle printable keys on keydown if an edit box is in focus.
Handle printable input only when the matching WM_CHAR message is incoming.
Without an edit box, do the handling in keydown as usual to support hotkeys.
2021-04-09 12:24:27 +02:00
Niels Martin Hansen
785e42a6f9 Feature: Volume sliders in Game Options window 2021-04-09 12:18:52 +02:00
Niels Martin Hansen
88c92f7b7c Codechange: Move volume control slider logic to separate functions 2021-04-09 12:18:52 +02:00
Niels Martin Hansen
64c9af0991 Add: NWidgetBase::GetCurrentRect function 2021-04-09 12:18:52 +02:00
Niels Martin Hansen
49d370185b Change: Default music and sound effects volume to be lower 2021-04-09 12:18:52 +02:00
Wim Leflere
5233fd2751 Change: [win32] Use user UI language for initial language selection (#8973) (#8974) 2021-04-09 11:22:03 +02:00
translators
2b86d42ddc Update: Translations from eints
english (us): 3 changes by 2TallTyler
korean: 3 changes by telk5093
russian: 32 changes by Ln-Wolf
spanish: 1 change by JohnBoyFan
french: 4 changes by arikover
portuguese: 10 changes by azulcosta
2021-04-08 17:53:09 +00:00
Jonathan G Rennison
3ede756d23 Fix: Viewport drag tooltips not being removed when dragging over other windows 2021-04-08 19:34:45 +02:00
Jonathan G Rennison
ae94b2d296 Fix: Viewport drag tooltip flickering when dragging outside window 2021-04-08 19:34:45 +02:00
translators
1529403584 Update: Translations from eints
norwegian (bokmal): 3 changes by Anolitt
spanish (mexican): 3 changes by absay
vietnamese: 3 changes by KhoiCanDev
german: 3 changes by danidoedel
finnish: 3 changes by hpiirai
catalan: 3 changes by J0anJosep
spanish: 3 changes by JohnBoyFan
2021-04-07 17:53:18 +00:00
Loïc Guilloux
f306d65ea3 Fix: [CMake] Use the right run-time library depending on vcpkg triplet (#8964) 2021-04-07 12:43:17 +02:00
Ghislain Antony Vaillant
e7cf589868 Fix: Honor default soundfont for FluidSynth
Debian now provides a default soundfont for FluidSynth via its alternatives system.

In short, FluidSynth is configured to look for `/usr/share/sounds/sf3/default-GM.sf3` as its default soundfont, and each soundfront package (FluidR3, OPL-3, MuseScore...) may provide or override this symlink. By default, FluidSynth is installed on Debian with the `TimGM6mb` soundfont by default due to its limited size.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929185 for further details.
2021-04-07 12:30:04 +02:00
Ghislain Antony Vaillant
9725bd8dd0 Fix: Use FluidSynth default soundfont 2021-04-07 12:29:21 +02:00
Niels Martin Hansen
746f1ca11a Codechange: Remove the now meaningless console_cp parameter from OTTD2FS 2021-04-07 09:31:47 +02:00
Niels Martin Hansen
e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 2021-04-07 09:31:47 +02:00
Jonathan G Rennison
825867f2c5 Fix: [Network] State conditions for sending client info/quit packets (#8959)
Use status >= STATUS_AUTHORIZED as the state criteria for all cases
where updates about other clients are sent.
This avoids the case where a client is informed that another client
has joined but not informed when it later quits, resulting in
stale entries in the client list window.
2021-04-06 19:31:52 +01:00
920bf703cd Fix: Allow full sample range for 16-bit audio.
Clamping each sample value to half the available range could cause
unnecessary premature clipping with lots of sounds playing. This change
does not affect the actual volume level.
2021-04-06 19:31:14 +01:00
42fbdda9ab Change: Apply power-of-3 scaling to master effect volume to improve perceived loudness change. 2021-04-06 19:31:14 +01:00
Bernard Teo
f0a24e98f5 Fix #8922: Show vehicle window for single vehicle in shared order grouping (#8926) 2021-04-06 19:30:35 +01:00
translators
2f5035d6dc Update: Translations from eints
korean: 1 change by telk5093
2021-04-06 17:53:34 +00:00
Loïc Guilloux
39b4a8e67e Change: [CMake] Improve 'In-source build' error message (#8955) 2021-04-06 13:54:27 +02:00
Didac Perez Parera
ca783d447a Feature: Button to reset game settings to their default values (#8958) 2021-04-06 12:47:44 +02:00
Didac Perez Parera
43c465e8f4 Change: Disable NewGRF window apply button if no change was made (#8934) 2021-04-05 22:24:03 +02:00
130a052ed5 Fix: Apply master effect volume during mixing instead of sound start. (#8945)
This makes the volume control work as most players would expect, affecting
existing playing sounds as well as new sounds.
2021-04-05 12:18:59 +02:00
Michael Lutz
1cd3a3b070 Fix #8935: [OSX] Crash when clicking 'Save' due to wrongly-threaded OS call. (#8944) 2021-04-05 12:18:45 +02:00
translators
295d542911 Update: Translations from eints
spanish (mexican): 1 change by absay
vietnamese: 1 change by KhoiCanDev
estonian: 1 change by siimsoni
romanian: 3 changes by kneekoo
catalan: 1 change by perezdidac
portuguese: 1 change by azulcosta
2021-04-04 17:52:55 +00:00
Charles Pigott
e8a94dc8bb Cleanup: Delete remaining Blob code 2021-04-04 08:01:54 +01:00
Charles Pigott
e8022a589d Codechange: Replace CBlobT usage with std::vector 2021-04-04 08:01:54 +01:00
Charles Pigott
f481c9fc2c Codechange: Replace CStrA with std::string 2021-04-04 08:01:54 +01:00
Milek7
33c5f984f5 Codechange: Use COINIT_MULTITHREADED in CoInitializeEx (#8938) 2021-04-04 07:40:56 +01:00
translators
5b1ea0ee38 Update: Translations from eints
swedish: 1 change by DonaldDuck313
norwegian (bokmal): 1 change by Anolitt
english (us): 1 change by 2TallTyler
chinese (simplified): 8 changes by RichardYan314
german: 1 change by danidoedel
romanian: 115 changes by kneekoo
finnish: 1 change by hpiirai
spanish: 2 changes by MontyMontana
polish: 3 changes by yazalo
2021-04-03 17:52:59 +00:00
translators
ec0c159586 Update: Translations from eints
korean: 1 change by telk5093
indonesian: 25 changes by dimaspaf14
romanian: 23 changes by kneekoo
2021-04-02 17:53:17 +00:00
Loïc Guilloux
799eb31ff1 Change: [CMake] Copy AI/GS compatibility files to build dir (#8906) 2021-04-02 10:15:45 +02:00
Didac Perez Parera
e760c9fbec Fix: adjust object and rail station selection window padding to be consistent (#8929)
consistent
2021-04-02 10:15:26 +02:00
Jonathan G Rennison
83ac5aa27a Fix: Memory leak of airport tile layout in AirportChangeInfo (prop 0A) (#8928) 2021-04-02 10:13:53 +02:00
Tyler Trahan
adb9fa3b36 Feature: Press ctrl to build diagonal rivers in Scenario Editor (#8880) 2021-04-02 10:13:27 +02:00
stormcone
bde5396d11 Add: Hotkey to focus the build object class name filter editbox. 2021-04-02 10:12:47 +02:00
stormcone
c56e9a546d Add: Hotkey to focus the rail station class name filter editbox. 2021-04-02 10:12:47 +02:00
milek7
295f34a9df Fix: Freeing LanguagePack with wrong size. 2021-04-02 10:12:25 +02:00
Charles Pigott
dd798d688b Fix #8919: Release builds with asserts enabled (#8925) 2021-04-01 23:57:49 +01:00
Charles Pigott
2a9825b8de Add: [Actions] Debian Bullseye release build (#8921) 2021-04-01 20:45:13 +01:00
translators
c5cb44e138 Update: Translations from eints
catalan: 1 change by J0anJosep
spanish: 3 changes by MontyMontana
2021-04-01 17:53:24 +00:00
Patric Stout
4d501655ad Fix: building on Raspberry Pi failed because of const vs constexpr (#8924) 2021-04-01 19:39:55 +02:00
Patric Stout
501087058e Fix: [CMake] if the regex for STABLETAG is empty, it means it is stable
This feels a bit inside out, but it makes sense: if there are no
"beta1" or "RC1" mentions, it means it is a stable release.
2021-04-01 13:26:34 +02:00
Patric Stout
9639e77297 Fix: [Actions] "is-tag" variable is the 5th element, not 6th
The 6th is "is-stable-tag", but it is currently broken in meaning.
Betas and RCs are considered "stable", but final releases are not.
This is the reason it was working for RC1, but not for the final
release.
2021-04-01 13:26:34 +02:00
Patric Stout
fece1c57ca Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
translators
9eb6c78a02 Update: Translations from eints
catalan: 2 changes by J0anJosep
2021-04-01 08:13:26 +00:00
Charles Pigott
591ea9862d Codechange: Suppress warnings when asserts are disabled (#8916) 2021-04-01 10:03:12 +02:00
translators
088964a091 Update: Translations from eints
luxembourgish: 1 change by phreeze83
serbian: 59 changes by nkrs
2021-03-31 17:53:48 +00:00
Charles Pigott
086c95718d Fix #8803: Only auto-remove signals when rail can be built (#8904) 2021-03-31 09:27:25 +01:00
translators
50cd6e135e Update: Translations from eints
english (us): 23 changes by 2TallTyler
luxembourgish: 63 changes by phreeze83
ukrainian: 72 changes by StepanIvasyn
catalan: 5 changes by J0anJosep
turkish: 5 changes by nullaf
2021-03-30 17:53:18 +00:00
Mike
49c89cb5f6 Fix #8565: Stopped road vehicle displays a speed different than 0 (#8901) 2021-03-30 19:42:12 +02:00
translators
e23ccc95f5 Update: Translations from eints
english (us): 7 changes by HAJDog247
czech: 18 changes by PatrikSamuelTauchim
luxembourgish: 99 changes by phreeze83
serbian: 4 changes by nkrs
catalan: 20 changes by J0anJosep
french: 1 change by arikover
portuguese: 30 changes by azulcosta
2021-03-29 17:52:55 +00:00
translators
a1230b932c Update: Translations from eints
swedish: 30 changes by kustridaren
spanish (mexican): 1 change by absay
japanese: 13 changes by Azusa257
vietnamese: 1 change by KhoiCanDev
estonian: 12 changes by siimsoni
czech: 6 changes by PatrikSamuelTauchim, 2 changes by tomas-vl
chinese (simplified): 88 changes by clzls
arabic (egypt): 16 changes by AviationGamerX
luxembourgish: 4 changes by phreeze83
korean: 34 changes by telk5093
italian: 16 changes by AlphaJack
german: 1 change by danidoedel, 1 change by Wuzzy2
slovak: 30 changes by FuryPapaya
catalan: 35 changes by J0anJosep
tamil: 16 changes by Aswn
dutch: 32 changes by Afoklala
portuguese (brazilian): 14 changes by Greavez, 5 changes by jpsl00
2021-03-28 17:53:11 +00:00
Charles Pigott
2d7b34bc68 Fix #8886: Don't try to resolve folders within tars named '.' 2021-03-28 09:52:15 +01:00
translators
a36b286e04 Update: Translations from eints
norwegian (bokmal): 28 changes by Anolitt
spanish (mexican): 29 changes by absay
galician: 1 change by JohnBoyFan
vietnamese: 30 changes by KhoiCanDev
estonian: 31 changes by siimsoni
czech: 6 changes by tomas-vl
arabic (egypt): 73 changes by AviationGamerX
hungarian: 37 changes by pnpBrumi
german: 24 changes by danidoedel, 4 changes by matthiasradde, 2 changes by SecretIdetity
russian: 2 changes by SecretIdetity
finnish: 40 changes by lanurmi
catalan: 47 changes by J0anJosep
lithuanian: 30 changes by devbotas
spanish: 29 changes by JohnBoyFan
french: 30 changes by MalaGaM
portuguese (brazilian): 7 changes by jpsl00, 5 changes by Greavez
polish: 31 changes by Milek7
2021-03-27 18:46:44 +00:00
translators
76e92f6751 Update: Translations from eints 2021-03-26 18:46:58 +00:00
Patric Stout
d0ed656fd1 Change: scale heightmaps we export to highest peak and inform the user of this value
Before this commit, it scaled to map-height-limit. Recently this
could also be set to "auto", meaning players don't really know
or care about this value.

This also means that if a player exported a heightmap and wanted
to import it again, looking like the exact same map, he did not
know what value for "highest peak" to use.
2021-03-26 12:22:32 +01:00
Patric Stout
13a5264438 Fix: store the recent new game_creation settings in savegames
This allows us to later on see what someone did, and makes sure
that "restart" command still knows how the game was created.
2021-03-26 12:22:32 +01:00
Patric Stout
f05e2e0d40 Feature: allow setting a custom terrain type to define highest peak
At least, TGP will try to reach it. It heavily depends on the map
if it is reachable at all. But for sure it will do its atmost to
get there!
2021-03-26 12:22:32 +01:00
Patric Stout
45c2c29c35 Add: allow setting the highest mountain for heightmaps
It will add some slack to the map height limit if that was set
to auto.
2021-03-26 12:22:32 +01:00
Patric Stout
422e132845 Feature: auto-detect map height limit based on generated map
This opens up the true power of the TGP terrain generator, as it
is no longer constrainted by an arbitrary low map height limit,
especially for extreme terrain types.

In other words: on a 1kx1k map with "Alpinist" terrain type, the
map is now really hilly with default settings.

People can still manually limit the map height if they so wish,
and after the terrain generation the limit is stored in the
savegame as if the user set it.

Cheats still allow you to change this value.
2021-03-26 12:22:32 +01:00
Patric Stout
1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
2021-03-26 12:22:32 +01:00
Patric Stout
23f27db8c3 Change: remove "maximum map height" from the New Game GUI
This setting influence the max heightlevel, and not as the name
suggests: the height of the generated map.

How ever you slice it, it is a very weird place to add this
setting, and it is better off being only in the settings menu.

Commits following this commit also make it more useful, so users
no longer have to care about it.
2021-03-26 12:22:32 +01:00
Patric Stout
70bc55cfd6 Feature: setting to indicate desert coverage for tropic climate
This is an indication value; the game tries to get as close as it
can, but due to the complex tropic rules, that is unlikely to be
exact.

In the end, it picks a height-level to base the desert/tropic
line on. This is strictly seen not needed, as we can convert any
tile to either. But it is the simplest way to get started with
this without redoing all related functions.
2021-03-26 12:22:32 +01:00
Patric Stout
cafe4eed6e Feature: setting to indicate snow coverage for arctic climate (replaces snow line height)
Setting the snow coverage (in % of the map) makes a lot more sense
to the human, while still allowing the niche player to set (by
finding the correct %) a snow line height they like. This makes for
easier defaults, as it decoupled terrain height from amount of snow.

Maps can never be 100% snow, as we do not have sprites for coastal
tiles.

Internally, this calculates the best snow line height to approach
this coverage as close as possible.
2021-03-26 12:22:32 +01:00
Milek7
7a886cb4d4 Change: Do not disallow persistent buffer mapping on AMD GPUs, as it is actually faster. 2021-03-25 19:37:24 +00:00
translators
bcaa367b68 Update: Translations from eints
chinese (traditional): 25 changes by SiderealArt
japanese: 81 changes by taku315
2021-03-25 18:47:34 +00:00
Koen Bussemaker
59bfed65a1 Fix #8875: Filter string in station window breaks flow in user interface 2021-03-25 16:19:18 +00:00
Patric Stout
751434ea63 Fix: placing random trees in SE crashes the game (#8892)
This used to work by accident: originally the code checked if
GenerateWorld was threaded. If not, it would abort the function.
This worked for placing trees, because it was also returning false
when it was not active.

With the recent changes, that check got removed, and this crash
started to happen. So now check if we have a modal window, which
is a very solid indication we are generating the world.
2021-03-25 11:57:28 +01:00
translators
0c4443667d Update: Translations from eints
slovak: 6 changes by FuryPapaya
2021-03-24 18:40:00 +00:00
translators
3b3412d561 Update: Translations from eints
arabic (egypt): 22 changes by AviationGamerX
2021-03-23 18:08:07 +00:00
translators
f9d24ff45e Update: Translations from eints
slovak: 10 changes by FuryPapaya
2021-03-22 18:54:16 +00:00
translators
ae65ceb1a7 Update: Translations from eints
chinese (simplified): 2 changes by clzls
korean: 2 changes by telk5093
slovak: 9 changes by FuryPapaya
catalan: 4 changes by J0anJosep
polish: 4 changes by pAter-exe
2021-03-22 18:07:50 +00:00
Michael Lutz
df958dc907 Fix f0f96e31: [OpenGL] Broken window resizing due to invalid buffer pitch on texture creation. 2021-03-21 22:26:55 +01:00
translators
545ca3d014 Update: Translations from eints
vietnamese: 118 changes by KhoiCanDev
slovak: 13 changes by FuryPapaya
2021-03-21 18:10:20 +00:00
frosch
0230624359 Fix f0f96e31: [OpenGL] warning: comparison of integer expressions of different signedness. (#8881) 2021-03-21 18:38:51 +01:00
Michael Lutz
f0f96e3103 Fix #8871: [OpenGL] Initialize all buffers after resize and clear back buffer. (#8877) 2021-03-20 19:43:54 +01:00
translators
c92358527b Update: Translations from eints
ukrainian: 1 change by StepanIvasyn
2021-03-20 18:06:09 +00:00
dP
d8dfa1613f Fix: Recompute road/railtype availability after disabling the engine 2021-03-20 17:55:23 +00:00
b43cc21214 Fix: OSK layout not scaled for 2x or 4x GUI scale. 2021-03-20 17:55:17 +00:00
translators
1893aef649 Update: Translations from eints
spanish (mexican): 8 changes by absay
ukrainian: 13 changes by StepanIvasyn
dutch: 3 changes by Afoklala
lithuanian: 1 change by devbotas
2021-03-19 18:06:01 +00:00
translators
379b6b45e0 Update: Translations from eints
ukrainian: 10 changes by StepanIvasyn
portuguese: 78 changes by azulcosta
2021-03-18 19:03:56 +00:00
translators
8ad75e4798 Update: Translations from eints
swedish: 1 change by kustridaren
estonian: 1 change by siimsoni
russian: 5 changes by Ln-Wolf, 3 changes by SecretIdetity
ukrainian: 7 changes by StepanIvasyn
lithuanian: 31 changes by devbotas
portuguese: 54 changes by azulcosta
2021-03-17 19:03:35 +00:00
translators
8b16cbaf6f Update: Translations from eints
estonian: 2 changes by siimsoni
2021-03-16 19:14:32 +00:00
translators
9782268e17 Update: Translations from eints
swedish: 10 changes by kustridaren
norwegian (bokmal): 3 changes by buzzCraft
czech: 39 changes by PatrikSamuelTauchim
ukrainian: 4 changes by StepanIvasyn
2021-03-16 19:02:11 +00:00
translators
5c73f93361 Update: Translations from eints
english (us): 8 changes by 2TallTyler
estonian: 16 changes by siimsoni
korean: 5 changes by telk5093
italian: 32 changes by AlphaJack
german: 5 changes by Wuzzy2
danish: 15 changes by achton
lithuanian: 89 changes by devbotas
spanish: 3 changes by MontyMontana
french: 8 changes by arikover
portuguese (brazilian): 3 changes by Greavez
polish: 17 changes by yazalo, 2 changes by pAter-exe
2021-03-15 18:07:52 +00:00
Patric Stout
9bfa7198fd Change: Heading for 1.12 now (#8862) 2021-03-14 20:47:31 +01:00
914 changed files with 89065 additions and 44553 deletions

View File

@@ -10,6 +10,7 @@ notifications:
only-by:
- DorpsGek
commit-comment:
discussion:
pull-request:
issue:
tag-created:

View File

@@ -1,7 +0,0 @@
## Version of OpenTTD
## Expected result
## Actual result
## Steps to reproduce

41
.github/ISSUE_TEMPLATE/bug.yaml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Bug Report
description: Found a bug in OpenTTD?
title: "[Bug]: "
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: version
attributes:
label: Version of OpenTTD
description: Fill in below what version of OpenTTD you are using, including your OS.
placeholder: ex. 1.11.2, Windows 10
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected result
description: Describe in a few words what you expected to happen.
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual result
description: Describe in a few words what actually happens.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: As detailed as possible, please tell us how we can reproduce this. Feel free to attach a savegame (zip it first) to make it more clear.
placeholder: |
1. Loaded the attached savegame.
2. Click on the button left of that other icon.
3. The window doesn't open.
validations:
required: true

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Suggestions and ideas?
url: https://www.tt-forums.net/viewforum.php?f=32
about: Have a suggestion or an idea for a cool new feature? Post them on our forum!

37
.github/ISSUE_TEMPLATE/crash.yaml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Crash
description: Did OpenTTD crash?
title: "[Crash]: "
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this crash report!
- type: input
id: version
attributes:
label: Version of OpenTTD
description: Fill in below what version of OpenTTD you are using, including your OS.
placeholder: ex. 1.11.2, Windows 10
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Please spend a few words if you can reproduce this problem.
placeholder: |
1. Bought a new train.
2. The game crashed.
validations:
required: true
- type: textarea
id: crashlogs
attributes:
label: Upload crash files
description: With the `crash.log`, `crash.dmp`, and `crash.sav` we can analyze the crash in detail; this way you allow us to easier triage and fix the problem.
placeholder: |
1. Zip the `crash.log`, `crash.dmp` and `crash.sav`.
2. Click on this field.
3. Drag and drop the zip file in here.
validations:
required: true

View File

@@ -39,6 +39,7 @@ Describe here
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.
* The bug fix is important enough to be backported? (label: 'backport requested')
* This PR touches english.txt or translations? Check the [guidelines](https://github.com/OpenTTD/OpenTTD/blob/master/docs/eints.md)
* This PR affects the save game format? (label 'savegame upgrade')
* This PR affects the GS/AI API? (label 'needs review: Script API')
* ai_changelog.hpp, gs_changelog.hpp need updating.

View File

@@ -4,9 +4,9 @@ tag=$(git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\
# If we are a tag, show the part of the changelog till (but excluding) the last stable
if [ -n "$tag" ]; then
grep='^[0-9]\+\.[0-9]\+\.[0-9]\+[^-]'
grep='^[0-9]\+\.[0-9]\+[^-]'
next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
exit 0
fi

34
.github/stale.yml vendored
View File

@@ -1,34 +0,0 @@
daysUntilClose: 7
staleLabel: stale
closeComment: false
exemptMilestones: true
exemptAssignees: true
issues:
daysUntilStale: 60
exemptLabels:
- pinned
- security
- "good first issue"
- regression
markComment: >
This issue has been automatically marked as stale because it has not had any activity in the last two months.
If you believe the issue is still relevant, please test on the latest nightly and report back.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
pulls:
daysUntilStale: 30
exemptLabels:
- pinned
markComment: >
This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

221
.github/unused-strings.py vendored Normal file
View File

@@ -0,0 +1,221 @@
"""
Script to scan the OpenTTD source-tree for STR_ entries that are defined but
no longer used.
This is not completely trivial, as OpenTTD references a lot of strings in
relation to another string. The most obvious example of this is a list. OpenTTD
only references the first entry in the list, and does "+ <var>" to get to the
correct string.
There are other ways OpenTTD does use relative values. This script tries to
account for all of them, to give the best approximation we have for "this
string is unused".
"""
import glob
import os
import re
import subprocess
import sys
from enum import Enum
LENGTH_NAME_LOOKUP = {
"VEHICLE_TYPES": 4,
}
class SkipType(Enum):
NONE = 1
LENGTH = 2
EXTERNAL = 3
ZERO_IS_SPECIAL = 4
EXPECT_NEWLINE = 5
def read_language_file(filename, strings_found, errors):
strings_defined = []
skip = SkipType.NONE
length = 0
common_prefix = ""
last_tiny_string = ""
with open(filename) as fp:
for line in fp.readlines():
if not line.strip():
if skip == SkipType.EXPECT_NEWLINE:
skip = SkipType.NONE
continue
line = line.strip()
if skip == SkipType.EXPECT_NEWLINE:
# The only thing allowed after a list, is this next marker, or a newline.
if line == "###next-name-looks-similar":
# "###next-name-looks-similar"
# Indicates the common prefix of the last list has a very
# similar name to the next entry, but isn't part of the
# list. So do not emit a warning about them looking very
# similar.
if length != 0:
errors.append(f"ERROR: list around {name} is shorted than indicated by ###length")
common_prefix = ""
else:
errors.append(f"ERROR: expected a newline after a list, but didn't find any around {name}. Did you add an entry to the list without increasing the length?")
skip = SkipType.NONE
if line[0] == "#":
if line.startswith("###length "):
# "###length <count>"
# Indicates the next few entries are part of a list. Only
# the first entry is possibly referenced, and the rest are
# indirectly.
if length != 0:
errors.append(f"ERROR: list around {name} is shorted than indicated by ###length")
length = line.split(" ")[1].strip()
if length.isnumeric():
length = int(length)
else:
length = LENGTH_NAME_LOOKUP[length]
skip = SkipType.LENGTH
elif line.startswith("###external "):
# "###external <count>"
# Indicates the next few entries are used outside the
# source and will not be referenced.
if length != 0:
errors.append(f"ERROR: list around {name} is shorted than indicated by ###length")
length = line.split(" ")[1].strip()
length = int(length)
skip = SkipType.EXTERNAL
elif line.startswith("###setting-zero-is-special"):
# "###setting-zero-is-special"
# Indicates the next entry is part of the "zero is special"
# flag of settings. These entries are not referenced
# directly in the code.
if length != 0:
errors.append(f"ERROR: list around {name} is shorted than indicated by ###length")
skip = SkipType.ZERO_IS_SPECIAL
continue
name = line.split(":")[0].strip()
strings_defined.append(name)
# If a string ends on _TINY or _SMALL, it can be the {TINY} variant.
# Check for this by some fuzzy matching.
if name.endswith(("_SMALL", "_TINY")):
last_tiny_string = name
elif last_tiny_string:
matching_name = "_".join(last_tiny_string.split("_")[:-1])
if name == matching_name:
strings_found.add(last_tiny_string)
else:
last_tiny_string = ""
if skip == SkipType.EXTERNAL:
strings_found.add(name)
skip = SkipType.LENGTH
if skip == SkipType.LENGTH:
skip = SkipType.NONE
length -= 1
common_prefix = name
elif skip == SkipType.ZERO_IS_SPECIAL:
strings_found.add(name)
elif length > 0:
strings_found.add(name)
length -= 1
# Find the common prefix of these strings
for i in range(len(common_prefix)):
if common_prefix[0 : i + 1] != name[0 : i + 1]:
common_prefix = common_prefix[0:i]
break
if length == 0:
skip = SkipType.EXPECT_NEWLINE
if len(common_prefix) < 6:
errors.append(f"ERROR: common prefix of block including {name} was reduced to {common_prefix}. This means the names in the list are not consistent.")
elif common_prefix:
if name.startswith(common_prefix):
errors.append(f"ERROR: {name} looks a lot like block above with prefix {common_prefix}. This mostly means that the list length was too short. Use '###next-name-looks-similar' if it is not.")
common_prefix = ""
return strings_defined
def scan_source_files(path, strings_found):
for new_path in glob.glob(f"{path}/*"):
if os.path.isdir(new_path):
scan_source_files(new_path, strings_found)
continue
if not new_path.endswith((".c", ".h", ".cpp", ".hpp", ".ini")):
continue
# Most files we can just open, but some use magic, that requires the
# G++ preprocessor before we can make sense out of it.
if new_path == "src/table/cargo_const.h":
p = subprocess.run(["g++", "-E", new_path], stdout=subprocess.PIPE)
output = p.stdout.decode()
else:
with open(new_path) as fp:
output = fp.read()
# Find all the string references.
matches = re.findall(r"[^A-Z_](STR_[A-Z0-9_]*)", output)
strings_found.update(matches)
def main():
strings_found = set()
errors = []
scan_source_files("src", strings_found)
strings_defined = read_language_file("src/lang/english.txt", strings_found, errors)
# STR_LAST_STRINGID is special, and not really a string.
strings_found.remove("STR_LAST_STRINGID")
# These are mentioned in comments, not really a string.
strings_found.remove("STR_XXX")
strings_found.remove("STR_NEWS")
strings_found.remove("STR_CONTENT_TYPE_")
# This string is added for completion, but never used.
strings_defined.remove("STR_JUST_DATE_SHORT")
strings_defined = sorted(strings_defined)
strings_found = sorted(list(strings_found))
for string in strings_found:
if string not in strings_defined:
errors.append(f"ERROR: {string} found but never defined.")
for string in strings_defined:
if string not in strings_found:
errors.append(f"ERROR: {string} is (possibly) no longer needed.")
if errors:
for error in errors:
print(error)
sys.exit(1)
else:
print("OK")
if __name__ == "__main__":
main()

View File

@@ -16,17 +16,22 @@ jobs:
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:2.0.10
image: emscripten/emsdk:2.0.31
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 2.0.10-${{ runner.os }}
key: 2.0.31-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
@@ -77,7 +82,7 @@ jobs:
libsdl: libsdl1.2-dev
- compiler: gcc
cxxcompiler: g++
extra-cmake-parameters: -DOPTION_DEDICATED=ON
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG"
runs-on: ubuntu-20.04
env:
@@ -86,7 +91,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: |
@@ -157,19 +162,19 @@ jobs:
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
MACOSX_DEPLOYMENT_TARGET: 10.14
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare cache key
id: key
run: |
echo "::set-output name=image::$ImageOS-$ImageVersion"
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
@@ -232,14 +237,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2016]
os: [windows-latest, windows-2019]
arch: [x86, x64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare cache key
id: key
@@ -248,10 +253,10 @@ jobs:
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
@@ -315,3 +320,92 @@ jobs:
run: |
cd ${GITHUB_WORKSPACE}/build
ctest --timeout 120
msys2:
name: msys2
strategy:
fail-fast: false
matrix:
include:
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
release: false
install: >-
git
make
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-lzo2
mingw-w64-${{ matrix.arch }}-libpng
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
shell: msys2 {0}
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -G"MSYS Makefiles"
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Test
shell: msys2 {0}
run: |
cd build
ctest -j $(nproc) --timeout 120
check_annotations:
name: Check Annotations
needs:
- emscripten
- linux
- macos
- windows
- msys2
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v3

View File

@@ -10,42 +10,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 4
- name: Get pull-request commits
run: |
set -x
# actions/checkout did a merge checkout of the pull-request. As such, the first
# commit is the merge commit. This means that on HEAD^ is the base branch, and
# on HEAD^2 are the commits from the pull-request. We now check if those trees
# have a common parent. If not, we fetch a few more commits till we do. In result,
# the log between HEAD^ and HEAD^2 will be the commits in the pull-request.
DEPTH=4
while [ -z "$(git merge-base HEAD^ HEAD^2)" ]; do
# Prevent infinite recursion
if [ ${DEPTH} -gt 256 ]; then
echo "No common parent between '${GITHUB_HEAD_REF}' and '${GITHUB_BASE_REF}'." >&2
exit 1
fi
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --deepen=${DEPTH} origin HEAD
DEPTH=$(( ${DEPTH} * 4 ))
done
# Just to show which commits we are going to evaluate.
git log --oneline HEAD^..HEAD^2
- name: Checkout commit-checker
uses: actions/checkout@v2
with:
repository: OpenTTD/OpenTTD-git-hooks
path: git-hooks
ref: master
uses: OpenTTD/actions/checkout-pull-request@v2
- name: Check commits
run: |
set -x
HOOKS_DIR=./git-hooks/hooks GIT_DIR=.git ./git-hooks/hooks/check-commits.sh HEAD^..HEAD^2
echo "Commit checks passed"
uses: OpenTTD/OpenTTD-git-hooks@main

View File

@@ -12,9 +12,7 @@ jobs:
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:2.0.10
# uid=1001(runner) gid=121(docker)
options: -u 1001:121
image: emscripten/emsdk:2.0.31
steps:
- name: Update deployment status to in progress
@@ -33,7 +31,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.sha }}
@@ -43,10 +41,15 @@ jobs:
git checkout -b ${name}
- name: Setup cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 2.0.10-${{ runner.os }}
key: 2.0.31-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
@@ -73,7 +76,7 @@ jobs:
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
@@ -84,18 +87,15 @@ jobs:
- name: Publish preview
run: |
# setuptools is missing in this Docker image, which breaks installing
# awscli. So we need to do this in two steps to recover sanity.
pip3 install setuptools
pip3 install awscli
~/.local/bin/aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
~/.local/bin/aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
~/.local/bin/aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
~/.local/bin/aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
# Invalidate the cache of the CloudFront distribution
~/.local/bin/aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*"
aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

View File

@@ -59,7 +59,7 @@ jobs:
- if: steps.core_developer.outcome == 'success'
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"

View File

@@ -59,7 +59,7 @@ jobs:
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"

View File

@@ -29,14 +29,14 @@ jobs:
steps:
- name: Checkout (Release)
if: github.event_name == 'release'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We generate a changelog; for this we need the full git log.
fetch-depth: 0
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
# We generate a changelog; for this we need the full git log.
@@ -44,7 +44,7 @@ jobs:
- name: Checkout (Trigger)
if: github.event_name == 'repository_dispatch'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
# We generate a changelog; for this we need the full git log.
@@ -138,10 +138,10 @@ jobs:
echo "Folder on CDN: ${FOLDER}"
echo "Workflow trigger: ${TRIGGER_TYPE}"
echo "::set-output name=version::$(cat .version)"
echo "::set-output name=is_tag::${IS_TAG}"
echo "::set-output name=folder::${FOLDER}"
echo "::set-output name=trigger_type::${TRIGGER_TYPE}"
echo "version=$(cat .version)" >> $GITHUB_OUTPUT
echo "is_tag=${IS_TAG}" >> $GITHUB_OUTPUT
echo "folder=${FOLDER}" >> $GITHUB_OUTPUT
echo "trigger_type=${TRIGGER_TYPE}" >> $GITHUB_OUTPUT
env:
NIGHTLIES_BRANCH: master
FOLDER_RELEASES: openttd-releases
@@ -174,14 +174,14 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-source
path: build/bundles/*
retention-days: 5
- name: Store source (for other jobs)
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: internal-source
path: source.tar.gz
@@ -195,7 +195,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -258,7 +258,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-docs
path: build/bundles/*.tar.xz
@@ -276,7 +276,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -355,7 +355,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-linux-generic
path: build/bundles
@@ -371,16 +371,15 @@ jobs:
fail-fast: false
matrix:
include:
- container_image: "ubuntu:18.04"
bundle_name: "bionic"
- container_image: "ubuntu:20.04"
bundle_name: "focal"
- container_image: "ubuntu:20.10"
bundle_name: "groovy"
- container_image: "debian:buster"
bundle_name: "buster"
compiler: "g++"
- container_image: "ubuntu:22.04"
bundle_name: "jammy"
compiler: "g++"
- container_image: "debian:bullseye"
bundle_name: "bullseye"
compiler: "g++"
runs-on: ubuntu-20.04
container:
@@ -388,7 +387,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -406,7 +405,7 @@ jobs:
apt-get install -y --no-install-recommends \
cmake \
debhelper \
g++ \
${{ matrix.compiler }} \
git \
make \
openssl \
@@ -432,7 +431,7 @@ jobs:
cd build
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
CXX=${{ matrix.compiler }} cmake ${GITHUB_WORKSPACE} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
# EOF
@@ -458,7 +457,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-linux-${{ matrix.bundle_name }}
path: build/bundles
@@ -468,13 +467,13 @@ jobs:
name: MacOS
needs: source
runs-on: macos-10.15
runs-on: macos-11
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
MACOSX_DEPLOYMENT_TARGET: 10.14
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -492,10 +491,10 @@ jobs:
- name: Prepare cache key
id: key
run: |
echo "::set-output name=image::$ImageOS-$ImageVersion"
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-0 # Increase the number whenever dependencies are modified
@@ -649,7 +648,7 @@ jobs:
mv _CPack_Packages/*/Bundle/openttd-*.zip bundles/
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-macos-universal
path: build-x64/bundles
@@ -674,7 +673,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -695,10 +694,10 @@ jobs:
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified
@@ -746,6 +745,21 @@ jobs:
with:
arch: ${{ matrix.host }}
- name: Import code signing certificate
shell: powershell
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
$tempFile = [System.IO.Path]::GetTempFileName()
$bytes = [System.Convert]::FromBase64String($env:WINDOWS_CERTIFICATE_P12)
[IO.File]::WriteAllBytes($tempFile, $bytes)
$pwd = ConvertTo-SecureString $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force
Import-PfxCertificate -FilePath $tempFile -CertStoreLocation Cert:\CurrentUser\My -Password $pwd
Remove-Item $tempFile
env:
WINDOWS_CERTIFICATE_P12: ${{ secrets.WINDOWS_CERTIFICATE_P12 }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
- name: Build (with installer)
if: needs.source.outputs.is_tag == 'true'
shell: bash
@@ -761,12 +775,15 @@ jobs:
-DOPTION_USE_NSIS=ON \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Build (without installer)
if: needs.source.outputs.is_tag != 'true'
@@ -782,12 +799,15 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Create bundles
shell: bash
@@ -809,13 +829,207 @@ jobs:
rm -f bundles/*.sha256
echo "::endgroup::"
- name: Sign installer
if: needs.source.outputs.is_tag == 'true'
shell: bash
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
cd ${GITHUB_WORKSPACE}/build/bundles
../../os/windows/sign.bat *.exe "${WINDOWS_CERTIFICATE_COMMON_NAME}"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-windows-${{ matrix.arch }}
path: build/bundles
retention-days: 5
windows-appx:
name: Windows Store
needs:
- source
- windows
if: needs.source.outputs.is_tag == 'true'
runs-on: windows-latest
steps:
- name: Download source
uses: actions/download-artifact@v3
with:
name: internal-source
- name: Unpack source
shell: bash
run: |
tar -xf source.tar.gz --strip-components=1
- name: Download x86 build
uses: actions/download-artifact@v3
with:
name: openttd-windows-x86
- name: Download x64 build
uses: actions/download-artifact@v3
with:
name: openttd-windows-x64
- name: Download arm64 build
uses: actions/download-artifact@v3
with:
name: openttd-windows-arm64
- name: Unpack builds
shell: bash
run: |
mkdir builds
cd builds
function extract {
mkdir $1
# Extract the zip version of the release
unzip ../openttd-*-windows-$2.zip -d $1
# Remove the extraneous directory
mv $1/openttd-*-windows-$2/* $1/
rmdir $1/openttd-*-windows-$2
# Move the openttd.exe to the '{arch}-binaries' folder
mkdir $1-binaries
mv $1/openttd.exe $1-binaries/
}
extract x86 win32
extract x64 win64
extract arm64 arm64
# Use the "x86" folder as the source of the common binaries (lang files, etc) and remove the others
mv x86 common-binaries
rm -rf x64 arm64
- name: Install OpenGFX
shell: bash
run: |
mkdir -p builds/common-binaries/baseset
cd builds/common-binaries/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/7.1/opengfx-7.1-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
tar xf opengfx-*.tar
echo "::endgroup::"
rm -f opengfx-all.zip opengfx-*.tar
- name: Install OpenMSX
shell: bash
run: |
mkdir -p builds/common-binaries/baseset
cd builds/common-binaries/baseset
echo "::group::Download OpenMSX"
curl -L https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip -o openmsx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip openmsx-all.zip
tar xf openmsx-*.tar
echo "::endgroup::"
rm -f openmsx-all.zip openmsx-*.tar
- name: Install OpenSFX
shell: bash
run: |
mkdir -p builds/common-binaries/baseset/opensfx
cd builds/common-binaries/baseset/opensfx
echo "::group::Download OpenSFX"
curl -L https://cdn.openttd.org/opensfx-releases/1.0.3/opensfx-1.0.3-all.zip -o opensfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenSFX"
unzip opensfx-all.zip
tar xf opensfx-*.tar
echo "::endgroup::"
rm -f opensfx-all.zip opensfx-*.tar
- name: Generate signing certificate
shell: cmd
run: |
cd builds
REM We need to provide a signed .appx to the Windows Store, so generate a certificate with password 'password'
call ..\os\windows\winstore\generate-key.bat "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" password cert.pfx
- name: Generate assets
shell: cmd
run: |
cd os\windows\winstore
call generate-assets.bat
- name: Prepare manifests
shell: cmd
run: |
cd builds
mkdir manifests
REM Set the version environment variable
call ..\os\windows\winstore\set-version.bat x86-binaries\openttd.exe
call ..\os\windows\winstore\prepare-manifests.bat manifests "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" "57420OpenTTDDevelopers.OpenTTDofficial"
- name: Prepare binaries
shell: bash
run: |
cd builds
# Copy the Windows Store assets
mkdir common-binaries/Assets
cp -R ../os/windows/winstore/assets-common/* common-binaries/Assets/
mkdir Assets
cp -R ../os/windows/winstore/assets/* Assets/
cp manifests/*.xml .
- name: Build
shell: cmd
run: |
REM Add the Windows SDK tools to the PATH
echo|set /p="SET VS_INSTALLDIR=" > _vspath.bat
vswhere -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath >> _vspath.bat
call _vspath.bat
call "%VS_INSTALLDIR%\Common7\Tools\VsDevCmd.bat"
REM Set the version environment variable
call os\windows\winstore\set-version.bat builds\x86-binaries\openttd.exe
cd builds
mkdir output
REM Build and sign the package
makeappx build /v /f PackagingLayout.xml /op output\ /bv %OTTD_VERSION% /pv %OTTD_VERSION% /ca
SignTool sign /fd sha256 /a /f cert.pfx /p password "output\OpenTTD.appxbundle"
- name: Store appx
uses: actions/upload-artifact@v3
with:
name: openttd-windows-store
path: |
builds/output/OpenTTD.appxbundle
builds/cert.pfx
retention-days: 5
upload:
name: Upload (AWS)
needs:
@@ -837,7 +1051,7 @@ jobs:
steps:
- name: Download all bundles
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Calculate checksums
run: |
@@ -869,7 +1083,7 @@ jobs:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
- name: Trigger 'New OpenTTD release'
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
repository: OpenTTD/workflows
@@ -890,7 +1104,7 @@ jobs:
steps:
- name: Download all bundles
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1

18
.github/workflows/unused-strings.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Unused strings
on:
pull_request:
jobs:
unused-strings:
name: Unused strings
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for unused strings
run: |
set -ex
python3 .github/unused-strings.py

View File

@@ -5,7 +5,7 @@ if(NOT BINARY_NAME)
endif()
project(${BINARY_NAME}
VERSION 1.11.2
VERSION 13.0
)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
@@ -22,7 +22,7 @@ if (EMSCRIPTEN)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
# Use GNUInstallDirs to allow customisation
# but set our own default data and bin dir
@@ -76,7 +76,7 @@ add_custom_target(find_version
-DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR}
-DREV_MAJOR=${PROJECT_VERSION_MAJOR}
-DREV_MINOR=${PROJECT_VERSION_MINOR}
-DREV_BUILD=${PROJECT_VERSION_PATCH}
-DWINDOWS=${WIN32}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
BYPRODUCTS ${GENERATED_SOURCE_FILES}
@@ -241,6 +241,10 @@ target_link_libraries(openttd
Threads::Threads
)
if(HAIKU)
target_link_libraries(openttd "be" "network" "midi")
endif()
if(IPO_FOUND)
set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE True)
set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL True)
@@ -301,7 +305,7 @@ if(EMSCRIPTEN)
add_definitions(-s DISABLE_EXCEPTION_CATCHING=0)
# Export functions to Javascript.
target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
# Preload all the files we generate during build.
# As we do not compile with FreeType / FontConfig, we also have no way to
@@ -355,17 +359,20 @@ if(WIN32)
-DUNICODE
-D_UNICODE
-DWITH_UNISCRIBE
-DPSAPI_VERSION=1
)
target_link_libraries(openttd
ws2_32
winmm
imm32
usp10
psapi
)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D_SQ64)
add_definitions(-DPOINTER_IS_64BIT)
endif()
include(CreateRegression)

View File

@@ -69,7 +69,7 @@ that comes with vcpkg. After that, you can run something similar to this:
```powershell
mkdir build
cd build
cmake.exe .. -G'Visual Studio 16 2019' -DCMAKE_TOOLCHAIN_FILE="<location of vcpkg>\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static"
cmake.exe .. -G"Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE="<location of vcpkg>\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static"
```
Change `<location of vcpkg>` to where you have installed vcpkg. After this

View File

@@ -94,8 +94,8 @@ Although we really appreciate feedback and ideas, we will close feature requests
Many of those ideas etc do have a place on the [forums](https://www.tt-forums.net); and if enough people like it, someone will stand up and make it.
It's usually best discuss in [irc](https://wiki.openttd.org/en/Development/IRC%20channel) before opening a feature request or working on a large feature in a fork.
Discussion in irc can take time, but it can be productive and avoid disappointment :)
It's usually best to discuss on [Discord](https://discord.gg/openttd) before opening a feature request or working on a large feature in a fork.
Discussion can take time, but it can be productive and avoid disappointment. :)
## Pull requests
@@ -137,7 +137,7 @@ git checkout upstream/master -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
Use Git's [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase) feature to tidy up your commits before making them public.
5. Locally rebase the upstream development branch into your topic branch:
@@ -212,8 +212,8 @@ When it comes to gameplay features there are at least these groups of interests:
- *Control freak:* micromanagement like conditional orders, refitting and loading etc.
- *Casual:* automatisation like cargodist, path based signalling etc.
To please everyone, the official branch tries to stay close to the original gameplay; after all, that is what everyone brought here.
The preferred method to alter and extent the gameplay is via add-ons like NewGRF and GameScripts.
To please everyone, the official branch tries to stay close to the original gameplay; after all, that is what brought everyone here.
The preferred method to alter and extend the gameplay is via add-ons like NewGRF and GameScripts.
For a long time, the official branch was also open to features which could be enabled/disabled, but the corner-cases that came with some configurations have rendered some parts of the code very complicated.
Today, new features have to work with all the already existing features, which is not only challenging in corner cases, but also requires spending considerable more work than just "making it work in the game mode that I play".
@@ -265,5 +265,5 @@ If you would not like to accept this risk, please do either commit anonymously o
### Attribution of this Contributing Guide
This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE) terms for Bootstrap documentation.
This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/) terms for Bootstrap documentation.
The GDPR notice is adapted from [rsyslog](https://github.com/rsyslog/rsyslog/blob/master/CONTRIBUTING.md) under the [GNU General Public License](https://github.com/rsyslog/rsyslog/blob/master/COPYING).

View File

@@ -1,43 +1,43 @@
### The OpenTTD team (in alphabetical order):
- Grzegorz Duczyński (adf88) - General coding (since 1.7.2)
- Albert Hofkamp (Alberth) - GUI expert (since 0.7)
- Matthijs Kooijman (blathijs) - Pathfinder-guru, Debian port (since 0.3)
- Ulf Hermann (fonsinchen) - Cargo Distribution (since 1.3)
- Christoph Elsenhans (frosch) - General coding (since 0.6)
- Loïc Guilloux (glx) - Windows Expert (since 0.4.5)
- Loïc Guilloux (glx) - General / Windows Expert (since 0.4.5)
- Charles Pigott (LordAro) - General / Correctness police (since 1.9)
- Michael Lutz (michi_cc) - Path based signals (since 0.7)
- Michael Lutz (michi_cc) - General / Path based signals (since 0.7)
- Niels Martin Hansen (nielsm) - Music system, general coding (since 1.9)
- Owen Rudge (orudge) - Forum host, OS/2 port (since 0.1)
- Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5)
- Ingo von Borstel (planetmaker) - General coding, Support (since 1.1)
- Remko Bijker (Rubidium) - Lead coder and way more (since 0.4.5)
- José Soler (Terkhen) - General coding (since 1.0)
- Leif Linse (Zuu) - AI/Game Script (since 1.2)
- Remko Bijker (Rubidium) - Coder and way more (since 0.4.5)
- Patric Stout (TrueBrain) - NoProgrammer (since 0.3), sys op
### Inactive Developers:
- Grzegorz Duczyński (adf88) - General coding (1.7 - 1.8)
- Albert Hofkamp (Alberth) - GUI expert (0.7 - 1.9)
- Jean-François Claeys (Belugas) - GUI, newindustries and more (0.4.5 - 1.0)
- Bjarni Corfitzen (Bjarni) - macOS port, coder and vehicles (0.3 - 0.7)
- Victor Fischer (Celestar) - Programming everywhere you need him to (0.3 - 0.6)
- Ulf Hermann (fonsinchen) - Cargo Distribution (1.3 - 1.6)
- Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;) (0.4.5 - 0.6)
- Jonathan Coome (Maedhros) - High priest of the NewGRF Temple (0.5 - 0.6)
- Attila Bán (MiHaMiX) - WebTranslator 1 and 2 (0.3 - 0.5)
- Attila Bán (MiHaMiX) - Developer WebTranslator 1 and 2 (0.3 - 0.5)
- Ingo von Borstel (planetmaker) - General coding, Support (1.1 - 1.9)
- Zdeněk Sojka (SmatZ) - Bug finder and fixer (0.6 - 1.3)
- José Soler (Terkhen) - General coding (1.0 - 1.4)
- Christoph Mallon (Tron) - Programmer, code correctness police (0.3 - 0.5)
- Patric Stout (TrueBrain) - NoProgrammer (0.3 - 1.2), sys op (active)
- Thijs Marinussen (Yexo) - AI Framework, General (0.6 - 1.3)
- Leif Linse (Zuu) - AI/Game Script (1.2 - 1.6)
### Retired Developers:
- Tamás Faragó (Darkvater) - Ex-Lead coder (0.3 - 0.5)
- Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3 - 0.3)
- Emil Djupfeld (egladil) - macOS port (0.4 - 0.6)
- Emil Djupfeld (egladil) - macOS port (0.4.5 - 0.6)
- Simon Sasburg (HackyKid) - Bug fixer (0.4 - 0.4.5)
- Ludvig Strigeus (ludde) - Original author of OpenTTD, main coder (0.1 - 0.3)
- Cian Duffy (MYOB) - BeOS port / manual writing (0.1 - 0.3)
- Petr Baudiš (pasky) - Many patches, newgrf support, etc. (0.3 - 0.3)
- Petr Baudiš (pasky) - Many patches, newgrf support (0.3 - 0.3)
- Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker (0.6 - 0.7)
- Serge Paquet (vurlix) - 2nd contributor after ludde (0.1 - 0.3)
@@ -52,7 +52,7 @@
- Alberto Demichelis - Squirrel scripting language
- L. Peter Deutsch - MD5 implementation
- Michael Blunck - For revolutionizing TTD with awesome graphics
- George - Canal graphics
- George - Canal/Lock graphics
- Andrew Parkhouse (andythenorth) - River graphics
- David Dallaston (Pikka) - Tram tracks
- All Translators - For their support to make OpenTTD a truly international game

View File

@@ -34,7 +34,7 @@ Both 'stable' and 'nightly' versions are available for download:
- most people should choose the 'stable' version, as this has been more extensively tested
- the 'nightly' version includes the latest changes and features, but may sometimes be less reliable
On some platforms OpenTTD will also be available via your OS package manager or a similar service.
OpenTTD is also available for free on [Steam](https://store.steampowered.com/app/1536610/OpenTTD/), [GOG.com](https://www.gog.com/game/openttd), and the [Microsoft Store](https://www.microsoft.com/p/openttd-official/9ncjg5rvrr1c). On some platforms OpenTTD will be available via your OS package manager or a similar service.
## 1.2) OpenTTD gameplay manual
@@ -77,9 +77,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:
- https://www.openttd.org/downloads/opengfx-releases/ for OpenGFX
- https://www.openttd.org/downloads/opensfx-releases/ for OpenSFX
- https://www.openttd.org/downloads/openmsx-releases/ for OpenMSX
- https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX
- https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX
- https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
@@ -116,35 +116,6 @@ Most types of add-on content can be downloaded within OpenTTD via the 'Check Onl
Add-on content can also be installed manually, but that's more complicated; the [OpenTTD wiki](https://wiki.openttd.org/) may offer help with that, or the [OpenTTD directory structure guide](./docs/directory_structure.md).
### 1.5.1) AI opponents
OpenTTD comes without AI opponents, so if you want to play with AIs you have to download them.
The easiest way is via the 'Check Online Content' button in the main menu.
You can select some AIs that you think are compatible with your playing style.
AI help and discussions may also be found in the [AI section of the forum](https://www.tt-forums.net/viewforum.php?f=65).
### 1.5.2) Scenarios and height maps
Scenarios and heightmaps can be added via the 'Check Online Content' button in the main menu.
### 1.5.3) NewGRFs
A wide range of add-content is available as NewGRFs, including vehicles, industries, stations, landscape objects, town names and more.
NewGRFs can be added via the 'Check Online Content' button in the main menu.
See also the wiki [guide to NewGRFs](https://wiki.openttd.org/en/Manual/NewGRF) and [the forum graphics development section](https://www.tt-forums.net/viewforum.php?f=66).
### 1.5.4) Game scripts
Game scripts can provide additional challenges or changes to the standard OpenTTD gameplay, for example setting transport goals, or changing town growth behaviour.
Game scripts can be added via the 'Check Online Content' button in the main menu.
See also the wiki [guide to game scripts](https://wiki.openttd.org/en/Manual/Game%20script) and [the forum graphics game script section](https://www.tt-forums.net/viewforum.php?f=65).
### 1.6) OpenTTD directories
@@ -162,8 +133,9 @@ If you want to compile OpenTTD from source, instructions can be found in [COMPIL
'Official' channels
- [OpenTTD website](https://www.openttd.org)
- [OpenTTD official Discord](https://discord.gg/openttd)
- IRC chat using #openttd on irc.oftc.net [more info about our irc channel](https://wiki.openttd.org/en/Development/IRC%20channel)
- [OpenTTD on Github](https://github.com/openTTD/) for code repositories and for reporting issues
- [OpenTTD on Github](https://github.com/OpenTTD/) for code repositories and for reporting issues
- [forum.openttd.org](https://forum.openttd.org/) - the primary community forum site for discussing OpenTTD and related games
- [OpenTTD wiki](https://wiki.openttd.org/) community-maintained wiki, including topics like gameplay guide, detailed explanation of some game mechanics, how to use add-on content (mods) and much more
@@ -205,6 +177,9 @@ See the comments in the source files in `src/3rdparty/md5` for the complete lice
The implementations of Posix `getaddrinfo` and `getnameinfo` for OS/2 in `src/3rdparty/os2` are distributed partly under the GNU Lesser General Public License 2.1, and partly under the (3-clause) BSD license.
The exact licensing terms can be found in `src/3rdparty/os2/getaddrinfo.c` resp. `src/3rdparty/os2/getnameinfo.c`.
The fmt implementation in `src/3rdparty/fmt` is licensed under the MIT license.
See `src/3rdparty/fmt/LICENSE.rst` for the complete license text.
## 4.0 Credits

View File

@@ -12,6 +12,7 @@ set(AI_COMPAT_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
)
foreach(AI_COMPAT_SOURCE_FILE IN LISTS AI_COMPAT_SOURCE_FILES)

View File

@@ -379,3 +379,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -131,3 +131,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -68,3 +68,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -6,3 +6,16 @@
*/
AILog.Info("1.10 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -4,3 +4,18 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.11 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -6,3 +6,16 @@
*/
AILog.Info("1.9 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

21
bin/ai/compat_12.nut Normal file
View File

@@ -0,0 +1,21 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("12 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type)
{
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

6
bin/ai/compat_13.nut Normal file
View File

@@ -0,0 +1,6 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@@ -9,6 +9,7 @@ set(GS_COMPAT_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
)
foreach(GS_COMPAT_SOURCE_FILE IN LISTS GS_COMPAT_SOURCE_FILES)

View File

@@ -13,3 +13,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -4,3 +4,18 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.11 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -35,3 +35,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -35,3 +35,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -28,3 +28,15 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -20,3 +20,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

View File

@@ -13,3 +13,16 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

21
bin/game/compat_12.nut Normal file
View File

@@ -0,0 +1,21 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("12 API compatibility in effect.");
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}

6
bin/game/compat_13.nut Normal file
View File

@@ -0,0 +1,6 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@@ -1,3 +1,289 @@
13.0-beta1 (2022-10-31)
------------------------------------------------------------------------
Feature: Airport construction GUI displays infrastructure cost (#10094)
Feature: Purchase land multiple tiles at a time (#10027)
Feature: Add sticky pin & shade widgets to Object Selection UI panel (#10019, #10020)
Feature: Improved handling of HiDPI and mixed-DPI screens (#9994, #9996, #9997, #10064)
Feature: Alternative linkgraph colour schemes (#9866)
Feature: Allow Shift+Insert as paste in edit box (#9836)
Feature: Setting to make the local town authority rubber-stamp all actions (#9833)
Feature: Add/extend console commands to enable screenshot automation (#9771)
Feature: [Linkgraph] Show a tooltip with statistics when hovering a link (#9760)
Feature: Build objects by area (#9709)
Feature: Add setting to hide news about competitors vehicle crash (#9653)
Feature: Ctrl-click to remove fully autoreplaced vehicles from list (#9639)
Feature: Wide rivers on map generation (#9628)
Add: [Script] ScriptCargo::GetWeight to get cargo weights (#9930)
Add: Command line option to skip NewGRF scanning (#9879)
Add: Show video driver name in Game Options window (#9872)
Add: [NewGRF] Map seed as global variable (#9834)
Add: [Script] IndustryType::ResolveNewGRFID to resolve industry id from grf_local_id and grfid (#9798)
Add: [Script] ObjectType::ResolveNewGRFID to resolve object id from grfid and grf_local_id (#9795)
Update: To all the friends we have lost and those we have gained (#10000)
Change: Use the Simulation subcategory to openttd.desktop (#10015)
Change: Constantly update destination of 'any depot' orders (#9959)
Change: Use an indent, not a dash, to list train capacity (#9887)
Change: [NewGRF] Increase vehicle sprite stack from 4 layers to 8 (#9863)
Change: Don't pay Property Maintenance on stations when Infrastructure Maintenance is disabled (#9828)
Change: Improved layout of the finance window (#9827)
Change: [Admin] Bump admin port protocol due to command changes (#9754)
Change: Suppress vehicle age warnings for stopped vehicles (#9718)
Change: Make pf.yapf.rail_firstred_twoway_eol on by default (#9544)
Change: Deliver cargo to the closest industry first (#9536)
Fix: Lots of fixes to how windows handle resizing (#10040, #10042, #10046, #10051, #10056, #10068, #10070, #10098)
Fix: Console commands list_ai output was truncated with a suitably large number of AIs (#10075)
Fix #9876: MacBook Touch Bar crash / render issues w/ 32bpp graphics (#10060)
Fix: Reduce framerate overhead in Train::Tick (#10055)
Fix: Only open scenario editor date query once (#10050)
Fix #10048: Don't relocate company HQ on the same exact location (#10049)
Fix #10038: Missing upper bounds check when loading custom playlists (#10039)
Fix: Wrong string used to determine size of zoomed out station sign (#10036)
Fix: Disable "turn around" button for other companies' road vehicles (#10033)
Fix: Online Players list mouse hover behaviour (#10031)
Fix: [NewGRF] Weirdness of new stations (#10017)
Fix #9854: DrawStringMultiLine() could draw beyond its bounding box (#10014)
Fix: Incorrect player name in online players window (#10013)
Fix #8099: News window zoom level fixes (#10005)
Fix: [NewGRF] Upper 16 random bits should be the same for all station tiles in callback 140 (#9992)
Fix #9989: £0 Net Profit is neither negative nor positive (#9991)
Fix #9804: Only apply sprite_zoom_min setting when sprites available (#9988)
Fix #9972: Add missing fill/resize flags on Framerate window widgets (#9982)
Fix #9935: Use more selectivity when building SSE specific code (#9980)
Fix #9940: Print debuglevel parse errors to console when changed from console (#9979)
Fix #9977: Clearing the console with a large number of lines could cause a crash (#9978)
Fix #9974: Console command getsysdate did not work due to off-by-one error (#9975)
Fix: [NewGRF] Default value of RailVehicleInfo::railveh_type was inconsistent with other default properties (#9967)
Fix #8584: Vehicles with shared orders getting invalid or unexpected start dates (#9955)
Fix #9951: [NewGRF] Scenario editor random industries button broke NewGRF persistent storage (#9952)
Fix: Validation of various internal command parameters that could have allowed a rogue client to crash servers (#9942, #9943, #9944, #9945, #9946, #9947, #9948, #9950)
Fix #9937: Station industries_near incorrect after removing part moved sign (#9938)
Fix: [Script] ScriptRoad::HasRoadType really check for RoadType (#9934)
Fix #9363: Rebuild client list on reinit event (#9929)
Fix #9925: Industry tile layout validation for layouts of only one tile (#9926)
Fix #9918: Reset industy last production year on scenario start (#9920)
Fix #9914: Prevent more useless pathfinder run for blocked vehicles (#9917)
Fix: List a max of four share owners instead of three (#9905)
Fix: [NewGRF] Industry layouts with zero regular tiles should be invalid (#9902)
Fix #9869: Remove docking tile when doing a clear square (#9898)
Fix: New player companies use favorite manager face, if saved (#9895)
Fix: Towns don't build parallel, redundant bridges (#9891)
Fix #9712: Cap town bridge length at original 11-tile limit (#9890)
Fix #9883: Show cost/income float over end tile of rail or road construction (#9889)
Fix #9870: Don't update infrastructure totals when overbuilding object on canal (#9888)
Fix #9877: GS could trigger 'Cost: £0' cost message (#9878)
Fix 44f2ef1: [strgen] Allow gender for {CARGO_SHORT} (#9873)
Fix #9867: Industry::stations_near not filled at industry creation (#9868)
Fix #9853: Incorrect merge of guiflags and flags for osk_activation (#9855)
Fix #6544: Don't join AI company when loading network game in singleplayer (#9794)
Fix: Company values do not properly account for shares (#9770)
Fix #9546: Crash when no industries are present in game (#9726)
Fix #9708: [Linkgraph] Don't assume vehicles have a non-zero max speed (#9693)
Fix #9665: [Linkgraph] Fix travel times of non-direct journeys (#9693)
Fix #8797: Use logical rail length when placing signals (#9652)
Cleanup: [NewGRF] Remove unused flag sprites (#10052)
12.2 (2022-04-02)
------------------------------------------------------------------------
Feature: Remember the last-used signal between games (#9792)
Change: [MacOS] Allow touchbar usage on all supported OS versions (#9776)
Change: Add a timestamp in name of crash files (#9761)
Fix #9736: Duplicate multiplayer window opens upon canceling password entry (#9842)
Fix: Removing long roads doesn't prioritise refusal of local authority over other errors (#9831)
Fix #9020: Glitchy station coverage highlight when changing selection (#9825)
Fix: Correct some Romanian town names (#9819)
Fix: Original music playback rate was slightly too fast (#9814)
Fix #9811: Use the NewGRF-defined vehicle center when dragging ships and aircraft (#9812)
Fix: Do not let shares in the company taking over another company disappear (#9808)
Fix #9802: Crash when using lots of NewGRF waypoint types (#9803)
Fix #9766: Don't write uninitialised data in config file (#9767)
Fix #9743: [MacOS] Don't try to render touchbar sprites with invalid zoom level (#9776)
Fix #9774: Building roadstop in estimation mode updates station acceptance (#9775)
Fix: If vehicles only refit to cargo-slots >= 32, the default cargo was wrong (#9744)
Fix #9735: Possible desync when replacing a depot on same tile (#9738)
Fix #9730: [Network] Connections can use an invalid socket due to a race condition (#9731)
Fix: Don't show sign edit window for GS-owned signs (#9716)
Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704)
Fix #9680: Crash when loading really old savegames with aircraft in certain places (#9699)
Fix: Update last servicing dates when using the date cheat (#9694)
Fix: Error message shows about missing glyphs while suitable fallback font is found (#9692)
12.1 (2021-11-08)
------------------------------------------------------------------------
Feature: Button to toggle showing advanced signal types (#9617)
Change: Don't show screenshot GUI in screenshots (#9674)
Change: Suppress panning in intro game, while user is interacting with the GUI (#9645)
Change: Draw rotor in cursor when dragging helicopters in depots (#9612)
Fix: Invalid memory access when loading a currency NewGRF (#9675)
Fix #9579: Object and HQ construction is Construction cost, not Property Maintenance (#9673)
Fix #9669: Ships exiting a blocked depot/lock could exit in the wrong direction (#9672)
Fix: Every 16th client never reconnects after server restart (#9666)
Fix #9643: Screenshots were always written as BMP files (#9644)
Fix #9630: Intro game could zoom in/out more than allowed by settings (#9633)
Fix #9626: Incorrect loading of script saved data (#9629)
Fix: Emergency crash save had the wrong NewGRF list saved in it (#9627)
Fix #9595: Always use plural forms of cargo for subsidy strings (#9619)
Fix #9614: Refresh rate dropdown was still active when vsync was enabled (#9618)
Fix: Don't use 'server address' string in server list when displaying an invite code (#9615)
12.0 (2021-10-17)
------------------------------------------------------------------------
Add: [Network] Keep the refresh button in lowered state while refreshing (#9600)
Add: Console command to list search directories for various things (#9583)
Fix: Try all possible reverse directions when a ship reaches a dead end (#9610)
Fix: Incorrect Romanian own name (#9598)
Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594)
Fix #9548: [Squirrel] Crash during engine cleanup after reaching memory limit on realloc (#9592)
Fix #9588: [Squirrel] Reaching memory limit during script registration could prevent further script detections (#9589)
Fix: Make ships more likely to find their destination at the cost of slightly worse paths (#9576)
Change: Reverse ship when leaving docks if a better path exists (#9610)
Change: Allow all tiles around docks to be docking tiles (#9578)
12.0-RC1 (2021-09-25)
------------------------------------------------------------------------
Feature: Display icon/text whether vehicle is lost in vehicle (list) window (#9543)
Feature: [MacOS] Add selected toolbar buttons to MacBook Pro Touch Bar (#9511)
Feature: Button to open order window from vehicle shared orders window (#9325)
Feature: Ctrl-Clicking shared order vehicle list opens order window (#9325)
Feature: Multiple rotating views on title screen (#8980)
Feature: Hide block signals in GUI by default (#8688)
Add: [Script] Allow GameScripts to build neutral objects (#9568)
Add: [Network] Allow sending chat messages via admin port (#9563)
Add: [AI/GS] Missing water related functions and objects (#8390)
Fix: Industry funding window did not update when changing funding method (#9572)
Fix #9562: [NewGRF] Handle case of invalid Action2 with zero results (#9564)
Fix: Incorrect error messages when placing water in scenario editor (#9560)
Fix #9484: Update locale currencies settings config map (#9559)
Fix: Prevent train reversing when entirely inside a train depot (#9557)
Fix: [Network] Add back 'Spectate' option to company toolbar menu (#9556)
Fix #9463: [Win32] Work around XAudio2 crashes (#9549)
Fix #8603: Don't give focus to text filter when opening Object GUI (#9547)
Fix #9241: Grove and forest tree brushes did not also create rainforest terrain (#9542)
Fix: [Network] Several crashes in our network code (#9534, #9456)
Fix #9527: Crash when trying to place multi-tile objects at map edge (#9529)
Fix: [Network] SendCmdNames only sent one name per packet (#9528)
Fix #9407: Desync when founding a town nearby a station (#9526)
Fix #9521: Don't load at just removed docks that were part of a multi-dock station (#9524)
Fix: Ships always tried to avoid docking tiles when pathfinding (even if nothing was on them) (#9522)
Fix: [Network] Convert server_advertise to server_game_type in config file (#9515)
Fix #9490: [Network] A full server couldn't be queried (#9508)
Fix: [Network] Don't show GameScript " (v0)" for old servers (#9507)
Fix: [Network] Show query errors in the server listing instead of error popup (#9506)
Fix: [Network] Crash when last-joined server was no longer available (#9503)
Fix #9501: [Network] Crash when more than one game-info query was pending (#9502)
Fix: Wrong error message when building canals over ship depots / locks (#9410)
Fix: Reduce cost of building canals over objects on sea (#9410)
Change: [Linkgraph] Delete links only served by vehicles stopped in depot (#9499)
12.0-beta2 (2021-08-19)
------------------------------------------------------------------------
Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo (#9457)
Fix: Wrong town window refreshed when building an airport with noise levels enabled (#9497)
Fix: Improve wording of network-related messages (#9494, #9495, #9500)
Fix: [Network] Report reuse of invite-code (#9487)
Fix: [Network] Connecting with the same client name thrice hangs the server (#9485)
12.0-beta1 (2021-08-15)
------------------------------------------------------------------------
Feature: [Network] Remove lobby window; pressing "Join Game" now immediately joins a server (#9467)
Feature: [Network] Synchronize server name to clients and display in Online Players window (#9472)
Feature: [Network] Mention you are a spectator in the status bar (#9471)
Feature: [Network] No longer require port-forwarding to host a server (#9443, #9447)
Feature: [Network] Allow setting your server visibility to "invite-only" (#9434)
Feature: [Network] Join servers based on their invite code (#9432)
Feature: Raise the maximum NewGRF limit to 255 (#9428)
Feature: Persistent rotation of numbered auto/netsave after restart (#9395, #9397)
Feature: [NewGRF] Maximum curve speed modifier for rail vehicles (#9346)
Feature: Move sensitive information to secrets.cfg and private information to private.cfg (#9298)
Feature: Signed Windows builds (#9294)
Feature: [NewGRF] Define refittability of default vehicles using cargo classes (#9148)
Feature: Configurable subsidy duration, up to 5000 years (#9081)
Feature: [Network] Rework in-game Online Players window (#9067)
Feature: [Network] Show previous chat history when the chat message box is open (#9025)
Feature: Button to reset game settings to their default values (#8958)
Feature: Press Ctrl to build diagonal rivers in Scenario Editor (#8880)
Feature: Set wagon replacement per group when using autoreplace (#7441)
Add: [Network] Open Online Players window on starting/joining a server (#9479)
Add: [Script] Basic information about loaded NewGRFs for scripts (#9464)
Add: [AI] Get the number of vehicles in a given group (#9462)
Add: [Network] Inform network clients what game-script a server is running (#9441)
Add: Hindi translation (#9086)
Add: [Network] Ensure players fill in a name instead of defaulting to "Player" (#9080)
Change: Allow pause/unpause console command in single player (#9342)
Change: Make savegame format self-descriptive and consistent across all objects (#9322, #9335, #9338, #9339)
Change: By default, make "unload all" leave stations empty (#9301)
Change: Reworked the debug levels and messages for network logs (#9230, #9251)
Change: [Emscripten] Set default scrolling mode to non-pointer-locking (#9191)
Change: Use neutral pronouns for various strings (#9189, #9203, #9228)
Change: Make the town directory horizontally resizable (#9157)
Change: Allow non-ASCII currency separators (#9121)
Change: [NewGRF] Display a pop-up window for Errors with severity ERROR (#9119)
Change: Treat languages as finished, if translations are 75% completed (#9019, #9086)
Change: Disable NewGRF window apply button if no change was made (#8934)
Fix: [Script] Crash when iterating lists of which the key is larger than 32bit (#9465)
Fix: [Network] Desync due to use of unstable sort when distributing cargo production (#9460)
Fix #9440: Negative cargo payments not being handled correctly (#9455)
Fix: [Network] Crash when joining a server again after a TCP disconnect (#9453)
Fix: Don't enable rename button for network clients in build vehicle window (#9452)
Fix: Money could underflow and wrap around (#9451)
Fix: Parse the console settings the same way as config settings (#9438)
Fix: Ensure no more than the allowed number of NewGRFs are loaded from the configuration (#9430)
Fix: [NewGRF] Overflow when determining cargo mask for string code 9A 1E (#9423)
Fix: Integers for scripts are 64bit, but saved as 32bit (#9415)
Fix #9392: [Script] Return a valid value with GetBuildWithRefitCapacity even when AIs are maxed out in vehicles (#9393)
Fix #8169: Crash when autoreplacing vehicle with no orders (#9387)
Fix: Wrong cargo line position in IndustryCargo window (#9383)
Fix: Race-condition during startup of NewGRF scan (#9382)
Fix: Don't propagate Shift/Ctrl state till next game-tick (#9381)
Fix: Prevent palette updates during copying to the video driver (#9379)
Fix: [Network] Determining GetNetworkRevisionString could overflow and underflow its buffer (#9372)
Fix #9358: Don't skip empty files in tar archives (#9367)
Fix: For old savegames, station bus/truck station cache was not updated (#9366)
Fix #9353: [Script] Garbage collecting on priority queues could crash the game (#9356)
Fix: Respect the autosave_on_exit setting for Null video driver (#9343)
Fix: Compatible NewGRFs in crash-log reported wrong MD5 hash (#9340)
Fix: [Script] Ensure the saved script strings are properly validated and terminated (#9336)
Fix #9316: Town bridge length limit check incorrect above 250k inhabitants (#9318)
Fix: Limit heightmap sizes to 8192x8192 (#9307)
Fix #9281: Money generating exploit when buying out a company (#9300)
Fix: Part of a tile might not be redrawn when terraforming (#9296)
Fix: [OpenGL] Increase timeout when waiting for the GPU to be done with the drawing buffer (#9282)
Fix: Vehicles sent in the wrong direction if there is no path to the destination (#9280)
Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing (#9278)
Fix #9267: [Script] Crash during garbage collection (#9275)
Fix: Encountering two-way red signals could prune unrelated Pathfinder branches (#9271)
Fix #9255: [Network] Crash when hostname is not found (#9259)
Fix #9256: Invalid read after free when replacing train chains (#9258)
Fix: [Emscripten] Force secure WebSockets over HTTPS (#9248)
Fix #9242: Tree tick handler did not scale by map size (#9246)
Fix: [Network] Mark server as offline when no longer reachable (#9244)
Fix: [Network] Don't rebuild the host-list during iterating the list (#9240)
Fix: [Network] Don't mark the last-joined server as a manually added server (#9239)
Fix: [Network] Clients leaving because of broken connections was not broadcasted (#9238)
Fix: [Network] Check on CIDR for netmask check considered everything valid (#9235)
Fix: Creating screenshots on dedicated servers failed (#9232)
Fix: Leaking file descriptors for downloaded content (#9229)
Fix: Spelling of several town names (#9222)
Fix #9209: Game hangs when resizing highscore/news window if the screen is too small (#9210)
Fix: [Network] Optimize creating network connections for clients using IPv4 and IPv6 (#9199)
Fix #9186: Fix incorrect bounding box height causing station sprite glitch (#9187)
Fix: Truncating strings in settings could leave invalid UTF-8 characters (#9121)
Fix: Many issues related to window scaling (#9087, #9219)
Fix: Invalidate cached vehicle colourmaps when changing liveries setting (#9006)
Fix #8981: Don't attempt to re-reserve path if already entering/entered depot (#9000)
Fix: Missing 'Town names:' colon in map gen GUI (#8986)
Fix: Sorting and filtering industries that produce/accept many cargoes (#8468)
Remove: [Network] COMPANY_INFO packets (#9475)
Remove: [Network] A server can no longer set a limit to the amount of spectators allowed (#9466)
Remove: Arbitrary limit on number of statically loaded NewGRFs (#9431)
Remove: [Network] Language and map-name from server information (#9070)
1.11.2 (2021-05-03)
------------------------------------------------------------------------
Change: [Win32] Limit hardware accelerated video driver to OpenGL 3.2 or higher (#9077)
@@ -2294,7 +2580,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: [NewGRF] Additional text in fund industry window is NewGRF supplied and thus should have a default colour (r22631)
- Fix: Also initialise _old_vds with newgame settings; TTD savegames do not contain these settings [FS#4622] (r22626)
- Fix: Do not zero the orders of disaster vehicles when converting savegames [FS#4642] (r22625)
- Fix: When closing an AI company the local player cheated to, we need to cheat him to another company [FS#4654] (r22624, r22623)
- Fix: When closing an AI company the local player cheated to, we need to cheat them to another company [FS#4654] (r22624, r22623)
- Fix: When closing down companies their shares in other companies must be sold even if share trading is disabled at that point of time (r22622)
- Fix: When asking the user to confirm an unsafe unpausing, there is no need to execute a command if 'no' is chosen. This also prevents crashing when clicking unpause while the confirm window is shown (r22621)
- Fix: Enforce refit orders to be 'always go to depot' orders; service-only and stop-in-depot orders make no sense with refitting [FS#4651] (r22620)
@@ -3016,7 +3302,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: Chat message caused glitch when rejoining a network game [FS#3757] (r19629)
- Fix: Desync when a command is received and in the queue while a client starts joining, i.e. save the game state. This can happen in two ways: with frame_freq > 1 a command received in a previous frame might not be executed yet or when a command is received in the same frame as the join but before the savegame is made. In both cases the joining client would not get all commands to get in-sync with the server (and the other clients) (r19620)
- Fix: Company related graphs were not updated correctly after changing the company colour [FS#3763] (r19615)
- Fix: Possible invalid read when server moves client to spectators before he finishes joining [FS#3755] (r19613)
- Fix: Possible invalid read when server moves client to spectators before they finish joining [FS#3755] (r19613)
- Fix: Crash when opening a savegame with a waypoint from around 0.4.0 [FS#3756] (r19612)
- Fix: Improve joining behaviour; kicking clients when entering passwords that was just cleared, 'connection lost' for people failing the password, access restriction circumvention [CVE-2010-0401] [FS#3754] (r19610, r19609, r19608, r19607, r19606)
- Fix: Desync debugging; false positives in the cache validity checks and saving/loading the command stream (r19619, r19617, r19602, r19601, r19600, r19596, r19593, r19592, r19589, r19587, r19586)
@@ -3371,7 +3657,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: Do not account for path reservation costs when entering a signal block via a 'block' signal. This way you will not get double penalties, both red signals and reservation costs, for the block signalled tracks [FS#2722] (r18535)
- Fix: [NewGRF] An industry NewGRF that defined a too small size for action0 prop 0A could cause a crash (r18527)
- Fix: Allegro does not like to work with extmidi, so warn the user about that [FS#3272] (r18520)
- Fix: When you pass a signal at danger, in a PBS controlled area, do not try to do the 'safe' thing and stop, but continue going; the user wanted the train to pass the signal at danger so (s)he has to suffer the consequences. Of course one can always stop the train manually [FS#2891] (r18515)
- Fix: When you pass a signal at danger, in a PBS controlled area, do not try to do the 'safe' thing and stop, but continue going; the user wanted the train to pass the signal at danger so they have to suffer the consequences. Of course one can always stop the train manually [FS#2891] (r18515)
- Fix: No error message was created for the first fatal NewGRF error [FS#3368] (r18506)
- Fix: Improve airport movement on several airports [FS#3169] (r18505)
- Fix: Autoreplace and autorenew always reset their cargo sub type to 0. Now find a sub cargo type with the exact same name and use that, otherwise fallback to 0. So cargo sub types can be maintained via autoreplace *if* the new vehicle supports the same cargo sub type [FS#3159] (r18499)
@@ -3854,7 +4140,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: Make the join/spectate command require to be connected to a network game; in SP it could lead to crashes (r15514)
- Fix: Generating a map with the original map generator with freeform edges on resulted in a crash [FS#2641] (r15511)
- Fix: Pre-0.5 OpenTTD stored new_nonstop and full_load_any in a different way, savegame conversion was not working for them (r15500)
- Fix: Crash when opening the game options when the currently loaded base graphics pack has less than 2 valid graphics files. For example when someone replaces all his/her original base graphics with custom work (but keeps the name) or renames the dos ones to windows or vice versa [FS#2630] (r15476)
- Fix: Crash when opening the game options when the currently loaded base graphics pack has less than 2 valid graphics files. For example when someone replaces all their original base graphics with custom work (but keeps the name) or renames the dos ones to windows or vice versa [FS#2630] (r15476)
0.7.0-beta1 (2009-02-16)
@@ -4616,7 +4902,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: Switching players (using the cheat) crashed on Big Endian machines [FS#1150] (r11023)
- Fix: The canal border determination did not take oil rigs into consideration (r11022)
- Fix: Do not display income/expenses when they do not belong to a 'valid' tile, like the money cheat/giving money [FS#1175] (r11021)
- Fix: One could not give money when (s)he had too much money or rather: when casting the amount of money to an int32 becomes negative [FS#1174] (r11020)
- Fix: One could not give money when they had too much money or rather: when casting the amount of money to an int32 becomes negative [FS#1174] (r11020)
- Fix: When determining the gender of a string, do not assume that the gender is in the front of the string when there can be case switching code at that location [FS#1104] (r10792)
- Fix: Determining whether there is a tunnel going under the lowered area is only needed in two directions instead of all four, so take the directions (one for each axis) to the nearest border (along the given axis) [FS#1058] (r10686)
- Fix: Graphical glitches when the 'link landscape toolbar' patch is turned on when opening one of the construction toolbars [FS#1076] (r10685)
@@ -4677,7 +4963,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: Do not unconditionally assume that a tile has a depot (r11027)
- Fix: Give a more correct error when building some things on tile 0 [FS#1173] (r11024)
- Fix: Do not display income/expenses when they do not belong to a 'valid' tile, like the money cheat and giving money [FS#1175] (r11021)
- Fix: One could not give money when (s)he had too much money [FS#1174] (r11020)
- Fix: One could not give money when they had too much money [FS#1174] (r11020)
- Fix: Disallow buying/selling shares in your own company or a bankrupt company [FS#1169] (r11018)
- Fix: Crash when quitting the game in one of the end score windows [FS#1218] (r11071)
@@ -5637,7 +5923,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe
- Fix: Vehicles slow down under bridge if the track is on a foundation
- Fix: You can no longer change name of waypoints whom are owned by somebody else
- Fix: Shares are now also sold when a company goes bankrupt [SF#1090313]
- Fix: It is no longer possible to crash trains of other companies by building a depot close to a station; trains do no longer enter tiles that do not belong to his owner [SF#1087701]
- Fix: It is no longer possible to crash trains of other companies by building a depot close to a station; trains do no longer enter tiles that do not belong to their owner [SF#1087701]
- Fix: Crashed trains are not reported to have too few orders any more [SF#1087403]
- Fix: Backup-order-list was not closed with an OT_NOTHING, [SF#1086375]
- Fix: Docks now have a button to display the catchment area [SF#1085255]

View File

@@ -26,8 +26,10 @@ macro(compile_flags)
add_compile_options(/Zc:rvalueCast)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Enable multi-threaded compilation.
add_compile_options(/MP)
add_compile_options(
/MP # Enable multi-threaded compilation.
/FC # Display the full path of source code files passed to the compiler in diagnostics.
)
endif()
endif()
@@ -41,6 +43,11 @@ macro(compile_flags)
add_link_options(
"$<$<NOT:$<CONFIG:Debug>>:-fstack-protector>" # Prevent undefined references when _FORTIFY_SOURCE > 0
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_link_options(
"$<$<CONFIG:Debug>:-Wl,--disable-dynamicbase,--disable-high-entropy-va,--default-image-base-low>" # ASLR somehow breaks linking for x64 Debug builds
)
endif()
endif()
# Prepare a generator that checks if we are not a debug, and don't have asserts
@@ -49,6 +56,11 @@ macro(compile_flags)
if(MSVC)
add_compile_options(/W3)
if(MSVC_VERSION GREATER 1929)
# Starting with version 19.30, there is an optimisation bug, see #9966 for details
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(
-W
@@ -156,7 +168,7 @@ macro(compile_flags)
message(FATAL_ERROR "No warning flags are set for this compiler yet; please consider creating a Pull Request to add support for this compiler.")
endif()
if(NOT WIN32)
if(NOT WIN32 AND NOT HAIKU)
# rdynamic is used to get useful stack traces from crash reports.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
endif()

View File

@@ -122,6 +122,8 @@ set(CPACK_STRIP_FILES YES)
set(CPACK_OUTPUT_FILE_PREFIX "bundles")
if(APPLE)
# Stripping would produce unreadable stacktraces.
set(CPACK_STRIP_FILES NO)
set(CPACK_GENERATOR "Bundle")
include(PackageBundle)
@@ -129,7 +131,7 @@ if(APPLE)
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macos-universal")
else()
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macos-${CPACK_SYSTEM_NAME}")
endif()
endif()
elseif(WIN32)
set(CPACK_GENERATOR "ZIP")
if(OPTION_USE_NSIS)
@@ -138,6 +140,13 @@ elseif(WIN32)
endif()
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-windows-${CPACK_SYSTEM_NAME}")
if(WINDOWS_CERTIFICATE_COMMON_NAME)
add_custom_command(TARGET openttd
POST_BUILD
COMMAND "${CMAKE_SOURCE_DIR}/os/windows/sign.bat" "$<TARGET_FILE:openttd>" "${WINDOWS_CERTIFICATE_COMMON_NAME}"
)
endif()
elseif(UNIX)
# With FHS, we can create deb/rpm/... Without it, they would be horribly broken
# and not work. The other way around is also true; with FHS they are not
@@ -174,6 +183,10 @@ elseif(UNIX)
if(DISTRO_ID STREQUAL "arch")
set(PLATFORM "arch")
set(CPACK_GENERATOR "TXZ")
elseif(DISTRO_ID STREQUAL "fedora" OR DISTRO_ID STREQUAL "rhel")
set(PLATFORM "fedora")
set(CPACK_GENERATOR "RPM")
include(PackageRPM)
else()
set(UNSUPPORTED_PLATFORM_NAME "Linux distribution '${DISTRO_ID}' from /etc/os-release")
endif()

View File

@@ -18,6 +18,6 @@ function(link_package NAME)
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR} -- ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY}")
endif()
elseif(LP_ENCOURAGED)
message(WARNING "${NAME} not found; compiling OpenTTD without ${NAME} is strongly disencouraged")
message(WARNING "${NAME} not found; compiling OpenTTD without ${NAME} is strongly discouraged")
endif()
endfunction()

View File

@@ -3,6 +3,7 @@
source_group("AI Core" REGULAR_EXPRESSION "src/ai/")
source_group("Blitters" REGULAR_EXPRESSION "src/blitter/")
source_group("Core Source Code" REGULAR_EXPRESSION "src/core/")
source_group("Font Cache" REGULAR_EXPRESSION "src/fontcache/")
source_group("Game Core" REGULAR_EXPRESSION "src/game/")
source_group("MD5" REGULAR_EXPRESSION "src/3rdparty/md5/")
source_group("Misc" REGULAR_EXPRESSION "src/misc/")
@@ -11,12 +12,13 @@ source_group("Network Core" REGULAR_EXPRESSION "src/network/core/")
source_group("OSX" REGULAR_EXPRESSION "src/os/macosx/")
source_group("Pathfinder" REGULAR_EXPRESSION "src/pathfinder/")
source_group("Save/Load handlers" REGULAR_EXPRESSION "src/saveload/")
source_group("Save/Load handlers\\Compat" REGULAR_EXPRESSION "src/saveload/compat/")
source_group("Sound" REGULAR_EXPRESSION "src/sound/")
source_group("Sprite loaders" REGULAR_EXPRESSION "src/spriteloader/")
source_group("Squirrel" REGULAR_EXPRESSION "src/3rdparty/squirrel/squirrel/")
source_group("Tables" REGULAR_EXPRESSION "src/table/")
source_group("Video" REGULAR_EXPRESSION "src/video/")
source_group("Video/GL" REGULAR_EXPRESSION "src/3rdparty/opengl/")
source_group("Video\\GL" REGULAR_EXPRESSION "src/3rdparty/opengl/")
source_group("Widgets" REGULAR_EXPRESSION "src/widgets/")
source_group("Windows files" REGULAR_EXPRESSION "src/os/windows/|\.rc$")

View File

@@ -56,7 +56,7 @@ function(set_options)
option(OPTION_DEDICATED "Build dedicated server only (no GUI)" OFF)
option(OPTION_INSTALL_FHS "Install with Filesystem Hierarchy Standard folders" ${DEFAULT_OPTION_INSTALL_FHS})
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" OFF)
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON)
if(EMSCRIPTEN)
# Although pthreads is supported, it is not in a way yet that is
# useful for us.

1
cmake/PackageRPM.cmake Normal file
View File

@@ -0,0 +1 @@
set(CPACK_RPM_PACKAGE_ARCHITECTURE "${ARCHITECTURE}")

View File

@@ -6,9 +6,6 @@ endif()
if(NOT REV_MINOR)
set(REV_MINOR 0)
endif()
if(NOT REV_BUILD)
set(REV_BUILD 0)
endif()
#
# Finds the current version of the current folder.
@@ -138,7 +135,7 @@ else()
configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
"${FIND_VERSION_BINARY_DIR}/rev.cpp")
if(WIN32)
if(WINDOWS)
message(STATUS "Generating ottdres.rc")
configure_file("${CMAKE_SOURCE_DIR}/src/os/windows/ottdres.rc.in"
"${FIND_VERSION_BINARY_DIR}/ottdres.rc")

View File

@@ -13,6 +13,7 @@ cmake_minimum_required(VERSION 3.5)
# The parameter "enumname" specifies the enumeration to extract. This can also be a regular expression.
# The parameter "filename" specifies the relative path to the file, where the enumeration is extracted from. This can also be a glob expression.
#
# All files where enumerations are extracted from are automatically added via #include
#
if(NOT GENERATE_SOURCE_FILE)
@@ -41,6 +42,7 @@ foreach(ENUM IN LISTS ENUM_LINES)
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" FILE ${FILE})
string(APPEND ${PLACE_HOLDER} "\n${ADD_INDENT}/* automatically generated from ${FILE} */")
list(APPEND INCLUDES "#include \"${FILE}\"")
foreach(LINE IN LISTS SOURCE_LINES)
string(REPLACE "${RM_INDENT}" "" LINE "${LINE}")
@@ -116,4 +118,7 @@ foreach(ENUM IN LISTS ENUM_LINES)
endforeach()
endforeach()
list(REMOVE_DUPLICATES INCLUDES)
string(REPLACE ";" "\n" INCLUDES "${INCLUDES}")
configure_file(${GENERATE_SOURCE_FILE} ${GENERATE_BINARY_FILE})

View File

@@ -35,6 +35,7 @@ execute_process(COMMAND ${OPENTTD_EXECUTABLE}
-vnull:ticks=30000
-d script=2
-d misc=9
-Q
OUTPUT_VARIABLE REGRESSION_OUTPUT
ERROR_VARIABLE REGRESSION_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE

View File

@@ -28,10 +28,10 @@ endmacro()
macro(dump_class_templates NAME)
string(REGEX REPLACE "^Script" "" REALNAME ${NAME})
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} *GetParam(ForceType<${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} &GetParam(ForceType<${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} *GetParam(ForceType<const ${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} &GetParam(ForceType<const ${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} *GetParam(ForceType<${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline ${NAME} &GetParam(ForceType<${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} *GetParam(ForceType<const ${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; }")
string(APPEND SQUIRREL_EXPORT "\n template <> inline const ${NAME} &GetParam(ForceType<const ${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; }")
if("${NAME}" STREQUAL "ScriptEvent")
string(APPEND SQUIRREL_EXPORT "\n template <> inline int Return<${NAME} *>(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; }")
elseif("${NAME}" STREQUAL "ScriptText")

View File

@@ -12,32 +12,11 @@ endif()
if(NOT APIUC)
message(FATAL_ERROR "Script needs APIUC defined")
endif()
if(NOT API_FILES)
message(FATAL_ERROR "Script needs API_FILES defined")
endif()
set(ARGC 1)
set(ARG_READ NO)
# For MSVC CMake runs this script from a batch file using || to detect errors,
# depending on source path it may quote args, and cause cmd to not understand ||
# and pass it as argument to ourself.
# Read all the arguments given to CMake; we are looking for -- and everything
# that follows, until ||. Those are our api files.
while(ARGC LESS CMAKE_ARGC)
set(ARG ${CMAKE_ARGV${ARGC}})
if(ARG STREQUAL "||")
set(ARG_READ NO)
endif()
if(ARG_READ)
list(APPEND SCRIPT_API_BINARY_FILES "${ARG}")
endif()
if(ARG STREQUAL "--")
set(ARG_READ YES)
endif()
math(EXPR ARGC "${ARGC} + 1")
endwhile()
file(READ "${API_FILES}" SCRIPT_API_BINARY_FILES)
foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel \\*engine\\)$")

View File

@@ -0,0 +1,557 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<!-- derived from Iron Horse branch at https://github.com/andythenorth/iron-horse/tree/company_colour_indexes -->
<head>
<title>OpenTTD Company Colour Indexes</title>
<meta charset="UTF-8" />
<style>
th {
vertical-align: top;
border-bottom: solid 1px #ddd;
padding-top: 30px;
padding-right: 15px;
text-align: right;
}
tr.top td {
padding-top: 20px;
}
tr.bottom td {
border-bottom: solid 1px #ddd;
padding-bottom: 10px;
}
td {
text-align: right;
}
span {
border: solid 1px #000;
width: 32px;
height: 32px;
display: inline-block;
vertical-align: top;
margin-left: 0px;
}
</style>
</head>
<body>
<h1>Company Colour Indexes</h1>
<p>Hex / dec indexes into the DOS palette</p>
<p>
Visual representation of values derived from <a href="https://github.com/frosch123/TTDViewer/blob/master/src/recolor.xml#L186">https://github.com/frosch123/TTDViewer/blob/master/src/recolor.xml#L186</a>
</p>
<table style="margin-top:30px;">
<tbody>
<tr class="top">
<th rowspan="3">COLOUR_DARK_BLUE</th>
<td><span style="background-color:rgb( 8, 24, 88)"></span></td>
<td><span style="background-color:rgb( 12, 36, 104)"></span></td>
<td><span style="background-color:rgb( 20, 52, 124)"></span></td>
<td><span style="background-color:rgb( 28, 68, 140)"></span></td>
<td><span style="background-color:rgb( 40, 92, 164)"></span></td>
<td><span style="background-color:rgb( 56, 120, 188)"></span></td>
<td><span style="background-color:rgb( 72, 152, 216)"></span></td>
<td><span style="background-color:rgb(100, 172, 224)"></span></td>
</tr>
<tr>
<td>0xc6</td>
<td>0xc7</td>
<td>0xc8</td>
<td>0xc9</td>
<td>0xca</td>
<td>0xcb</td>
<td>0xcc</td>
<td>0xcd</td>
</tr>
<tr class="bottom">
<td>198</td>
<td>199</td>
<td>200</td>
<td>201</td>
<td>202</td>
<td>203</td>
<td>204</td>
<td>205</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_PALE_GREEN</th>
<td><span style="background-color:rgb( 16, 52, 24)"></span></td>
<td><span style="background-color:rgb( 32, 72, 44)"></span></td>
<td><span style="background-color:rgb( 56, 96, 72)"></span></td>
<td><span style="background-color:rgb( 76, 116, 88)"></span></td>
<td><span style="background-color:rgb( 96, 136, 108)"></span></td>
<td><span style="background-color:rgb(120, 164, 136)"></span></td>
<td><span style="background-color:rgb(152, 192, 168)"></span></td>
<td><span style="background-color:rgb(184, 220, 200)"></span></td>
</tr>
<tr>
<td>0x60</td>
<td>0x61</td>
<td>0x62</td>
<td>0x63</td>
<td>0x64</td>
<td>0x65</td>
<td>0x66</td>
<td>0x67</td>
</tr>
<tr class="bottom">
<td>96</td>
<td>97</td>
<td>98</td>
<td>99</td>
<td>100</td>
<td>101</td>
<td>102</td>
<td>103</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_PINK</th>
<td><span style="background-color:rgb(112, 16, 32)"></span></td>
<td><span style="background-color:rgb(136, 32, 52)"></span></td>
<td><span style="background-color:rgb(160, 56, 76)"></span></td>
<td><span style="background-color:rgb(188, 84, 108)"></span></td>
<td><span style="background-color:rgb(204, 104, 124)"></span></td>
<td><span style="background-color:rgb(220, 132, 144)"></span></td>
<td><span style="background-color:rgb(236, 156, 164)"></span></td>
<td><span style="background-color:rgb(252, 188, 192)"></span></td>
</tr>
<tr>
<td>0x2a</td>
<td>0x2b</td>
<td>0x2c</td>
<td>0x2d</td>
<td>0x2e</td>
<td>0x2f</td>
<td>0x30</td>
<td>0x31</td>
</tr>
<tr class="bottom">
<td>42</td>
<td>43</td>
<td>44</td>
<td>45</td>
<td>46</td>
<td>47</td>
<td>48</td>
<td>49</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_YELLOW</th>
<td><span style="background-color:rgb(128, 68, 8)"></span></td>
<td><span style="background-color:rgb(156, 96, 16)"></span></td>
<td><span style="background-color:rgb(184, 120, 24)"></span></td>
<td><span style="background-color:rgb(212, 156, 32)"></span></td>
<td><span style="background-color:rgb(232, 184, 16)"></span></td>
<td><span style="background-color:rgb(252, 212, 0)"></span></td>
<td><span style="background-color:rgb(252, 248, 128)"></span></td>
<td><span style="background-color:rgb(252, 252, 192)"></span></td>
</tr>
<tr>
<td>0x3e</td>
<td>0x3f</td>
<td>0x40</td>
<td>0x41</td>
<td>0x42</td>
<td>0x43</td>
<td>0x44</td>
<td>0x45</td>
</tr>
<tr class="bottom">
<td>62</td>
<td>63</td>
<td>64</td>
<td>65</td>
<td>66</td>
<td>67</td>
<td>68</td>
<td>69</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_RED</th>
<td><span style="background-color:rgb( 92, 0, 0)"></span></td>
<td><span style="background-color:rgb(128, 0, 0)"></span></td>
<td><span style="background-color:rgb(160, 0, 0)"></span></td>
<td><span style="background-color:rgb(196, 0, 0)"></span></td>
<td><span style="background-color:rgb(224, 0, 0)"></span></td>
<td><span style="background-color:rgb(252, 52, 52)"></span></td>
<td><span style="background-color:rgb(252, 100, 88)"></span></td>
<td><span style="background-color:rgb(252, 144, 124)"></span></td>
</tr>
<tr>
<td>0xb3</td>
<td>0xb4</td>
<td>0xb5</td>
<td>0xb6</td>
<td>0xb7</td>
<td>0xa4</td>
<td>0xa5</td>
<td>0xa6</td>
</tr>
<tr class="bottom">
<td>179</td>
<td>180</td>
<td>181</td>
<td>182</td>
<td>183</td>
<td>164</td>
<td>165</td>
<td>166</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_LIGHT_BLUE</th>
<td><span style="background-color:rgb( 16, 64, 96)"></span></td>
<td><span style="background-color:rgb( 24, 80, 108)"></span></td>
<td><span style="background-color:rgb( 40, 96, 120)"></span></td>
<td><span style="background-color:rgb( 52, 112, 132)"></span></td>
<td><span style="background-color:rgb( 80, 140, 160)"></span></td>
<td><span style="background-color:rgb(116, 172, 192)"></span></td>
<td><span style="background-color:rgb(156, 204, 220)"></span></td>
<td><span style="background-color:rgb(204, 240, 252)"></span></td>
</tr>
<tr>
<td>0x9a</td>
<td>0x9b</td>
<td>0x9c</td>
<td>0x9d</td>
<td>0x9e</td>
<td>0x9f</td>
<td>0xa0</td>
<td>0xa1</td>
</tr>
<tr class="bottom">
<td>154</td>
<td>155</td>
<td>156</td>
<td>157</td>
<td>158</td>
<td>159</td>
<td>160</td>
<td>161</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_GREEN</th>
<td><span style="background-color:rgb( 32, 80, 4)"></span></td>
<td><span style="background-color:rgb( 48, 96, 4)"></span></td>
<td><span style="background-color:rgb( 64, 112, 12)"></span></td>
<td><span style="background-color:rgb( 84, 132, 20)"></span></td>
<td><span style="background-color:rgb( 92, 156, 52)"></span></td>
<td><span style="background-color:rgb(108, 176, 64)"></span></td>
<td><span style="background-color:rgb(124, 200, 76)"></span></td>
<td><span style="background-color:rgb(144, 224, 92)"></span></td>
</tr>
<tr>
<td>0x52</td>
<td>0x53</td>
<td>0x54</td>
<td>0x55</td>
<td>0xce</td>
<td>0xcf</td>
<td>0xd0</td>
<td>0xd1</td>
</tr>
<tr class="bottom">
<td>82</td>
<td>83</td>
<td>84</td>
<td>85</td>
<td>206</td>
<td>207</td>
<td>208</td>
<td>209</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_DARK_GREEN</th>
<td><span style="background-color:rgb( 28, 52, 24)"></span></td>
<td><span style="background-color:rgb( 44, 68, 32)"></span></td>
<td><span style="background-color:rgb( 60, 88, 48)"></span></td>
<td><span style="background-color:rgb( 80, 104, 60)"></span></td>
<td><span style="background-color:rgb(104, 124, 76)"></span></td>
<td><span style="background-color:rgb(128, 148, 92)"></span></td>
<td><span style="background-color:rgb(152, 176, 108)"></span></td>
<td><span style="background-color:rgb(180, 204, 124)"></span></td>
</tr>
<tr>
<td>0x58</td>
<td>0x59</td>
<td>0x5a</td>
<td>0x5b</td>
<td>0x5c</td>
<td>0x5d</td>
<td>0x5e</td>
<td>0x5f</td>
</tr>
<tr class="bottom">
<td>88</td>
<td>89</td>
<td>90</td>
<td>91</td>
<td>92</td>
<td>93</td>
<td>94</td>
<td>95</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_BLUE</th>
<td><span style="background-color:rgb( 0, 52, 160)"></span></td>
<td><span style="background-color:rgb( 0, 72, 184)"></span></td>
<td><span style="background-color:rgb( 0, 96, 212)"></span></td>
<td><span style="background-color:rgb( 24, 120, 220)"></span></td>
<td><span style="background-color:rgb( 56, 144, 232)"></span></td>
<td><span style="background-color:rgb( 88, 168, 240)"></span></td>
<td><span style="background-color:rgb(128, 196, 252)"></span></td>
<td><span style="background-color:rgb(188, 224, 252)"></span></td>
</tr>
<tr>
<td>0x92</td>
<td>0x93</td>
<td>0x94</td>
<td>0x95</td>
<td>0x96</td>
<td>0x97</td>
<td>0x98</td>
<td>0x99</td>
</tr>
<tr class="bottom">
<td>146</td>
<td>147</td>
<td>148</td>
<td>149</td>
<td>150</td>
<td>151</td>
<td>152</td>
<td>153</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_CREAM</th>
<td><span style="background-color:rgb(116, 68, 40)"></span></td>
<td><span style="background-color:rgb(136, 84, 56)"></span></td>
<td><span style="background-color:rgb(164, 96, 64)"></span></td>
<td><span style="background-color:rgb(184, 112, 80)"></span></td>
<td><span style="background-color:rgb(204, 128, 96)"></span></td>
<td><span style="background-color:rgb(212, 148, 112)"></span></td>
<td><span style="background-color:rgb(224, 168, 128)"></span></td>
<td><span style="background-color:rgb(236, 188, 148)"></span></td>
</tr>
<tr>
<td>0x72</td>
<td>0x73</td>
<td>0x74</td>
<td>0x75</td>
<td>0x76</td>
<td>0x77</td>
<td>0x78</td>
<td>0x79</td>
</tr>
<tr class="bottom">
<td>114</td>
<td>115</td>
<td>116</td>
<td>117</td>
<td>118</td>
<td>119</td>
<td>120</td>
<td>121</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_MAUVE</th>
<td><span style="background-color:rgb( 36, 40, 68)"></span></td>
<td><span style="background-color:rgb( 48, 52, 84)"></span></td>
<td><span style="background-color:rgb( 64, 64, 100)"></span></td>
<td><span style="background-color:rgb( 80, 80, 116)"></span></td>
<td><span style="background-color:rgb(100, 100, 136)"></span></td>
<td><span style="background-color:rgb(132, 132, 164)"></span></td>
<td><span style="background-color:rgb(172, 172, 192)"></span></td>
<td><span style="background-color:rgb(212, 212, 224)"></span></td>
</tr>
<tr>
<td>0x80</td>
<td>0x81</td>
<td>0x82</td>
<td>0x83</td>
<td>0x84</td>
<td>0x85</td>
<td>0x86</td>
<td>0x87</td>
</tr>
<tr class="bottom">
<td>128</td>
<td>129</td>
<td>130</td>
<td>131</td>
<td>132</td>
<td>133</td>
<td>134</td>
<td>135</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_PURPLE</th>
<td><span style="background-color:rgb( 40, 20, 112)"></span></td>
<td><span style="background-color:rgb( 64, 44, 144)"></span></td>
<td><span style="background-color:rgb( 88, 64, 172)"></span></td>
<td><span style="background-color:rgb(104, 76, 196)"></span></td>
<td><span style="background-color:rgb(120, 88, 224)"></span></td>
<td><span style="background-color:rgb(140, 104, 252)"></span></td>
<td><span style="background-color:rgb(160, 136, 252)"></span></td>
<td><span style="background-color:rgb(188, 168, 252)"></span></td>
</tr>
<tr>
<td>0x88</td>
<td>0x89</td>
<td>0x8a</td>
<td>0x8b</td>
<td>0x8c</td>
<td>0x8d</td>
<td>0x8e</td>
<td>0x8f</td>
</tr>
<tr class="bottom">
<td>136</td>
<td>137</td>
<td>138</td>
<td>139</td>
<td>140</td>
<td>141</td>
<td>142</td>
<td>143</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_ORANGE</th>
<td><span style="background-color:rgb(184, 120, 24)"></span></td>
<td><span style="background-color:rgb(204, 136, 8)"></span></td>
<td><span style="background-color:rgb(228, 144, 4)"></span></td>
<td><span style="background-color:rgb(252, 156, 0)"></span></td>
<td><span style="background-color:rgb(252, 176, 48)"></span></td>
<td><span style="background-color:rgb(252, 196, 100)"></span></td>
<td><span style="background-color:rgb(252, 216, 152)"></span></td>
<td><span style="background-color:rgb(244, 220, 176)"></span></td>
</tr>
<tr>
<td>0x40</td>
<td>0xc0</td>
<td>0xc1</td>
<td>0xc2</td>
<td>0xc3</td>
<td>0xc4</td>
<td>0xc5</td>
<td>0x27</td>
</tr>
<tr class="bottom">
<td>64</td>
<td>192</td>
<td>193</td>
<td>194</td>
<td>195</td>
<td>196</td>
<td>197</td>
<td>39</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_BROWN</th>
<td><span style="background-color:rgb( 72, 44, 4)"></span></td>
<td><span style="background-color:rgb( 88, 60, 20)"></span></td>
<td><span style="background-color:rgb(104, 80, 44)"></span></td>
<td><span style="background-color:rgb(124, 104, 72)"></span></td>
<td><span style="background-color:rgb(152, 132, 92)"></span></td>
<td><span style="background-color:rgb(184, 160, 120)"></span></td>
<td><span style="background-color:rgb(212, 188, 148)"></span></td>
<td><span style="background-color:rgb(244, 220, 176)"></span></td>
</tr>
<tr>
<td>0x20</td>
<td>0x21</td>
<td>0x22</td>
<td>0x23</td>
<td>0x24</td>
<td>0x25</td>
<td>0x26</td>
<td>0x27</td>
</tr>
<tr class="bottom">
<td>32</td>
<td>33</td>
<td>34</td>
<td>35</td>
<td>36</td>
<td>37</td>
<td>38</td>
<td>39</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_GREY</th>
<td><span style="background-color:rgb( 64, 64, 64)"></span></td>
<td><span style="background-color:rgb( 80, 80, 80)"></span></td>
<td><span style="background-color:rgb(100, 100, 100)"></span></td>
<td><span style="background-color:rgb(116, 116, 116)"></span></td>
<td><span style="background-color:rgb(132, 132, 132)"></span></td>
<td><span style="background-color:rgb(148, 148, 148)"></span></td>
<td><span style="background-color:rgb(168, 168, 168)"></span></td>
<td><span style="background-color:rgb(184, 184, 184)"></span></td>
</tr>
<tr>
<td>0x4</td>
<td>0x5</td>
<td>0x6</td>
<td>0x7</td>
<td>0x8</td>
<td>0x9</td>
<td>0xa</td>
<td>0xb</td>
</tr>
<tr class="bottom">
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
</tr>
<tr class="top">
<th rowspan="3">COLOUR_WHITE</th>
<td><span style="background-color:rgb(132, 132, 132)"></span></td>
<td><span style="background-color:rgb(148, 148, 148)"></span></td>
<td><span style="background-color:rgb(168, 168, 168)"></span></td>
<td><span style="background-color:rgb(184, 184, 184)"></span></td>
<td><span style="background-color:rgb(200, 200, 200)"></span></td>
<td><span style="background-color:rgb(216, 216, 216)"></span></td>
<td><span style="background-color:rgb(232, 232, 232)"></span></td>
<td><span style="background-color:rgb(252, 252, 252)"></span></td>
</tr>
<tr>
<td>0x8</td>
<td>0x9</td>
<td>0xa</td>
<td>0xb</td>
<td>0xc</td>
<td>0xd</td>
<td>0xe</td>
<td>0xf</td>
</tr>
<tr class="bottom">
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
</tr>
</tbody>
</table>
</body>
</html>

117
docs/eints.md Normal file
View File

@@ -0,0 +1,117 @@
# Translations for OpenTTD
Eints is [OpenTTD's WebTranslator](https://translator.openttd.org/).
- Registered translators translate from English to their language.
- Eints validates the translations syntactically and that parameter usage matches the English base language.
- Eints synchronises translations to OpenTTD's repository every day, shortly before the nightly build.
When adding or altering strings in english.txt, you should stick to some rules, so translations are handled smoothly by Eints and translators.
This document gives some guidelines.
## I want to change a translation.
### I want to become a regular translator.
Just [sign up](https://github.com/OpenTTD/team/issues/new/choose) as a translator.
### I only want to point out some issues / typos in the current translation, or suggest a change.
[Open an issue](https://github.com/OpenTTD/OpenTTD/issues/new/choose), so it can be assigned to the translation team of the language.
The translators will decide whether, where and how to apply your suggestion.
### I want to submit translations via PR.
Sorry, we don't offer this option.
### I want to change the language definition (plural form, genders, cases) of a translation.
Please [create an issue](https://github.com/OpenTTD/OpenTTD/issues/new/choose) for this.
### I want to add an entirely new translation language.
OpenTTD has more than 4000 strings, translating all of them is a lot of work.
Despite the initial enthusiasm, only few people have the endurance to get to even 20% translation progress.
As such, starting a new translation requires the prospect that there is also translation interest in the future.
And, frankly, OpenTTD probably already covers all languages to which this applies, and a few more.
If you still want to make the case, that your language is spoken by several 100 million people, please [create an issue](https://github.com/OpenTTD/OpenTTD/issues/new/choose) for adding a new language.
## I want to change the English base language (english.txt).
### I want to change the wording / fix a typo in an English string, without changing the meaning (drastically).
Just change it in your PR.
Translators will be notified that their translation became "outdated", so they can double-check whether the translation needs updating.
### I want to add/change/remove parameters from an English string.
Just change the parameters in english.txt in your PR.
Don't touch the translations, please ignore compile warnings about them.
Translators will be notified that their translation became "invalid", so they can adjust the translation.
Eints will remember the old translations for translators to view, but remove them from the git repository, while they are "invalid"; so there won't be any compile warnings after the nightly sync.
### I want to change the meaning of an English string, so that no existing translation makes any sense anymore.
In this case, please change the STR_xxx string identifier of the string; basically: remove the old string, add a new one.
Don't touch the translations, please ignore compile warnings about them.
Eints will discard all memory of the old strings in the nightly sync, and translators can start fresh with a new string.
### I want to add a new string.
Add the new string somewhere in english.txt, where it fits with the neighbouring strings.
Don't touch the translations, even if you can speak some of the languages.
### I want to remove an unused string.
Remove the string from english.txt.
Don't touch the translations, please ignore compile warnings about them.
Eints will remove the translations from the git repository in the nightly sync.
### I want to reorder strings in english.txt without changing them.
Reorder english.txt as you like. Don't touch the translations.
Eints will reorder all translations to match english.txt in the nightly sync.
### I want to add/change '#' comments.
Change comments in english.txt as you like. Don't touch the translations.
Eints will replicate comments into all translations in the nightly sync. Comments are not translated.
### I want to change the STR_xxx string identifier for code style reasons, without changing the English text.
This is the only case, where your PR should also edit translations.
The STR_xxx string identifier is used by Eints as key value to track strings and translations. If you change it, that's the same as deleting a string and adding an unrelated new one.
So, to keep translations, you have to replace the STR_xxx for all translations in the PR as well.
However, you will only be able to keep the translations which are part of the git repository.
Translation history and information about translations being "outdated" will be lost.
So, keep your code style OCD to a minimum :)
## I want to fight a bot and lose.
Here are some things, people sometimes want to do, but which won't work.
### I want to enforce re-translation by clearing current translations.
You have to change the STR_xxx string identifier, that's the only option.
You cannot "clear" translations by removing them via PR; eints will reinstall the previous "syntactically perfect valid" translation.
### I want to revert a broken change, some translator just did via eints.
You have to revert the translations via the WebTranslator interface.
If there are many changes, ask someone with Admin access to eints, so they can manually upload a fixed translation file to eints.
You cannot revert translations changes via PR. Eints merges translations from git and from web by keeping a translation history, and committing the newest translation to git.
If you revert to an old translation in git, eints will simply think git did not yet get the newer translation, and commit it again.

83
docs/game_coordinator.md Normal file
View File

@@ -0,0 +1,83 @@
# Game Coordinator
To allow two players to play together, OpenTTD uses a Game Coordinator to
facilitate this.
When a server starts, it can register itself to the Game Coordinator. This
happens when `server_game_type` is set to either `invite-only` or `public`.
Upon registration, the Game Coordinator probes the network of the server, and
assigns the server an unique code, called an `invite code`.
When a client wants to join a server, it asks the Game Coordinator to help
with this by giving it the `invite code` of the server. The Game Coordinator
will, in this order, attempt several ways to connect the client and server
together:
## 1) Via direct IPv4 / IPv6
Upon registration, the Game Coordinator probes the server to see if a
direction connection to the server is possible based on the game port. It
tries this over the public IPv4 and IPv6, as announced by the server.
If either (or both) are successful, a client will always be asked to try
these direct IPs first when it wants to connect to this server.
- If the server is IPv4 only, the client is only asked to connect via IPv4.
- If the server is IPv6 only, the client is only asked to connect via IPv6.
- If the server is both IPv4 and IPv6, the client is asked to connect to to
one of those first. If that fails, it is asked to connect to the other.
Whether it tries IPv4 or IPv6 first, strongly depends on several network
infrastructure related events. The biggest influence is the network
latency over both protocols to the OpenTTD infrastructure.
In the end, if either the server is not reachable directly from the Internet
or the client fails to connect to either one of them, the connection attempt
continues with the next available method.
## 2) Via STUN
When a client wants to join a server via STUN, both the client and server
are asked to create a connection to the STUN server (normally
`stun.openttd.org`) via both IPv4 and IPv6. If the client or server has no
IPv4 or IPv6, it will not make a connection attempt via that protocol.
The STUN server collects the public IPv4 and/or IPv6 of the client and server,
together with the port the connection came in from. For most NAT gateways it
holds true that as long as you use the same local IP + port, your public
IP + port will remain the same, and allow for bi-directional communication.
And this fact is used to later on pair the client and server.
The STUN server reports this information directly to the Game Coordinator
(this in contrast to most STUN implementation, where this information is
first reported back to the peer itself, which has to relay it back to the
coordinator. OpenTTD skips this step, as the STUN server can directly talk to
the Game Coordinator). When the Game Coordinator sees a matching pair (in
terms of IPv4 / IPv6), it will ask both the client and server to connect to
their peer based on this public IP + port.
As the NAT gateway forwards the traffic on the public IP + port to the local
port, this creates a bi-directional socket between client and server. The
connection to the STUN server can now safely be closed, and the client and
server can continue to talk to each other.
Some NAT gateways do not allow this method; for those this attempt will fail,
and this also means that it is not possible to create a connection between
the client and server.
## 3) Via TURN
As a last resort, the Game Coordinator can decide to connect the client and
server together via TURN. TURN is a relay service, relaying the messages
between client and server.
As the client and server can already connect to the Game Coordinator, it is
very likely this is successful.
It is important to note that a relay service has full view of the traffic
send between client and server, and as such it is important that you trust
the relay service used.
For official binaries, this relay service is hosted by openttd.org. The relay
service as hosted by openttd.org only validates it is relaying valid OpenTTD
packets and does no further inspection of the payload itself.
Although in our experience most patch-packs also use the services as offered
by openttd.org, it is possible they use different services. Please be mindful
about this.

View File

@@ -79,7 +79,7 @@ the array so you can quickly see what is used and what is not.
<tr>
<td rowspan="2">0</td>
<td class="caption">ground</td>
<td class="bits" rowspan=27><span class="used" title="Tile type">XXXX</span> <span class="used" title="Presence and direction of bridge above">XX</span> <span class="used" title="Tropic Zone: only meaningfull in tropic climate. It contains the definition of the available zones">XX</span></td>
<td class="bits" rowspan=27><span class="used" title="Tile type">XXXX</span> <span class="used" title="Presence and direction of bridge above">XX</span> <span class="used" title="Tropic Zone: only meaningful in tropic climate. It contains the definition of the available zones">XX</span></td>
<td class="bits" rowspan=27><span class="used" title="Tile height">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOO</span><span class="usable" title="Owner (always OWNER_NONE)">1 OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>

View File

@@ -1,220 +1,207 @@
# Multiplayer manual for OpenTTD
Last updated: 2011-02-16
## Table of contents
- 1.0) [Starting a server](#10-starting-a-server)
- 2.0) [Connecting to a server](#20-connecting-to-a-server)
- 2.1) [Connecting to a server over the console](#21-connecting-to-a-server-over-the-console)
- 2.1) [Connecting to a server over the console](#21-connecting-to-a-server-over-the-console)
- 3.0) [Playing internet games](#30-playing-internet-games)
- 4.0) [Tips for servers](#40-tips-for-servers)
- 4.1)[Imposing landscaping limits](#41-imposing-landscaping-limits)
- 4.1)[Imposing landscaping limits](#41-imposing-landscaping-limits)
- 5.0) [Some useful things](#50-some-useful-things)
- 6.0) [Troubleshooting](#60-troubleshooting)
## 1.0) Starting a server
- Make sure that you have your firewall of the computer as well as possible
routers or modems of the server configured such that:
- port 3979 is free for both UDP and TCP connections in- and outgoing
- port 3978 is free outbound for UDP in order to advertise with the master
server (if desired). Otherwise you'll have to tell players your IP.
- port 3977 if use of the admin interface is desired (see admin_network.txt)
- Click "multiplayer" on the startup screen
- Click "start server"
- Type in a game name
- Select the type of game ('LAN/Internet' or 'Internet (advertise)'. With the
last one other people are able to see you online. Else they need your IP and
port to join)
- Click "start game", "load game" or "load scenario"
- Start playing
- Click on "Multiplayer" in the Start Menu.
- Click on "Start Server".
- Give your server a name.
- Select the visibility of your server:
- "Public": your server will be publicly listed.
- "Invite Only": only players who have the invite code for your server can
join.
- "Local": only players on your local network can join.
- (optional) Set a password for your server.
- Click "New Game", "Load Game", or "Play Scenario".
- Start playing.
## 2.0) Connecting to a server
- Click "multiplayer" on the startup screen
- If you want to connect to any network game in your LAN click on 'LAN', then
on 'Find Server'
- If you want to see which servers all online on the Internet, click on
'Internet' and 'Find Server'
- If there were more than one server
- select one in the list below the buttons
- click on 'join game'
- If you want to play and you have the ip or hostname of the game server you
want connect to.
- click add server
- type in the ip address or hostname
- if you want to add a port use :<port>
- Now you can select a company and press: "Join company", to help that company
- Or you can press "Spectate game", to spectate the game
- Or you can press "New company", and start your own company (if there are
slots free)
- You see a progressbar how far you are with joining the server.
- Happy playing
- Click on "Multiplayer" in the Start Menu.
- There are three ways to join a server:
- If you want to connect to a local server, click "Search LAN".
- If you want to connect to a public game, click "Search internet".
- If the server-owner shared an invite code with you:
- Click "Add Server".
- Fill in the invite code, which always starts with a `+`.
- Click "OK".
- Click on the server you want to join.
- Click "Join Game".
- If the server has a password, it will ask you for this.
- You see a progressbar how far you are with joining the server.
- Happy playing.
## 2.1) Connecting to a server over the console
- Open the console and type in the following command:
connect `<ip/host>:<port>#<company-no>`
- Open the console and type `connect` for help how to connect via the console.
## 3.0) Playing internet games
- Servers with a red dot behind it have a different version then you have. You
will not be able to join those servers.
- Servers with a red dot behind it have a different version then you have. You
will not be able to join those servers.
- Servers with a yellow dot behind it have NewGRFs that you do not have. You
will not be able to join those servers. However, via "NewGRF Settings" and
"Find missing content online" you might be able to download the needed
NewGRFs after which you can join the server.
- Servers with a yellow dot behind it have NewGRFs that you do not have. You
will not be able to join those servers. However, via "NewGRF Settings" and
"Find missing content online" you might be able to download the needed
NewGRFs after which you can join the server.
- It can happen that a connection is that slow, or you have that many clients
connected to your server, that your clients start to loose their connection.
Some things you can do about it:
- [network] frame_freq:
change it in console with: 'set network.frame_freq <number>'
the number should be between the 0 and 10, not much higher. It indicates
the delay between clicking and showing up. The higher, the more you notice
it, but the less bandwidth you use.
A good value for Internet-games is 2 or 3.
- It can happen that a connection is that slow, or you have that many clients
connected to your server, that your clients start to loose their connection.
Some things you can do about it:
- `[network] frame_freq`:
change it in console with: `set network.frame_freq <number>`
the number should be between the 0 and 10, not much higher. It indicates
the delay between clicking and showing up. The higher, the more you notice
it, but the less bandwidth you use.
A good value for Internet-games is 2 or 3.
- [network] sync_freq:
change it in console with: 'set network.sync_freq <number>'
the number should be between the 50 and 1000, not much lower, not much
higher. It indicates the time between sync-frames. A sync-frame is a frame
which checks if all clients are still in sync. When the value it too high,
clients can desync in 1960, but the server detects it in 1970. Not really
handy. The lower the value, the more bandwidth it uses.
NB: changing frame_freq has more effect on the bandwidth then sync_freq.
- `[network] sync_freq`:
change it in console with: `set network.sync_freq <number>`
the number should be between the 50 and 1000, not much lower, not much
higher. It indicates the time between sync-frames. A sync-frame is a frame
which checks if all clients are still in sync. When the value it too high,
clients can desync in 1960, but the server detects it in 1970. Not really
handy. The lower the value, the more bandwidth it uses.
NB: changing `frame_freq` has more effect on the bandwidth then `sync_freq`.
## 4.0) Tips for servers
- You can launch a dedicated server by adding -D as parameter.
- In UNIX like systems, you can fork your dedicated server by adding -f as
parameter.
- You can launch a dedicated server by adding `-D` as parameter.
- In UNIX like systems, you can fork your dedicated server by adding `-f` as
parameter.
- You can automatically clean companies that do not have a client connected to
them, for, let's say, 3 years. You can do this via: 'set autoclean_companies'
and 'set autoclean_protected' and 'set autoclean_unprotected'. Unprotected
removes a password from a company when it is not used for more then the
defined amount of months. 'set autoclean_novehicles' can be used to remove
companies without any vehicles quickly.
- You can automatically clean companies that do not have a client connected to
them, for, let's say, 3 years. You can do this via: `set autoclean_companies`
and `set autoclean_protected` and `set autoclean_unprotected`. Unprotected
removes a password from a company when it is not used for more then the
defined amount of months. `set autoclean_novehicles` can be used to remove
companies without any vehicles quickly.
- You can also do this manually via the console: 'reset_company'.
- You can also do this manually via the console: `reset_company`.
- You can let your server automatically restart a map when, let's say, year 2030
is reached. See 'set restart_game_date' for detail.
- You can let your server automatically restart a map when, let's say,
year 2030 is reached. See `set restart_game_date` for detail.
- If you want to be on the server-list, enable Advertising. To do this, select
'Internet (advertise)' in the Start Server menu, or type in console:
'set server_advertise 1'.
- If you want to be on the server-list, make your server public. You can do
this either from the Start Server window, via the in-game Online Players
window, or by typing in the console: `set server_game_type public`.
- You can protect your server with a password via the console: 'set server_pw',
or via the Start Server menu.
- You can protect your server with a password via the console: `set server_pw`,
or via the Start Server menu.
- When you have many clients connected to your server via Internet, watch your
bandwidth (if you have any limit on it, set by your ISP). One client uses
about 1.5 kilobytes per second up and down. To decrease this amount, setting
'frame_freq' to 1 will reduce it to roughly 1 kilobyte per second per client.
- When you have many clients connected to your server via Internet, watch your
bandwidth (if you have any limit on it, set by your ISP). One client uses
about 1.5 kilobytes per second up and down. To decrease this amount, setting
`frame_freq` to 1 will reduce it to roughly 1 kilobyte per second per client.
- OpenTTD's default settings for maximum number of clients, and amount of data
from clients to process are chosen to not influence the normal playing of
people, but to prevent or at least make it less likely that someone can
perform a (distributed) denial-of-service attack on your server by causing
an out-of-memory event by flooding the server with data to send to all
clients. The major factor in this is the maximum number of clients; with
32 clients "only" sending one chat message causes 1024 messages to be
distributed in total, with 64 clients that already quadruples to 4096. Given
that upstream bandwidth is usually the limiting factor, a queue of packets
that need to be sent will be created.
To prevent clients from exploiting this "explosion" of packets to send we
limit the number of incoming data, resulting in effectively limiting the
amount of data that OpenTTD will send to the clients. Even with the default
limits it is possible to generate about 70.000 packets per second, or about
7 megabit per second of traffic.
Given that OpenTTD kicks clients after they have not reacted within about 9
seconds from sending a frame update packet it would be possible that OpenTTD
keeps about 600.000 packets in memory, using about 50 megabytes of memory.
Given that OpenTTD allows short bursts of packets, you can have slightly
more packets in memory in case of a distributed denial of service attack.
When increasing the amount of incoming data, or the maximum number of
clients the amount of memory OpenTTD needs in case of a distributed denial
of service attack is linearly related to the amount of incoming data and
quadratic to the amount of clients. In short, a rule of thumb for, the
maximum memory usage for packets is:
#max_clients * #max_clients * bytes_per_frame * 10 KiB.
- OpenTTD's default settings for maximum number of clients, and amount of data
from clients to process are chosen to not influence the normal playing of
people, but to prevent or at least make it less likely that someone can
perform a (distributed) denial-of-service attack on your server by causing
an out-of-memory event by flooding the server with data to send to all
clients. The major factor in this is the maximum number of clients; with
32 clients "only" sending one chat message causes 1024 messages to be
distributed in total, with 64 clients that already quadruples to 4096. Given
that upstream bandwidth is usually the limiting factor, a queue of packets
that need to be sent will be created.
To prevent clients from exploiting this "explosion" of packets to send we
limit the number of incoming data, resulting in effectively limiting the
amount of data that OpenTTD will send to the clients. Even with the default
limits it is possible to generate about 70.000 packets per second, or about
7 megabit per second of traffic.
Given that OpenTTD kicks clients after they have not reacted within about 9
seconds from sending a frame update packet it would be possible that OpenTTD
keeps about 600.000 packets in memory, using about 50 megabytes of memory.
Given that OpenTTD allows short bursts of packets, you can have slightly
more packets in memory in case of a distributed denial of service attack.
When increasing the amount of incoming data, or the maximum number of
clients the amount of memory OpenTTD needs in case of a distributed denial
of service attack is linearly related to the amount of incoming data and
quadratic to the amount of clients. In short, a rule of thumb for, the
maximum memory usage for packets is:
`#max_clients * #max_clients * bytes_per_frame * 10 KiB`.
### 4.1) Imposing landscaping limits
- You can impose limits on companies by the following 4 settings:
- terraform_per_64k_frames
- terraform_frame_burst
- clear_per_64k_frames
- clear_frame_burst
- You can impose limits on companies by the following 4 settings:
- `terraform_per_64k_frames`
- `terraform_frame_burst`
- `clear_per_64k_frames`
- `clear_frame_burst`
- Explaining 'per_64K_frames' and 'burst'
- 'burst' defines 3 things, the maximum limit, the limit of a single action,
and the initial value for the limit assigned to a new company.
This setting is fairly simple and requires no math.
- Explaining `NNN_burst` and `NNN_per_64K_frames`
- `NNN_burst` defines 3 things, the maximum limit, the limit of a single
action, and the initial value for the limit assigned to a new company.
This setting is fairly simple and requires no math.
A value of 1 means a single tile can be affected by a single action.
This results in having to click 400 times when wanting to cover an area
of 20 x 20 tiles.
A value of 1 means a single tile can be affected by a single action.
This results in having to click 400 times when wanting to cover an area
of 20 x 20 tiles.
The default value 4096 covers an area of 64 x 64 tiles.
The default value 4096 covers an area of 64 x 64 tiles.
- 'per_64k_frames' defines the number of tiles added to each companies limit
per frame (however not past the possible maximum value,the 'burst').
64k rather resembles the exact number of 65536 frames. So setting this
variable to 65536 means: 65536 / 65536 = 1 tile per frame.
As a day consists of 74 frames, a company's limit is increased by 74
tiles during the course of a single day (2.22 seconds).
- `NNN_per_64K_frames` defines the number of tiles added to each companies
limit per frame (however not past the possible maximum value,the
`NNN_burst`). 64k rather resembles the exact number of 65536 frames. So
setting this variable to 65536 means: `65536 / 65536 = 1 tile per frame`.
To achieve a 1 tile per day increase the following calculation is needed:
1 / 74 (frames per day) * 65536 (per_64k_frames) = 885.62...
after rounding: a value of 886 means adding a bit over 1 tile per day.
As a day consists of 74 frames, a company's limit is increased by 74
tiles during the course of a single day (2.22 seconds).
To achieve a 1 tile per day increase the following calculation is needed:
`1 / 74 (frames per day) * 65536 (per_64k_frames) = 885.62...`.
After rounding: a value of 886 means adding a bit over 1 tile per day.
There is still enough space to scale this value downwards:
decreasing this value to 127 results in a bit over 1 tile added to the
allowance per week (7 days).
There is still enough space to scale this value downwards:
decreasing this value to 127 results in a bit over 1 tile added to the
allowance per week (7 days).
To create a setup in which a company gets an initial allowance only,
set the value to 0 - no increase of the allowance per frame.
- Even though construction actions include a clear tile action, they are not
affected by the above settings.
To create a setup in which a company gets an initial allowance only,
set the value to 0 - no increase of the allowance per frame.
- Even though construction actions include a clear tile action, they are not
affected by the above settings.
## 5.0) Some useful things
- You can protect your company so nobody else can join uninvited. To do this,
set a password in your Company Screen
- You can protect your company so nobody else can join uninvited. To do this,
set a password in your Company window.
- You can give other players some money via the ClientList (under the 'head'
in the mainbar).
- You can chat with other players via ENTER or via SHIFT+T or via the ClientList
- Servers can now kick players, so don't make them use it!
- You can chat with other players via ENTER or via SHIFT+T or via the Online
Players window
- Servers can kick players, so don't make them use it!
## 6.0) Troubleshooting
- My advertising server does not show up in list at servers.openttd.org
Run openttd with the '-d net=2' parameter. That will show which incoming
communication is received, whether the replies from the master server or
communication from an admin tool reach the programme. See section 1
'Starting a server' further up for the ports and protocols used by OpenTTD.
The ports can be configured in the config file.
### My server does not show up in the serverlist
- My advertising server warns a lot about getaddrinfo taking N seconds
This could be a transient issue with your (local) DNS server, but if the
problem persists there is likely a configuration issue in DNS resolving
on your computer. This seems to be a common configuration issue for
Docker instances, where the DNS resolving waits for a time out of usually
5 seconds.
Check if the visibility of your server is set to `public`.
If it is, and your server still isn't showing up, start OpenTTD with
`-d net=4` as extra argument. This will show debug message related to the
network, including communication to/from the Game Coordinator.
### My server warns a lot about getaddrinfo taking N seconds
This could be a transient issue with your (local) DNS server, but if the
problem persists there is likely a configuration issue in DNS resolving on
your computer.
#### Running OpenTTD in a Docker container?
This is an issue with dual-stack Docker containers. If there is no default
IPv6 resolver and IPv6 traffic is preferred, DNS requests will time out after
5 seconds. To resolve this, use an IPv4 DNS server for your Docker container,
for example by adding `--dns 1.1.1.1` to your `docker run` command.

214
docs/savegame_format.md Normal file
View File

@@ -0,0 +1,214 @@
# OpenTTD's Savegame Format
Last updated: 2021-06-15
## Outer container
Savegames for OpenTTD start with an outer container, to contain the compressed data for the rest of the savegame.
`[0..3]` - The first four bytes indicate what compression is used.
In ASCII, these values are possible:
- `OTTD` - Compressed with LZO (deprecated, only really old savegames would use this).
- `OTTN` - No compression.
- `OTTZ` - Compressed with zlib.
- `OTTX` - Compressed with LZMA.
`[4..5]` - The next two bytes indicate which savegame version used.
`[6..7]` - The next two bytes can be ignored, and were only used in really old savegames.
`[8..N]` - Next follows a binary blob which is compressed with the indicated compression algorithm.
The rest of this document talks about this decompressed blob of data.
## Data types
The savegame is written in Big Endian, so when we talk about a 16-bit unsigned integer (`uint16`), we mean it is stored in Big Endian.
The following types are valid:
- `1` - `int8` / `SLE_FILE_I8` -8-bit signed integer
- `2` - `uint8` / `SLE_FILE_U8` - 8-bit unsigned integer
- `3` - `int16` / `SLE_FILE_I16` - 16-bit signed integer
- `4` - `uint16` / `SLE_FILE_U16` - 16-bit unsigned integer
- `5` - `int32` / `SLE_FILE_I32` - 32-bit signed integer
- `6` - `uint32` / `SLE_FILE_U32` - 32-bit unsigned integer
- `7` - `int64` / `SLE_FILE_I64` - 64-bit signed integer
- `8` - `uint64` / `SLE_FILE_U64` - 64-bit unsigned integer
- `9` - `StringID` / `SLE_FILE_STRINGID` - a StringID inside the OpenTTD's string table
- `10` - `str` / `SLE_FILE_STRING` - a string (prefixed with a length-field)
- `11` - `struct` / `SLE_FILE_STRUCT` - a struct
### Gamma value
There is also a field-type called `gamma`.
This is most often used for length-fields, and uses as few bytes as possible to store an integer.
For values <= 127, it uses a single byte.
For values > 127, it uses two bytes and sets the highest bit to high.
For values > 32767, it uses three bytes and sets the two highest bits to high.
And this continues till the value fits.
In a more visual approach:
```
0xxxxxxx
10xxxxxx xxxxxxxx
110xxxxx xxxxxxxx xxxxxxxx
1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx
11110--- xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
```
## Chunks
Savegames for OpenTTD store their data in chunks.
Each chunk contains data for a certain part of the game, for example "Companies", "Vehicles", etc.
`[0..3]` - Each chunk starts with four bytes to indicate the tag.
If the tag is `\x00\x00\x00\x00` it means the end of the savegame is reached.
An example of a valid tag is `PLYR` when looking at it via ASCII, which contains the information of all the companies.
`[4..4]` - Next follows a byte where the lower 4 bits contain the type.
The possible valid types are:
- `0` - `CH_RIFF` - This chunk is a binary blob.
- `1` - `CH_ARRAY` - This chunk is a list of items.
- `2` - `CH_SPARSE_ARRAY` - This chunk is a list of items.
- `3` - `CH_TABLE` - This chunk is self-describing list of items.
- `4` - `CH_SPARSE_TABLE` - This chunk is self-describing list of items.
Now per type the format is (slightly) different.
### CH_RIFF
(since savegame version 295, this chunk type is only used for MAP-chunks, containing bit-information about each tile on the map)
A `CH_RIFF` starts with an `uint24` which together with the upper-bits of the type defines the length of the chunk.
In pseudo-code:
```
type = read uint8
if type == 0
length = read uint24
length |= ((type >> 4) << 24)
```
The next `length` bytes are part of the chunk.
What those bytes mean depends on the tag of the chunk; further details per chunk can be found in the source-code.
### CH_ARRAY / CH_SPARSE_ARRAY
(this chunk type is deprecated since savegame version 295 and is no longer in use)
`[0..G1]` - A `CH_ARRAY` / `CH_SPARSE_ARRAY` starts with a `gamma`, indicating the size of the next item plus one.
If this size value is zero, it indicates the end of the list.
This indicates the full length of the next item minus one.
In psuedo-code:
```
loop
size = read gamma - 1
if size == -1
break loop
read <size> bytes
```
`[]` - For `CH_ARRAY` there is an implicit index.
The loop starts at zero, and every iteration adds one to the index.
For entries in the game that were not allocated, the `size` will be zero.
`[G1+1..G2]` - For `CH_SPARSE_ARRAY` there is an explicit index.
The `gamma` following the size indicates the index.
The content of the item is a binary blob, and similar to `CH_RIFF`, it depends on the tag of the chunk what it means.
Please check the source-code for further details.
### CH_TABLE / CH_SPARSE_TABLE
(this chunk type only exists since savegame version 295)
Both `CH_TABLE` and `CH_SPARSE_TABLE` are very similar to `CH_ARRAY` / `CH_SPARSE_ARRAY` respectively.
The only change is that the chunk starts with a header.
This header describes the chunk in details; with the header you know the meaning of each byte in the binary blob that follows.
`[0..G]` - The header starts with a `gamma` to indicate the size of all the headers in this chunk plus one.
If this size value is zero, it means there is no header, which should never be the case.
Next follows a list of `(type, key)` pairs:
- `[0..0]` - Type of the field.
- `[1..G]` - `gamma` to indicate length of key.
- `[G+1..N]` - Key (in UTF-8) of the field.
If at any point `type` is zero, the list stops (and no `key` follows).
The `type`'s lower 4 bits indicate the data-type (see chapter above).
The `type`'s 5th bit (so `0x10`) indicates if the field is a list, and if this field in every record starts with a `gamma` to indicate how many times the `type` is repeated.
If the `type` indicates either a `struct` or `str`, the `0x10` flag is also always set.
As the savegame format allows (list of) structs in structs, if any `struct` type is found, this header will be followed by a header of that struct.
This nesting of structs is stored depth-first, so given this table:
```
type | key
-----------------
uint8 | counter
struct | substruct1
struct | substruct2
```
With `substruct1` being like:
```
type | key
-----------------
uint8 | counter
struct | substruct3
```
The headers will be, in order: `table`, `substruct1`, `substruct3`, `substruct2`, each ending with a `type` is zero field.
After reading all the fields of all the headers, there is a list of records.
To read this, see `CH_ARRAY` / `CH_SPARSE_ARRAY` for details.
As each `type` has a well defined length, you can read the records even without knowing anything about the chunk-tag yourself.
Do remember, that if the `type` had the `0x10` flag active, the field in the record first has a `gamma` to indicate how many times that `type` is repeated.
#### Guidelines for network-compatible patch-packs
For network-compatible patch-packs (client-side patches that can play together with unpatched clients) we advise to prefix the field-name with `__<shortname>` when introducing new fields to an existing chunk.
Example: you have an extra setting called `auto_destroy_rivers` you want to store in the savegame for your patched client called `mypp`.
We advise you to call this setting `__mypp_auto_destroy_rivers` in the settings chunk.
Doing it this way ensures that a savegame created by these patch-packs can still safely be loaded by unpatched clients.
They will simply ignore the field and continue loading the savegame as usual.
The prefix is strongly advised to avoid conflicts with future-settings in an unpatched client or conflicts with other patch-packs.
## Scripts custom data format
Script chunks (`AIPL` and `GSDT`) use `CH_TABLE` chunk type.
At the end of each record there's an `uint8` to indicate if there's custom data (1) or not (0).
There are 6 data types for scripts, called `script-data-type`.
When saving, each `script-data-type` starts with the type marker saved as `uint8` followed by the actual data.
- `0` - `SQSL_INT`:
- an `int64` with the actual value (`int32` before savegame version 296).
- `1` - `SQSL_STRING`:
- an `uint8` with the string length.
- a list of `int8` for the string itself.
- `2` - `SQSL_ARRAY`:
- each element saved as `script-data-type`.
- an `SQSL_ARRAY_TABLE_END` (0xFF) marker (`uint8`).
- `3` - `SQSL_TABLE`:
- for each element:
- key saved as `script-data-type`.
- value saved as `script-data-type`.
- an `SQSL_ARRAY_TABLE_END` (0xFF) marker (`uint8`).
- `4` - `SQSL_BOOL`:
- an `uint8` with 0 (false) or 1 (true).
- `5` - `SQSL_NULL`:
- (no data follows)
The first data type is always a `SQSL_TABLE`.

View File

@@ -1,6 +1,4 @@
OpenTTD's known bugs
Last updated: 2021-04-01
Release version: 1.11.0
------------------------------------------------------------------------

View File

@@ -17,6 +17,7 @@ set(BASESET_OTHER_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/openttd.grf
${CMAKE_CURRENT_SOURCE_DIR}/opntitle.dat
${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd.32.bmp
)
# Done by the subdirectories, if nforenum / grfcodec is installed

Binary file not shown.

View File

@@ -1,43 +0,0 @@
// This file is part of OpenTTD.
// OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
// OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "Flag graphics"
-1 * 3 05 14 24
-1 sprites/flags.png 8bpp 34 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 50 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 66 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 82 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 98 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 114 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 130 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 146 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 162 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 178 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 194 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 210 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 226 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 242 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 258 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 274 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 290 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 306 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 322 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 338 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 354 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 370 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 386 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 402 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 418 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 434 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 450 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 466 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 482 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 498 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 514 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 530 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 546 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 562 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 578 8 11 8 0 0 normal
-1 sprites/flags.png 8bpp 594 8 11 8 0 0 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -92,7 +92,6 @@
#include "roadstops.nfo"
#include "aqueduct.nfo"
#include "autorail.nfo"
#include "flags.nfo"
#include "openttdgui.nfo"
#include "airport_preview.nfo"
#include "chars.nfo"

View File

@@ -4,7 +4,7 @@
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "OpenTTD GUI graphics"
-1 * 3 05 15 \b 186 // OPENTTD_SPRITE_COUNT
-1 * 3 05 15 \b 191 // OPENTTD_SPRITE_COUNT
-1 sprites/openttdgui.png 8bpp 66 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 146 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 226 8 64 31 -31 7 normal
@@ -191,3 +191,8 @@
-1 sprites/openttdgui_convert_tram.png 8bpp 24 0 32 32 0 0 normal
-1 sprites/openttdgui.png 8bpp 513 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 526 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 539 440 12 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 553 440 12 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 567 440 12 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 581 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 593 440 10 10 0 0 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

BIN
media/openttd.1024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
media/openttd.2048.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
media/openttd.512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -6,6 +6,6 @@ Name=OpenTTD
Icon=${BINARY_NAME}
Exec=${BINARY_NAME}
Terminal=false
Categories=Game;
Categories=Game;Simulation;
Keywords=game;simulation;transport;tycoon;deluxe;economics;multiplayer;money;train;ship;bus;truck;aircraft;cargo;
@Comment_STR_DESKTOP_SHORTCUT_COMMENT@

View File

@@ -1,4 +1,4 @@
FROM emscripten/emsdk:2.0.10
FROM emscripten/emsdk:2.0.34
COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch

View File

@@ -1,6 +1,6 @@
## How to build with Emscripten
Building with Emscripten works with emsdk 2.0.10 and above.
Building with Emscripten works with emsdk 2.0.31 and above.
Currently there is no LibLZMA support upstream; for this we suggest to apply
the provided patch in this folder to your emsdk installation.
@@ -24,7 +24,7 @@ Next, build the game with emscripten:
```
mkdir build
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=$(pwd)/build-host -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emcmake cmake .. -DHOST_BINARY_DIR=../build-host -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_ASSERTS=OFF
docker run -it --rm -v $(pwd):$(pwd) -u $(id -u):$(id -g) --workdir $(pwd)/build emsdk-lzma emmake make -j5
```

View File

@@ -1,5 +1,5 @@
# LibLZMA is a recent addition to the emscripten SDK, so it is possible
# someone hasn't updated his SDK yet. Test out if the SDK supports LibLZMA.
# someone hasn't updated their SDK yet. Test out if the SDK supports LibLZMA.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-sUSE_LIBLZMA=1")

View File

@@ -10,44 +10,35 @@ Modifed by OpenTTD to have the bare minimum needed to work. Otherwise there
are constantly conflicts when trying to apply this patch to different versions
of emsdk.
diff --git a/embuilder.py b/embuilder.py
index 818262190ed..ab7d5adb7b2 100755
--- a/embuilder.py
+++ b/embuilder.py
@@ -60,6 +60,7 @@
'harfbuzz',
'icu',
'libjpeg',
+ 'liblzma',
'libpng',
'ogg',
'regal',
@@ -197,6 +198,8 @@ def main():
build_port('ogg', libname('libogg'))
elif what == 'libjpeg':
build_port('libjpeg', libname('libjpeg'))
+ elif what == 'liblzma':
+ build_port('liblzma', libname('liblzma'))
elif what == 'libpng':
build_port('libpng', libname('libpng'))
elif what == 'sdl2':
diff --git a/tools/settings.py b/tools/settings.py
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -38,6 +38,7 @@
'USE_SDL_NET',
'USE_SDL_GFX',
'USE_LIBJPEG',
+ 'USE_LIBLZMA',
'USE_OGG',
'USE_REGAL',
'USE_BOOST_HEADERS',
diff --git a/src/settings.js b/src/settings.js
index 61cd98939ba..be6fcb678c6 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -1197,6 +1197,9 @@ var USE_BZIP2 = 0;
@@ -1382,8 +1382,12 @@ var USE_BZIP2 = 0;
// 1 = use libjpeg from emscripten-ports
// [link]
var USE_LIBJPEG = 0;
+// 1 = use liblzma from emscripten-ports
+// [link]
+var USE_LIBLZMA = 0;
+
// 1 = use libpng from emscripten-ports
// [link]
var USE_LIBPNG = 0;
diff --git a/tools/ports/liblzma.py b/tools/ports/liblzma.py
new file mode 100644
index 00000000000..e9567ef36ff
--- /dev/null
+++ b/tools/ports/liblzma.py
@@ -0,0 +1,160 @@
@@ -58,6 +49,8 @@ index 00000000000..e9567ef36ff
+
+import os
+import shutil
+import logging
+from pathlib import Path
+
+VERSION = '5.2.5'
+HASH = '7443674247deda2935220fbc4dfc7665e5bb5a260be8ad858c8bd7d7b9f0f868f04ea45e62eb17c0a5e6a2de7c7500ad2d201e2d668c48ca29bd9eea5a73a3ce'
@@ -68,10 +61,11 @@ index 00000000000..e9567ef36ff
+
+
+def get(ports, settings, shared):
+ libname = ports.get_lib_name('liblzma')
+ ports.fetch_project('liblzma', 'https://tukaani.org/xz/xz-' + VERSION + '.tar.gz', 'xz-' + VERSION, sha512hash=HASH)
+
+ def create():
+ def create(final):
+ logging.info('building port: liblzma')
+
+ ports.clear_project_build('liblzma')
+
+ source_path = os.path.join(ports.get_dir(), 'liblzma', 'xz-' + VERSION)
@@ -88,22 +82,19 @@ index 00000000000..e9567ef36ff
+ 'tuklib_exit.c', 'tuklib_mbstr_fw.c', 'tuklib_mbstr_width.c', 'tuklib_open_stdxxx.c', 'tuklib_progname.c']
+ include_dirs_rel = ['../common', 'api', 'common', 'check', 'lz', 'rangecoder', 'lzma', 'delta', 'simple']
+
+ open(os.path.join(dest_path, 'src', 'config.h'), 'w').write(config_h)
+ Path(dest_path, os.path.join('src', 'config.h')).write_text(config_h)
+
+ final = os.path.join(dest_path, libname)
+ include_dirs = [os.path.join(dest_path, 'src', 'liblzma', p) for p in include_dirs_rel]
+ ports.build_port(os.path.join(dest_path, 'src'), final, flags=build_flags, exclude_dirs=exclude_dirs, exclude_files=exclude_files, includes=include_dirs)
+
+ ports.install_headers(os.path.join(dest_path, 'src', 'liblzma', 'api'), 'lzma.h')
+ ports.install_headers(os.path.join(dest_path, 'src', 'liblzma', 'api', 'lzma'), '*.h', 'lzma')
+
+ return final
+
+ return [shared.Cache.get(libname, create, what='port')]
+ return [shared.Cache.get_lib('liblzma.a', create, what='port')]
+
+
+def clear(ports, settings, shared):
+ shared.Cache.erase_file(ports.get_lib_name('liblzma'))
+ shared.Cache.erase_lib('liblzma.a')
+
+
+def process_args(ports):

View File

@@ -9,7 +9,15 @@ Module['websocket'] = { url: function(host, port, proto) {
* If you run your own server you can setup your own WebSocket proxy in
* front of it and let people connect to your server via the proxy. You
* are best to add another "if" statement as above for this. */
return null;
if (location.protocol === 'https:') {
/* Insecure WebSockets do not work over HTTPS, so we force
* secure ones. */
return 'wss://';
} else {
/* Use the default provided by Emscripten. */
return null;
}
} };
Module.preRun.push(function() {
@@ -65,10 +73,14 @@ Module.preRun.push(function() {
}
window.openttd_server_list = function() {
add_server = Module.cwrap("em_openttd_add_server", null, ["string", "number"]);
add_server = Module.cwrap("em_openttd_add_server", null, ["string"]);
/* Add servers that support WebSocket here. Example:
* add_server("localhost", 3979); */
/* Add servers that support WebSocket here. Examples:
* add_server("localhost");
* add_server("localhost:3979");
* add_server("127.0.0.1:3979");
* add_server("[::1]:3979");
*/
}
var leftButtonDown = false;

View File

@@ -85,6 +85,8 @@
position: absolute;
width: 100%;
z-index: 2;
/* OpenTTD draws the cursor itself */
cursor: none !important;
}
</style>
</head>

View File

@@ -31,5 +31,7 @@
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>LSMinimumSystemVersion</key>
<string>10.14.0</string>
</dict>
</plist>

View File

@@ -10,6 +10,7 @@
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
</windowsSettings>
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">

18
os/windows/sign.bat Normal file
View File

@@ -0,0 +1,18 @@
@echo off
REM Signing script
REM Arguments: sign.bat exe_to_sign certificate_subject_name
REM This is a loose wrapper around the Microsoft signtool application (included in the Windows SDK).
REM See https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe for more details.
REM Path to signtool.exe
IF NOT DEFINED SIGNTOOL_PATH (SET SIGNTOOL_PATH=signtool)
REM URL of the timestamp server
IF NOT DEFINED SIGNTOOL_TIMESTAMP_URL (SET SIGNTOOL_TIMESTAMP_URL=http://timestamp.digicert.com)
REM Sign with SHA-1 for Windows 7 and below
"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% -fd sha1 %1
REM Sign with SHA-256 for Windows 8 and above
"%SIGNTOOL_PATH%" sign -v -n %2 -tr %SIGNTOOL_TIMESTAMP_URL% -fd sha256 -td sha256 -as %1

View File

@@ -0,0 +1,2 @@
@echo off
powershell -File "%~dp0generate-assets.ps1"

View File

@@ -0,0 +1,48 @@
function ResizeImage() {
param([String]$sourcePath, [Int]$targetWidth, [Int]$targetHeight, [String]$targetPath)
Add-Type -AssemblyName "System.Drawing"
$img = [System.Drawing.Image]::FromFile($sourcePath)
$ratioX = $targetWidth / $img.Width;
$ratioY = $targetHeight / $img.Height;
$ratio = $ratioY
if ($ratioX -le $ratioY) {
$ratio = $ratioX
}
$newWidth = [int] ($img.Width * $ratio)
$newHeight = [int] ($img.Height * $ratio)
$resizedImage = New-Object System.Drawing.Bitmap($targetWidth, $targetHeight)
$graph = [System.Drawing.Graphics]::FromImage($resizedImage)
$graph.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$graph.Clear([System.Drawing.Color]::Transparent)
$graph.DrawImage($img, $targetWidth / 2 - $newWidth / 2, $targetHeight / 2 - $newHeight / 2, $newWidth, $newHeight)
$resizedImage.Save($targetPath)
$resizedImage.Dispose()
$img.Dispose()
}
$logoPath = "..\..\..\media\openttd.2048.png"
# Create the main image assets required for the Windows Store
New-Item -Path "." -Name "assets" -ItemType "directory" -Force
ResizeImage $logoPath 1240 1240 "assets\LargeTile.png"
ResizeImage $logoPath 284 284 "assets\SmallTile.png"
ResizeImage $logoPath 2480 1200 "assets\SplashScreen.png"
ResizeImage $logoPath 176 176 "assets\Square44x44Logo.png"
Copy-Item "assets\Square44x44Logo.png" -Destination "assets\Square44x44Logo.targetsize-44_altform-unplated.png"
ResizeImage $logoPath 600 600 "assets\Square150x150Logo.png"
Copy-Item "assets\Square150x150Logo.png" -Destination "assets\Square150x150Logo.targetsize-150_altform-unplated.png"
ResizeImage $logoPath 200 200 "assets\StoreLogo.png"
ResizeImage $logoPath 1240 600 "assets\Wide310x150Logo.png"
# Copy the logo for the store for the common package
New-Item -Path "." -Name "assets-common" -ItemType "directory" -Force
Copy-Item "assets\StoreLogo.png" -Destination "assets-common\StoreLogo.png"

View File

@@ -0,0 +1,2 @@
@echo off
powershell -File "%~dp0generate-key.ps1" %1 %2 %3

View File

@@ -0,0 +1,21 @@
[CmdletBinding()]
[Alias()]
Param
(
# Publisher ("CN=xyz")
[Parameter(Mandatory=$true, Position=0)]
$Publisher,
# Password
[Parameter(Mandatory=$true, Position=1)]
$PasswordParam,
# Filename
[Parameter(Mandatory=$true, Position=2)]
$OutputFilename
)
$cert = New-SelfSignedCertificate -Type Custom -Subject $Publisher -KeyUsage DigitalSignature -FriendlyName "OpenTTD signing certificate" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
$password = ConvertTo-SecureString -String $PasswordParam -Force -AsPlainText
Export-PfxCertificate -cert "Cert:\CurrentUser\My\$($cert.Thumbprint)" -FilePath $OutputFilename -Password $password

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap6="http://schemas.microsoft.com/appx/manifest/uap/windows10/6" IgnorableNamespaces="uap uap6">
<Identity Name="$IDENTITY_NAME$" Publisher="$PUBLISHER$" Version="$VERSION$" ResourceId="OpenTTD-common" />
<Properties>
<uap6:AllowExecution>false</uap6:AllowExecution>
<DisplayName>OpenTTD (official)</DisplayName>
<PublisherDisplayName>OpenTTD Developers</PublisherDisplayName>
<Logo>Assets\StoreLogoCommon.png</Logo>
</Properties>
<Resources>
<Resource Language="en-gb" />
<Resource Language="en-us" />
<Resource Language="en-au" />
<Resource Language="af-za" />
<Resource Language="ar-eg" />
<Resource Language="eu-es" />
<Resource Language="be-by" />
<Resource Language="pt-br" />
<Resource Language="bg-bg" />
<Resource Language="ca-es" />
<Resource Language="hr-hr" />
<Resource Language="cs-cz" />
<Resource Language="da-dk" />
<Resource Language="nl-nl" />
<Resource Language="et-ee" />
<Resource Language="fo-fo" />
<Resource Language="fr-fr" />
<Resource Language="gd-gb" />
<Resource Language="gl-es" />
<Resource Language="de-de" />
<Resource Language="el-gr" />
<Resource Language="he-il" />
<Resource Language="hu-hu" />
<Resource Language="is-is" />
<Resource Language="id-id" />
<Resource Language="ga-ie" />
<Resource Language="it-it" />
<Resource Language="ja-jp" />
<Resource Language="ko-kr" />
<Resource Language="lv-lv" />
<Resource Language="lt-lt" />
<Resource Language="lb-lu" />
<Resource Language="ms-my" />
<Resource Language="nb-no" />
<Resource Language="no-no" />
<Resource Language="pl-pl" />
<Resource Language="pt-pt" />
<Resource Language="ro-ro" />
<Resource Language="ru-ru" />
<Resource Language="sr-latn-rs" />
<Resource Language="zh-cn" />
<Resource Language="sk-sk" />
<Resource Language="sl-si" />
<Resource Language="es-es" />
<Resource Language="es-mx" />
<Resource Language="sv-se" />
<Resource Language="ta-in" />
<Resource Language="th-th" />
<Resource Language="zh-tw" />
<Resource Language="tr-tr" />
<Resource Language="uk-ua" />
<Resource Language="vi-vn" />
<Resource Language="cy-gb" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17134.0" MaxVersionTested="10.0.18363.0" />
</Dependencies>
</Package>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Name="$IDENTITY_NAME$" Publisher="$PUBLISHER$" Version="$VERSION$" ProcessorArchitecture="$ARCHITECTURE$" />
<Properties>
<DisplayName>OpenTTD (official)</DisplayName>
<PublisherDisplayName>OpenTTD Developers</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17134.0" MaxVersionTested="10.0.18363.0" />
</Dependencies>
<Resources>
<Resource Language="en-gb" />
<Resource Language="en-us" />
<Resource Language="en-au" />
<Resource Language="af-za" />
<Resource Language="ar-eg" />
<Resource Language="eu-es" />
<Resource Language="be-by" />
<Resource Language="pt-br" />
<Resource Language="bg-bg" />
<Resource Language="ca-es" />
<Resource Language="hr-hr" />
<Resource Language="cs-cz" />
<Resource Language="da-dk" />
<Resource Language="nl-nl" />
<!-- <Resource Language="eo-eo" />-->
<Resource Language="et-ee" />
<Resource Language="fo-fo" />
<!-- <Resource Language="fi-fi" />-->
<Resource Language="fr-fr" />
<Resource Language="gd-gb" />
<Resource Language="gl-es" />
<Resource Language="de-de" />
<Resource Language="el-gr" />
<Resource Language="he-il" />
<Resource Language="hu-hu" />
<Resource Language="is-is" />
<Resource Language="id-id" />
<Resource Language="ga-ie" />
<Resource Language="it-it" />
<Resource Language="ja-jp" />
<Resource Language="ko-kr" />
<!-- <Resource Language="la-va" />-->
<Resource Language="lv-lv" />
<Resource Language="lt-lt" />
<Resource Language="lb-lu" />
<Resource Language="ms-my" />
<Resource Language="nb-no" />
<Resource Language="no-no" />
<Resource Language="pl-pl" />
<Resource Language="pt-pt" />
<Resource Language="ro-ro" />
<Resource Language="ru-ru" />
<Resource Language="sr-latn-rs" />
<Resource Language="zh-cn" />
<Resource Language="sk-sk" />
<Resource Language="sl-si" />
<Resource Language="es-es" />
<Resource Language="es-mx" />
<Resource Language="sv-se" />
<Resource Language="ta-in" />
<Resource Language="th-th" />
<Resource Language="zh-tw" />
<Resource Language="tr-tr" />
<Resource Language="uk-ua" />
<Resource Language="vi-vn" />
<Resource Language="cy-gb" />
</Resources>
<Applications>
<Application Id="OpenTTD" Executable="openttd.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="OpenTTD (official)" Description="OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe." BackgroundColor="transparent" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View File

@@ -0,0 +1,35 @@
<PackagingLayout xmlns="http://schemas.microsoft.com/appx/makeappx/2017">
<!-- Main game -->
<PackageFamily ID="OpenTTD" FlatBundle="false" ManifestPath="manifests\Package.appxmanifest" ResourceManager="false">
<!-- x86 code package-->
<Package ID="OpenTTD-x86" ProcessorArchitecture="x86" ManifestPath="manifests\Package-x86.appxmanifest">
<Files>
<File DestinationPath="**" SourcePath="x86-binaries\**"/>
<File DestinationPath="Assets\**" SourcePath="Assets\**"/>
</Files>
</Package>
<!-- x64 code package-->
<Package ID="OpenTTD-x64" ProcessorArchitecture="x64" ManifestPath="manifests\Package-x64.appxmanifest">
<Files>
<File DestinationPath="**" SourcePath="x64-binaries\**"/>
<File DestinationPath="Assets\**" SourcePath="Assets\**"/>
</Files>
</Package>
<!-- ARM64 code package-->
<Package ID="OpenTTD-ARM64" ProcessorArchitecture="arm64" ManifestPath="manifests\Package-ARM64.appxmanifest">
<Files>
<File DestinationPath="**" SourcePath="ARM64-binaries\**"/>
<File DestinationPath="Assets\**" SourcePath="Assets\**"/>
</Files>
</Package>
<!-- Common asset package-->
<AssetPackage ID="OpenTTD-common" AllowExecution="false" ManifestPath="manifests\AssetsPackage.appxmanifest">
<Files>
<File DestinationPath="**" SourcePath="common-binaries\**"/>
</Files>
</AssetPackage>
</PackageFamily>
</PackagingLayout>

View File

@@ -0,0 +1,2 @@
@echo off
powershell -File "%~dp0prepare-manifests.ps1" %1 %2 %3 %OTTD_VERSION%

View File

@@ -0,0 +1,42 @@
[CmdletBinding()]
[Alias()]
Param
(
# Output folder
[Parameter(Mandatory=$true, Position=0)]
$OutputFolder,
# Publisher ("CN=xyz")
[Parameter(Mandatory=$true, Position=1)]
$Publisher,
# IdentityName
[Parameter(Mandatory=$true, Position=2)]
$IdentityName,
# Version
[Parameter(Mandatory=$true, Position=3)]
$AppVersion
)
function Prepare-Manifest {
param (
$Architecture
)
(Get-Content "$($PSScriptRoot)\manifests\Package.appxmanifest").replace('$PUBLISHER$', $Publisher).replace('$IDENTITY_NAME$', $IdentityName).replace('$VERSION$', $AppVersion).replace('$ARCHITECTURE$', $Architecture) | Set-Content "$($OutputFolder)\Package-$($Architecture).appxmanifest"
}
# Prepare the application binary manifests
Prepare-Manifest x86
Prepare-Manifest x64
Prepare-Manifest arm64
# Prepare the assets package manifest
(Get-Content "$($PSScriptRoot)\manifests\AssetsPackage.appxmanifest").replace('$PUBLISHER$', $Publisher).replace('$IDENTITY_NAME$', $IdentityName).replace('$VERSION$', $AppVersion) | Set-Content "$($OutputFolder)\AssetsPackage.appxmanifest"
# Prepare the overall package manifest
(Get-Content "$($PSScriptRoot)\manifests\Package.appxmanifest").replace('$PUBLISHER$', $Publisher).replace('$IDENTITY_NAME$', $IdentityName).replace('$VERSION$', $AppVersion).replace(' ProcessorArchitecture="$ARCHITECTURE$"', '') | Set-Content "$($OutputFolder)\Package.appxmanifest"
# Copy the PackagingLayout XML file
(Get-Content "$($PSScriptRoot)\manifests\PackagingLayout.xml") | Set-Content "$($OutputFolder)\PackagingLayout.xml"

View File

@@ -0,0 +1,14 @@
@echo off
if [%1]==[] goto err
powershell -File "%~dp0set-version.ps1" %1 > "%temp%\ottd-set-version.bat"
if not errorlevel 0 goto err
call "%temp%\ottd-set-version.bat"
del /q "%temp%\ottd-set-version.bat"
@rem Version number will now be in %OTTD_VERSION%
goto :eof
:err
echo Please supply the path of openttd.exe as the argument to this batch file.

Some files were not shown because too many files have changed in this diff Show More