Commit graph

19748 commits

Author SHA1 Message Date
Dennis Felsing c727b87601
Merge pull request #8315 from ChillerDragon/pr_chat_cleanup
Rename chat `Say()` to `SendChat()`
2024-05-06 02:06:14 +00:00
ChillerDragon 44d065888f Rename CChat::SayChat to CChat::SendChatQueued
Also replace one code snippet with a call to SendChatQueued
2024-05-06 09:49:35 +08:00
ChillerDragon 33baeb8f28 Rename CChat::Say to CChat::SendChat
Follows the convention set by the other methods that send network packets.
2024-05-06 09:23:19 +08:00
Dennis Felsing 5586961b4c
Merge pull request #8313 from Robyt3/Collision-Layers-Unload
Also unload collision and layers when unloading map
2024-05-05 15:47:46 +00:00
Robert Müller 1551dda3e9 Also unload collision and layers when unloading map
Ensure that the `CCollision` and `CLayers` instances do not keep any pointers to the map data after the map has been unloaded.
2024-05-05 12:41:18 +02:00
Robert Müller 7d640e1f98
Merge pull request #8309 from ChillerDragon/pr_init_ghost
Initialize all ghost item member (Closed #8297)
2024-05-05 09:37:54 +00:00
Robert Müller bf2343d60b
Merge pull request #8312 from ChillerDragon/pr_fix_misleading_demo_snap_var_names
Make demo snap variable names more obvious
2024-05-05 09:18:38 +00:00
ChillerDragon 1a3bb727c5 Make demo snap variable names more obvious
Closed #8245
2024-05-05 16:01:55 +08:00
Dennis Felsing 9bd9e0282c
Merge pull request #8311 from ChillerDragon/pr_ci_admin_msg_fixed
Increase rcon command delay in integration test
2024-05-05 07:44:42 +00:00
ChillerDragon 244875e339 Increase rcon command delay in integration test
Closed #8261
2024-05-05 15:24:38 +08:00
Dennis Felsing 2b2e57c2bb
Merge pull request #8308 from ChillerDragon/pr_team_enum
Use enum for teams (Closed #8306)
2024-05-05 03:59:35 +00:00
ChillerDragon f319ed239a Initialize all ghost item member (Closed #8297) 2024-05-05 11:47:05 +08:00
ChillerDragon 0b6bb8287a Use enum for teams (Closed #8306) 2024-05-05 11:38:29 +08:00
Dennis Felsing aafb4e2e09
Merge pull request #8304 from Zwelf/pr-teehistorian-finish-2
Store player names in teehistorian and Finish/TeamFinish v2
2024-05-05 01:34:57 +00:00
Dennis Felsing fdc929d2b1
Merge pull request #8293 from BlaiZephyr/add-team0-indicator
add team0mode indicator
2024-05-05 01:33:27 +00:00
Zwelf f14dab4cfa Increment teehistorian version_minor to 8
Allows easily distinguishing between Teehistorian extension from #8221
with wrong Tick (divided by 50) and this fixed one.
2024-05-04 21:40:06 +02:00
Zwelf af4da41c4c Record Player and Team finishes in Teehistorian 2024-05-04 21:40:06 +02:00
meloƞ 2b6f5641d6 hud-final 2024-05-04 21:20:20 +02:00
Zwelf fcd8aae388 Record player name in Teehistorian files 2024-05-04 20:44:20 +02:00
Dennis Felsing 2f22447d44
Merge pull request #8302 from Robyt3/Video-Refactoring
Video recorder: improve error handling and log messages, fix crashes, refactoring
2024-05-04 14:59:06 +00:00
meloƞ 9c2e70ff67 Empty 2024-05-04 16:08:16 +02:00
Jupeyy 9336b4cb37
Merge pull request #8301 from ChillerDragon/pr_skin_warn
Improve skin name validation error message (Closed #8300)
2024-05-04 12:57:48 +00:00
Robert Müller e5927d9024 Fix crashes when video recording is not started successfully
Add additional checks to ensure that the `CVideo::Stop` function and the functions called by it will correctly stop the current video also if the video was not started successfully, i.e. if `CVideo::Start` returned `false` from any of the error branches.

In the `CVideo::Stop` function, iterate over the vectors of video and audio threads directly instead of using `m_VideoThreads` and `m_AudioThreads`, which do not reflect the actual count if the initialization failed before the threads were created.

In the `CVideo::Stop` function, only call `av_write_trailer` if the video recording was stated successfully, i.e. only if `avformat_write_header` was called successfully, as this will otherwise cause the client to crash. Closes #6375.

In the `CVideo::Stop` function, only call `avio_closep` if the format context was allocated.

In the `CVideo::FinishFrames` function, ensure that the codec has been allocated and opened, otherwise using it is not allowed.

Add assertions to the `CVideo::Start` and `Stop` functions to ensure that the same video is not started/stopped multiple times.
2024-05-04 13:55:35 +02:00
Robert Müller 3a0e2429d1 Assert that size of image data matches size of video
Crash with assertion when the size of the graphics is different from the video currently being rendered, instead of causing weirder bugs and a corrupted video file.
2024-05-04 13:55:35 +02:00
Robert Müller a0465b67dd Improve various variable and class names of the video recorder
- Rename variable `m_vBuffer` -> `m_vAudioBuffers`
- Rename class `SAudioBuffer` -> `CAudioBuffer`
- Rename variable `m_vPixelHelper` -> `m_vVideoBuffers`
- Add class `CVideoBuffer` as wrapper
- Remove unused variable `m_Vframe`
- Rename variable `m_ASeq` -> `m_AudioFrameIndex`
- Rename variable `m_VSeq` -> `m_VideoFrameIndex`
- Rename variable `m_vVideoThreads` -> `m_vpVideoThreads`
- Rename variable `m_vAudioThreads` -> `m_vpAudioThreads`
- Rename function `ReadRGBFromGL` -> `UpdateVideoBufferFromGraphics`
- Remove unnecessary `ALEN` definition
- Remove unused variable `NextPts`
- Rename class `OutputStream` -> `COutputStream`
- Rename variable `pSt` -> `m_pStream`
- Rename variable `pEnc` -> `m_pCodecContext`
- Rename variable `m_vpSwsCtxs` -> `m_vpSwsContexts`
- Rename variable `m_vpSwrCtxs` -> `m_vpSwrContexts`
- Rename variable `pOC` -> `pFormatContext`
- Rename class `SVideoRecorderThread` -> `CVideoRecorderThread`
- Rename class `SAudioRecorderThread` -> `CAudioRecorderThread`
2024-05-04 13:55:35 +02:00
Robert Müller 5f647b97eb Ensure correct sample and bit rate are used for video recording
The wrong sampling rate was being used for video recording if the client is not restarted after changing the `snd_rate` config variable.

Ensure that the correct bit rate is used if the sample rate was adjusted because the selected value is not supposed.
2024-05-04 13:15:54 +02:00
Robert Müller 9d2c11d7ee Improve error handling and logging of video recorder
Use `log_error` for all errors and consistently format all error messages.

Handle all ffmpeg errors and output the formatted ffmpeg error message when possible.

Register a log callback for ffmpeg log messages to delegate them to our logging system, to fix the log messages being interleaved with our log messages and not using the correct line breaks on Windows.

Stop video and demo immediately and show an error message popup if the video could not be started successfully.

Remove unnecessary debug output from ffmpeg.
2024-05-04 13:15:54 +02:00
Robert Müller e595545cd6 Fix duplicate file extension .mp4 for demos rendered from menu
The file extension is always added in `CClient::StartVideo` now.
2024-05-04 13:04:58 +02:00
Robert Müller 33c5bfb09b Fix indentation of comments 2024-05-04 13:04:58 +02:00
Robert Müller c78eebfc67 Use nullptr instead of 0 and NULL 2024-05-04 13:04:58 +02:00
Robert Müller c4c1518709 Remove dead code 2024-05-04 13:04:58 +02:00
Robert Müller 15bebb8fb6 Remove unnecessary downcast to CGraphics_Threaded 2024-05-04 13:04:58 +02:00
ChillerDragon 8b0b09fffd Improve skin name validation error message (Closed #8300) 2024-05-04 17:43:59 +08:00
Dennis Felsing 43c03c4d54
Merge pull request #8296 from ChillerDragon/pr_camel_tools
Remove tools camel case style exception
2024-05-04 05:20:30 +00:00
ChillerDragon f788a04892 Remove tools camel case style exception 2024-05-04 10:56:33 +08:00
Dennis Felsing cce5514c08
Merge pull request #8294 from Robyt3/Server-Voteoption-Alignment
Fix alignment of vote option heap entries with `remove_vote`
2024-05-03 16:44:30 +00:00
Robert Müller b745d75306 Fix alignment of vote option heap entries with remove_vote
When using the `remove_vote` command, the entire heap of vote options is allocated again without the entry being removed. This allocation was not considering the required alignment for `CVoteOptionServer` objects and potentially wasting space by aligning with `alignof(std::max_align_t)`. When allocating the entries with the `add_vote` command, the alignment is already specified correctly.
2024-05-03 18:22:33 +02:00
Dennis Felsing fc180562f6
Merge pull request #8151 from ChillerDragon/pr_tidy_camel
Enforce UpperCamelCase for local variables
2024-05-02 13:48:56 +00:00
meloƞ 9bbe238159 added team0mode indicator 2024-05-02 14:23:30 +02:00
ChillerDragon 63c8172d11 Enforce UpperCamelCase for local variables 2024-05-02 18:52:16 +08:00
heinrich5991 2dbcb9795a
Merge pull request #8139 from ChillerDragon/pr_cui_noop
Remove useless operation in CUIRect SplitMid
2024-05-02 06:14:34 +00:00
Dennis Felsing 7b97138202 Version 18.2 2024-05-02 11:15:02 +08:00
heinrich5991 ab869909e0
Merge pull request #8291 from BlaiZephyr/update-readme
fix up readme on building with MSVC (Visual Studio)
2024-05-01 17:52:57 +00:00
meloƞ a822fb47a0 fix up readme on building with MSVC (Visual Studio) 2024-05-01 18:44:22 +02:00
heinrich5991 213222b72b
Merge pull request #8289 from Robyt3/Client-Address-Check-Cleanup
Remove unnecessary check excluding packets from wrong server
2024-05-01 15:24:34 +00:00
Dennis Felsing 70785eb0dd
Merge pull request #8281 from ChillerDragon/pr_fix_triggeredevents7
Make sixup TriggeredEvents reliable
2024-05-01 15:16:29 +00:00
Dennis Felsing 7f73ca1313
Merge pull request #8290 from Robyt3/Graphics-Backend-Resize-Delegate
Remove `CCommandProcessorFragment_GLBase::Resize` delegate
2024-05-01 15:00:09 +00:00
Robert Müller dd62cda8ba Remove CCommandProcessorFragment_GLBase::Resize delegate
Use `ResizeImage` function directly instead.
2024-05-01 14:56:34 +02:00
Robert Müller 20c28f78ce Remove unnecessary check excluding packets from wrong server
This is already checked for all connection-oriented packets when feeding the connection in

952d3f6631/src/engine/shared/network_conn.cpp (L260-L266)

Closes #8285.
2024-05-01 13:34:19 +02:00
heinrich5991 2cd877f0ce
Merge pull request #8272 from ChillerDragon/pr_fix_snap_uuid_register
Fix ddnet ex snap item registration (closed #8271)
2024-05-01 09:56:42 +00:00