Commit graph

20665 commits

Author SHA1 Message Date
Robert Müller fbe559ea79 Fix console not keeping scroll position when backlog is full
The console was not keeping its current scoll position if entries from the backlog are removed due to being recycled when new entries are added. For this purpose, a callback function is added to the ringbuffer to handle popped items, so the scrolling position of the console can be updated based on the number of lines of the removed backlog entries.
2024-04-21 12:52:55 +02:00
Robert Müller 151b2854e3 Fix potential client crash when console backlog is full
Fix backlog corruption in `CConsole::PumpBacklogPending` when many backlog entries are allocated at the same time. When allocating many entries from the `m_Backlog` ringbuffer at the same time, the first entries being allocated may already have been recycled again, so the pointers to them being stored in the temporary vector of new backlog entries were pointing arbitrarily into the ringbuffer data, which could cause corruption of the structural and user data of the ringbuffer. Now, we iterate over the entire backlog and only update uninitialized entries instead of storing the new entries separately.

This was sometimes caught as a misaligned access with UBSan:

```
src/engine/shared/ringbuffer.cpp:160:14: runtime error: member access within misaligned address 0x00014126f4df for type 'struct CItem', which requires 8 byte alignment
0x00014126f4df: note: pointer points here
<memory cannot be printed>
    0 0x5825349a6a1c in CRingBufferBase::Prev(void*) src/engine/shared/ringbuffer.cpp:160
    1 0x5825334e8934 in CTypedRingBuffer<CGameConsole::CInstance::CBacklogEntry>::Prev(CGameConsole::CInstance::CBacklogEntry*) src/engine/shared/ringbuffer.h:59
    2 0x5825334d13e6 in CGameConsole::OnRender() src/game/client/components/console.cpp:1259
    3 0x582533bce058 in CGameClient::OnRender() src/game/client/gameclient.cpp:715
    4 0x582532f3cc44 in CClient::Render() src/engine/client/client.cpp:894
    5 0x582532f9d236 in CClient::Run() src/engine/client/client.cpp:2971
    6 0x582533002e5e in main src/engine/client/client.cpp:4523
```
2024-04-21 12:52:54 +02:00
Robert Müller 8d69a4f67c
Merge pull request #8237 from def-/pr-estonian-18.2
Update Estonian translations (by Cammo)
2024-04-21 10:43:41 +00:00
By ea4205904d
Update simplified_chinese.txt 2024-04-21 18:36:46 +08:00
By d9fd9f679c
Update traditional_chinese.txt 2024-04-21 18:35:08 +08:00
dobrykafe 7bd5bef756 update slovak translations for 18.2 2024-04-20 23:59:02 +02:00
dobrykafe 6c801ed7b2 update czech translations for 18.2 2024-04-20 23:58:35 +02:00
Zwelf 1b6ad6ba8b
Merge pull request #8240 from Robyt3/Ghost-Asan-Fixes
Fix OOB accesses rendering ghosts, fix ghost hook collision line
2024-04-20 21:55:41 +00:00
Robert Müller 9be40e1782 Fix OOB accesses rendering ghosts, fix ghost hook collision line
Fix out-of-bounds accesses when rendering ghost players, which use the client ID `-2`. This was causing the hook collision line of ghost players to be affected by real players, which is not correct, as ghosts do not interact with other characters.

