Commit graph

1994 commits

Author SHA1 Message Date
Corantin H aca398f3c9 Added dialog to fix invalid map settings on load 2024-01-23 20:13:57 +01:00
Corantin H 9cc8a28305 Better map settings input (autocomplete, validation) 2024-01-23 20:13:56 +01:00
Samuele Radici 79cf3b4e17
Update config_variables.h
text error
2024-01-22 01:33:44 +01:00
Dennis Felsing fca6e0abe3
Merge pull request #7837 from Robyt3/Demo-Recorder-Improvements
Refactor demo recorder usage
2024-01-21 22:39:46 +00:00
Alexander Akulich d0f5ced546 Make http states a enum class and use it across the codebase 2024-01-22 01:06:59 +03:00
Robert Müller 9150f48562 Refactor demo recorder usage
To simplify the usage of the demo recorder, parameters are added to the `IDemoRecorder::Stop` function to control whether the demo file is removed or renamed when stopping the recording.

Ensure demo files of the replay recorder are always removed (except on crashes). The temporary replay demos were previously not removed when being disconnected from a server.

Fix auto demos being stopped and restarted when enabling replays in the settings menu. Now only the replay recorder is stopped/started when necessary.

Fix replay recorder being restarted when setting `cl_replay` variable with console without changing the value.

Remove unnecessary `CClient::m_ButtonRender` variable. Demo rendering is already stopped correctly when reaching the end of the demo without this additional variable.

Remove unused `CDemoRecorder::m_pMapData` variable.
2024-01-21 22:21:56 +01:00
Robert Müller b89e4e8770 Finish CHttpRequest::OnCompletion before updating State()
Ensure that the `CHttpRequest::OnCompletion` function has finished before updating the state which is visible to other threads. Otherwise, threads may try to access the result of a completed HTTP request, before the result has been initialized/updated in the `OnCompletion` function.

Fixes warning due to invalid texture width/height being shown for downloaded skins, because the texture was loaded before the image data was initialized. Closes #7818.

Regression from #7683. Before this, the `OnCompletion` function could also modify the HTTP request's state, which was used to check if loading the skin PNG failed. Instead of doing this, a separate check is added for the skin download task to check that the PNG was loaded successfully.
2024-01-21 14:53:33 +01:00
ChillerDragon e59c9a6450 Only log http requests if `dbg_curl 1`
closed #7823
2024-01-19 12:38:53 +08:00
Robert Müller c90a52f51c Add CDynamicRingBuffer to avoid specifying size as template 2024-01-17 18:17:08 +01:00
heinrich5991 bb3bd57c0e
Merge pull request #7683 from Learath2/dd_pr_curlmultifinal
Use curl-multi. Supersedes #5842
2024-01-15 21:54:24 +00:00
Learath2 f5910343e2 Fix CI 2024-01-14 15:37:44 +03:00
Learath2 bcf86d81f3 Fix CRegister 2024-01-13 15:28:53 +03:00
Learath2 6eb51239c9 Fix some clang-tidy issues and UB 2024-01-12 23:27:49 +03:00
heinrich5991 035cb6eab8
Merge pull request #7784 from ChillerDragon/pr_256_welcome
Increase sv_welcome to 256
2024-01-10 16:57:59 +00:00
ChillerDragon 21f6af9d38 Increase sv_welcome to 256 2024-01-10 17:39:24 +01:00
Robert Müller 80a52cae95 Avoid including zlib.h in header file
By adding `CDataFileWriter::ECompressionLevel` to replace usage of zlib internal compression levels in the `CDataFileWriter` API.

Use `std::numeric_limits<int>::max()` instead of `INT_MAX` in one case where the latter was only declared by the transitive zlib include. The `limits` header is already included and its use is more fitting for C++ code.
2024-01-09 19:36:41 +01:00
Learath2 9b3ebf3f1b Remove debug statement, fix CI 2024-01-07 17:48:48 +03:00
Robert Müller a80d875e85 Improve error log messages when saving settings fails
Log separate messages for `io_sync` error, `io_close` error and general write errors.
2024-01-07 12:24:07 +01:00
Robert Müller 999119c60f Propagate unknown UUID-based map items in map tools
Adapt the `CDataFileReader::GetItem` function so it optionally also returns a `CUuid` for UUID-based map items, including for items with unknown UUIDs where the item type will be `-1`. Adapt the `CDataFileWriter::AddItem` function so it optionally also accepts a `CUuid` which will be used if the item type is `-1`.

The additional checks for invalid map item types in the map tools are removed again and instead the new UUID parameters are used so map items with unknown UUIDs are written back to maps correctly.

