ddnet/src/game
Robert Müller 6cdfa35727 Allow background jobs to be aborted, refactoring
Add `IJob::Abortable(bool)` function which jobs can call to specify whether they can be aborted. Jobs are not abortable per default. Abortable jobs may have their state set to `IJob::STATE_ABORTED` at any point if the job was aborted. The job state should be checked periodically in the `IJob::Run` function and the job should terminate at the earliest, safe opportunity when aborted. Scheduled jobs which are not abortable are guaranteed to fully complete before the job pool is shut down. However, if the job pool is already shutting down, no additional jobs will be enqueue anymore and abortable jobs will immediately be aborted.

In particular, the sound loading, community icon loading, master chooser and host lookup jobs are specified as being abortable. Conversely, the jobs saving replay demos, editor maps and screenshots are expected to finish before the client is shut down.

When the client is quitting/restarting, it will now disconnect from the current server first, before saving the config, to ensure that any actions that happen on disconnect (demo recorders being stopped etc.) happen first. The shutdown message is rendered before disconnecting and waiting for background jobs to finish.

The HTTP client is now initialized later during server launch, after the network initialization. Error handling is added and the server stops if the HTTP client could not be initialized, same as the client.

The `RunBlocking` functions are removed, as they are not used anymore after curl-multi was added.

The function `IJob::Status` is renamed to `State` and `IJob::STATE_PENDING` is renamed to `STATE_QUEUED` for consistency with naming of the HTTP client.

The member variables of the engine interface are encapsulated and the `jobs.h` include is removed from `engine.h`, which removes transitive includes of `system.h`.

Documentation for all job and job pool API is added.
2024-02-25 17:03:45 +01:00
..
client Allow background jobs to be aborted, refactoring 2024-02-25 17:03:45 +01:00
editor Allow background jobs to be aborted, refactoring 2024-02-25 17:03:45 +01:00
server ClientEmptyClientSlotEmpty 2024-02-19 21:36:21 +01:00
alloc.h Move alloc.h to game/ and use it in client/prediction/entity.h 2023-09-15 18:04:29 +03:00
collision.cpp Remove unnecessary check for entities close to map border 2024-01-18 22:44:22 +01:00
collision.h Fix readability-make-member-function-const 2023-12-14 23:38:03 +01:00
gamecore.cpp Fix comment grammar 2024-01-07 18:05:12 +01:00
gamecore.h Fix readability-make-member-function-const 2023-12-14 23:38:03 +01:00
layers.cpp Ensure white color for entities layers when loading map layers 2023-12-11 13:37:23 +01:00
layers.h Remove Parallax Zoom from map file 2023-10-29 23:43:19 +01:00
localization.cpp Remove CLocConstString 2023-08-30 19:24:38 +02:00
localization.h Remove CLocConstString 2023-08-30 19:24:38 +02:00
mapbugs.cpp Remove obsolete clang-tidy NOLINT comments 2023-10-11 17:22:59 +02:00
mapbugs.h Remove code for CRC in most places, except where needed for net compat 2020-10-14 17:08:58 +02:00
mapbugs_list.h Revert "Add mapbug "stoppers-passthrough@ddnet.tw"" 2018-08-22 08:33:21 +02:00
mapitems.cpp Differentiate between normal and checkpoint teles 2023-12-27 15:23:57 +01:00
mapitems.h Differentiate between normal and checkpoint teles 2023-12-27 15:23:57 +01:00
mapitems_ex.cpp Remove Parallax Zoom from map file 2023-10-29 23:43:19 +01:00
mapitems_ex.h Remove Parallax Zoom from map file 2023-10-29 23:43:19 +01:00
mapitems_ex_types.h Remove Parallax Zoom from map file 2023-10-29 23:43:19 +01:00
prng.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
prng.h Replace all usages of C standard headers with C++ headers 2023-03-01 19:26:51 +01:00
teamscore.cpp Make less headers depend on <base/system.h> 2023-12-11 23:52:23 +01:00
teamscore.h Remove unnecessary include in protocol, move definitions to cpp file 2023-01-03 14:10:58 +01:00
tuning.h Replace 50 with SERVER_TICK_SPEED or TickSpeed() 2023-11-23 14:42:30 +01:00
version.h Version 18.0.3 2024-02-03 08:53:27 +01:00
voting.h Run clang-format 2020-09-26 21:50:15 +02:00