Closes #8239.
2024-04-20 23:28:37 +02:00
Dennis Felsing 09e09f37ca Update Estonian translations (by Cammo) 2024-04-21 00:04:28 +08:00
Dennis Felsing a00d6a3119
Merge pull request #8235 from furo321/swedish-18.2
Update Swedish translations for 18.2
2024-04-20 11:09:41 +00:00
furo 06d6e3c816 Update Swedish translations for 18.2 2024-04-20 12:15:12 +02:00
Robert Müller 4b3035d336
Merge pull request #8232 from def-/pr-18.2-transl
Translations for upcoming 18.2
2024-04-20 08:42:10 +00:00
Dennis Felsing b35503273c
Merge pull request #8234 from ChillerDragon/pr_typo_reckoning
Fix reckoning typo in comment
2024-04-20 02:18:52 +00:00
ChillerDragon db627976e5 Fix reckoning typo in comment 2024-04-20 09:53:58 +08:00
Dennis Felsing 0494878334 Translations for upcoming 18.2 2024-04-20 09:02:45 +08:00
Dennis Felsing 173e675ec1
Merge pull request #8203 from Robyt3/Graphics-LoadPng-Cleanup
Change `PNG` in function names to `Png`, pass `CImageInfo` by reference to `IGraphics::LoadPng`
2024-04-20 00:55:02 +00:00
Dennis Felsing e5e48a84ee
Merge pull request #8229 from Robyt3/Client-StartVideo-Refactoring
Add optional name argument to `start_video` command, improve descriptions of demo-related console commands, refactoring
2024-04-20 00:35:42 +00:00
Robert Müller d2c8132fb6 Add optional name argument to start_video command, refactoring
Add optional filename argument to `start_video` command, to start recording to a video file with a specific filename, instead of always using the current timestamp.

Add log messages to `start_video` and `stop_video` commands to indicate success and errors.

Make the `CClient::StartVideo` function non-`static` and reduce duplicate code in the `Con_StartVideo` function.

Determine the video filename outside of the `CVideo` constructor, same as for demos.
2024-04-19 20:09:20 +02:00
Robert Müller 93d5a8be32 Improve descriptions of demo-related console commands 2024-04-19 20:08:41 +02:00
Dennis Felsing 261c02125b
Merge pull request #8228 from Robyt3/Client-Map-Change-Cleanup
Fix prediction errors and incorrect rendering after changing map
2024-04-19 02:07:08 +00:00
Robert Müller 12d3c8245d Fix prediction errors and incorrect rendering after changing map
Fix game times and prediction not being updated when only exactly two snapshots have been received, due to the conditions `m_aReceivedSnapshots[...] >= 3`. These specific condition are not necessary and replaced with simpler checks whether the current snapshot is set. Some duplicate nested conditions are also removed.

Pump the network first in `CClient::Update` before updating anything else, to ensure that snapshots are received from the network client before the game times and prediction are being updated based on the current snapshots.

Fix current and previous game tick always being `0` on the first call of `IGameClient::OnNewSnapshot` when two snapshot have been received. Now, the game ticks are properly initialized from the two initial snapshots.

Fix old inputs sometimes being used in prediction after changing map because inputs with tick `-1` were not being ignored.

Ensure all snapshots and game times are properly cleared when entering the game.
2024-04-18 20:40:31 +02:00
Dennis Felsing da09087416
Merge pull request #8227 from Zwelf/pr-disable-practice-while-saving
Disallow activating /practice while save is in progress and improve messaging for when `/save`/`/load` command does nothing
2024-04-18 01:53:19 +00:00
Dennis Felsing 998d69240c
Merge pull request #8226 from Robyt3/Windows-Console-Nul
Fix assertion on Windows when redirecting console output to `nul`
2024-04-18 01:53:18 +00:00
Zwelf e1355dc891 Improve messaging to players why /load command does nothing 2024-04-17 22:10:40 +02:00
Zwelf f6f5629fd0 Disallow /load when practice mode is enabled 2024-04-17 22:10:40 +02:00
Zwelf 25f85afef5 Improve messaging to players why /save command does nothing 2024-04-17 22:10:40 +02:00
Zwelf da5a466ac3 Disallow enabling practice while save and load is in progress 2024-04-17 22:10:40 +02:00
Robert Müller 3ef00d465e Fix assertion on Windows when redirecting console output to nul
`GetConsoleMode` can fail with `ERROR_INVALID_HANDLE` when redirecting output to `nul`, which is considered a character file but cannot be used as a console.
2024-04-17 20:00:32 +02:00
Dennis Felsing e142b2d526
Merge pull request #8224 from Robyt3/Server-Freeze-Initial-Fix
Fix freeze not working during first 50 server ticks
2024-04-17 00:34:56 +00:00
Robert Müller 36db1e604f Fix freeze not working during first 50 server ticks
The purpose of this condition is to only update the freeze time every 50 ticks so the freeze bar keeps being refilled after one second when standing in freeze, but it incorrectly prevented freeze from being applied during the first 50 ticks after the map has been loaded. Now, freeze is also applied if not currently frozen, so the behavior directly after changing the map is identical to subsequent respawns.
2024-04-16 20:55:31 +02:00
Dennis Felsing d028756bbb Revert "Record player name in Teehistorian files"
This reverts commit 783f4e3093.
2024-04-16 12:41:14 +08:00
Dennis Felsing 6c9af4d2cc Revert "Record Player and Team finishes in Teehistorian"
This reverts commit ece1ec07f5.
2024-04-16 12:41:10 +08:00
Dennis Felsing 68a64b4ae1
Merge pull request #8219 from Robyt3/Client-Component-Setter-Cleanup
Remove unnecessary client component variables and setters
2024-04-16 01:40:12 +00:00
Dennis Felsing 5f45e218ef
Merge pull request #8221 from Zwelf/pr-teehistorian-finish
Store player names in teehistorian and Finish/TeamFinish
2024-04-16 01:11:16 +00:00
Dennis Felsing 88ff8204db
Merge pull request #8220 from Zwelf/pr-practice-disallow-save
Disallow `/save` on teams with practice enabled
2024-04-16 01:11:13 +00:00
Dennis Felsing 17110ace66
Merge pull request #8171 from Zwelf/pr-simplify-base-hook
Simplify and fix HookBase calculation
2024-04-16 01:11:11 +00:00
Zwelf ece1ec07f5 Record Player and Team finishes in Teehistorian 2024-04-16 00:50:05 +02:00
Zwelf 783f4e3093 Record player name in Teehistorian files 2024-04-16 00:50:05 +02:00
Zwelf 868e6e0975 Disallow /save on teams with practice enabled 2024-04-16 00:34:23 +02:00
Robert Müller 8817a69269 Remove unnecessary client component variables and setters
Use the gameclient to access other components instead.
2024-04-15 20:26:26 +02:00
Dennis Felsing 2e211c9a31
Merge pull request #8218 from dobrykafe/pr-align-friendslist
Fix alignment of labels in friends list
2024-04-15 01:31:55 +00:00
Dennis Felsing fe41f58197
Merge pull request #8164 from murpii/pr_teleport_reset_jumps
Refresh air jumps after teleporting
2024-04-15 01:31:50 +00:00
Dennis Felsing aca25cc802
Merge pull request #8216 from Robyt3/Demo-ServerInfo-Fix
Fix incorrect score kind in demos depending on last server
2024-04-15 01:31:38 +00:00
dobrykafe 19b19262a4 fix alignment of labels in friends list 2024-04-15 00:29:46 +02:00
Robert Müller 8a378da89b
Merge pull request #8217 from dobrykafe/pr-remove-conmode
Remove unused `ConMode` function
2024-04-14 21:07:58 +00:00
dobrykafe 3b7019d3f7 remove unused ConMode function 2024-04-14 22:48:20 +02:00
Robert Müller 47e4505193
Merge pull request #8215 from furo321/fix-timecp-mysql
Fix `/timecp` not working with MySQL
2024-04-14 20:23:18 +00:00
Robert Müller 2423e35fd2 Fix incorrect score kind in demos depending on last server
Clear current server info when playing demos to ensure that the score kind (points, time) is detected correctly. Previously, when playing a demo with points score kind and `cl_demo_assume_race 0`, the score was not shown as points when the last server that the client connected to had a race gametype.

Move the implementation for `cl_demo_assume_race` together with the rest of the demo server info initialization in the `CClient::DemoPlayer_Play` function.
2024-04-14 22:18:49 +02:00
furo cf6569029f Fix /timecp not working with MySQL 2024-04-14 19:51:09 +02:00