Commit graph

20857 commits

Author SHA1 Message Date
Robert Müller 3345bc9da0
Merge pull request #9186 from def-/pr-transl-18.7
Update translations for upcoming 18.7
2024-11-01 09:06:00 +00:00
Dennis Felsing d6e31d35fe Update translations for upcoming 18.7 2024-11-01 09:12:18 +01:00
Dennis Felsing 19aa7fbb77 Version 18.8 2024-11-01 09:11:04 +01:00
Dennis Felsing 0f91b1287d
Merge pull request #9185 from Robyt3/Client-Font-Error
Improve error handling on invalid fonts and font index
2024-11-01 07:50:48 +00:00
Dennis Felsing 6bcf8ead49 Fix clang-tidy 2024-11-01 08:32:26 +01:00
Robert Müller 96eb49ad3f Improve error handling on invalid fonts and font index
Log more detailed error messages when fonts could not be loaded and when the font index is malformed. Show warning popup on client launch if any font failed to load, although this warning won't be readable if all fonts failed to be loaded.
2024-11-01 00:16:14 +01:00
Dennis Felsing f827b6e999
Merge pull request #9183 from KebsCS/pr-fix-command-preview
Fix chat command preview overlap
2024-10-31 21:27:15 +00:00
KebsCS 6dc11bbb89
Fix chat command preview overlap 2024-10-31 21:33:52 +01:00
Dennis Felsing 215c683692
Merge pull request #9182 from Robyt3/Client-clear_chat-Command
Add `clear_chat` command
2024-10-30 22:30:58 +00:00
Robert Müller c978ecec39 Add clear_chat command
Add a command to clear all lines of chat messages, same as the `clear_local_console`/`clear_remote_console` commands for the consoles. This is useful for example when taking screenshots or recording videos with initially empty chat.
2024-10-30 23:06:25 +01:00
Dennis Felsing df3eeffa3d
Merge pull request #9180 from KebsCS/pr-fix-tele-brush
Fix editor tele layer brush number
2024-10-30 08:13:21 +00:00
KebsCS 768384a8da
Fix editor tele layer brush number 2024-10-30 01:12:45 +01:00
Dennis Felsing f74027666a
Merge pull request #9179 from Robyt3/Client-Ghost-Validation
Improve ghost file validation
2024-10-29 21:23:43 +00:00
Robert Müller 9b4a80d8b7 Improve ghost file validation
Fix out-of-bounds reads in ghost loader when current chunk does not contain enough data for expected number of items.

Improve validation of ghost header information. Ensure strings (owner and map name) are null-terminated and valid UTF-8 to avoid crashes. Avoid duplicate code for validating header.

Remove `static` buffers for compression and decompression of ghost data, which would prevent parallelizing ghost recording and loading. Switch between the main buffer and only one temporary buffer instead of using two temporary buffers.

Automatically delete the ghost file when the recording is stopped with the number of ticks or time being invalid, i.e. when ghost recording will be restarted. This should ensure that invalid ghost files are not left behind if recording is not immediately restarted after being stopped, e.g. due to edge cases like standing inside a start-tile.

Use `int32_t` for `DiffItem` and `UndiffItem` data pointers as these functions are expected to operate on 32-bit integers. Ensure chunk and item data is aligned with `int32_t` to avoid potential unaligned accesses. Use `size_t` for size arguments.

Add assertions to ghost loader and recorder functions to ensure their correct usage. Ensure a file is not already open when opening another one and ensure that a file is open when reading/writing. Ensure that the ghost data type is valid, i.e. between `0` and `0xFF` because it is packed into an `unsigned char`. Ensure data size is valid and aligned with `int32_t`, otherwise data would be packed incorrectly by the `DiffItem` function. Improve error messages, consistent with the error messages of the demo player and recorder. Use the `log_*` functions for logging. Use the same color for all ghost-related log messages.

Avoid `system.h` include in `ghost.h` by moving `CGhostHeader` function definitions to `ghost.cpp`.

Closes #7413.
2024-10-29 21:19:07 +01:00
Robert Müller 402c6aa985 Fix editor Save As confirmation, prevent opening empty filename
The confirmation popup was not shown for the Save As dialog anymore, due to the label being changed to `Save As` for the respective quick action. This check based on string comparison is rather brittle and can be replaced with comparison of the storage type with `IStorage::TYPE_SAVE`.

