recover on disconnection
This commit is contained in:
parent
f1799183f3
commit
66c5cab5d3
1 changed files with 6 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ For Copyright and License: See LICENSE.md
|
||||||
#region Public Variables
|
#region Public Variables
|
||||||
|
|
||||||
var TOKEN: String
|
var TOKEN: String
|
||||||
var VERBOSE: bool = false
|
var VERBOSE: bool = true
|
||||||
var INTENTS: int = 513
|
var INTENTS: int = 513
|
||||||
|
|
||||||
# Caches
|
# Caches
|
||||||
|
|
@ -676,7 +676,11 @@ func _send_heartbeat() -> void: # Send heartbeat OP code 1
|
||||||
return
|
return
|
||||||
|
|
||||||
var response_payload = {'op': 1, 'd': _last_seq}
|
var response_payload = {'op': 1, 'd': _last_seq}
|
||||||
_send_dict_wss(response_payload)
|
if _client.get_ready_state() == WebSocketPeer.State.STATE_OPEN:
|
||||||
|
_send_dict_wss(response_payload)
|
||||||
|
else:
|
||||||
|
print("Websocket not open, skipping send")
|
||||||
|
login()
|
||||||
_heartbeat_ack_received = false
|
_heartbeat_ack_received = false
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print('Heartbeat sent!')
|
print('Heartbeat sent!')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue