Commit Graph

178 Commits

Author SHA1 Message Date
d18cbdf5e4 Merge pull request #52481 from Faless/net/4.x_native_peers
[Net] Extension system for network peers, webrtc.
2021-09-28 12:57:45 +02:00
7a62bd1e44 Document Android permission requirements for network access where needed 2021-09-25 12:32:46 +02:00
2d810e8cd9 [Net/Docs] Update extensions documentation. 2021-09-24 21:23:43 +02:00
25226329be [Net] MultiplayerPeer cleanup, defaults. 2021-09-24 18:40:39 +02:00
d54f2ad7ca Don't generate empty doc sections and reduce code duplication 2021-09-20 20:59:33 -05:00
3cc01b2824 Merge pull request #52226 from Faless/debugger/4.x_start_options 2021-09-14 16:20:02 +02:00
5b25457794 Multiplayer networking renames/simplification
Removes _networking_ prefix from some methods and members, now that multiplayer has been largely moved out of Node and SceneTree and is seperated into its own set of classes.
2021-09-08 12:05:54 +02:00
bf9aae09ba [Net] Move multiplayer to core subdir, split RPCManager.
Move multiplayer classes to "core/multiplayer" subdir.

Move the RPCConfig and enums (TransferMode, RPCMode) to a separate
file (multiplayer.h), and bind them to the global namespace.

Move the RPC handling code to its own class (RPCManager).

Renames "get_rpc_sender_id" to "get_remote_sender_id".
2021-09-07 11:14:30 +02:00
fd52e18d19 Try other resolved IPs if one fails to connect 2021-08-30 13:00:48 +08:00
ecb2e8297c [Editor] Editor debugger binds according to editor settings. 2021-08-29 18:03:12 +02:00
c44ebb020d HTML5: Fix warnings and re-enable werror=yes on CI
Add a missing call to disable warnings on a forked env for freetype's
`sfnt.c`.
2021-08-06 12:12:37 +02:00
0cee8831b2 Merge pull request #51005 from Faless/mp/4.x_channels
[Net] Implement RPC channels in MultiplayerAPI.
2021-08-04 09:31:33 +02:00
8465ecc3ae Merge pull request #51036 from winterpixelgames/master-ws-fix
WebsocketPeer outbound buffer fixes and buffer size query
2021-08-01 11:12:15 +02:00
de02cf44ae Websocket peer outbound buffer fixes. Expose outbound buffered amount. 2021-07-31 19:48:31 -06:00
2cf39b97ae [Net] Implement RPC channels in MultiplayerAPI. 2021-07-30 17:29:50 +02:00
7adf4cc9b5 doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.

Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
2021-07-30 15:29:52 +02:00
1e8bf86379 [Net] Add generate_unique_id to MultiplayerPeer.
Used by ENetMultiplayerPeer and WebSocketServer to generate network IDs,
and exposed to the user for p2p networks (e.g. WebRTCMultiplayerPeer)
and custom MultiplayerPeer implementations.
2021-07-29 10:40:03 +02:00
92299989bd Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
3564c16cb8 Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
4e6efd1b07 Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
6631f66c2a Optimize StringName usage
* 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-18 21:20:02 -03:00
1475f617a3 Expose the resource name the client used to the websocket server
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-17 07:48:18 +02:00
06568bbfdf Misc cleanup of header includes
Was looking for misuse of module headers without checking that the module is
actually enabled and got carried away...
2021-07-15 00:46:43 +02:00
5ad4f26659 Implement the ability to disable classes
* 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-13 09:25:14 -03:00
88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
58455b18b5 Improve error reporting in WebSocketServer
This should make troubleshooting easier.
2021-07-05 16:35:21 +02:00
90bb560984 Protocol shadows a variable. 2021-06-30 01:25:27 -07:00
eb318d3e04 Merge pull request #49966 from Faless/net/4.x_ws_timeout
[Net] Add WebSocketServer handshake_timeout property.
2021-06-29 02:00:00 +02:00
458437edef [Net] Add WebSocketServer handshake_timeout property.
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 15:53:25 +02:00
d244dda597 [Net] Fix WebSocketClient path parsing.
Recent changes to parse_url caused the client to make invalid HTTP
requests if no path was specified.
2021-06-28 15:09:58 +02:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
f6756e2bf5 Merge pull request #49698 from aaronfranke/prop-no-usage
Add PROPERTY_USAGE_NONE and use it
2021-06-18 12:28:05 +02:00
0ff4095b36 Better format arguments in variant parser 2021-06-18 00:06:40 -03:00
8b692e8872 Add PROPERTY_USAGE_NONE and use it 2021-06-17 19:10:26 -04:00
04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
3f078c99f6 Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
015fc2ad4f Merge pull request #48205 from Faless/net/4.x_url_parsing
[Net] Implement String::parse_url for parsing URLs.
2021-05-03 13:55:57 +02:00
05ad08941b Add WebSocketMultiplayerPeer _incoming_packets check bound 2021-04-30 21:00:52 +05:00
8247667a3e Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

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-27 16:26:27 +02:00
3bb40669d5 [Net] Implement String::parse_url for parsing URLs.
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-26 09:55:24 +02:00
a56e37545b Document secure wss:// caveats for WebSocketClient
See https://github.com/godotengine/godot/issues/37739.
2021-04-07 21:32:17 +02:00
91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
f7209b459b Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
b5334d14f7 Update copyright statements to 2021
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 🎆
2021-01-01 20:19:21 +01:00
c7b53c03ae SCons: Add explicit dependencies on thirdparty code in cloned env
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-18 10:29:34 +01:00
1167ab96e9 [HTML5] Add function signatures to JS libraries. 2020-12-04 23:21:33 +01:00
4617a7fa9c [HTML5] Run eslint --fix.
Should I write a poem about this whole new world? ;)
2020-11-23 12:15:18 +01:00
a82f70ea9f [HTML5] Libraries refactor for linting.
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-21 14:22:40 +01:00
112e2fdfc3 Fix godot_js_websocket_send function unused assignment. 2020-11-17 18:28:39 +00:00
02161aad5a Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00