When the file dialog is used to open files, prevent opening files with an empty filename if enter is pressed while no file is selected (i.e. when the filter excludes all entries).
2024-10-27 15:40:00 +01:00
Dennis Felsing a52986f006
Merge pull request #9175 from Robyt3/Console-ExecutionQueue-Cleanup
Use `std::vector` for console execution queue, fix console result client ID sometimes being uninitialized
2024-10-27 10:59:07 +00:00
Robert Müller 2cd8721cde Use std::vector for console execution queue
Simplify the code by replacing the usage of a linked list and heap with an `std::vector`.

The assignment operators are replaced with copy constructors to use `std::vector`.
2024-10-27 11:02:43 +01:00
Robert Müller 3ec2564acc Fix console result client ID sometimes being uninitialized
Add the client ID as a constructor argument to `CResult` to ensure that it is initialized.
2024-10-27 11:02:43 +01:00
Dennis Felsing 12f5410bdb
Merge pull request #9174 from ChillerDragon/pr_fix_vanilla_demos
Fix vanilla demo tuning
2024-10-27 06:12:20 +00:00
ChillerDragon 386d456484 Fix vanilla demo tuning 2024-10-27 10:06:47 +08:00
Dennis Felsing cb508bdbe1
Merge pull request #9171 from heinrich5991/pr_ddnet_mastersrv_ddper
mastersrv: Add DDPer support
2024-10-26 18:22:43 +00:00
heinrich5991 9067dc5a2a
Merge pull request #9164 from Robyt3/Base-Log-Color-Macros
Add `log_*_color` macros, deprecate `IConsole::Print`
2024-10-26 15:43:35 +00:00
heinrich5991 ff87fac384 mastersrv: Add DDPer support
This allows DDPer to continue using our mastersrv while not showing up
in the DDNet client.
2024-10-26 17:19:45 +02:00
Dennis Felsing 1d04f8e641
Merge pull request #9170 from Robyt3/Windows-MoveFile-WriteThrough
Ensure file is moved when `fs_rename` function returns on Windows
2024-10-26 09:46:52 +00:00
Robert Müller 14facd5a4f Ensure file is moved when fs_rename function returns on Windows
Use the flag `MOVEFILE_WRITE_THROUGH` with the `MoveFileExW` function on Windows to ensure that the file is renamed/moved on the disk before the function returns. Otherwise, if the function returns before the file is moved, subsequent loading of the file with this name may fail sporadically.

See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw
2024-10-26 10:20:33 +02:00
Dennis Felsing 4c048f5c7b
Merge pull request #9167 from Robyt3/Client-CLineInput-Event-Condition-Cleanup
Remove redundant check of key for text input events
2024-10-25 20:27:11 +00:00
Robert Müller 565e79fa04 Remove redundant check of key for text input events
Input events with `IInput::FLAG_TEXT` never have a key, so this additional check for modifier keys is redundant.
2024-10-25 22:05:00 +02:00
Robert Müller ce8fa3fba8
Merge pull request #9159 from def-/pr-persian
Update Persian language by ArAsH
2024-10-24 21:43:36 +00:00
Dennis Felsing f121e1ddaa
Merge pull request #9166 from Robyt3/Editor-IsEntitiesLayer-Use
Use `CLayer::IsEntitiesLayer` function to avoid duplicate code
2024-10-24 21:01:50 +00:00
Robert Müller a93cba1a4f Use CLayer::IsEntitiesLayer function to avoid duplicate code 2024-10-24 22:42:39 +02:00
Dennis Felsing a7a07ad402 Update Persian language by ArAsH 2024-10-24 22:26:59 +02:00
Robert Müller e2df30a59e Add log_*_color macros, deprecate IConsole::Print
Add `log_error_color`, `log_warn_color`, `log_info_color`, `log_debug_color` and `log_trace_color` macros to wrap `log_log_color` function with specific log levels.

Add comment to mark the `IConsole::Print` function as deprecated in favor of the `log_*` functions, which should be preferred for the following reasons:

