Commit graph

20140 commits

Author SHA1 Message Date
Dennis Felsing c5ab4def3d
Merge pull request #8709 from Robyt3/Network-Socket-Init-Cleanup-Fix
Fix UDP socket creation/cleanup if opening IPv6 socket fails
2024-08-11 22:11:42 +00:00
Robert Müller 570c2c857a Fix UDP socket creation/cleanup if opening IPv6 socket fails
Previously, the `net_udp_create` function returned whether the IPv6 socket in particular was created successfully. If an IPv4 socket or Websocket was created successfully before this, it was not used and also not closed properly, if the IPv6 socket could not be created.

Now, the `net_udp_create` function succeeds if the socket for at least one network type (IPv4, IPv6 or Websocket) could be created successfully.

Avoid reusing local variables and remove redundant comments. Also apply the same refactoring to `net_tcp_create`, which already has the behavior of succeeding if the socket for any network type (IPv4 or IPv6) was created successfully.
2024-08-11 17:09:09 +02:00
Dennis Felsing afd1bd9cde
Merge pull request #5949 from ChillerDragon/pr_07_client
Add 0.7 client support
2024-08-10 13:08:32 +00:00
ChillerDragon e0bc98e79a Add alpha support for 0.7 skins 2024-08-10 14:50:43 +02:00
ChillerDragon 53b01862d4 Remove netversion from demo editor init 2024-08-10 14:50:43 +02:00
ChillerDragon 399075c339 Display 0.7 skins in chat 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 be67622544 Resend 0.7 skin change if it got filtered by the server 2024-08-10 14:50:43 +02:00
ChillerDragon 093a78464a Add custom ddnet 0.7 skin greensward
https://github.com/teeworlds/teeworlds/pull/2152
2024-08-10 14:50:43 +02:00
Alexander Akulich fe99a346dd Improve 0.7 skins
skins7: Extract the skins dir to a macro
skins7: Look for the skins at 'skins7' dir
Data: Add 0.7 skins (diliated)
CMenus::RenderSkinSelection7: Fix the skins number (use 0.7 getter)
CSkins7::GetColorV3: Fix missing UnclampLighting
CRenderTools: Use stronger type for 0.7 colors
CSkins7::RandomizeSkin: Use enum value instead of hardcode+comment
CMenus::RenderSettingsTee7: Enable team skins validation
system: Add str_utf8_copy_num()
GameClient: Extract ApplySkin7InfoFromGameMsg()
GameClient: Add skin7 to CClientData (also process and validate it)
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
Dennis Felsing 3a84cfeb8b
Merge pull request #8705 from Robyt3/Clang-Tidy-Static-Name-Fixes
Remove clang-tidy `static` variable name exceptions
2024-08-10 11:47:02 +00: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
Dennis Felsing 44666c21f7
Merge pull request #8704 from Robyt3/Client-Connect-Resolve-Error
Show warning when connect address cannot be resolved
2024-08-09 21:49:12 +00: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
Dennis Felsing 00586a0c4a Revert "Faster /rank, fixes test result"
This reverts commit c2a3444f87.
2024-08-08 18:59:20 +02:00
Dennis Felsing e3dd2895dd Revert "Fix /rank"
This reverts commit 49bef9c453.
2024-08-08 18:59:20 +02:00
Dennis Felsing 7added6eef
Merge pull request #8700 from Robyt3/Binds-Repeat-Fix
Fix binds not being repeated when key held down
2024-08-08 16:37:18 +00:00
Robert Müller 645a00551b Fix binds not being repeated when key held down
Closes #8699. Regression from #8685.
2024-08-08 18:14:59 +02:00
Dennis Felsing 49bef9c453 Fix /rank
minTime being NULL means no rank
2024-08-08 17:13:47 +02:00
Dennis Felsing 647abbd801
Merge pull request #8693 from def-/pr-optimize-query
Faster /rank, fixes test result
2024-08-08 14:39:13 +00:00
Dennis Felsing 9be9a902e7
Merge pull request #8697 from heinrich5991/pr_ddnet_to_ipv4_mapped
Use `Ipv6::to_ipv4_mapped` in mastersrv
2024-08-07 22:19:45 +00:00
heinrich5991 83a90c9a06
Merge pull request #8676 from Robyt3/Client-LineInput-Event-Handling-Consistency
Consistently return `true` from `OnInput` function for used events
2024-08-07 22:07:49 +00:00
heinrich5991 dd1fb2026d
Merge pull request #8696 from Robyt3/UI-DoubleClick-LeftMouse-Only
Only activate double-clicks with left mouse button again
2024-08-07 22:07:10 +00:00
heinrich5991 d42ae75a9e Use Ipv6::to_ipv4_mapped in mastersrv
Needs Rust 1.63.0, should be old enough at this point.
2024-08-08 00:00:41 +02:00
Robert Müller 2c7c391ff0 Only activate double-clicks with left mouse button again
Double-clicks could also be activated with other mouse buttons on some UI elements, which was unintentionally added by #8489.
2024-08-07 20:59:45 +02:00
Dennis Felsing c2a3444f87 Faster /rank, fixes test result 2024-08-07 18:10:36 +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
heinrich5991 7dc682565b
Merge pull request #8650 from def-/pr-ban-time
Don't show ban time for vpn bans
2024-08-05 21:08:44 +00: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
Dennis Felsing b50d8eb79e
Merge pull request #8686 from StormAxs/master
Fix practice finish time
2024-08-05 10:23:07 +00:00
-StormAx 52a6b4d69f Fix https://github.com/ddnet/ddnet/issues/8668 2024-08-05 06:22:16 +03:00
Dennis Felsing 8d609b9202
Merge pull request #8685 from Robyt3/Client-Binds-Fixes
Support composite binds with `+` commands, fix handling of composite binds with F1-F24 keys, fix incorrect key names with multiple modifiers, refactoring
2024-08-04 20:44:40 +00:00
Robert Müller 3eb8122eea Support composite binds with + commands
Previously, binding `+` commands like `+hook` to composite keys like `shift+x` or `ctrl+alt+mouse1` was not possible, as it would lead to stuck inputs when one of the modifiers is released first before the primary key. When binding `+` commands to composite binds the modifier was instead ignored to prevent this.

