Commit graph

27 commits

Author SHA1 Message Date
Rémi Verschelde 25b2f1780a
Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
2023-06-15 14:35:45 +02:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Fabio Alessandrelli 40d60ca6ae [WebSocket] Fix debugger implementation.
Register module during core initialization so the remote debugger can
properly handle the "wss://" protocol.
2022-10-13 17:25:29 +02:00
Fabio Alessandrelli a8950f98dd [WebSocket] Refactor websocket module.
This commit is a huge refactor of the websocket module.
The module is really old, and some design choices had to be
re-evaluated.

The WebSocketClient and WebSocketServer classes are now gone, and
WebSocketPeer can act as either client or server.
The WebSocketMultiplayerPeer class is no longer abstract, and implements
the Multiplayer API on top of the lower level WebSocketPeer.

WebSocketPeer is now a "raw" peer, like StreamPeerTCP and StreamPeerTLS,
so it emits no signal, and just needs polling to update its internal
state.

To use it as a client, simply call WebSocketPeer.coonect_to_url, then
frequently poll the peer until STATE_OPEN is reached and then you can
write or read from it, or STATE_CLOSED and then you can check the
disconnect code and reason).

To implement a server instead, a TCPServer must be created, and the
accepted connections needs to be provided to
WebSocketPeer.accept_stream (which will perform the HTTP handshake).

A full example of a WebSocketServer using TLS will be provided in the
demo repository.
2022-10-11 15:52:30 +02:00
Fabio Alessandrelli d20b32186f [Web] Rename JavaScript platform to Web.
Also rename export name from "HTML5" to "Web".
2022-08-29 11:52:00 +02:00
Fabio Alessandrelli 202320e1ed [Websocket] Remove dummy JS server implemenation.
It does nothing but printing errors (only websocket client is available
in browsers), so we might as well return null when you instantiate it.
2022-08-07 13:44:16 +02:00
reduz de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
Rémi Verschelde 5fe6984639 Modules: Don't build editor-specific classes in templates
They're moved to an `editor` subfolder so that we can easily handle them
separately.
2022-03-28 16:48:15 +02:00
reduz 6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
reduz 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
Rémi Verschelde 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
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Ignacio Etcheverry 18332a0094 websocket: Fix crash at exit when not running the editor
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-16 04:30:12 +02:00
Fabio Alessandrelli 3097c2da96 Add WebSocket debugger, use it for Javascript. 2020-05-12 15:09:13 +02:00
Fabio Alessandrelli beb87504e0 Remove WebSocket defaults from project settings.
Can be manually set, let's not pollute them further.
Should also be done for WebRTC.
2020-05-12 12:24:26 +02:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
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.
2020-01-01 11:16:22 +01:00
Fabio Alessandrelli aae6c075aa Remove libwebsocket. No longer used, yay! 2019-07-04 15:03:04 +02:00
Fabio Alessandrelli 9e303ef71c WebSocket module now uses wslay library.
Both client and server are supported on native builds (as usual).

SSL server is still not supported, but will soon be possible with this
new library.

The API stays the same, we just need to work out potential issues due to
this big library switch.
2019-07-04 15:03:04 +02:00
Fabio Alessandrelli 6a1bf006a3 Move IDHandler JS module to platform from Websock 2019-04-12 12:41:49 +02:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde d1f3b622f0 Fix missing/malformed license headers 2019-01-01 12:46:36 +01:00
Fabio Alessandrelli c066db4d59 Convert WebSocket module to use PacketBuffer class 2018-11-12 22:55:17 +01:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Poommetee Ketson ff070de986 s/2017/2018/g for gles2, websocket, linux appdata 2018-03-21 16:07:51 +07:00
Fabio Alessandrelli 658d71c3b9 Relicense module to the wondeful Godot community! 2018-02-06 14:10:13 +01:00
Fabio Alessandrelli 6a644d3ee1 Add websocket module.
Webassembly is client-only for obvious reasons.
Other platforms support both client and server using libwebsockets.
2018-02-06 14:10:13 +01:00