From dd546dc5b86e0bb9c397919fd8bfcf8e8460bc38 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 8 May 2018 14:40:08 +0200 Subject: Document websocket module, further document enet --- modules/websocket/doc_classes/WebSocketServer.xml | 109 ++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 modules/websocket/doc_classes/WebSocketServer.xml (limited to 'modules/websocket/doc_classes/WebSocketServer.xml') diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml new file mode 100644 index 000000000..a1061e446 --- /dev/null +++ b/modules/websocket/doc_classes/WebSocketServer.xml @@ -0,0 +1,109 @@ + + + + A WebSocket server implementation + + + 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 NetworkedMultiplayerPeer.poll] it at regular intervals (e.g. inside [method Node._process]). When clients connect, disconnect, or send data, you will receive the appropriate signal. + Note: This class will not work in HTML5 exports due to browser restrictions. + + + + + + + + + + + + + Disconnects the given peer. + + + + + + + + + Returns the IP address of the given peer. + + + + + + + + + Returns the remote port of the given peer. + + + + + + + + + Returns [code]true[/code] if a peer with the given ID is connected. + + + + + + + Returns [code]true[/code] if the server is actively listening on a port. + + + + + + + + + + + + + Start listening on the given port. + You can specify the desired subprotocols via the "protocols" array. If the list empty (default), "binary" will be used. + You can use this server as a network peer for [MultiplayerAPI] by passing true as "gd_mp_api". Note: [signal data_received] will not be fired and clients other than Godot will not work in this case. + + + + + + + Stop the server and clear its state. + + + + + + + + + + + Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client. + + + + + + + Emitted when a client disconnects. + + + + + + + Emitted when a new message is received. Note: This signal is NOT emitted when used as high level multiplayer peer. + + + + + + -- cgit v1.2.3-70-g09d2