summaryrefslogtreecommitdiff
path: root/modules/websocket
AgeCommit message (Collapse)Author
2020-07-10Add override keywords.Marcel Admiraal
2020-07-03Remove String::find_last (same as rfind)Stijn Hinlopen
2020-05-16websocket: Fix crash at exit when not running the editorIgnacio Etcheverry
EditorDebuggerServer::register_protocol_handler must not be called before editor initialization. Otherwise, if the editor is never initialized, the added StringName will not be released until static destructors are called (instead of being release during editor deinitialization).
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-05-14Style: Fix missing/invalid copyright headersRémi Verschelde
2020-05-14Modernize remaining uses of 0/NULL instead of nullptr (C++11)Rémi Verschelde
Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2020-05-12Add WebSocket debugger, use it for Javascript.Fabio Alessandrelli
2020-05-12Remove WebSocket defaults from project settings.Fabio Alessandrelli
Can be manually set, let's not pollute them further. Should also be done for WebRTC.
2020-05-10Fix Closure compiler build, python style.Fabio Alessandrelli
Move copyToFS into utils.js library included with '--pre-js'.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-30SCons: Format buildsystem files with psf/blackRémi Verschelde
Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
2020-03-23Adding missing include guards to header files identified by LGTM.Rajat Goswami
This addresses the issue godotengine/godot#37143
2020-03-17Style: Set clang-format Standard to Cpp11Rémi Verschelde
For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-08Fix Javascript platform after PoolVector removal.Fabio Alessandrelli
Eval should be rechecked.
2020-02-18doc: Sync classref with current sourceRémi Verschelde
Handle removal of Pool*Array types and other recent changes.
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-02-15Fix EMWSClient::get_connection_status(), try catchFabio Alessandrelli
2020-01-31Update docs to version 4.0clayjohn
2020-01-28Disable Nagle's algorithm for WebSocket TCP.Fabio Alessandrelli
This should greatly decrease latency for the most common use cases. A new function WebSocketPeer::set_no_delay will allow to configure it if so desired.
2020-01-26Merge pull request #35516 from Faless/ws/fix_latency_32Rémi Verschelde
Lower WebSocket latency, fixes.
2020-01-26doc: Drop unused 'category' property from headerRémi Verschelde
We already removed it from the online docs with #35132. Currently it can only be "Built-In Types" (Variant types) or "Core" (everything else), which is of limited use. We might also want to consider dropping it from `ClassDB` altogether in Godot 4.0.
2020-01-24Lower WebSocket latency, fixes.Fabio Alessandrelli
WSLPeer now tries to flush packet queue after put_packet call. WSLServer::listen correctly returns TCP_Server::listen return value.
2020-01-23doc: Misc updates for AnimationNode* and othersRémi Verschelde
- Add some missing descriptions. - Add links to tutorials for ARVR and AnimationTree. - Style fixes. - Engine changes: * Make `AnimationNodeTransition.input_<number>` properties internal so that they don't appear in the docs. They still appear in the inspector based on the actual number of inputs requested. * Drop unimplemented `CPUParticles.flatness`. It's only used for 3D particles in `ParticlesMaterial`, and thus only relevant for `CPUParticles3D`.
2020-01-21Fix MultiplayerAPI crash when peer impl misbehave.Fabio Alessandrelli
Also fix WebSocketMultiplayer::get_available_packet_count() return value when peer is not configured to use the multiplayer API.
2020-01-16Validate input in (CPU)Particles set_emission_shape()Rémi Verschelde
Fixes #29777. Co-authored-by: Cameron Reikes <cameronreikes@gmail.com>
2020-01-15Prevent GDScript language server from listening to external hosts by defaultHoukime
* Add bind_ip property to WebSocketServer defaulting to "*" (listen to everyone) * Set default for GDscript Language Server to listen only to localhost Fixes potential security issue with GDScript language server being exposed to the broad net by default. Since it is the server which primary usage is to provide utility to the local editor there is no need to expose it.
2020-01-14Update documentation to reflect HTML5 limitations.Fabio Alessandrelli
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-21WSLPeer now prevents receiving data after close.Fabio Alessandrelli
Used to spit error and report empty packets when connection was still half-closed (waiting for confirmation from other end).
2019-11-15Fix Visual Studio throwing C4334 warning.Marcel Admiraal
2019-10-16Trim protocol field from spaces in WS classes.Fabio Alessandrelli
2019-10-15Fix HTML5 build after 67a4c30.Fabio Alessandrelli
I messed up a rebase and a commit was partly skipped
2019-10-11doc: Sync classref with current sourceRémi Verschelde
2019-10-09Document all this new improvements.Fabio Alessandrelli
2019-10-09Custom headers support in WebSocketClient.Fabio Alessandrelli
This commit also converts all PoolVector<String> parameters to `const Vector<String>` in both WebSocketServer and WebSocketClient.
2019-10-09Implement WebSocketServer SSL support.Fabio Alessandrelli
2019-10-09WebSocketClient can now use custom SSL certificateFabio Alessandrelli
Via the `trusted_ssl_certificate` property.
2019-10-09Re-implement WebSocket get host/port.Fabio Alessandrelli
Was lost during library switch
2019-09-24doc: Fix parsing of self-closing XML tagsRémi Verschelde
Follow-up to #31925, `<member />` tags just before `</members>` would cause a parsing issue, and we'd never notice that we're no longer parsing members. Also added space before closing `/>`.
2019-09-04Run doctool after overridden properties changesBojidar Marinov
2019-08-28Style: Fix copyright headers in new filesRémi Verschelde
2019-08-21Merge pull request #29871 from Faless/crypto/initial_prRémi Verschelde
More Crypto, SSL server, crt/key as Resource, HashingContext
2019-08-20Merge pull request #31483 from Faless/ws/fix_double_relayRémi Verschelde
Fix WebSocketServer relaying message twice.
2019-08-19Fix WebSocketServer relaying message 2 times.Fabio Alessandrelli
The WebSocketMultiplayerPeer was relaying the same message two times, both in _server_relay and _process_multiplayer (which was only supposed to store the packet, given the server was one of the destination). _process_multiplayer now only store the packet, and calls _server_relay which will relay the message to other clients if needed.
2019-08-19WebSocketServer now sanitize destination peers.Fabio Alessandrelli
When relaying messages in multiplayer mode. Could cause a crash in case a malicious client sends a bogus packet and for those cases where a peer has just disconnected and a message arrive from another peer with the disconnected one as destination.
2019-08-19Move CryptoCore to it's own folder.Fabio Alessandrelli
Crypto classes will be placed in core/crypto.
2019-08-17Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'Rémi Verschelde
The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is (conditionally defines the error message). There are a few ERR_EXPLAINC calls for C-strings where String is not included which can stay as is to avoid adding additional _MSGC macros just for that. Part of #31244.
2019-08-12Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in rest of 'modules/'Robin Hübner