304 Commits

Author SHA1 Message Date
Spartan322
cd86012a9d Merge commit godotengine/godot@71a9948157 2025-07-19 14:15:00 -04:00
A Thousand Ships
f11aff3841 Editor: Restructure editor code
Moving various editor files into sub folders to reduce clutter
2025-07-04 18:18:22 +02:00
Spartan322
9023767920 Merge commit godotengine/godot@1bbfe637c6 2025-06-10 22:00:50 -04:00
kobewi
13f642d959 Replace XML codeblock spaces with tabs 2025-06-06 14:35:38 +02:00
Spartan322
0e99b001ac Merge commit godotengine/godot@5dd76968d8 2025-06-05 23:07:30 -04:00
Haoyu Qiu
1e82bafa3a Remove redundant info on the enum types used 2025-06-04 08:21:47 +08:00
Thaddeus Crews
7a3d2f6779 Merge pull request #106606 from aaronfranke/pow2_64
Add 64-bit versions of core power of 2 functions
2025-06-02 18:51:56 -05:00
Aaron Franke
f6f1df7d73 Add 64-bit versions of core power of 2 functions 2025-06-01 23:11:12 -07:00
Spartan322
2b59059dde Merge commit godotengine/godot@2d3bdcac35 2025-04-19 16:05:28 -04:00
Marcos Casagrande
f05b22c53e Web: Avoid extra copy when encoding string in WebSocket _onmessage 2025-04-19 17:48:30 +02:00
Thaddeus Crews
1f56d96cf2 Merge pull request #104893 from Repiteo/scons/external-includes-alt
SCons: Add `CPPEXTPATH` for external includes
2025-04-02 07:48:03 -05:00
Thaddeus Crews
f25fc34439 SCons: Add CPPEXTPATH for external includes 2025-04-02 07:29:08 -05:00
Yufeng Ying
4f4031a675 Replace size() == 0 with is_empty(). 2025-04-02 19:18:43 +08:00
Lukas Tenbrink
ffa6ef220b Use append_ instead of parse_ for String methods. 2025-03-27 17:51:02 +01:00
Thaddeus Crews
f09ee0171a Style: Begin integrating simple .clangd fixes 2025-03-22 13:24:35 -05:00
Rémi Verschelde
2fa721b1bc Merge pull request #104127 from Ivorforce/360-noclip
Remove `String` clipping constructors.
2025-03-19 12:27:10 +01:00
Lukas Tenbrink
a23f630781 Remove String clipping constructors.
Callers should instead call constructors with explicit encoding names, with known length `Span`.
2025-03-15 12:34:44 +01:00
kobewi
7cb2fb189a Remove TOOLS_ENABLED checks from editor/ 2025-03-14 18:13:16 +01:00
Thaddeus Crews
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
Spartan322
35e289fa5e Merge commit godotengine/godot@0b6a717ac1 2025-02-04 11:38:32 -05:00
Fabio Alessandrelli
a2f5eb9cf0 [WS] Fix wslay multi-frame message parsing (again)
We incorrectly assumed that the `payload_length` in the recv start
callback of wslay was the final message size, but according to the
WebSocket  protocol, the payload length always refers to the current
frame's payload size.

The protocol, in fact, do not include a "message payload" length on
purpose to allow sending messages of unknown size without forcing the
sender to buffer the whole message (RFC6455 Section 5.4).

This means a receiving peer has no way to know beforehand how long a
message will be, and needs instead to keep track of the length of each
frame until the FIN one is received to properly reconstruct the message
at the end.
2025-01-28 16:26:11 +01:00
Spartan322
94949a2769 Merge commit godotengine/godot@a7146ef807 2025-01-21 17:08:38 -05:00
Fabio Alessandrelli
81181c5941 [WS] Fix peer stuck in CLOSING state
This was due by the buffer being cleared on close (including in closing
state) preventing further reads.

This commit changes the close logic to only clear the buffer when the
peer connection has been fully closed (acknowledged by the other end, or
closed due to a "broken" connection).
2025-01-18 16:01:40 +01:00
Spartan322
e0126b63c2 Merge commit godotengine/godot@d33da79d3f 2025-01-16 18:50:47 -05:00
Adam Scott
33e16435f5 Replace some problematic uses of String::num to String::num_int64 2025-01-15 12:51:51 -05:00
Spartan322
4ffc9ac18b Merge commit godotengine/godot@bdf625bd54 2025-01-04 00:55:26 -05:00
Rémi Verschelde
7dd14207dc Merge pull request #100631 from Faless/fix/wslay_frame_end_not_fin
[WS] Fix wslay multi-frame message parsing
2025-01-03 00:48:47 +01:00
Spartan322
1609981ccf Merge commit godotengine/godot@75ce4266c4 2024-12-29 11:38:02 -05:00
Yufeng Ying
33817b186f Remove unused header in drivers and modules.
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
2024-12-24 00:40:47 +08:00
Fabio Alessandrelli
d798068a08 [WS] Fix wslay multi-frame message parsing
The wslay library, somehow unintuitively, will call the frame recv end
callback for control frames.

