Commit Graph

53 Commits

Author SHA1 Message Date
Matt ee00143f3a Throw assert only in debug builds for missing game actions. 2019-02-07 18:23:58 +01:00
Matt c7ab757a86 Cleanup. 2018-12-29 23:06:15 +01:00
Matt 14695e9b41 Fix game actions with ghost flags being recorded to replays. 2018-12-29 19:23:28 +01:00
Matt 5a8b611b83 Update. 2018-12-29 19:23:28 +01:00
Matt df0cc72887 Add normalisation support to remove gaps. 2018-12-29 19:23:27 +01:00
Matt bf8108c2d6 Lock game actions and commands to replay commands if replay is active. 2018-12-29 19:23:27 +01:00
Matt a6efef1e81 Add support to record and replay game commands/actions. 2018-12-29 19:23:27 +01:00
Matt 4ff2dbd108 Automatically expose game action name via macro. 2018-12-20 22:20:58 +01:00
ζeh Matt d88a9048f9 Fix #8431: crash when game action logging is enabled. (#8447) 2018-12-15 18:41:55 +00:00
ζeh Matt 2da01caa1e Fix #8338: GAs using player id instead of index to log money spent. (#8361) 2018-12-05 07:39:57 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
ζeh Matt 1abb31a159 Implement game action logging. (#8138) 2018-11-20 06:04:42 +01:00
ζeh Matt 7831208f42 Fix #8199: Crash using player id as index. (#8210) 2018-11-02 22:48:45 +01:00
Sijmen Schoon f3f4776afd Properly fix maze building when paused (#7852)
Also fixes two relevant bugs:
- The error message having no title
- Fixes the controls in the construction window activating when the initial placement fails because of e.g. the game being paused.
2018-08-04 14:30:13 +02:00
clang-format 90f1a328ab clang-format game actions 2018-07-23 15:58:01 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink 6c65c3d64d
Merge pull request #6774 from janisozaur/fixes
Various code improvements
2018-05-15 14:38:43 +02:00
Hielke Morsink 9f0d820b7c Use TileCoordsXYZD for wall locations 2018-05-14 12:36:45 +02:00
Hielke Morsink f9dd981234 Further fixes
- Use `= 0` for initializing types
- Add default values to some structs, instead of zero-initializing their instances with `{}`
- Use `std::make_unique` in Network.cpp
- Remove trivial constructors and destructors
- Improve readability of expression in Vehicle.cpp
2018-05-12 16:58:08 +02:00
Michał Janiszewski 0a92e74ced Minor fixes 2018-05-11 15:38:30 +02:00
ZehMatt 70ee22bbfa Discard empty errors. 2018-05-11 12:32:16 +02:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Michał Janiszewski 764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
ZehMatt bdc1cf8adc Refactor GAME_COMMAND_MAZE_SET_TRACK to game action. 2018-03-05 00:17:34 +01:00
Ted John 0c71855769 Replace Memory::Copy with std::copy 2018-02-04 12:40:24 +00:00
Hielke Morsink 8fac2e1480 Add guard to ensure game action is registered
This also reorders the headers, which caused RideDemolishAction to fail compiling, but that's also solved by adding the namespace before the call.
2018-01-29 13:22:13 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Gymnasiast 1626f86acc Compile park.c as C++ 2018-01-01 01:18:12 +01:00
Michael Steenbeek 3868b100df Stop encrypting money
It serves no purpose any more. Of course, we still need the ENCRYPT_MONEY() and DECRYPT_MONEY() functions for importing and exporting S6 files.
2017-12-07 23:22:24 +01:00
Marijn van der Werf 3d7867791d Move scenery window to UI module 2017-11-18 21:07:21 +01:00
Robbin Voortman f0b8559341 Lower game actions verbosity 2017-10-27 11:14:37 +02:00
Duncan 6e1521caec Reintroduce error messages when trying to open invalid rides (#6381)
* Reintroduce error messages when trying to open invalid rides

Mistake made during action refactor. I've added the ability to specify the error title and error args as well in the result constructor. In addition the set status will now perform a query to check if it is valid preventing error messages hitting the server.

* Bring error message setting into the function

This prevents any other function corrupting the message args. Looking at you update ride window.

* Increment network version for error message fix on set status

* Reintroduce the error title to set ride name

* Try not to introduce bugs due to inverting logic
2017-10-09 15:50:49 +01:00
Michał Janiszewski aba3c270bb Game actions fixes 2017-10-05 10:42:44 +02:00
Michał Janiszewski 4841e2c6f3 Improve verifying validty of new game action 2017-10-05 10:42:44 +02:00
Michał Janiszewski b70dd97234 Fix rebase errors 2017-10-05 10:42:44 +02:00
ZehMatt ce54b41aba Fix single player pre-designed rides not working.
Move ride_create_command into GameActionCompat
Refactor GameActions to return the GA_FLAGS instead of using the const value.
Refactor passing params to GameActions over constructor.
2017-10-05 10:42:44 +02:00
Michał Janiszewski 6ddac382be Fix copyright dates 2017-10-05 10:42:44 +02:00
Ted John 4ac8f1dc35 Make the game action callback type safe 2017-10-05 10:42:43 +02:00
Ted John aa30859ab7 Merge IGameAction into GameAction 2017-10-05 10:42:43 +02:00
ZehMatt 072ecadd48 Fix leaking memory creating game actions.
Specialized class use for game action results.
2017-10-05 10:42:43 +02:00
ZehM4tt 3657122b3b Moved ride create command to new game action system. 2017-10-05 10:42:43 +02:00
ZehM4tt fbd793083c Put action files in headers instead of cpps.
Added callbacks for GameActions and network support for them.
Refactored GameAction registration due static library issues.
Moved all C functions into a single file.
2017-10-05 10:42:43 +02:00
ZehM4tt 1b2a61c6ba Separated out byte swapping into its own header.
Simplified data serialisation of game actions.
Moved the flags away from parameters.
GameAction base now serialises mandatory data such as flags and player.
Split some functions from network in order to move command processing to the end of tick.
2017-10-05 10:42:43 +02:00
duncanspumpkin 149a854c51 Make changes to match @ZehMatt code 2017-10-05 10:42:39 +02:00
duncanspumpkin 205a1c9e12 Depreciate game command. Fix error messages 2017-10-05 10:42:39 +02:00
duncanspumpkin df5ea16026 Change function declarations. Move network code into network 2017-10-05 10:42:38 +02:00
duncanspumpkin 254041985f Make servers work 2017-10-05 10:42:38 +02:00
duncanspumpkin ae24ded8bf Make client work 2017-10-05 10:42:38 +02:00
duncanspumpkin 351b0df76b Initial try at adding networking 2017-10-05 10:42:38 +02:00