Closes #7701.
2024-01-06 21:25:15 +01:00
heinrich5991 c12835bc39 Group NETMSG_RCON_CMD_ADD 2024-01-05 18:10:57 +01:00
Corantin H 3c9294321e Fix crash on editor autosave
Add system method `timestamp_from_str` and add tests.
Replace `int64_t` with `time_t` to be more consistent.
2024-01-02 23:38:41 +01:00
Dennis Felsing a9c316055f
Merge pull request #7712 from furo321/rework-cfilecollection
Rework `CFileCollection`.
2023-12-26 08:02:40 +00:00
furo 5b5ead8356 Rework CFileCollection.
- Use existing functions from `system.h`
- Use sorting from `<algorithm>`
- Don't recall `ListDirectory` for every removal, which caused the client to hang previously with a lot of files.
2023-12-26 03:31:06 +01:00
furo b1f9137e34 Change path to demos/auto/server. Use same filename format as client. 2023-12-25 17:31:25 +01:00
Edgar 2b344f4a01
Merge pull request #7647 from Robyt3/Server-Votes-Config-Improvement
Improve vote config variable descriptions and value range
2023-12-20 10:41:17 +00:00
Learath 1f224344ec Format and bump fake curl 2023-12-18 23:02:00 +01:00
Learath 1dc8496470 Use curl-multi 2023-12-18 20:06:43 +01:00
Robert Müller eb222ae02a Remove CFGFLAG_SAVE when CFGFLAG_SERVER used
Server variables are currently not saved.
2023-12-16 21:21:03 +01:00
Robert Müller b067ccafc6 Improve vote config variable descriptions and value range
Closes #7584.
2023-12-16 18:01:06 +01:00
archimede67 5dbd5a1f49 Added quad alignment/snapping to other quads/points 2023-12-16 01:29:09 +01:00
Edgar 726ffe35d0
Merge pull request #7654 from def-/pr-curlopt-share
Disable CURL_LOCK_DATA_CONNECT (fixes #7636)
2023-12-15 09:26:34 +00:00
Dennis Felsing 5ff8697be1 Disable CURL_LOCK_DATA_CONNECT (fixes #7636) 2023-12-15 00:51:02 +01:00
Robert Müller 6a12e209b6 Fix readability-make-member-function-const 2023-12-14 23:38:03 +01:00
Robert Müller 187120dd31 Ensure network log files are closed when shutting down engine
Previously, the network log files were not explicitly closed unless the `dbg_lognetwork` command is used again manually.
2023-12-12 20:00:52 +01:00
Robert Müller 10b486a6b0 Remove unnecessary use of GetCompletePath
The result `aFullPath` is unused.
2023-12-12 20:00:48 +01:00
Dennis Felsing 7813cfed6c
Merge pull request #7618 from heinrich5991/pr_ddnet_less_system_h
Make less headers depend on `<base/system.h>`
2023-12-11 23:08:59 +00:00
heinrich5991 05af24a052 Make less headers depend on <base/system.h>
Move a couple of trivial type definitions to `<base/types.h>` instead.
2023-12-11 23:52:23 +01:00
Robert Müller 140fcea667 Avoid using console to reset game settings
Prevent potential dead lock when using `/map` chat command in combination with Teehistorian. Closes #7619. I could not reproduce the issue on Windows though.

This also means resetting game settings should actually be efficient now, because it only involves iterating over all game settings and directly resetting their value.
2023-12-10 11:23:20 +01:00
Dennis Felsing addb3c6980
Merge pull request #7616 from Robyt3/Snapshot-Storage-Separate-Alloc
Separate snapshot storage holder and snap data allocations
2023-12-09 21:45:45 +00:00
Robert Müller d3cc932a9b
Merge pull request #7393 from archimede67/editor-undo-redo-v2
Editor undo/redo v2
2023-12-09 18:17:38 +00:00
Robert Müller efc451324d Separate snapshot storage holder and snap data allocations
Previously, only one buffer was allocated to store each snapshot holder structure, the snapshot data and alternative snapshot data. This prevents tools like ASAN from detecting some invalid accesses, e.g. to the snapshot holder structure by underflowing the snapshot data pointer. Now three separate allocations are used instead. This hopefully helps debugging #2677.
2023-12-09 19:03:07 +01:00
Robert Müller 30df38f926 Add compile time errors for unsupported endianness
We support little and big endian but not PDP endian (Middle-endian).

Define endianness as string `CONF_ARCH_ENDIAN_STRING` to avoid conditional compilation when printing endianness.
2023-12-08 16:57:01 +01:00
heinrich5991 f52aa8a61c
Merge pull request #7592 from Robyt3/Protocol-VoteTime-Fix
Fix votes with timeout over 60 seconds not being shown in client
2023-12-05 19:34:41 +00:00
Robert Müller b738f5f9ce Fix votes with timeout over 60 seconds not being shown in client
Setting a vote timeout longer than 60 seconds with `sv_vote_time` caused the vote network messages to be discarded with the error message `weird message 'Sv_VoteSet' (15), failed on 'm_Timeout'` by the client, as the protocol did not allow longer vote timeouts.

This changes the protocol so the vote timeout can be any positive integer although for now the maximum `sv_vote_time` value is changed back to 60 again to preserve compatibility with old clients.

Closes #7583.
2023-12-05 20:12:15 +01:00
heinrich5991 801274ac63
Merge pull request #7580 from Robyt3/Message-Unpack-Check
Add missing unpacker error checks for server and client packets
2023-12-05 19:01:33 +00:00
Robert Müller 4ad0a48a48 Add missing unpacker error checks for server and client packets
Ensure all packets are unpacked correctly before using the unpacked data.

Ensure strings are valid UTF-8 in `CUnpacker::GetString`.
2023-12-05 19:40:27 +01:00
heinrich5991 3607e8e0f2
Merge pull request #7581 from Robyt3/Snapshot-Refactoring
Various minor refactoring of snapshot-related code
2023-12-05 00:36:40 +00:00
Corantin H 96e4c5f7cd Add editor undo/redo feature 2023-12-04 22:44:20 +01:00
Robert Müller 0c6978f553 Support arbitrary number of kernel interfaces, assert on errors
Support registering arbitrary number of interfaces with `IKernel` instead at most 32.

Assert when incorrect arguments are passed to `IKernel` functions instead of returning a `bool`, which was not being handled in all cases. These functions are not expected to fail expect on programming errors.

Consistently order and format creation and registration of kernel interfaces in client and server.
2023-12-04 18:11:47 +01:00
Robert Müller 0ff2c5b772 Use size_t and add assertions for CSnapshotStorage::Add 2023-12-04 17:59:40 +01:00