diff options
| author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-09-24 00:58:28 +0200 |
|---|---|---|
| committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-09-24 01:50:37 +0200 |
| commit | 4b92956db7cb479a1c3ee63f102f9866fbbc6fef (patch) | |
| tree | ecf842646ec674185988a4e140fd5f8c6a1b628d /modules/websocket/websocket_client.cpp | |
| parent | 5d91e87c64f757fb1c20f43a0a30db3c73073625 (diff) | |
| download | redot-engine-4b92956db7cb479a1c3ee63f102f9866fbbc6fef.tar.gz | |
Implement WebSocket clean close detection.
Diffstat (limited to 'modules/websocket/websocket_client.cpp')
| -rw-r--r-- | modules/websocket/websocket_client.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/websocket/websocket_client.cpp b/modules/websocket/websocket_client.cpp index 8211a7c361..f9b94dc519 100644 --- a/modules/websocket/websocket_client.cpp +++ b/modules/websocket/websocket_client.cpp @@ -112,12 +112,12 @@ void WebSocketClient::_on_close_request(int p_code, String p_reason) { emit_signal("server_close_request", p_code, p_reason); } -void WebSocketClient::_on_disconnect() { +void WebSocketClient::_on_disconnect(bool p_was_clean) { if (_is_multiplayer) { emit_signal("connection_failed"); } else { - emit_signal("connection_closed"); + emit_signal("connection_closed", p_was_clean); } } @@ -141,6 +141,6 @@ void WebSocketClient::_bind_methods() { ADD_SIGNAL(MethodInfo("data_received")); ADD_SIGNAL(MethodInfo("connection_established", PropertyInfo(Variant::STRING, "protocol"))); ADD_SIGNAL(MethodInfo("server_close_request", PropertyInfo(Variant::INT, "code"), PropertyInfo(Variant::STRING, "reason"))); - ADD_SIGNAL(MethodInfo("connection_closed")); + ADD_SIGNAL(MethodInfo("connection_closed", PropertyInfo(Variant::BOOL, "was_clean_close"))); ADD_SIGNAL(MethodInfo("connection_error")); } |
