Commit Graph

1194 Commits

Author SHA1 Message Date
Gymnasiast 9441d4b24f
Bump network version 2022-02-13 21:11:18 +01:00
ζeh Matt c0474d2d27
Merge pull request #16466 from ZehMatt/refactor/identifier-rideid
Use TIdentifier for RideId
2022-02-12 11:23:54 -08:00
ζeh Matt f4d105f843
Remove NetworkRideId 2022-02-12 18:11:18 +02:00
ζeh Matt a2470c0573
Rename ride_id_t to RideId 2022-02-12 18:11:18 +02:00
skdltmxn 29083f4cb2
Improve network module in more C++ way 2022-02-09 21:57:25 +01:00
ζeh Matt 19dca61ee8
Fix #16535: Entering construction mode unblocks all paths 2022-01-31 23:05:26 +01:00
ζeh Matt 41e8146465
Bump up network version 2022-01-29 17:09:05 +02:00
Michael Steenbeek f43a4344ce
Remove platform_get_user_directory() (#16530) 2022-01-29 09:01:05 -03:00
Gymnasiast f8c74fe2f8
Use u8string in Path/File; replace Path::Append with Path::Combine 2022-01-28 21:52:44 +01:00
Michael Steenbeek 149b164ee8
Use u8string for custom paths 2022-01-27 14:21:46 +01:00
Michael Steenbeek 9f74c7081b
Create definitions for u8string and u8string_view 2022-01-25 16:41:45 +01:00
Michael Steenbeek d97ecdd981
Fix #13336: Can no longer place Bumble Bee track design 2022-01-20 10:56:27 +01:00
duncanspumpkin 81b490b0bc Fix #16276. Paths on trackdesigns not connecting on placement 2022-01-15 07:11:07 +00:00
Michael Steenbeek 939ddb4813
Merge pull request #16399 from Gymnasiast/refactor/more-platform-functions-2
C++-ify most path handling
2022-01-09 13:29:54 +01:00
GalBr fae4e6323f
Fix #16234: Wrap vehicle colors when there are more than 32 trains (#16323)
* Wrap vehicle_colours in TrackDesignAction

* Wrap the color presets in set_vehicle_colours_to_random_preset

* Increment network version

* Update changelog.txt

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2022-01-08 19:03:58 -03:00
Gymnasiast 6bcf848b2f
Use C++ filesystem for more file/path functions 2022-01-08 19:07:48 +01:00
frutiemax adb692b74e Forward declare Formatter 2021-12-30 12:17:51 -05:00
ζeh Matt b89eddc867
Fix #16327: Crash supplying a bad signature size in the auth packet 2021-12-28 16:44:21 +02:00
Gal B 10bd0e7189 Increment NETWORK_STREAM_VERSION 2021-12-22 18:48:37 +02:00
ζeh Matt 186d3efb59
Merge pull request #16092 from ZehMatt/refactor/timing
Refactor update/time related things
2021-12-17 10:08:42 -08:00
duncanspumpkin 7e7947fe8b Move legacy identifier interpreting to separate file from parkfile 2021-12-15 21:29:02 +00:00
Duncan 3572c3f466
Fix #16201: Rides don't get properly deleted when you remove them (#16236)
* Fix #16201. Remove all tracks on a tile when demolishing

* Bump network version
2021-12-14 12:37:35 +00:00
ζeh Matt fc2862323a
Add utility function and some minor cleanup/documentation 2021-12-13 19:10:47 +02:00
ζeh Matt c464e38515
Use chrono::duration for Timer 2021-12-13 19:04:49 +02:00
ζeh Matt 94e20ba7fe
Rename some Update functions to Tick 2021-12-13 19:04:48 +02:00
ζeh Matt 25e1553555
Use Timer in DiscordService 2021-12-13 19:04:48 +02:00
Duncan 3deaa1af2e
Fix #16197: Park award time and type accidentally swapped 2021-12-12 11:20:17 +01:00
deurklink ceb49e0984
Fix: #16162 Go Kart speeds not correctly randomised (#16165)
* Fix Go Kart Speeds not being random

Go kart speeds now only get 2 different values (around 37kmh or around 25kmh), in vanilla Go karts can also have a value in between. This PR fixes that.

* Update changelog.txt

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

* Increment network version

* Update replays

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-12-11 17:11:23 +00:00
Duncan 56c4240d77
Make Parkfile Pathfinding Deterministic (#16147)
* Rename path find functions and use sub function

* Modify leaving park logic to not use park entrance index

* Remove ChosenParkEntrance from peep struct

* Refactor GetNearestParkEntrance

Removed the index as its pointless. Fixed function to use CoordsXY

* Increment network version

* Update replays
2021-12-11 16:03:59 +00:00
Duncan fdfd9b4760
Make track designs NSF map size safe (#16116)
* Make track designs NSF map size safe

* Increment network version
2021-12-06 16:58:50 +00:00
ζeh Matt 9f23449ffb
Move Staff/Guest/Peep to entity 2021-11-26 18:26:19 +02:00
ζeh Matt 56e78d5733
Merge pull request #15985 from ZehMatt/refactor/entities2
Refactor Sprite to Entity
2021-11-25 12:53:50 -08:00
Duncan 2b4eaab5dc
Modify TrackPlaceAction to handle ride type parameter (#15980)
* Modify TrackPlaceAction to handle ride type parameter

* Update network and plugin version

* Update replays
2021-11-25 12:28:30 +00:00
ζeh Matt 03fb9b390f
Rename Sprite to EntityRegistry 2021-11-24 17:04:12 +02:00
ζeh Matt 7c726e2a0c
Fix includes 2021-11-24 16:48:33 +02:00
ζeh Matt c6242fd310
More renaming 2021-11-24 15:50:18 +02:00
ζeh Matt 83b911b193
#15634: Refactor passing GameActions::Result by copy (#15951)
* Refactor to result GameActions::Result as copy instead of unique_ptr

* Remove alias GameActions::Result::Ptr

* Remove MakeResult wrapper

* Remove type forwarder in TileInspector
2021-11-24 07:35:08 +00:00
YJSoft fcf587dfa4
Fix #15974 Cannot download object from server (#15975)
Due to some leftover code from NSF rebase, server will parse MAPREQUEST incorrectly. so client will fail to download objects.
2021-11-23 08:36:37 +00:00
Michał Janiszewski 3ff2466251
Update network version for NSF (#15950) 2021-11-21 23:39:41 +00:00
IntelOrca 34128dc262
Add new .park save format
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com>
Co-authored-by: duncanspumpkin <duncanspumpkin@users.noreply.github.com>
Co-authored-by: ZehMatt <Zehmatt@users.noreply.github.com>
Co-authored-by: Broxzier <Broxzier@users.noreply.github.com>
2021-11-21 22:43:22 +01:00
Gymnasiast 61c67afc66
Release v0.3.5.1
- Improved: [#12825, #12869] The Tile Inspector window’s layout has been tweaked slightly.
- Change: [#15899] Weird bonus for path 0 - likely intended as a queue bonus (original bug).
- Fix: [#15138] Sometimes small scenery stays when building through it.
- Fix: [#15620] Placing track designs at locations blocked by anything results in wrong error message.
- Fix: [#15843] Tile Inspector can be resized too small.
- Fix: [#15844] Tile Inspector has inconsistent text colours.
- Fix: [#15878] Crash when opening a ride window for a corrupted vehicle.
- Fix: [#15908] Crash when track elements have no ride assigned.
- Fix: [#15919] Research status incorrectly considered for scenery when in editor modes.
- Fix: [#15938] Track designs of some ride types are incorrectly exported to TD6.
2021-11-21 22:06:59 +01:00
ζeh Matt c0f928f51d
Merge pull request #15895 from ZehMatt/refactor/gamecommands
Remove unnecessary game command ids
2021-11-13 08:21:40 -08:00
Michael Steenbeek fc421214e6
Bump network version 2021-11-13 13:18:46 +01:00
ζeh Matt 54af81450e
Remove unnecessary game command ids 2021-11-11 16:44:16 +02:00
ζeh Matt 96e2641d0d
Remove macro for registration and cleanup 2021-11-10 19:42:23 +02:00
Gymnasiast b9bc8d0606
Release v0.3.5
- Feature: [#3868] Initial support for using TTF in OpenGL mode (still contains bugs).
- Feature: [#7682] Follow ride/guest/staff in main window viewport.
- Feature: [#13407] Allow building chain lifts on enclosed dinghy slide pieces when cheats are on.
- Feature: [#15084] [Plugin] Add "vehicle.crash" hook.
- Feature: [#15143] Added a shortcut key for Giant Screenshot.
- Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported.
- Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity".
- Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty.
- Feature: [#15195] Added a bug-report item in file dropdown menu.
- Feature: [#15294] New vehicle animation type: flying animal.
- Fix: [#10614] Track Designs with missing path(s) do not use alternate pathways.
- Fix: [#12981] New vehicles do not appear in vehicle type dropdown.
- Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won.
- Fix: [#13912] “Dome park” no longer renders dome correctly.
- Fix: [#14316] Closing the Track Designs Manager window causes broken state.
- Fix: [#14482, #15258] Rides with invisibility hacks sometimes behave incorrectly.
- Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette.
- Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug).
- Fix: [#14741] Crash when exiting OpenRCT2 on macOS.
- Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner.
- Fix: [#15136] Exported SV6 files cause vanilla RCT2 to hang.
- Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group.
- Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly.
- Fix: [#15170] Plugin: incorrect label text alignment.
- Fix: [#15177] Crash in lightfx_add_lights_magic_vehicle().
- Fix: [#15184] Crash when hovering over water types in Object Selection.
- Fix: [#15193] Crash when rides/stalls are demolished.
- Fix: [#15197] Cannot place flat ride after removing it in construction window.
- Fix: [#15199] Construction window is not closed when a ride gets demolished.
- Fix: [#15213] Freeze when hovering over Reverse Freefall Coaster in Russian.
- Fix: [#15227] Crash on exit after hovering over water types in the Object Selection window.
- Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one.
- Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu.
- Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer.
- Fix: [#15322] Circus music doesn't play.
- Fix: [#15377] Entrance/exit ghost doesn't work on different stations without touching them first.
- Fix: [#15451] Guest list name filter remains after group selection.
- Fix: [#15466] Crash when opening a dropdown with 0 rows.
- Fix: [#15476] Crash when placing/clearing small scenery.
- Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2.
- Fix: [#15490] Tile inspector needlessly updates clearance height when changing surface slopes.
- Fix: [#15496] Crash in paint_swinging_inverter_ship_structure().
- Fix: [#15503] Freeze when doing specific coaster merges with block brakes.
- Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager.
- Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture.
- Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug).
- Fix: [#15579] Crash in track_block_get_next().
- Fix: [#15582] [Plugin] Litter properties return incorrect values.
- Fix: [#15584] Ride income underflows when on-ride photos are making losses.
- Fix: [#15612] Crash when placing walls beside certain scenery objects.
- Fix: [#15851] Incorrect percentage chance of jumping with Katie Smith cheat.
- Fix: [#15858] Joanne Barton and Emma Garrell cheat incorrectly not applying effects to self.
- Improved: [#3417] Crash dumps are now placed in their own folder.
- Improved: [#13524] macOS arm64 native (universal) app
- Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled.
- Change: [#8601] Revert ToonTower base block fix to re-enable support blocking.
- Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version.
2021-11-06 12:10:11 +01:00
Duncan de3d19a6b8
Fix #15858: Purple and Pizza cheats do not affect the named guest 2021-11-04 23:16:53 +01:00
Duncan 0389e926a0
Fix 15851: Katie Smith cheat (#15852)
* Fix #15851. Katie Smith cheat had v. low chance of jumping

Mistake made during implementation

* Increment network

* Update changelog
2021-11-03 17:35:52 +00:00
Duncan 3f19d6f7d7
Split Peep header Guest into separate header (#15810)
* Move guest functions and classes to guest header

* Reduce includes of Peep.h
2021-10-28 21:38:23 +01:00
Duncan a8d2d5fd44
Staff patrol area 2 from NSF (#15600)
* Port over changes from NSF for staff

* Fix import and export

* Fix crash on export

* Fix import issue

* Fix patrol import issue

* Remove staff id field

* Increment network version

* Actually remove all instances of staff id

* Update replays
2021-10-27 21:19:10 +01:00
ζeh Matt ec78ef3974
Refactor explicit constructor usage in NetworkBase 2021-10-27 04:32:08 +03:00
Gymnasiast 9e0fac9169
Bump network version 2021-10-22 16:17:40 +02:00
Hielke Morsink 9dd20ec619
Improve array formatting
For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
2021-10-17 18:21:45 +02:00
ζeh Matt f2372337bf
Bump up network version 2021-10-12 21:36:13 +03:00
Duncan fd18ac7f85
Modify StaffSetPatrolAreaAction to have three modes (#15494)
* Modify StaffSetPatrolAreaAction to have three modes

* Actually serialise mode

* Apply review comments

* Increment network version

* Apply review comment

* Update replay
2021-10-07 18:02:24 +01:00
ζeh Matt c1cde60e7f
Bump up network version 2021-09-29 19:49:42 +03:00
frutiemax 2906cb8c89
Fix #14474: Map size can be synced in multiplayer (#15312)
* Fix #14474: Map size can be synced in multiplayer

* Bump up network version

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2021-09-29 16:46:03 +01:00
Hielke Morsink 53c22c9b4b
Check for nullptr explicitly (#15458) 2021-09-24 20:05:50 +02:00
ζeh Matt e5de2adc4f
Merge pull request #15429 from ZehMatt/backport/ticks
Remove scenario ticks and adjust export/import
2021-09-23 12:08:16 -07:00
ζeh Matt c61f141cdc
Bump up network version 2021-09-23 21:49:09 +03:00
ζeh Matt 2529568bfc
Use std::string_view where appropriate in network code
Co-authored-by: Ted John <ted@brambles.org>
2021-09-18 00:14:28 +03:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Gymnasiast bdab3219cb
Modify object loading for JSON-only objects 2021-09-15 11:28:39 +02:00
ζeh Matt 59a6c34db4
Make use of std::optional strict 2021-09-13 20:02:32 +03:00
ζeh Matt f999b0acb2
Remove Nullable and use std::optional instead 2021-09-12 16:55:56 +03:00
ζeh Matt d21ccc103b
Bump up network version 2021-09-10 19:10:15 +03:00
ZehMatt e65a1f6fc5
Forward NetworkRideId_t to ride_id_t and adjust serialiser 2021-09-10 19:10:12 +03:00
ζeh Matt c844bf9142
Bump up network version 2021-09-05 18:16:37 +03:00
ζeh Matt 0be585024f
Merge pull request #15232 from ZehMatt/refactor/gNetwork
Move network instance to Context
2021-08-30 14:17:15 -07:00
spacek531 91099429c8 bump network 2021-08-29 14:52:43 -07:00
spacek531 cba52b240e
Bird animation (#15294)
* initial implementation;

progress 1

progress 2

refactor to chain start

progress 3

begin walking

finish bird

remove walking

remove unused functions

refactor track element getting

fix formatting

refactor and add comments

remove brackets from simple if-else statements

invalidate vehicle

refactor again

fix format and refactor

please satisfy clang format

fix fallthrough

invalidate default case

remove redundant falltrhough

network bump

use std::max

refactor animation again

fix modulus

* move array declaration

* satisfy clang-format

* add changelog entry
2021-08-29 10:30:34 +01:00
Hielke Morsink 956e77f4c3
Use [[nodiscard]] for allocator and RAII functions (#15244) 2021-08-23 20:09:43 +02:00
ζeh Matt 3ab70b200b
Fix #15255: Wall banner index defaults to 0 instead of null type 2021-08-21 19:24:09 +02:00
Hielke Morsink 15d3a4a9da
Update more include guards (#15254) 2021-08-21 12:55:28 +02:00
Duncan 223b926f8c
Use std::vector for ride use memory (#14884)
* Use std::vector for ride use memory

* Use new system for import/export

* Remove legacy field

* Add replay entity size protection to prevent crash

* Increment network version

* Update replays

* Move function to header

* Move constant to RCT12 header as used for both 1 and 2

* Align naming with nsf
2021-08-17 21:29:35 +01:00
ZehMatt b3bb2f5d80
Refactor NetworkBase to use the System base class 2021-08-17 07:22:04 +03:00
ZehMatt 4ece997ff3
Remove unused function network_close 2021-08-17 06:33:50 +03:00
ZehMatt 0960413927
Remove unused function network_send_map 2021-08-17 06:31:12 +03:00
ZehMatt b8a81ae1c7
Remove unused declarations 2021-08-17 06:30:16 +03:00
ZehMatt e440942c54
Remove SetEnvironment from NetworkBase and all its other wrappers 2021-08-17 06:25:47 +03:00
ZehMatt 40313b1ea3
Move network instance into Context 2021-08-17 06:20:07 +03:00
ZehMatt 87fbb9faf5
Fix potential crash on corrupted network data 2021-08-06 20:30:03 +03:00
Gymnasiast 277317b6f1
Bump network and plug-in API version 2021-08-01 15:15:33 +02:00
Duncan 69f0020a62
Fix #8601: Revert fix to TT’s base blocks, for support blocker usage 2021-07-31 14:10:00 +02:00
ZehMatt dd2ffec14b
Code review changes 2021-07-29 20:08:57 +03:00
ZehMatt 4f54aa5c42
Limit the count of packets processed per update 2021-07-29 20:06:38 +03:00
ZehMatt 6877b8214a
Fix unhandled exceptions during packet processing 2021-07-29 20:06:36 +03:00
Duncan e9eb1b8304
Banner Refactor from NSF (#14788)
* Banner refactor

* Fix mistake in fix_duplicated_banners

* Reduce limit back

* Fix export

* Free banner on delete

* Increment network version

* Fix potential banner pointer crashes

Co-authored-by: Ted John <ted@brambles.org>
2021-07-27 10:25:58 +01:00
Hielke Morsink c887a049d2
Fix various Cppcheck warnings (#15081) 2021-07-24 23:41:50 +02:00
Gymnasiast e0daac9442
Release v0.3.4
- Feature: [#13967] Track List window now displays the path to the design when debugging tools are on.
- Feature: [#14071] “Vandals stopped” statistic for security guards.
- Feature: [#14169] Lighting effects for shops and stalls.
- Feature: [#14296] Allow using early scenario completion in multiplayer.
- Feature: [#14538] [Plugin] Add property for getting current plugin api version.
- Feature: [#14620] [Plugin] Add properties related to guest generation.
- Feature: [#14636] [Plugin] Add properties related to climate and weather.
- Feature: [#14731] Opaque water (like in RCT1).
- Change: [#14496] [Plugin] Rename Object to LoadedObject to fix conflicts with Typescript's Object interface.
- Change: [#14536] [Plugin] Rename ListView to ListViewWidget to make it consistent with names of other widgets.
- Change: [#14751] “No construction above tree height” limitation now allows placing high trees.
- Change: [#14841] Redesign the About window, including new button to copy the current version info.
- Fix: [#11829] Visual glitches and crashes when using RCT1 assets from mismatched or corrupt CSG1.DAT and CSG1i.DAT files.
- Fix: [#12262] Windows can appear off screen with small screens or high scaling.
- Fix: [#13581] Opening the Options menu causes a noticeable drop in FPS.
- Fix: [#13894] Block brakes do not animate.
- Fix: [#13986] OpenGL: Track preview window, flip/rotate button do not update the thumbnail.
- Fix: [#14315] Crash when trying to rename Air Powered Vertical Coaster in Korean.
- Fix: [#14330] join_server uses default_port from config.
- Fix: [#14415] Entrances/exits are removed when built on top of each other.
- Fix: [#14449] Surface smoothing at extra zoom levels not working.
- Fix: [#14468] Cannot close Options window on Android.
- Fix: [#14493] [Plugin] isHidden only works for tile elements up to the first element with a base height of over 32.
- Fix: [#14587] Confusing message when joining server with mismatched network version.
- Fix: [#14604] American-style Steam Trains are not imported correctly from RCT1 saves.
- Fix: [#14638] The “About OpenRCT2” window cannot be themed.
- Fix: [#14682] Crash when painting Swinging Ships with invalid subtype.
- Fix: [#14707] Crash when window is closed during text input.
- Fix: [#14710] Ride/Track Design preview does not show if it costs more money than available.
- Fix: [#14774] Incorrect import of scenery research caused all scenery to be unlocked.
- Fix: [#14806] Incorrect function call in WallPlaceAction plugin code.
- Fix: [#14871] Crash when trying to place track when there are no free tile elements.
- Fix: [#14880] Unable to close changelog window when its content fails to load.
- Fix: [#14945] Incorrect drop height penalty on log flume ride.
- Fix: [#14964] Unable to build in multiplayer as client with "Build while paused" cheat enabled when the host is paused.
- Improved: [#14511] “Unlock operating limits” cheat now also unlocks all music.
- Improved: [#14712, #14716] Improve startup times.
- Improved: [#14982] Add Malgun Gothic and change Nanum Gothic filename for Korean.
2021-07-19 12:54:49 +02:00
ζeh Matt b2387d06b6
Fix #14964: Building in multiplayer while paused 2021-06-30 20:51:04 +02:00
duncanspumpkin b68b516842 Update network version 2021-06-27 08:33:40 +01:00
duncanspumpkin b959f5ae2c Increment network version 2021-06-08 08:04:18 +01:00
Ted John 81d7c3f02b Make tile elements dynamic and resizeable 2021-06-05 21:17:03 +01:00
Duncan b7e7915efa
Merge pull request #14780 from duncanspumpkin/sprite2
Sprite Refactor 2: Moving around EntityTweener and misc
2021-06-01 20:10:17 +01:00
Michael Steenbeek 31848b195e
Close #14765: Rename gCheatsFastLiftHill 2021-05-29 18:41:16 +02:00
duncanspumpkin 3199029168 Split off EntityTweener into seperate file 2021-05-29 07:47:49 +01:00
Duncan 21bb949322
Fix 14774: Scenery research always unlocks on load (#14777)
* Fix #14774: Incorrect import of scenery research

Mistake during a refactor caused all scenery to be imported as already researched.

* Update changelog

* Update network version
2021-05-28 18:55:19 +01:00
Matt 7c8beededb
Bump network version 2021-05-23 20:01:42 +03:00
ζeh Matt 38c7a70025
Fix #14710: Preview not shown without enough money (#14711)
* Fix #14710: Preview not shown without enough money

* Bump up network version

* Add changelog.txt entry
2021-05-23 09:45:48 -03:00
Duncan d46e4a9bb1
Network serialiser for entities (#14541)
* Start a network serialiser for entities

will be used only for checksums and replay diffs

* Continue work

* Use the new serailser for checksums

* Use new serialiser for replays

* keep compilers happy

* Try create checksum stream

* Fix compiling

* Split off class into seperate file

* Update Xcode project

* Increment network version

* Fix pragma mistake

* Fix none network builds

* Update replays

* Improve ChecksumStream and use FNV internally

* Small cleanups

* satisfy compilers

* Revert change of checksum size to simplfy rerecording

* Zero initialise data

* Fix serialiser

* Update replays again

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
Co-authored-by: Matt <m.moninger.h@gmail.com>
2021-05-09 19:12:44 +01:00
ζeh Matt 08ebc1ab41
Fix #14587: Send queued packets before disconnecting the client (#14596)
* Fix #14587: Send queued packets before disconnecting the client

* Log better information during network authentication
2021-05-09 07:56:20 +01:00
Duncan 8eabdf8c8f
Split guest and staff peep variables (#14462)
* Split guest and staff peep variables

* Move variable location

* Increment network version

* Update replays
2021-04-18 17:48:21 +01:00
Michael Steenbeek bbf33b6577
Fix serialisation of PlaceParkEntranceAction 2021-04-15 21:32:26 +02:00
Duncan a9e1f2e89c
Remove SpriteBase::flags (#14460)
* Remove SpriteBase::flags

* Increment network version

* update replays
2021-04-11 18:02:19 +01:00
Michael Steenbeek 0e327c86e4
Fix ratings calculation taking 30 minutes 2021-04-02 22:57:36 +02:00
A.N 4d3328c7bb
Add preprocessor directives to stop unused variable/function warnings. (#14422) 2021-04-02 14:41:11 +02:00
Duncan b65f12f1cf
Use correct null value (#14421)
* Use correct null value

* Increment network version
2021-04-02 13:13:33 +01:00
Michael Steenbeek 7344b7fbfd
Use 16-bit ride_id_t thoughout and raise RIDE_ID_NULL (#14411)
* Replace RIDE_ENTRY_INDEX_NULL with OBJECT_ENTRY_INDEX_NULL

Ride entries are objects like any other, so there is little point having separate constants.

* Use ride_id_t in many more places

* Change RIDE_ID_NULL to 0xFFFF

* Increment network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-04-01 16:02:57 +01:00
Duncan 619b2afc15
Compute checksum by entity type (#14383)
* Compute checksum by entity type

* Copy only the entity size

* Update replays and network version
2021-03-27 09:36:41 +00:00
Duncan 977d05ba29
Entity type5: Remove peep assigned type (#14380)
* Remove users of AssignedPeepType

* Remove AssignedPeepType

Field no longer required due to changes to EntityType

* Move enum to the RCT12 header

* Increment network version

* Update replays
2021-03-24 08:54:05 +00:00
Duncan ccfa22c230
Entity type4: Remove MiscEntityType and add FountainType (#14344)
* Move jumpingfountain type out of misc entity type

* Remove SubType for MiscEntities as it is no longer required

* Update replays

* Apply review comments

* Increment network version
2021-03-22 21:24:50 +00:00
Maximilian Bottin 6f28914f61
Fix #14296: Allow early scenario completion in multiplayer 2021-03-18 20:30:11 +01:00
Duncan df7a284822
Entity type 2: Remove sprite_identifier (#14334)
* Start changing the underlying type

* Further work

* Complete refactor

* Further cleanup

* Remove pointless check

* Increment network and plugin versions

* Add defaults

* Further defaults

* Fix test paint

* Update replays
2021-03-17 08:04:41 +00:00
Duncan 5474194905
Implement train view and remove linked_list_index (#13956)
* Make train manager view

* Remove linked list index field

* Remove merge mistake

* Fix further rebase errors

* Rename and add comments

* Update replays

* Fix Xcode project

* Increment network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-15 08:13:00 +00:00
manatails 4fe5b1dc79
Add "Vandals stopped" stat for security guards (#14071)
* Add a stat for security guards: Vandals stopped

* Update src/openrct2-ui/windows/Staff.cpp

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* Update src/openrct2/peep/Guest.cpp

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* No need to update screenCoords at the last line

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

* Add changelog entry and bump network version

* Update to new UI code

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-14 09:18:35 -03:00
Gymnasiast 3f65f282d7
Release v0.3.3
- Feature: [#12110] Add Hybrid Coaster (Rocky Mountain Construction I-Box) track type.
- Feature: [#12999] .sea (RCT Classic) scenarios are now listed in the “New Scenario” dialog.
- Feature: [#13000] objective_options command for console.
- Feature: [#13096] Add Esperanto translation.
- Feature: [#13164] Add 'Objective options' to Cheats menu.
- Change: [#9568] Change lift sounds of Reverser Roller Coaster and Compact Inverted Coaster to better fitting ones.
- Change: [#13160] The lay-out of the Park Cheats tab has been improved.
- Fix: [#1324] Last track piece map selection still visible when placing ride entrance or exit (original bug).
- Fix: [#3200] Close Construction window upon selecting vehicle page.
- Fix: [#4022] Fix Mac cursor offset on launch
- Fix: [#4041] Garbled park option on scenario editor with custom theme.
- Fix: [#4865] Offer an option to disable inhibiting the monitor power.
- Fix: [#5178] Lighting effects cannot be disabled in software mode
- Fix: [#5904] Empty errors on tile inspector base height change.
- Fix: [#6086] Cannot install existing track design with another name.
- Fix: [#6614, #8623] Colours are distorted when using OpenGL with Intel integrated graphics drivers.
- Fix: [#7443] Construction arrows pulse at irregular intervals.
- Fix: [#7518] Water isn't cut down by view clipping tool.
- Fix: [#7748] Tooltips would not timeout for normal UI elements.
- Fix: [#8015] RCT2 files are not found when put into the OpenRCT2 folder.
- Fix: [#8957] Error title missing when building with insufficient funds
- Fix: [#10186] Placing multiple saved rides ignores design name (original bug).
- Fix: [#12368] Desync due to ghost station pieces affecting changing ride settings.
- Fix: [#12940] Windows cause issues with snow drawing.
- Fix: [#13019] Simulated trains sometimes open construction window when they crash.
- Fix: [#13021] Mowed grass and weeds don't show up in extra zoom levels.
- Fix: [#13024] Console cursor does not correctly render at current cursor position.
- Fix: [#13029] Not all Junior Roller Coaster pieces are shown when "Show all track pieces" cheat is enabled.
- Fix: [#13044] Rides in RCT1 saves all have "0 customers per hour".
- Fix: [#13074] Entrance and exit ghosts for mazes not being removed.
- Fix: [#13083] Dialog for renaming conflicting track design crops text out.
- Fix: [#13097] Missing direction arrow for stations
- Fix: [#13098] UI buttons for entrance and exit don't toggle according to them being built.
- Fix: [#13098] Maze can still be constructed while placing entrance and exit (original bug).
- Fix: [#13118] Closing construction window resets ride viewport.
- Fix: [#13129] Missing error message when waiting for train to leave station on the ride measurements graph.
- Fix: [#13138] Fix logical sorting of list windows.
- Fix: [#13158] Cursors are drawn incorrectly in text input fields.
- Fix: [#13222] Vehicle collision causes negative number of passengers (original bug).
- Fix: [#13226, #7280] No error is shown when attempting to load a corrupted save.
- Fix: [#13266] Plugin API: Deleting key of sharedStorage not working.
- Fix: [#13278] Desync caused by ghost tiles changing the ride mode.
- Fix: [#13289] Litter and vomit sometimes not loading with RCT1 saved game or scenario
- Fix: [#13292] Impossible excitement rating requirements with finish building 5 coasters goal
- Improved: [#13023] Made add_news_item console command last argument, assoc, optional.
- Improved: [#13098] Improvements to the maze construction window user interface
- Improved: [#13125] Selecting the RCT2 files now uses localised dialogs.
2021-03-13 12:17:05 +01:00
Michał Janiszewski 67b61478cf Reduce inclusion of EntityList.h 2021-02-25 10:56:27 +01:00
Michał Janiszewski 8ee49ab615 Reduce inclusion of world/Sprite.h 2021-02-25 10:56:27 +01:00
Michael Steenbeek 0cdbc99984
Merge pull request #13848 from IntelOrca/refactor/shortcut-engine
Introduce new shortcut engine
2021-02-21 14:01:39 +01:00
Ted John e28c23f10f
Fix regression in CreateSocket (#14131) 2021-02-21 03:58:34 +00:00
Ted John 2b3aabb8e4 Remove old shortcut code and fix issues 2021-02-21 03:14:18 +00:00
Michael Steenbeek 2379c7c9a6
Bump network version 2021-02-19 09:36:45 +01:00
Ted John 3f5698b1e0 Fix REPL write line on Linux 2021-02-16 20:24:51 +00:00
Ted John 05cb106ee7 Improve advertise messages 2021-02-16 20:24:50 +00:00
Ted John c30e1f083b Improve network console messages 2021-02-16 20:24:50 +00:00
Ted John fe70cf26a7
Fix #13933: Clients do not run server plugins 2021-02-05 23:27:15 +01:00
Duncan 2d6da7551b
Fix #13958: Queue corruption due to intersecting entrances
There was a whole host of bugs that this issue has exposed which were caused by intersecting the queue of a ride with an entrance/exit or shop. When this was done the peep would be removed from the queue incorrectly and could end up at the wrong station or a variety of other unexpected behaviour
2021-01-30 17:20:01 +01:00
Michael Steenbeek d3a4c16270
Reserve room for tile owner 2021-01-29 16:56:33 +01:00
ζeh Matt 109a06663d
Fix entrance or exit stacked on top considered a duplicate 2021-01-29 16:19:07 +01:00
Duncan eb52391b9a
Remove next_in_quadrant (#13754)
* Use std::vector of quadrants

* Prevent ptr invalidation issues

* Remove next_in_quadrant

* Make review changes

* Rebuild next_in_quadrant for S6Export

* Fix formatting

* Constexpr where possible

* Increment network version and update replays
2021-01-23 07:36:46 +00:00
Michael Steenbeek 20f959c833
Use track_type_t in more places 2021-01-22 11:33:55 +01:00
Duncan f80531070b
Implement EntityLists (#13853)
* Implement EntityLists

* Remove dead code

* Use alternative name for iterator

* Add comments

* Increment network version

* Update replays

* Remove further dead code

* Update replays again
2021-01-21 18:36:34 +00:00
Duncan 3321720d4a
Split up misc list access to be type specific (#13870)
* Split up misc list access to be type specific

Took the opertunity to use a fold expression to simplify the code

* Increment network version
2021-01-21 08:29:02 +00:00
skdltmxn 7ef4d7762f
Refactor to avoid unnecessary copies (#13736)
* Refactor to avoid unnecessary copies

* Fix dangling references
2021-01-11 18:14:15 -03:00
Michael Steenbeek 60d1e94046
Close #7059: Implement landscape doors on Ghost Train (#13636)
* Implement landscape door updating

* Implement door drawing for Ghost Train

* Amend changelog and bump network version

* Apply review requests

* Always return default seat rotation for ride types with landscape doors

* Fix comment

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-01-10 21:38:02 +00:00
Mathias Gibbens b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Duncan d5ada2dca1
Remove type from SpriteBase (#13735)
* Move type field into sub structures

* Use type for misc_type

* Use type for l_type

* Rename to SubType

* Rename SpriteGeneric to MiscEntity

* Rename generic to misc

* Add extra nullptr checks for compilers that cant understand

* Make review changes

* Increment network version

* Update replays
2021-01-10 15:14:34 +00:00
Michael Steenbeek 1da6ae6b51
Merge pull request #13710 from skdltmxn/refactor/string_view
Refactor/string view
2021-01-10 13:37:01 +01:00
skdltmxn b0a8ebc808
Refactor to use push_back more efficient (#13726) 2021-01-08 20:59:55 +00:00
Gymnasiast cd270df349
Bump network version 2021-01-06 21:25:49 +01:00
skdltmxn c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
Matt c442ef6207
Improve performance of tweening entities between ticks 2021-01-05 00:26:58 +02:00
Tulio Leao b7f70ab20b Close #13628: Refactor MASTER_SERVER_STATUS to strong enum 2020-12-23 20:07:53 -03:00
Mike Jones 4e991beb8d
Closes #12419: Merge MISC_COMMAND and GAME_COMMAND into strong enum (#13103)
Merge MISC_COMMAND and GAME_COMMAND enums

Cleanup
2020-12-22 20:53:37 -03:00
Duncan 7440d7eb2b
Fix #13567: Added ability for peeps to stop eating certain food constanly (#13592)
* Fix #13567: Cure guests of severe gluttony

Incorrect assumption that bitscanforward itertated over 64 bits meant that food that was previously within the ExtraItemFlags would never get removed from the peeps inventory. bitscanforward function has been replaced with a 64bit version

* Bump network version
2020-12-17 17:45:40 +00:00
Adam f09b14ef2b
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
Adam 1b61b4b104
Fix #13489: Mechanics continue heading to inspect broken down rides (#13490)
* Fix #13489: Mechanics continue heading to inspect broken down rides
2020-12-05 15:05:55 -03:00
Ted John 9fda9b741c
Fix #13517: Bad formatting of chat messages (#13521)
* Bump network version which was the main cause of the problem.
* Ensure each chat line starts with some format codes.
2020-12-05 13:23:21 +00:00
Ted John b6a688e540 Refactor format tokens 2020-11-27 18:54:57 +00:00
Ted John 1e5d998338 Remove more instances of format codes 2020-11-27 18:54:56 +00:00
Michael Steenbeek b595370648
Fix #13257: Rides w/ exactly the minimum objective length not counted (#13446) 2020-11-23 19:22:16 -03:00
Michael Steenbeek 23871de19f
Remove built-in explode guests cheat 2020-11-16 22:07:52 +01:00
adam-bloom d79308ef40
Fix #12895: Prevent Mechanics from fixing just fixed rides (#13389)
* Fix #12895: only update ride mechanic status when advancing state

* add changelog message

* Change changelog wording

* Bump network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-13 20:13:13 -03:00
Tulio Leao b8f56fd980
Merge pull request #13312 from Gymnasiast/refactor/ride-id-it
Use ride_id_t in more places
2020-11-07 13:03:29 -03:00
Gymnasiast 7ef8082185
Bump network version 2020-11-07 13:49:15 +01:00
Hielke Morsink f0c1ea1d37
Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
Michael Steenbeek 3c1aaa97d7
Merge pull request #13379 from Gymnasiast/json-id-in-repo
Allow object lookup using new JSON id
2020-11-06 14:48:56 +01:00
Gymnasiast bafafa6805
Create functions to load objects by JSON id 2020-11-05 21:24:43 +01:00
Richard Fine 438b197b80
Debunch peeps (#12917)
* Stop guests from being forced to the center line of a path over time

Change the way we apply randomness to peep destinations when moving from one tile to the next, to allow peeps that are moving along a straight path to maintain their perpendicular offset relative to the path direction, instead of being (eventually) forced back to the center line.

* Update test expectations

The changes to guest movement mean that the number of steps taken for these expected paths are now slightly different to before.
2020-11-03 22:30:36 -03:00
Sadret c2d309af38
Close #13346: Change FootpathScenery to FootpathAddition (#13350) 2020-11-03 08:17:29 +00:00
Aaron van Geffen cea5fab238 Release v0.3.2
- Feature: [#12110] Add Hybrid Coaster (Rocky Mountain Construction I-Box) track type.
- Feature: [#12999] .sea (RCT Classic) scenarios are now listed in the “New Scenario” dialog.
- Feature: [#13000] objective_options command for console.
- Feature: [#13096] Add Esperanto translation.
- Feature: [#13164] Add 'Objective options' to Cheats menu.
- Change: [#9568] Change lift sounds of Reverser Roller Coaster and Compact Inverted Coaster to better fitting ones.
- Change: [#13160] The lay-out of the Park Cheats tab has been improved.
- Fix: [#1324] Last track piece map selection still visible when placing ride entrance or exit (original bug).
- Fix: [#3200] Close Construction window upon selecting vehicle page.
- Fix: [#4022] Fix Mac cursor offset on launch
- Fix: [#4041] Garbled park option on scenario editor with custom theme.
- Fix: [#4865] Offer an option to disable inhibiting the monitor power.
- Fix: [#5178] Lighting effects cannot be disabled in software mode
- Fix: [#5904] Empty errors on tile inspector base height change.
- Fix: [#6086] Cannot install existing track design with another name.
- Fix: [#6614, #8623] Colours are distorted when using OpenGL with Intel integrated graphics drivers.
- Fix: [#7443] Construction arrows pulse at irregular intervals.
- Fix: [#7518] Water isn't cut down by view clipping tool.
- Fix: [#7748] Tooltips would not timeout for normal UI elements.
- Fix: [#8015] RCT2 files are not found when put into the OpenRCT2 folder.
- Fix: [#8957] Error title missing when building with insufficient funds
- Fix: [#10186] Placing multiple saved rides ignores design name (original bug).
- Fix: [#12368] Desync due to ghost station pieces affecting changing ride settings.
- Fix: [#12940] Windows cause issues with snow drawing.
- Fix: [#13019] Simulated trains sometimes open construction window when they crash.
- Fix: [#13021] Mowed grass and weeds don't show up in extra zoom levels.
- Fix: [#13024] Console cursor does not correctly render at current cursor position.
- Fix: [#13029] Not all Junior Roller Coaster pieces are shown when "Show all track pieces" cheat is enabled.
- Fix: [#13044] Rides in RCT1 saves all have "0 customers per hour".
- Fix: [#13074] Entrance and exit ghosts for mazes not being removed.
- Fix: [#13083] Dialog for renaming conflicting track design crops text out.
- Fix: [#13097] Missing direction arrow for stations
- Fix: [#13098] UI buttons for entrance and exit don't toggle according to them being built.
- Fix: [#13098] Maze can still be constructed while placing entrance and exit (original bug).
- Fix: [#13118] Closing construction window resets ride viewport.
- Fix: [#13129] Missing error message when waiting for train to leave station on the ride measurements graph.
- Fix: [#13138] Fix logical sorting of list windows.
- Fix: [#13158] Cursors are drawn incorrectly in text input fields.
- Fix: [#13222] Vehicle collision causes negative number of passengers (original bug).
- Fix: [#13226, #7280] No error is shown when attempting to load a corrupted save.
- Fix: [#13266] Plugin API: Deleting key of sharedStorage not working.
- Fix: [#13278] Desync caused by ghost tiles changing the ride mode.
- Fix: [#13289] Litter and vomit sometimes not loading with RCT1 saved game or scenario
- Fix: [#13292] Impossible excitement rating requirements with finish building 5 coasters goal
- Improved: [#13023] Made add_news_item console command last argument, assoc, optional.
- Improved: [#13098] Improvements to the maze construction window user interface
- Improved: [#13125] Selecting the RCT2 files now uses localised dialogs.
2020-11-01 20:00:01 +01:00
Gymnasiast 140e945a7b
Increase network version 2020-10-26 23:13:49 +01:00
Haven Kim ce2f78bd51
Fix #13222 : Vehicle collision causes negative number of passengers
When peep_sprite_remove is called, RemoveFromRide() will decrease ride's num_riders
2020-10-19 23:33:54 +02:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
X123M3-256 9681ea4cea
Add "Hybrid Coaster" ride type (#12110)
* Add "Hybrid coaster" ride type

* Add turns

* Add diagonal slopes

* Add bank transitions

* Add diagonal bank transitions

* Add banked turns

* Add sloped turns

* Add sloped bank transitions

* Add sloped banked turns

* Add s bends

* Add helices

* Add barrel rolls

* Add half loops

* Start changing supports to wooden

* Switch diagonals and banked turns to wooden supports

* Finish switching supports to wooden

* Alter default supports for small turns and steep turns

* Split track sprites that were glitching

* Fix incorrect sprite indices on small helices

* Add supports for large flat to steep pieces

* Fix bug with b supports

* Add supports for quarter loops

* Finalize set of track elements

* Fix strange colors when track piece is highlighted

* Update sprites.json

* Add support for corkscrews

* Fix incorrect remap colors and default supports

* Add slope to banked turn transitions

* Add support for preview image in color selection window

* Fix static glitches

* Correct Z offset

* Set segment heights (and fix more static glitches)

* Improve sloped curve supports

* Fix slope to banked turn transitions

* Fix dynamic glitches

* Fix boosters

* Remove corkscrews

* Set ride data and implement ride rating function

* Fix glitches on steep turns and gentle to steep

* Format code

* Add sprites

* Add track color preview image

* Fix formatting

* Add files to MSVC project

* Fix Testpaint

* Revert removal of RIDE_TYPE_50 from GetClassification

* Introduce constant instead of hard coded number

* Fix stray change

* Improve legibility of ride_ratings_calculate_hybrid_coaster()

* Fix comments on byte_97B23C

* Fix two other stray changes

* Fix Xcode project

* Adjust bounding boxes to make clipping behaviour more consistent

* Fix two glitches on medium and large turns

* Address comments from DuncansPumpkin

* Fix incorrect ride ID

* Fix steep turn sprites

* Run PNG images through OptiPNG

* Update changelog

* Fix namespace error

* Use arrays for supports to handle additional elements

* Rename functions to TitleCase and add namespace

* Increment network version

Co-authored-by: Edward Calver <hx010973@reading.ac.uk>
Co-authored-by: tylerleamon <59478575+tylerleamon@users.noreply.github.com>
Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-10-10 20:27:12 +01:00
Vinicius Sa c6b7893d77
Verify pointer against nullptr before using it
Reported by PVS-Studio (Warning: V1004).

Fix 6/7.

Issue: 12523
2020-10-06 18:21:26 -03:00
Aaron van Geffen 797fe48b0f
Merge pull request #13068 from mwnciau/json-compilation-performance
Fix #13055: Replace includes of Json.hpp in header files with json_fwd.hpp
2020-10-06 01:09:41 +02:00
Simon Jarrett 134371f03c Change includes of nlohmann/json_fwd.hpp to new core/JsonFwd.hpp 2020-10-06 00:16:21 +02:00
Julia Pinheiro 6a76547c5b
Close #12412: Refactor PROMPT_MODE to use strong enum (#13076) 2020-10-02 23:04:59 -03:00
Simon Jarrett 9c5e9f8dbc Replace includes of Json.hpp in header files with json_fwd.hpp 2020-10-02 11:31:20 +01:00
Julia Pinheiro c36ec5c5ce
Close #12425: Refactor SOCKET_STATUS to use strong enum (#13064) 2020-10-01 22:10:51 -03:00
Julia Pinheiro 657106d4c6
Close #12424: Refactor NetworkStatisticsGroup to use strong enum (#13056) 2020-10-01 22:07:48 -03:00
Tulio Leao d01dcea98a Release v0.3.1
- Feature: [#10807] Add 2x and 4x zoom levels (currently limited to OpenGL).
- Feature: [#12703] Add scenario plugin APIs.
- Feature: [#12708] Add plugin-accessible names to all game actions.
- Feature: [#12712] Add TCP / socket plugin APIs.
- Feature: [#12840] Add Park.entranceFee to the plugin API.
- Feature: [#12884] Add BaseTileElement.occupiedQuadrants to the plugin API.
- Feature: [#12885] Add SmallSceneryElement.quadrant to the plugin API.
- Feature: [#12886] Make all scenery placement and remove actions available to the plugin API.
- Feature: [#2350, #12922] Add snow, heavy snow and blizzard to weather types.
- Fix: [#400] Unable to place some saved tracks flush to the ground (original bug).
- Fix: [#5753] Entertainers make themselves happy instead of the guests.
- Fix: [#7037] Unable to save tracks starting with a sloped turn or helix.
- Fix: [#12691] Ride graph tooltip incorrectly used count instead of number string.
- Fix: [#12694] Crash when switching ride types with construction window open.
- Fix: [#12701] Silent NSIS setup flag /S isn't silent, upgrade pop-up appears anyway.
- Fix: [#12737] Space Rings draw the same vehicle 4 times.
- Fix: [#12756] Scenario Editor crashing the game on macOS.
- Fix: [#12764] Rides don't start aged anymore.
- Fix: [#12818] Ride price not ignored in free-rides parks.
- Fix: [#12820] Title menu buttons not invalidating properly
- Fix: [#12845] Deleting ride with active ad campaign creates incorrect notification.
- Fix: [#12857] Incorrect Peep thoughts in imported RCT1 parks.
- Fix: [#12881] Guests' favourite rides are not listed in the guest window.
- Fix: [#12910] Plugin API: getRide sometimes returns null for valid ride IDs.
- Fix: [#12912] Plugin: selectedCell of CustomListView is being ignored on creation.
- Fix: [#12918] Cannot place vanilla TD6 tracks of the Hypercoaster, Monster Trucks, Classic Mini Roller Coaster, Spinning Wild Mouse and Hyper-Twister types.
- Fix: Incomplete loop collision box allowed overlapping track (original bug).
- Improved: [#12806] Add Esperanto diacritics to the sprite font.
- Improved: [#12837] Arabic text is now drawn and shaped correctly on Windows.
- Improved: [#12890] Add stroke to lowercase 'L' to differentiate from capital 'I'.
- Technical: [#12749] The required version of macOS has been lowered to 10.13 (High Sierra).
2020-09-27 17:57:34 -03:00
Duncan da82144bfb
Fix #12944. Mistake from refactor meant formatter optimised away (#12961)
Not sure why it should get optimised away but this will fix the crashes.
2020-09-18 09:25:17 +01:00
Matt b3b9a348c5
Apply review suggestions 2020-09-17 22:16:05 +03:00
Matt ccde06ab0f
Explicitly pass formatter arguments to ShowError and family 2020-09-17 22:14:36 +03:00
Matt 2639349925
Move storage into Formatter class and refactor usage 2020-09-17 22:14:36 +03:00
Simon Jarrett 1b821c1059 Refactor ServerList to use new JSON library 2020-09-16 20:18:53 +01:00
Simon Jarrett 651a2951a1 Refactor NetworkUser to use new JSON library
- Removed the ToJson(json_t) method
- The FromJson method expects to receive a JSON node of type object (as per added documentation)
- Unlike elsewhere, we need to use iterators for the Save() method to allow us to remove items from the array
2020-09-16 20:18:53 +01:00
Simon Jarrett de9a16404b Refactor NetworkServerAdvertiser to use new JSON library
- the body.dump() calls throughout use the default indent parameter of -1 so will produce JSON with no whitespace
- OnRegistrationReponse must be passed a JSON node of type object
2020-09-16 20:18:53 +01:00
Simon Jarrett c655d47dd3 Refactor NetworkGroup to use new JSON library 2020-09-16 20:18:53 +01:00
Simon Jarrett f1bcf20050 Refactor NetworkBase to use new JSON library 2020-09-16 20:18:52 +01:00
Michael Steenbeek 3acbb92074
Merge pull request #12922 from Gymnasiast/LetItSnow2 2020-09-15 18:11:45 +02:00
Tulio Leao c1729c8a87
Merge pull request #12858 from ju-pinheiro/network-strong-enums
NETWORK_PERMISSION and NETWORK_AUTH replaced by strong enums
2020-09-15 08:07:19 -03:00
Gymnasiast a46a21973f
Amend changelog; bump network version 2020-09-14 22:00:54 +02:00
ju-pinheiro 214620951f Close #12421: Refactor NETWORK_AUTH to use strong enum
Replacing enum NETWORK_AUTH with enum class NetworkAuth.
2020-09-10 19:32:28 -03:00
ju-pinheiro 20a8bbc322 Close #12420: Refactor NETWORK_PERMISSION to use strong enum
First approach, instead of a bigger refactor to avoid the need of "static_cast".
2020-09-10 19:32:27 -03:00
Tulio Leao cf5f3da0df
Cleanup c-style casts from Socket.cpp 2020-09-10 21:36:21 +02:00
Michael Steenbeek bd28b74655
Make all game actions take an ObjectEntryIndex where applicable (#12384)
* Make all game actions take an ObjectEntryIndex where applicable

* Update replays for parameter size change

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-09-09 17:03:20 +01:00
Richard Fine d2d9750a5b Fix #5753: Entertainers make themselves happy instead of the guests
After identifying guests that are near an entertainer, modify the guest's HappinessTarget and TimeInQueue values instead of the entertainer's own values.
2020-09-08 16:40:29 -04:00
chess123mate 83de5fab2a
Fix #12818 - Ride prices not ignored in free-rides parks (#12832) 2020-09-05 11:10:42 -03:00
Ted John 33ba51b763 Fix crashes and improve socket lifecycle 2020-09-03 22:38:42 +01:00
Ted John fd6fddb61a Improve WSA handling 2020-09-03 22:38:42 +01:00
Ted John 182bcaf21a Implement setNoDelay 2020-09-03 22:38:42 +01:00
Ted John dce547af99 Start implementing TCP API 2020-09-03 22:38:35 +01:00
Nils Caspar 359bbee9f5
Fix #12845: Cancel marketing campaigns for demolished rides (#12848) 2020-09-03 18:20:42 -03:00
Julia Pinheiro dafde532af
Close #12426: Refactor NETWORK_READPACKET to use strong enum (#12807)
Replacing enum NETWORK_READPACKET with enum class NetworkReadPacket.
2020-08-31 09:13:15 -03:00
ju-pinheiro e9c3f31422
Close #12423: Refactor NETWORK_SERVER_STATE to use strong enum (#12802)
#12423
2020-08-29 08:05:51 -03:00
Tulio Leao 10aca0fe6e Fix #12764: Rides don't start aged anymore 2020-08-25 08:21:34 -03:00
frutiemax 4165d64e60
Part of #11159: save_for_network returns unique_ptr (#12163) 2020-08-22 18:56:34 -03:00
Simon Jarrett 9fb51c18d4 Fix: Incomplete loop collision box allowed overlap (original bug) 2020-08-18 17:03:35 +01:00
Aaron van Geffen 135cc10b47 Release v0.3.0 2020-08-15 21:13:50 +02:00
ζeh Matt c1076658fc
Merge pull request #12658 from ZehMatt/fix-network-hang
Fix freezes on incomplete packet transmission
2020-08-12 19:00:27 +02:00
Matt 08af1e9be6 Increase network buffer to maximum packet size of 64 KiB 2020-08-12 18:36:12 +02:00
Michael Steenbeek d1b193c06d
Fix #11968: Maze height is higher than it should be 2020-08-12 18:33:15 +02:00
Matt ebc2be4cd0 Fix freezes on incomplete packet transmission 2020-08-12 18:11:09 +02:00
Matt 2a9796f2cc Add more guards in network code 2020-08-11 15:56:09 +02:00
ζeh Matt cb38d28b62
Fix #12621: Missing argument for localisation 2020-08-10 14:58:39 +02:00
Matt c16bdb5c69 Fix #11085: Handle player list before game actions during map load 2020-08-08 20:47:34 +02:00
ζeh Matt 765eada18e
Merge pull request #12526 from ZehMatt/win32-cleanup
Win32 and namespace cleanup
2020-08-05 17:18:50 +02:00
Duncan 3533d1734f
Merge pull request #12571 from ZehMatt/network/update-2
Refactor more network code
2020-08-05 15:55:24 +01:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Matt e91e68e3ec Re-phrase the network compatibility comment 2020-08-05 16:19:57 +02:00
Tulio Leao 78053e34d5
Fix #12561: Synchronized coasters not synced (#12572) 2020-08-04 15:51:35 +01:00
Matt 07b343813a Fix passing missing parameter 2020-08-03 00:46:44 +02:00
Matt 28dcaeae2f Refactor reading/writing packets 2020-08-03 00:36:02 +02:00
Matt 21f63c1010 Pass NetworkCommand type as constructor to simplify code 2020-08-02 22:31:00 +02:00
Matt 313b8a7518 Remove std::unique_ptr and use move semantics instead 2020-08-02 22:08:56 +02:00
Matt 224efdbbdf Simplify usage of NetworkPacket::Data 2020-08-02 22:07:47 +02:00
Duncan f49bfa777a
Change maze pathfinding to not prefer a direction (#12546)
* Change maze pathfinding to not prefer a direction

* Increment network version

* Update changelog

* Update replays
2020-08-02 08:20:34 +01:00
Michael Steenbeek e0f2aa9b99
Fix: Brakes keep working during "Brakes failure"
This was an error in the original implementation back in 2015.
Thanks to @duncanspumpkin for checking the assembly.
2020-07-30 22:21:19 +02:00
Matt f258c8034d Wrap code with macro test DISABLE_NETWORK 2020-07-30 20:29:16 +02:00
Matt af757fa58e Categorize members of NetworkBase 2020-07-30 20:29:15 +02:00
Matt 4cede91424 Introduce NetworkClient and NetworkServer 2020-07-30 20:29:15 +02:00
Matt cf1fb9ecff Move some types into NetworkTypes.h 2020-07-30 20:29:15 +02:00
Matt 37f6a11a1f Move Network declaration into header and rename to NetworkBase 2020-07-30 20:29:15 +02:00
ζeh Matt 8490e87eeb
Close #12422: Refactor NETWORK_COMMAND to use strong enum (#12481)
* Refactor NETWORK_COMMAND to strong enum

* Refactor all uses of NETWORK_COMMAND

Closes #12422
2020-07-28 17:24:40 +01:00
Matt 4b587e3989 Minor cleanup 2020-07-25 16:02:26 +02:00
Matt ab48c00a89 Fix client being stuck on empty object list 2020-07-25 15:23:26 +02:00
Matt 241ff111dd Address reviews 2020-07-25 14:10:01 +02:00
Matt 6c40d9f3d5 Fix formatting 2020-07-24 23:11:28 +02:00
Matt e31317e025 Rename function to be consistent 2020-07-24 23:11:28 +02:00
Matt d230bc8914 Bump up network version 2020-07-24 23:11:28 +02:00
Matt 908090104a Send client heartbeats to keep connection alive 2020-07-24 23:11:28 +02:00
Matt 1eedaf32dd Refactor sending the object list including status reporting 2020-07-24 23:11:28 +02:00
Matt 0f31b82af0 Add missing network command 2020-07-24 23:11:28 +02:00
Matt 8ef5d0e838 Rename some things to clarify purpose, add constant for map requests 2020-07-24 23:11:12 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
frutiemax a961d9784f
Part of #12243: Use coords for MazeRemoveTrack (#12251) 2020-07-15 23:34:26 -03:00
Jim 0248621502
Increase handyman randomness in queue (#12145)
* Increase randomness when handyman is on queue path

* Add myself to contributors

* Refactor hex variable probabilities

* Add check if queue is connected to a ride

* Update changelog

* Bump network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-07-08 19:48:08 +01:00
Gymnasiast 7cc510f6b7
Increment network version 2020-07-07 21:14:16 +02:00
frutiemax bee0b4b82d
Part of #11159: Optimize util_zlib_deflate return (#12111) 2020-07-04 09:21:50 -03:00
frutiemax 26ae2dbf04
Part of #11437: Move PlatformFileExists to Platform2.h (#12077) 2020-07-02 12:03:31 -03:00
Gymnasiast 2ee21e360c
Bump network version 2020-06-17 21:46:54 +02:00
Irrelevant Irreverent db85f0c78b Bump network version 2020-06-16 09:08:04 -04:00
Duncan b3d77dd6c9
Remove banner entry when deleting tiles with tile inspector (#11880) 2020-06-11 23:42:48 +02:00
Michael Steenbeek 9ef8d6da42
Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00