This has the side effect that while receiving a long message (i.e. a
multi-frame message), if a control frame (e.g. a ping or pong) is
received it may seem that a FIN frame has been received, resulting in
the current code truncating the message.

To avoid this, this commit now ignores the frame recv end callback, and
instead rely on the msg recv callback where we can check the opcode, and
is guaranteed to be called only when the FIN frame is received for text
and binary frames.
2024-12-20 12:44:59 +01:00
Spartan322
c3314b0ab0 Merge commit godotengine/godot@1f47e4c4e3 2024-12-04 20:11:58 -05:00
Fabio Alessandrelli
95401f0753 [WebSocket] Clarify that connect_to_url is non-blocking 2024-11-27 13:31:28 +01:00
Spartan322
3a73c6ebd1 Merge commit godotengine/godot@cb411fa960 2024-11-12 13:46:59 -05:00
Fabio Alessandrelli
3114bda4e1 [WS] Implement wslay unbuffered message parsing
Ensure we never read more than we can store during poll.

Raise default max packets to 4096 to maintain the same performance for
the first 2048 packets.
2024-11-12 17:19:39 +01:00
Thaddeus Crews
caff0ff591 Merge pull request #97913 from Faless/fix/websocket_closing_transition
[WS] Detect disconnection due to protocol errors
2024-11-12 09:28:15 -06:00
Fabio Alessandrelli
e2d62f8618 [WebSocket] Add optional heartbeat via "ping" control frames.
Has no effect in Web exports since the browsers do not expose a way to
send ping control frames.
2024-11-07 15:18:46 +01:00
Fabio Alessandrelli
6cdfc8c9fe [WS] Detect disconnection due to protocol errors
When wslay receives a message that is too big or cause a protocol error,
it automatically sends a close request to the remote peer but it also
completely stop calling the receive callback resulting in the state
being "stuck" as CONNECTED (even if both client and server have
disconnected).

We now check if we sent a close message and reading has been disabled to
manually transition to the "closed" state with the proper reason.
2024-11-04 11:20:30 +01:00
Spartan322
82de309d58 Merge commit godotengine/godot@8004c7524f 2024-10-30 05:22:24 -04:00
Spartan322
6beb1eef9a Fix copyright headers referring to Godot 2024-10-27 11:17:29 -04:00
Adam Scott
0d350e7108 Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
Dubhghlas McLaughlin
e8542b06ac Rebrand preambles to Redot
Credits:
Co-authored-by: Skogi <skogi.b@gmail.com>
Co-authored-by: Spartan322 <Megacake1234@gmail.com>
Co-authored-by: swashberry <swashdev@pm.me>
Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se>
Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com>
Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com>
Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com>
Co-authored-by: radenthefolf <radenthefolf@gmail.com>
Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com>
Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com>
Co-authored-by: decryptedchaos <nixgod@gmail.com>
Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com>
Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com>
Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com>
Co-authored-by: Mister Puma <MisterPuma80@gmail.com>
Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com>
Co-authored-by: SingleError <isaaconeoneone@gmail.com>
Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
2024-10-11 02:26:51 -04:00
Haoyu Qiu
6516ca6b11 Parse fragment from URL 2024-09-27 19:42:30 +08:00
Thaddeus Crews
9f9ee0c813 SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
Daylily-Zeleen
3d575801ce Allow ClassDB to create a Object without postinitialization for GDExtension. 2024-08-20 20:19:02 +08:00
Fabio Alessandrelli
7f610a2c6e [WS] Fix set_no_delay on Windows
Windows socket implementation is, as usual, broken in many ways.

This includes `setsockopt` failing to set `TCP_NODELAY` if the socket is
still in a connecting state.

This also means we need to keep polling the IP resolver until the socket
reaches the CONNECTED state (so it can set the TCP_NODELAY after the
connection is successful).
2024-08-07 09:47:00 +02:00
Rémi Verschelde
2add44c0dc Merge pull request #94168 from Faless/net/wsl_peer_reuse
[WebSocket] Allow reusing closing and closed peers
2024-08-01 00:06:26 +02:00
Fabio Alessandrelli
d65e7aab76 [WebSocket] Ensure TCP_NODELAY is always set
Almost all WebSocket implementations (including all major browsers)
disable Nagle's algorithm to favor low latency over packet overhead.

This was also the case in Godot 3.x, while in Godot 4.0 this was only
being done for clients and wasn't even always working due to a bug.

This commit fixes the aforementioned bug, and forces TCP_NODELAY when
accepting a stream as a server.
2024-07-22 14:40:19 +02:00
Fabio Alessandrelli
acba901087 [WebSocket] Allow reusing closing and closed peers 2024-07-10 12:56:40 +02:00
A Thousand Ships
955d5affa8 Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
Thaddeus Crews
9903e6779b Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00