diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-08-28 20:27:45 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-08-29 11:52:00 +0200 |
commit | d20b32186fc192f5e527a1211291b0cb293f4e66 (patch) | |
tree | 20f5e9e84e10b68c318f576344a10a9fc63d235f /modules/websocket | |
parent | 223e083d36ac1ca3f7aa46898d8870e476132f7a (diff) |
[Web] Rename JavaScript platform to Web.
Also rename export name from "HTML5" to "Web".
Diffstat (limited to 'modules/websocket')
-rw-r--r-- | modules/websocket/SCsub | 2 | ||||
-rw-r--r-- | modules/websocket/doc_classes/WebSocketClient.xml | 6 | ||||
-rw-r--r-- | modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml | 2 | ||||
-rw-r--r-- | modules/websocket/doc_classes/WebSocketPeer.xml | 10 | ||||
-rw-r--r-- | modules/websocket/doc_classes/WebSocketServer.xml | 2 | ||||
-rw-r--r-- | modules/websocket/emws_client.cpp | 12 | ||||
-rw-r--r-- | modules/websocket/emws_client.h | 4 | ||||
-rw-r--r-- | modules/websocket/emws_peer.cpp | 10 | ||||
-rw-r--r-- | modules/websocket/emws_peer.h | 4 | ||||
-rw-r--r-- | modules/websocket/register_types.cpp | 4 | ||||
-rw-r--r-- | modules/websocket/remote_debugger_peer_websocket.cpp | 4 | ||||
-rw-r--r-- | modules/websocket/remote_debugger_peer_websocket.h | 2 | ||||
-rw-r--r-- | modules/websocket/wsl_client.cpp | 4 | ||||
-rw-r--r-- | modules/websocket/wsl_client.h | 4 | ||||
-rw-r--r-- | modules/websocket/wsl_peer.cpp | 4 | ||||
-rw-r--r-- | modules/websocket/wsl_peer.h | 4 | ||||
-rw-r--r-- | modules/websocket/wsl_server.cpp | 4 | ||||
-rw-r--r-- | modules/websocket/wsl_server.h | 4 |
18 files changed, 43 insertions, 43 deletions
diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub index dc0661995f..890fb71592 100644 --- a/modules/websocket/SCsub +++ b/modules/websocket/SCsub @@ -7,7 +7,7 @@ env_ws = env_modules.Clone() thirdparty_obj = [] -if env["platform"] == "javascript": +if env["platform"] == "web": # Our JavaScript/C++ interface. env.AddJSLibraries(["library_godot_websocket.js"]) diff --git a/modules/websocket/doc_classes/WebSocketClient.xml b/modules/websocket/doc_classes/WebSocketClient.xml index f586c58302..7d73194ea9 100644 --- a/modules/websocket/doc_classes/WebSocketClient.xml +++ b/modules/websocket/doc_classes/WebSocketClient.xml @@ -24,8 +24,8 @@ If [code]true[/code] is passed as [code]gd_mp_api[/code], the client will behave like a multiplayer peer for the [MultiplayerAPI], connections to non-Godot servers will not work, and [signal data_received] will not be emitted. If [code]false[/code] is passed instead (default), you must call [PacketPeer] functions ([code]put_packet[/code], [code]get_packet[/code], etc.) on the [WebSocketPeer] returned via [code]get_peer(1)[/code] and not on this object directly (e.g. [code]get_peer(1).put_packet(data)[/code]). You can optionally pass a list of [code]custom_headers[/code] to be added to the handshake HTTP request. - [b]Note:[/b] To avoid mixed content warnings or errors in HTML5, you may have to use a [code]url[/code] that starts with [code]wss://[/code] (secure) instead of [code]ws://[/code]. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's SSL certificate. Do not connect directly via the IP address for [code]wss://[/code] connections, as it won't match with the SSL certificate. - [b]Note:[/b] Specifying [code]custom_headers[/code] is not supported in HTML5 exports due to browsers restrictions. + [b]Note:[/b] To avoid mixed content warnings or errors in Web, you may have to use a [code]url[/code] that starts with [code]wss://[/code] (secure) instead of [code]ws://[/code]. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's SSL certificate. Do not connect directly via the IP address for [code]wss://[/code] connections, as it won't match with the SSL certificate. + [b]Note:[/b] Specifying [code]custom_headers[/code] is not supported in Web exports due to browsers restrictions. </description> </method> <method name="disconnect_from_host"> @@ -52,7 +52,7 @@ <members> <member name="trusted_ssl_certificate" type="X509Certificate" setter="set_trusted_ssl_certificate" getter="get_trusted_ssl_certificate"> If specified, this [X509Certificate] will be the only one accepted when connecting to an SSL host. Any other certificate provided by the server will be regarded as invalid. - [b]Note:[/b] Specifying a custom [code]trusted_ssl_certificate[/code] is not supported in HTML5 exports due to browsers restrictions. + [b]Note:[/b] Specifying a custom [code]trusted_ssl_certificate[/code] is not supported in Web exports due to browsers restrictions. </member> <member name="verify_ssl" type="bool" setter="set_verify_ssl_enabled" getter="is_verify_ssl_enabled"> If [code]true[/code], SSL certificate verification is enabled. diff --git a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml index 23aa6ba3db..4cc4d515e7 100644 --- a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml +++ b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml @@ -27,7 +27,7 @@ Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under [code]network/limits[/code]. For server, values are meant per connected peer. The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer. Buffer sizes are expressed in KiB, so [code]4 = 2^12 = 4096 bytes[/code]. All parameters will be rounded up to the nearest power of two. - [b]Note:[/b] HTML5 exports only use the input buffer since the output one is managed by browsers. + [b]Note:[/b] Web exports only use the input buffer since the output one is managed by browsers. </description> </method> </methods> diff --git a/modules/websocket/doc_classes/WebSocketPeer.xml b/modules/websocket/doc_classes/WebSocketPeer.xml index 43b765d2fe..627b9c607c 100644 --- a/modules/websocket/doc_classes/WebSocketPeer.xml +++ b/modules/websocket/doc_classes/WebSocketPeer.xml @@ -17,27 +17,27 @@ <description> Closes this WebSocket connection. [code]code[/code] is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). [code]reason[/code] is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes). [b]Note:[/b] To achieve a clean close, you will need to keep polling until either [signal WebSocketClient.connection_closed] or [signal WebSocketServer.client_disconnected] is received. - [b]Note:[/b] The HTML5 export might not support all status codes. Please refer to browser-specific documentation for more details. + [b]Note:[/b] The Web export might not support all status codes. Please refer to browser-specific documentation for more details. </description> </method> <method name="get_connected_host" qualifiers="const"> <return type="String" /> <description> Returns the IP address of the connected peer. - [b]Note:[/b] Not available in the HTML5 export. + [b]Note:[/b] Not available in the Web export. </description> </method> <method name="get_connected_port" qualifiers="const"> <return type="int" /> <description> Returns the remote port of the connected peer. - [b]Note:[/b] Not available in the HTML5 export. + [b]Note:[/b] Not available in the Web export. </description> </method> <method name="get_current_outbound_buffered_amount" qualifiers="const"> <return type="int" /> <description> - Returns the current amount of data in the outbound websocket buffer. [b]Note:[/b] HTML5 exports use WebSocket.bufferedAmount, while other platforms use an internal buffer. + Returns the current amount of data in the outbound websocket buffer. [b]Note:[/b] Web exports use WebSocket.bufferedAmount, while other platforms use an internal buffer. </description> </method> <method name="get_write_mode" qualifiers="const"> @@ -57,7 +57,7 @@ <param index="0" name="enabled" type="bool" /> <description> Disable Nagle's algorithm on the underling TCP socket (default). See [method StreamPeerTCP.set_no_delay] for more information. - [b]Note:[/b] Not available in the HTML5 export. + [b]Note:[/b] Not available in the Web export. </description> </method> <method name="set_write_mode"> diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml index 6a7bf8075c..19c36700e6 100644 --- a/modules/websocket/doc_classes/WebSocketServer.xml +++ b/modules/websocket/doc_classes/WebSocketServer.xml @@ -6,7 +6,7 @@ <description> This class implements a WebSocket server that can also support the high-level multiplayer API. After starting the server ([method listen]), you will need to [method MultiplayerPeer.poll] it at regular intervals (e.g. inside [method Node._process]). When clients connect, disconnect, or send data, you will receive the appropriate signal. - [b]Note:[/b] Not available in HTML5 exports. + [b]Note:[/b] Not available in Web exports. [b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. </description> <tutorials> diff --git a/modules/websocket/emws_client.cpp b/modules/websocket/emws_client.cpp index e051a3b564..65e0703c00 100644 --- a/modules/websocket/emws_client.cpp +++ b/modules/websocket/emws_client.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED #include "emws_client.h" @@ -82,12 +82,12 @@ Error EMWSClient::connect_to_host(String p_host, String p_path, uint16_t p_port, String str = "ws://"; if (p_custom_headers.size()) { - WARN_PRINT_ONCE("Custom headers are not supported in HTML5 platform."); + WARN_PRINT_ONCE("Custom headers are not supported in Web platform."); } if (p_ssl) { str = "wss://"; if (ssl_cert.is_valid()) { - WARN_PRINT_ONCE("Custom SSL certificate is not supported in HTML5 platform."); + WARN_PRINT_ONCE("Custom SSL certificate is not supported in Web platform."); } } str += p_host + ":" + itos(p_port) + p_path; @@ -126,11 +126,11 @@ void EMWSClient::disconnect_from_host(int p_code, String p_reason) { } IPAddress EMWSClient::get_connected_host() const { - ERR_FAIL_V_MSG(IPAddress(), "Not supported in HTML5 export."); + ERR_FAIL_V_MSG(IPAddress(), "Not supported in Web export."); } uint16_t EMWSClient::get_connected_port() const { - ERR_FAIL_V_MSG(0, "Not supported in HTML5 export."); + ERR_FAIL_V_MSG(0, "Not supported in Web export."); } int EMWSClient::get_max_packet_size() const { @@ -156,4 +156,4 @@ EMWSClient::~EMWSClient() { } } -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED diff --git a/modules/websocket/emws_client.h b/modules/websocket/emws_client.h index b71fd78124..ff63a76753 100644 --- a/modules/websocket/emws_client.h +++ b/modules/websocket/emws_client.h @@ -31,7 +31,7 @@ #ifndef EMWS_CLIENT_H #define EMWS_CLIENT_H -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED #include "core/error/error_list.h" #include "emws_peer.h" @@ -66,6 +66,6 @@ public: ~EMWSClient(); }; -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED #endif // EMWS_CLIENT_H diff --git a/modules/websocket/emws_peer.cpp b/modules/websocket/emws_peer.cpp index 86169f88e9..859c92b457 100644 --- a/modules/websocket/emws_peer.cpp +++ b/modules/websocket/emws_peer.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED #include "emws_peer.h" @@ -110,15 +110,15 @@ void EMWSPeer::close(int p_code, String p_reason) { } IPAddress EMWSPeer::get_connected_host() const { - ERR_FAIL_V_MSG(IPAddress(), "Not supported in HTML5 export."); + ERR_FAIL_V_MSG(IPAddress(), "Not supported in Web export."); } uint16_t EMWSPeer::get_connected_port() const { - ERR_FAIL_V_MSG(0, "Not supported in HTML5 export."); + ERR_FAIL_V_MSG(0, "Not supported in Web export."); } void EMWSPeer::set_no_delay(bool p_enabled) { - ERR_FAIL_MSG("'set_no_delay' is not supported in HTML5 export."); + ERR_FAIL_MSG("'set_no_delay' is not supported in Web export."); } EMWSPeer::EMWSPeer() { @@ -129,4 +129,4 @@ EMWSPeer::~EMWSPeer() { close(); } -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED diff --git a/modules/websocket/emws_peer.h b/modules/websocket/emws_peer.h index f52f615c35..cdbc9212a5 100644 --- a/modules/websocket/emws_peer.h +++ b/modules/websocket/emws_peer.h @@ -31,7 +31,7 @@ #ifndef EMWS_PEER_H #define EMWS_PEER_H -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED #include "core/error/error_list.h" #include "core/io/packet_peer.h" @@ -88,6 +88,6 @@ public: ~EMWSPeer(); }; -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED #endif // EMWS_PEER_H diff --git a/modules/websocket/register_types.cpp b/modules/websocket/register_types.cpp index 056111ec92..faa7021b2f 100644 --- a/modules/websocket/register_types.cpp +++ b/modules/websocket/register_types.cpp @@ -36,7 +36,7 @@ #include "websocket_client.h" #include "websocket_server.h" -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED #include "emscripten.h" #include "emws_client.h" #include "emws_peer.h" @@ -59,7 +59,7 @@ static void _editor_init_callback() { void initialize_websocket_module(ModuleInitializationLevel p_level) { if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) { -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED EMWSPeer::make_default(); EMWSClient::make_default(); #else diff --git a/modules/websocket/remote_debugger_peer_websocket.cpp b/modules/websocket/remote_debugger_peer_websocket.cpp index 6319c3c664..f703873cbf 100644 --- a/modules/websocket/remote_debugger_peer_websocket.cpp +++ b/modules/websocket/remote_debugger_peer_websocket.cpp @@ -103,7 +103,7 @@ void RemoteDebuggerPeerWebSocket::close() { } bool RemoteDebuggerPeerWebSocket::can_block() const { -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED return false; #else return true; @@ -111,7 +111,7 @@ bool RemoteDebuggerPeerWebSocket::can_block() const { } RemoteDebuggerPeerWebSocket::RemoteDebuggerPeerWebSocket(Ref<WebSocketPeer> p_peer) { -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED ws_client = Ref<WebSocketClient>(memnew(EMWSClient)); #else ws_client = Ref<WebSocketClient>(memnew(WSLClient)); diff --git a/modules/websocket/remote_debugger_peer_websocket.h b/modules/websocket/remote_debugger_peer_websocket.h index 3227065ded..a37a789cbe 100644 --- a/modules/websocket/remote_debugger_peer_websocket.h +++ b/modules/websocket/remote_debugger_peer_websocket.h @@ -33,7 +33,7 @@ #include "core/debugger/remote_debugger_peer.h" -#ifdef JAVASCRIPT_ENABLED +#ifdef WEB_ENABLED #include "emws_client.h" #else #include "wsl_client.h" diff --git a/modules/websocket/wsl_client.cpp b/modules/websocket/wsl_client.cpp index 478dbb9d47..2bb57226ea 100644 --- a/modules/websocket/wsl_client.cpp +++ b/modules/websocket/wsl_client.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef JAVASCRIPT_ENABLED +#ifndef WEB_ENABLED #include "wsl_client.h" #include "core/config/project_settings.h" @@ -404,4 +404,4 @@ WSLClient::~WSLClient() { disconnect_from_host(); } -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED diff --git a/modules/websocket/wsl_client.h b/modules/websocket/wsl_client.h index 58b867fbe4..5d90bc4034 100644 --- a/modules/websocket/wsl_client.h +++ b/modules/websocket/wsl_client.h @@ -31,7 +31,7 @@ #ifndef WSL_CLIENT_H #define WSL_CLIENT_H -#ifndef JAVASCRIPT_ENABLED +#ifndef WEB_ENABLED #include "core/error/error_list.h" #include "core/io/stream_peer_ssl.h" @@ -86,6 +86,6 @@ public: ~WSLClient(); }; -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED #endif // WSL_CLIENT_H diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 15df4d039c..97bd87a526 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef JAVASCRIPT_ENABLED +#ifndef WEB_ENABLED #include "wsl_peer.h" @@ -348,4 +348,4 @@ WSLPeer::~WSLPeer() { _data = nullptr; } -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED diff --git a/modules/websocket/wsl_peer.h b/modules/websocket/wsl_peer.h index aabd3fd43e..92672eb2c4 100644 --- a/modules/websocket/wsl_peer.h +++ b/modules/websocket/wsl_peer.h @@ -31,7 +31,7 @@ #ifndef WSL_PEER_H #define WSL_PEER_H -#ifndef JAVASCRIPT_ENABLED +#ifndef WEB_ENABLED #include "core/error/error_list.h" #include "core/io/packet_peer.h" @@ -110,6 +110,6 @@ public: ~WSLPeer(); }; -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED #endif // WSL_PEER_H diff --git a/modules/websocket/wsl_server.cpp b/modules/websocket/wsl_server.cpp index 517b9643f8..7457ac7087 100644 --- a/modules/websocket/wsl_server.cpp +++ b/modules/websocket/wsl_server.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef JAVASCRIPT_ENABLED +#ifndef WEB_ENABLED #include "wsl_server.h" #include "core/config/project_settings.h" @@ -326,4 +326,4 @@ WSLServer::~WSLServer() { stop(); } -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED diff --git a/modules/websocket/wsl_server.h b/modules/websocket/wsl_server.h index ec7567c732..b0b7a6a5c9 100644 --- a/modules/websocket/wsl_server.h +++ b/modules/websocket/wsl_server.h @@ -31,7 +31,7 @@ #ifndef WSL_SERVER_H #define WSL_SERVER_H -#ifndef JAVASCRIPT_ENABLED +#ifndef WEB_ENABLED #include "websocket_server.h" #include "wsl_peer.h" @@ -93,6 +93,6 @@ public: ~WSLServer(); }; -#endif // JAVASCRIPT_ENABLED +#endif // WEB_ENABLED #endif // WSL_SERVER_H |