summaryrefslogtreecommitdiff
path: root/modules/websocket
AgeCommit message (Collapse)Author
2021-07-18Optimize StringName usagereduz
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
2021-07-17Expose the resource name the client used to the websocket serverMeriipu
This information is exposed to the websocket server through the client_connected-signal. example.com/chat?id=10 gives the resource name "/chat?id=10"
2021-07-15Misc cleanup of header includesRémi Verschelde
Was looking for misuse of module headers without checking that the module is actually enabled and got carried away...
2021-07-13Implement the ability to disable classesreduz
* This PR adds the ability to disable classes when building. * For now it's only possible to do this via command like: `scons disable_classes=RayCast2D,Area3D` * Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-12[Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer.Fabio Alessandrelli
2021-07-05Improve error reporting in WebSocketServerHugo Locurcio
This should make troubleshooting easier.
2021-06-30Protocol shadows a variable.K. S. Ernest (iFire) Lee
2021-06-29Merge pull request #49966 from Faless/net/4.x_ws_timeoutRémi Verschelde
[Net] Add WebSocketServer handshake_timeout property.
2021-06-28[Net] Add WebSocketServer handshake_timeout property.Fabio Alessandrelli
Allows customization of the maximum time a client is allowed to stay in the the "pending" state (i.e. awaiting HTTP handshake). This used to be 1 second by before, the new default is 3 seconds.
2021-06-28[Net] Fix WebSocketClient path parsing.Fabio Alessandrelli
Recent changes to parse_url caused the client to make invalid HTTP requests if no path was specified.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-18Merge pull request #49698 from aaronfranke/prop-no-usageRémi Verschelde
Add PROPERTY_USAGE_NONE and use it
2021-06-18Better format arguments in variant parserMichael Alexsander Silva Dias
2021-06-17Add PROPERTY_USAGE_NONE and use itAaron Franke
2021-06-11Rename Reference to RefCountedPedro J. Estébanez
2021-05-06Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio
2021-05-03Merge pull request #48205 from Faless/net/4.x_url_parsingFabio Alessandrelli
[Net] Implement String::parse_url for parsing URLs.
2021-04-30Add WebSocketMultiplayerPeer _incoming_packets check boundMaxStgs
2021-04-27Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde
We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
2021-04-26[Net] Implement String::parse_url for parsing URLs.Fabio Alessandrelli
Splits the URL into (scheme, host, port, path). Supports both literal IPv4 and IPv6. Strip credentials when present (e.g. http://user:pass@example.com/). Use that function in both HTTPRequest and WebSocketClient.
2021-04-07Document secure wss:// caveats for WebSocketClientHugo Locurcio
See https://github.com/godotengine/godot/issues/37739.
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-02-08Initialize class/struct variables with default values in modules/Rafał Mikrut
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-18SCons: Add explicit dependencies on thirdparty code in cloned envRémi Verschelde
Since we clone the environments to build thirdparty code, we don't get an explicit dependency on the build objects produced by that environment. So when we update thirdparty code, Godot code using it is not necessarily rebuilt (I think it is for changed headers, but not for changed .c/.cpp files), which can lead to an invalid compilation output (linking old Godot .o files with a newer, potentially ABI breaking version of thirdparty code). This was only seen as really problematic with bullet updates (leading to crashes when rebuilding Godot after a bullet update without cleaning .o files), but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
2020-12-04[HTML5] Add function signatures to JS libraries.Fabio Alessandrelli
2020-11-23[HTML5] Run eslint --fix.Fabio Alessandrelli
Should I write a poem about this whole new world? ;)
2020-11-21[HTML5] Libraries refactor for linting.Fabio Alessandrelli
Initial work to make liniting easier. This includes: - Rename http_request.js to library_godot_http_request.js. - Rename externs.js to engine.externs.js. - New library_godot_runtime.js (GodotRuntime) wraps around emscripten functions. - Refactor of XMLHttpRequest handler in engine/preloader.js. - Few fixes to bugs spotted by early stage linting.
2020-11-17Fix godot_js_websocket_send function unused assignment.Marcel Admiraal
2020-11-16Remove empty lines around braces with the formatting scriptAaron Franke
2020-11-10[HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli
The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
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>`.