Fix database corruption and enhance duck messages
- Fix missing field errors that caused 'ducks_shot' message format errors - Enhanced _sanitize_player_data to ensure all required fields exist - Added comprehensive field validation and type conversion - Added multiple variations for duck_flies_away messages (normal, fast, golden) - Improved error handling for corrupted/incomplete player data
This commit is contained in:
@@ -1251,7 +1251,7 @@ class DuckHuntBot:
|
||||
except asyncio.TimeoutError:
|
||||
self.logger.warning("Task cancellation timed out")
|
||||
|
||||
# Quick database save
|
||||
# Final database save
|
||||
try:
|
||||
self.db.save_database()
|
||||
self.logger.info("Database saved")
|
||||
@@ -1294,4 +1294,5 @@ class DuckHuntBot:
|
||||
finally:
|
||||
# Ensure writer is cleared regardless of errors
|
||||
self.writer = None
|
||||
self.reader = None
|
||||
self.reader = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user