Now, binding `+` commands to composite keys is also possible. Active binds (key, modifier) are stored and when a modifier key is released all binds using that modifier are also released.

Closes #8314.
2024-08-04 22:23:30 +02:00
Robert Müller dc1a483b53 Make handling of F1-F24 keys binds consistent with regular binds
The handling of F1-F24 keys in `CBindsSpecial` was not correct for composite binds, leading to stuck inputs if modifier keys are released first. Now, the `CBindsSpecial::OnInput` function simply delegates to `CBinds::OnInput` for F-key presses/releases so the behavior is consistent with regular binds.
2024-08-04 22:10:15 +02:00
Robert Müller 12e5f7f1d3 Various minor refactoring of CBinds
- Use `UnbindAll` function in destructor to reduce duplicate code.
- Use appropriate constants instead of magic number `0`.
- Remove redundant comments.
- Remove redundant `else if` condition.
- Rename generic loop variables `i` and `j` to `Modifier` and `Key` for clarity.
2024-08-04 22:09:52 +02:00
Robert Müller 9f6cb92cb9 Add assertions to CBinds::Bind and Get functions 2024-08-04 22:09:47 +02:00
Robert Müller 8fd40efe36 Fix key names for composite binds with multiple modifiers
This was only affecting the key names displayed in the voting HUD, e.g. with `bind "ctrl+alt+f3" "vote yes"` the voting HUD previously showed `+f3` as the key name.
2024-08-04 22:09:29 +02:00
Robert Müller d2222f55e7 Add CBindSlot as return value for GetBindSlot function 2024-08-04 22:05:50 +02:00
Robert Müller b28bac89d4 Move CBinds::GetKeyId function to IInput::FindKeyByName 2024-08-04 22:05:34 +02:00
heinrich5991 585615a7cd
Merge pull request #8683 from archimede67/fix-teamcount-sb
Fix invalid team count in scoreboard for split teams
2024-08-04 15:42:59 +00:00
Corantin H 79ff930aaa Fix invalid team count in scoreboard for split teams
Refactor state variables into `CScoreboardRenderState`
2024-08-04 17:20:56 +02:00
Robert Müller bdd7784bbb Consistently return true from OnInput function for used events
The `OnInput` function should return `true` exactly for events that were handled. In case of line inputs, the function returned `true` when then line input was changed instead. For the consoles, the function did not return `true` for some events that were handled.
2024-08-03 11:58:15 +02:00
Jupeyy 00d941a309
Merge pull request #8675 from Robyt3/Graphics-Interface-Cleanup
Remove unused graphics functions, flags and command
2024-08-03 07:14:45 +00: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