Commit graph

5441 commits

Author SHA1 Message Date
Robert Müller 30f49201e5
Merge pull request #8764 from ChillerDragon/pr_cfgcol_07_marking
Use color type for 0.7 marking configs
2024-08-20 05:53:33 +00:00
ChillerDragon 15713d7859 Use color type for 0.7 marking configs 2024-08-20 11:23:26 +08:00
Robert Müller 40fbc2140b Use std::string for IInput::GetClipboardText
Simplify clipboard handling by returning an `std::string` and freeing the string returned by SDL immediately, so the clipboard data does not stay in memory unnecessarily after the clipboard has been used until the clipboard data is requested again.

Fix possible TOCTOU when pasting from the clipboard into a lineinput, due to the clipboard data being requested twice.
2024-08-19 19:03:49 +02:00
Bamcane 5c2ab4cb92 Fix client sixup translation context
Co-authored-by: Robyt3 <robytemueller@gmail.com>
2024-08-18 18:14:27 +08:00
Dennis Felsing b05ffeae3b
Merge pull request #8762 from ChillerDragon/pr_fix_dummy7_marking_alpha
Fix 0.7 dummy marking alpha being reset
2024-08-18 06:34:56 +00:00
Dennis Felsing 9fe2203a24
Merge pull request #8754 from ChillerDragon/pr_fix_06_demo_cutting
Fix cutting 0.6 demos
2024-08-18 06:29:33 +00:00
ChillerDragon 99fe6b09ed Fix 0.7 dummy marking alpha being reset
Closed #8757
2024-08-18 11:06:40 +08:00
ChillerDragon e8fbb440b9 Fix cutting 0.6 demos
Closed #8748
2024-08-18 10:05:58 +08:00
Dennis Felsing b16bc401a8
Merge pull request #8716 from ChillerDragon/pr_hide_url_for_06
Hide address url for 0.6 ips (Closed #8712)
2024-08-17 17:42:30 +00:00
heinrich5991 f057898ce0
Merge pull request #8745 from ChillerDragon/pr_07_hook_coll
Fix hook coll on vanilla 0.7 servers
2024-08-16 12:56:24 +00:00
ChillerDragon fac02650f1 Fix hook coll on vanilla 0.7 servers
Thanks to @fokkonaut for this F-Client commit

8ecd8c7f0a

Closed #8742
2024-08-16 19:12:42 +08:00
heinrich5991 aaf69542b6
Merge pull request #8739 from ChillerDragon/pr_log_error_crc
Use error log level for snap crc errors
2024-08-16 08:21:30 +00:00
Dennis Felsing 8d024be37c
Merge pull request #8738 from ChillerDragon/pr_increase_max_tmp_cmd_len
Increase max temp cmp length
2024-08-16 07:50:40 +00:00
Chiller Dragon 87aa664899
Lower the cmd length to 64
Co-authored-by: Dennis Felsing <dennis@felsing.org>
2024-08-16 15:32:53 +08:00
ChillerDragon 1f0467b545 Use error log level for snap crc errors
A snapshot crc error should not happen.
If it does happen it will cause lags and it means something is really wrong.
2024-08-16 13:34:38 +08:00
ChillerDragon 04c141828f Increase max temp cmp length
Fixes long rcon commands being cut off on custom servers.
2024-08-16 13:01:35 +08:00
heinrich5991 438e04f785 Complain on higher log level that 0.7 support was disabled
Not sure why it was on debug level before.
2024-08-15 14:47:40 +02:00
Robert Müller b4bd13c3aa
Merge pull request #8721 from Rei-Tw/improve-bans
Improve bans rcon command pagination
2024-08-14 17:29:31 +00:00
Rei-Tw 035b4a1447 Make bans command better
Update src/engine/shared/netban.cpp

Remove the word "currently" for the empty ban list message.

Co-authored-by: Dennis Felsing <dennis@felsing.org>

Update src/engine/shared/netban.cpp

Text format refactor, adding "currently"

Co-authored-by: Dennis Felsing <dennis@felsing.org>
2024-08-14 15:29:42 +02:00
Jupeyy e3622f3532
Fix debug hud units 2024-08-14 14:11:04 +02:00
ChillerDragon 7fa2306138 Hide address url for 0.6 ips (Closed #8712) 2024-08-14 18:25:10 +08:00
Dennis Felsing f14ae6bf13
Merge pull request #8725 from ChillerDragon/pr_fix_06_register
Fix 0.6 master server register (closed #8722)
2024-08-14 07:04:38 +00:00
ChillerDragon c16a38b4fa Fix 0.6 master server register (closed #8722) 2024-08-14 12:11:04 +08:00
heinrich5991 4f09d3f7d4
Merge pull request #8701 from Robyt3/Client-Spectate-ClientIds
Improve `cl_show_ids`: support spectator menu, optimize, refactor
2024-08-13 09:50:12 +00:00
Robert Müller 594968fe07 Improve cl_show_ids: support spectator menu, optimize, refactor
Also show client IDs in the spectator menu when `cl_show_ids` is enabled. Previously, this setting applied to scoreboard and chat, although the setting and config variable descriptions were only mentioning the scoreboard.

Extract client ID formatting in `CGameClient::FormatClientId` function to reduce duplicate code and ensure it is consistent.

Correctly indent client IDs also when largest client ID is 100 or larger. Fix scoreboard spectator client ID buffer not being large enough for IDs 100 and larger.

Make client ID formatting more efficient by avoiding `str_format` except for formatting the number itself and appending text directly to the text cursor when possible.
2024-08-12 22:59:32 +02:00
Dennis Felsing 043480b06e server: Handle dnsbl and other non-critical stuff only on new ticks
Less risk of causing microlags then, I think once per second is often enough since it has to iterate through all players
2024-08-12 18:49:17 +02:00
ChillerDragon 21507b51f1 Send the new is ddnet message in 0.7 connections
We already sent the legacy is ddnet message and so far the ddnet
protocol over 0.7 seems to work fine.

But for completeness and correctness it is now also sending the new
ddnet version net message.
2024-08-11 09:25:18 +08:00
ChillerDragon 53b01862d4 Remove netversion from demo editor init 2024-08-10 14:50:43 +02:00
ChillerDragon 8903f49716 Render skins in 0.7 demos 2024-08-10 14:50:43 +02:00
ChillerDragon bae37ab7df Add 0.7 client support
While keeping 0.6 fully working and untouched
This adds the option to connect via 0.7

0.7 servers are now mixed into the server browser list.
And users can also manually connect via 0.7
using a connection url like so:

    ./DDNet "connect tw-0.7+udp://127.0.0.1:8303"

This also adds a "Tee 0.7" section in the menu to pick a 0.7 skin.
The config variables are prefixed with player7_ like for example
player7_color_body
2024-08-10 14:50:42 +02:00
Robert Müller 2fa4c1f603 Remove clang-tidy static variable name exceptions
- Remove `readability-identifier-naming.StaticVariableIgnoredRegexp`.
- Mark `static` variables as `const` and use `UPPER_CASE` for names when possible.
- Use local variables instead of `static` variables when possible.
- Use member variables with correct name instead of `static` variables.
- Pass output buffer for `static` function `GetKeyBindModifiersName` by argument instead of returning pointer to `static` buffer.
2024-08-10 13:27:55 +02:00
Robert Müller 323ccf5a22 Show warning when connect address cannot be resolved
Show warning and disconnect instead of falling back to connecting to `localhost` when the connect address cannot be resolved.
2024-08-09 20:22:00 +02:00
heinrich5991 e97b8e1818
Merge pull request #8690 from def-/pr-dnsbl-info
More dnsbl printing
2024-08-06 16:53:17 +00:00
Dennis Felsing 922e32be0c More dnsbl printing 2024-08-06 17:21:24 +02:00
Dennis Felsing 082580f586 Don't show ban time for vpn bans 2024-08-05 20:27:16 +02:00
heinrich5991 75ec6ed304
Merge pull request #8652 from def-/pr-vpn-ban-1min
Only ban VPNs for a minute
2024-08-05 16:19:50 +00:00
Robert Müller b28bac89d4 Move CBinds::GetKeyId function to IInput::FindKeyByName 2024-08-04 22:05:34 +02:00
Robert Müller 924f8f582b Remove unused TEXLOAD_NOMIPMAPS and TEXLOAD_NO_COMPRESSION
The flag `TEXLOAD_NO_COMPRESSION` is entirely unused.

The flag `TEXLOAD_NOMIPMAPS` is unused and only the respective `CCommandBuffer::TEXFLAG_NOMIPMAPS` is used internally, so the former flag does not need to be exposed to users of `IGraphics`.
2024-08-02 18:16:26 +02:00
Robert Müller 273f3e5bfa Remove unused return value of IGraphics::UnloadTexture function 2024-08-02 18:16:15 +02:00
Robert Müller da8ec6bed9 Remove unused LoadTextureRawSub and CMD_TEXTURE_UPDATE
The `IGraphics::LoadTextureRawSub` function and the respective `CMD_TEXTURE_UPDATE` command are unused. Only text textures are updated after having been uploaded, but there is a separate `CMD_TEXT_TEXTURE_UPDATE` for that.
2024-08-02 18:15:55 +02:00
Robert Müller 9110d393dd Remove unused IGraphics::NullTexture function
It should not be necessary to access the null-texture directly. The `CTextureHandle::IsNullTexture` function can be used to check if a texture handle is the null-texture.
2024-08-02 18:15:34 +02:00
Robert Müller 7f59a159e4 Refactor, rename IGraphics::IsImageFormatRGBA
Rename `IGraphics::IsImageFormatRGBA` function to `IsImageFormatRgba`.

Rename parameter `pFileName` to `pContextName`, as this name does not necessarily describe a file.

Remove unnecessary check for parameter `pFileName` (now `pContextName`) being unset, which is and should never be the case.

Rename parameter `Img` to `Image` for consistency.
2024-07-30 19:58:53 +02:00
Robert Müller 82bf71e780 Refactor IGraphics::CheckImageDivisibility
Put the context name in quotation marks in the warning message.

Rename parameter `pFileName` to `pContextName`, as this name does not necessarily describe a file.

Rename parameter `Img` to `Image` for consistency.
2024-07-30 19:58:53 +02:00
Robert Müller 92b0b90b29 Remove unused CClient::DirectInput function
The function is unused and because the message is not flushed it would also not have worked correctly. The `NETMSG_INPUT` message is already packed and flushed in the `CClient::SendInput` function.

Closes #8408.
2024-07-29 21:43:50 +02:00
Robert Müller 23fb01f9dd Smoother menu checker background scrolling on loading screens
Update global time also while rendering loading screens and shift the menu checker background based on the global time so it's smoother while loading.
2024-07-28 20:38:51 +02:00
Dennis Felsing 1d92b5acd6
Merge pull request #8658 from Robyt3/Client-Image-Non-Rgba-Leak
Fix memory leak of non-RGBA image data, clear all image info
2024-07-27 22:12:42 +00:00
Dennis Felsing 6911944c57
Merge pull request #8659 from Robyt3/Client-Dummy-Connecting-Improvement
Improve dummy connecting button and error handling
2024-07-27 22:11:47 +00:00
Robert Müller b61005d3e7 Improve dummy connecting button and error handling
Track whether the dummy is currently connecting separately so the dummy being disconnected due to errors can be detected. Show an error message as echo in the chat when the dummy could not be connected, e.g. when the server is full.

Use the global time for limiting the dummy connecting delay instead of using game ticks, so the delay also works correctly when having connection problems (i.e., when ticks do not advance). Handle the dummy connecting being delayed separately from the dummy currently connecting.

Add tooltips for the "Connect dummy"-button when it's disable due to dummy not being allow on the server or when connecting is delayed.

Add console error messages for `dummy_connect` command.
2024-07-27 22:44:15 +02:00
Robert Müller fb832b482c Fix memory leak of non-RGBA image data, clear all image info
The image data was not being freed when `IGraphics::LoadTextureRawMove` is used with images that are not in RGBA format as this falls back to using `IGraphics::LoadTextureRaw` which requires manually freeing the image data.

Also consistently clear all image info in `LoadTextureRawMove`. This makes it necessary to store the size of the preview image in the editor separately, as previously the width and height of the unloaded image info were being used to render the preview image.
2024-07-27 21:24:32 +02:00
Robert Müller 8a3929d48c Support IME composition strings of arbitrary length
Previously, IME composition strings were limited to at most 32 bytes, e.g. 10 Hiragana characters. Now, `SDL_TextEditingExtEvent` (`SDL_TEXTEDITING_EXT`) is supported, which uses heap-allocated composition strings of arbitrary length.

On the other hand, the buffer for input event text was larger than necessary, as SDL text events only contain at most 32 bytes (`SDL_TEXTINPUTEVENT_TEXT_SIZE` is not used directly to avoid the include). With the hint for extended IME handling enabled, long composition text will be sent as multiple text events (without breaking UTF-8).
2024-07-27 17:32:41 +02:00