Record pathfinding context on flying disconnects
This commit is contained in:
1 parent
0b462f4a76
commit
d4eae5ee5f
5 files changed
+141
-2
No files matched your search
@@ -648,6 +648,29 @@ def start_automation(global_state, initialize=True):
|
||||
else:
|
||||
with reload_lock:
|
||||
bot.tick(g)
|
||||
except OSError as exc:
|
||||
connection = g.get('connection')
|
||||
if (not connection or not connection.connected or
|
||||
isinstance(exc, (BrokenPipeError,
|
||||
ConnectionResetError,
|
||||
ConnectionAbortedError))):
|
||||
next_path = g.path[0] if g.path else None
|
||||
position = (utils.pint(g.pos)
|
||||
if g.get('pos') else None)
|
||||
g.path = []
|
||||
g.movement_status = 'disconnected'
|
||||
print('[movement] connection closed during tick at {}; '
|
||||
'on_ground={}, y_v={:.2f}, next_path={}'.format(
|
||||
position, g.get('on_ground'),
|
||||
g.get('y_v', 0.0), next_path), flush=True)
|
||||
return
|
||||
traceback.print_exc()
|
||||
g.movement_error = traceback.format_exc()
|
||||
g.path = []
|
||||
g.movement_status = 'error'
|
||||
print('[movement] stopped after navigation error',
|
||||
flush=True)
|
||||
return
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
g.movement_error = traceback.format_exc()
|
||||
|
||||
Reference in new issue
Block a user