- They support `printf`-formatting without a separate buffer.
- They support all five log levels.
- They do not require a pointer to `IConsole` to be used.
- Consistency of logging code.
2024-10-23 17:52:54 +02:00
Emir Marincic 5a716ae463
Merge pull request #9163 from Robyt3/Console-Format-Removal
Remove obsolete `IConsole::Format` function, fix `show_ips` output
2024-10-21 22:21:16 +00:00
Robert Müller 66c5609ae4 Remove obsolete IConsole::Format function, fix show_ips output
The `IConsole::Format` function was previously used to format the log and rcon output, but it has become obsolete when the logging was refactored.

The function was still being used to format the output of the `show_ips` command in the rcon, which was causing this particular rcon line to have the old log format (e.g. `[12:34:56][server]: Value: 0`). Now, `IConsole::Print` is used directly, as this causes the output to be sent with the correct format and only to the rcon command user.

The `IConsole::FPrintCallback` function pointer typedef is also obsolete and unused.
2024-10-21 23:35:30 +02:00
Dennis Felsing 74fa79b489
Merge pull request #9162 from Robyt3/Client-TextureHandle-Cleanup
Avoid redundant overwriting of texture handles after unloading
2024-10-21 21:07:49 +00:00
Dennis Felsing 78f5013d93
Merge pull request #9161 from KebsCS/pr-regional-top5team
Fix top5team sql
2024-10-21 21:07:46 +00:00
KebsCS 97af0168eb
Fix top5team sql 2024-10-21 22:14:08 +02:00
Robert Müller 4314608dfb Avoid redundant overwriting of texture handles after unloading
It's not necessary to create a new `CTextureHandle` object after unloading the handle and it's also not necessary to check if the texture handle is valid when unloading it.
2024-10-21 22:07:13 +02:00
Robert Müller d923e58452
Merge pull request #9158 from Jupeyy/pr_unblock_less
Don't block drivers before & equal to 2.0.137.
2024-10-20 09:33:43 +00:00
Jupeyy efc1d2d4d1
Don't block drivers before 2.0.137.
Reported by meep on discord. He apparently uses a driver from around 2020 that also worked
without problems.
2024-10-20 11:14:28 +02:00
Dennis Felsing baddafefa0
Merge pull request #9157 from Robyt3/Client-Settings-Skin-Reveal
Scroll to selected skin when entering name and switching tabs
2024-10-19 21:43:53 +00:00
Robert Müller 9e7ba82507 Scroll to selected skin when entering name and switching tabs
Scroll to reveal the selected skin when entering a skin name and when switching between the player and dummy tabs.
2024-10-19 20:50:10 +02:00
Dennis Felsing 1bd0f4330f
Merge pull request #9155 from Robyt3/Client-LastRaceTick-Cleanup
Move last race tick and current race time handling to `CGameClient`
2024-10-18 20:38:55 +00:00
Robert Müller b724ccc6a6 Move last race tick and current race time handling to CGameClient
Store and update the last race tick directly in `CGameClient` instead of in `CGhost`, as the value is also used in the gameclient.

Move current race time calculation from `CClient` to `CGameClient`, as this function is not used in the engine and this allows removing unnecessary virtual functions.

Closes #1720.
2024-10-18 22:10:58 +02:00
Dennis Felsing 74b485b397
Merge pull request #9153 from Robyt3/Editor-Curvetype-Popup
Add popup to select envelope curve type, support shift+left click
2024-10-17 07:15:53 +00:00
Robert Müller 9a1bd192c4 Add popup to select envelope curve type, support shift+left click
Show popup to select the envelope curve type from a list when right clicking the curve type button, as selecting the curve type by pressing the button multiple times is inconvenient.

Switch to previous curve type on shift+left clicking the curve type button.
2024-10-16 22:31:02 +02:00
Dennis Felsing 3e9ca3314f
Merge pull request #9152 from Robyt3/CLayers-Refactoring
Minor refactoring of `CLayers`
2024-10-15 20:56:55 +00:00
Robert Müller 7ac0a8f6c6 Reduce indent, avoid C style casts in CLayers::InitTilemapSkip 2024-10-15 21:11:31 +02:00
Robert Müller e0461f4c21 Combine CLayers::Init and CLayers::InitBackground functions
The `CLayers::InitBackground` function implemented a subset of the `CLayers::Init` function, only loading the game layers and not the other entities layers, so a Boolean parameter can be used to reduce the duplicate code.
2024-10-15 21:11:31 +02:00
Robert Müller b991a44b40 Rename variables l/g to LayerIndex/GroupIndex 2024-10-15 21:11:24 +02:00