Commit Graph

69 Commits

Author SHA1 Message Date
3nd3r
a8b4196cf2 Fix auto-rejoin after KICK to rejoin immediately 2025-12-28 23:04:37 -06:00
3nd3r
5e4bbb4309 Update README to reflect current features
- Removed references to removed duck types (concrete, diamond, explosive, etc.)
- Removed references to removed items (sniper rifle, duck radar, etc.)
- Updated to show only 3 duck types: normal, golden, fast
- Documented current commands and features
- Added Recent Updates section
- Cleaned up and organized for clarity
2025-12-28 17:58:01 -06:00
3nd3r
53a66f5202 Update duckhelp to send PM with detailed commands 2025-12-28 17:52:02 -06:00
3nd3r
b71f8f4ec6 Add join and part admin commands for channel management 2025-12-28 17:49:31 -06:00
3nd3r
5db4ce0ab3 Revert to original working code - clean slate
- Start from original code that was known to work
- Will add features back incrementally
- This ensures we know exactly what breaks/works
2025-12-28 17:43:11 -06:00
3nd3r
90b604ba72 Add force_spawn_duck for admin ducklaunch - fixes missing method error 2025-12-28 16:51:26 -06:00
3nd3r
dd06c9377f Revert to simple version: Remove new ducks and items
- Removed new duck types (concrete, diamond, holy_grail, explosive, poisonous, etc.)
- Removed new shop items (sniper rifle, duck radar, bread, splash water, etc.)
- Removed status effects system (eliminated, poisoned, wet, etc.)
- Removed item drops and temporary effects
- Kept only original 3 duck types: normal, golden, fast
- Kept original simple shop
- KEPT BUG FIX: Golden duck XP now awarded on each hit
- KEPT BUG FIX: Message sanitization preserves IRC codes
- Simpler, more stable bot with core improvements
2025-12-28 16:48:56 -06:00
3nd3r
eb907e1e2c Add original/backup code for reference
- Original working code before recent modifications
- Kept for comparison and debugging purposes
- Helps identify what changed and what broke
2025-12-28 16:29:47 -06:00
3nd3r
f6a9f4592a Fix critical bug: Messages being stripped by over-aggressive sanitization
- Bot messages containing IRC color codes were being completely stripped
- sanitize_user_input() without allowed_chars was removing all formatting
- Changed to only remove CR/LF from messages while preserving formatting codes
- This was causing silent failures where no messages were sent to channel
2025-12-28 16:03:42 -06:00
3nd3r
6069240553 Fix critical bug: Award XP on multi-HP duck hits
- Fixed issue where players weren't getting XP when hitting (but not killing) multi-HP ducks
- XP was calculated but never added to player's total
- This bug could cause bot failures with new multi-HP duck types
- Now properly awards XP on each hit and saves to database
2025-12-28 16:00:40 -06:00
3nd3r
f3f251a391 Add explicit error replies for core commands 2025-12-28 15:49:07 -06:00
3nd3r
3e7436840e Fix: remove blocking sleep, unreachable code, and unused admin helper 2025-12-28 15:40:59 -06:00
3nd3r
9bd51a24cc Accept leading-whitespace commands; log spawn send failures 2025-12-28 15:33:17 -06:00
3nd3r
d5654e9783 Normalize channel names for join tracking and commands 2025-12-28 15:30:17 -06:00
3nd3r
ba9beae82f Harden temporary effect parsing to prevent silent command failures 2025-12-28 15:24:46 -06:00
3nd3r
7d85f83faa Fix JOIN parsing for trailing channel and rejoin success handling 2025-12-28 15:19:49 -06:00
3nd3r
02c055d7e3 Log IRC join failures and confirm joins 2025-12-28 15:12:30 -06:00
3nd3r
617d9560e6 Restrict PM spawns to normal/fast/golden 2025-12-28 14:34:14 -06:00
3nd3r
3b72a853ae Allow ducklaunch for new duck types 2025-12-28 14:31:45 -06:00
3nd3r
ffe8bdfaf2 Update README for new duck types and items 2025-12-28 13:50:08 -06:00
3nd3r
b256b9a9f6 Add new duck types and items 2025-12-28 13:36:41 -06:00
3nd3r
4d17ae8f04 Prepare for GitHub release 2025-12-28 13:16:55 -06:00
f8c46980de Update auto-rejoin settings for more persistent reconnection
- Reduced retry interval from 30 to 20 seconds for faster rejoins
- Increased max rejoin attempts from 10 to 100 for greater persistence
- Bot will now be more aggressive about staying in channels
2025-10-05 19:39:00 +01:00
b5613f20dd Add automatic channel rejoin functionality
- Added auto_rejoin configuration to connection settings
- Handles KICK events and automatically schedules rejoin attempts
- Configurable retry interval and max attempts
- Tracks rejoin attempts per channel with exponential backoff
- Handles JOIN confirmations to stop rejoin loops
- Proper cleanup of rejoin tasks on shutdown
- Respects shutdown and connection state before rejoining
- Logs all rejoin attempts and results for debugging
2025-10-05 19:34:49 +01:00
0176284012 Add comprehensive .gitignore
- Ignore Python __pycache__ directories and .pyc files
- Ignore logs/ directory and all .log files
- Ignore temporary and backup files
- Ignore IDE and OS generated files
- Remove tracked __pycache__ files from repository
2025-10-05 19:23:53 +01:00
857a15b666 Delete duckhunt.log 2025-10-05 18:22:54 +00:00
489989001c Delete logs/duckhunt.log 2025-10-05 18:22:40 +00:00
b39c82c84b Delete __pycache__/duckhunt.cpython-312.pyc 2025-10-05 18:22:24 +00:00
0a27f7272e hmm 2025-10-05 19:19:18 +01:00
85fa8a9170 Fix database corruption handling and auto-creation
- Added datetime import to fix NameError
- Simplified database handling to create new file if missing or corrupted
- Removed backup functionality per user request
- Fixed duplicate method definitions
- Enhanced error handling throughout database operations
- Auto-creates duckhunt.json with proper structure on startup
2025-10-05 19:18:46 +01:00
00e129d2f3 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
2025-10-03 20:14:38 +01:00
470edb4401 Add give command and rearm all functionality 2025-10-02 01:01:00 +01:00
a17bba215d Update player data with retroactive XP adjustments
- Adjusted XP values for players with recorded misses
- Applied -1 XP per miss to maintain consistency with new mechanic
- Players with 0 XP remain at 0 (no negative XP allowed)
2025-10-01 20:32:33 +01:00
687a57f018 Add XP loss for missing ducks
- Players now lose 1 XP when missing a duck
- Updated miss message to show XP loss
- XP cannot go below 0
2025-10-01 20:27:12 +01:00
7aded2ed83 Implement duck item drop system and remove all emojis
Duck Item Drop System:
- Added configurable drop rates per duck type (15%/25%/50%)
- Created weighted drop tables for different items
- Normal ducks: basic items (bullets, magazines, gun brush, sand)
- Fast ducks: useful items including bucket of water
- Golden ducks: rare items (bread, insurance, gun buyback, dry clothes)
- Items automatically added to player inventory
- Added drop notification messages for each duck type
- Integrated seamlessly with existing combat mechanics

Emoji Removal:
- Removed all emojis from source code files
- Updated logging system to use clean text prefixes
- Replaced trophy/medal emojis with #1/#2/#3 rankings
- Updated README.md to remove all emojis
- Professional clean appearance throughout codebase
2025-09-26 19:59:34 +01:00
5ed2f0fce6 Fix duckstats and rearm targeting issues
- Added target support to duckstats command (duckstats username)
- Disabled problematic channel membership validation for admin commands
- Activity validation is sufficient - if player exists and has game activity, allow targeting
- Fixes persistent not currently in channel errors for rearm command
2025-09-26 19:27:29 +01:00
b1b1d4d65f Fix channel validation by saving activity tracking immediately
- Activity tracking now saves to database immediately when commands are processed
- This ensures validate_target_player can see recent activity for channel membership checks
2025-09-26 19:24:45 +01:00
bf3cd48639 Update database and logs from bot runtime 2025-09-26 19:21:01 +01:00
25226a460b Fix magazine and bullet usage limits
- Fixed bug where players could use magazines beyond their level's maximum limit
- Added validation to prevent using bullets when magazine is already full
- Magazine items now respect level-based limits (e.g., 3 magazines at level 1)
- Items are not consumed from inventory if they can't be used due to limits
- Added proper error messages for when limits are reached
- Updated ShopManager to work with LevelManager for limit validation
2025-09-26 19:13:52 +01:00
f3a9c5b611 Security fixes, UI improvements, and game balance updates
- Fixed critical security vulnerabilities in shop targeting system
- Fixed admin authentication bypass issues
- Fixed auto-rearm feature config path (duck_spawning.rearm_on_duck_shot)
- Updated duck spawn timing to 20-60 minutes for better game balance
- Enhanced inventory display formatting with proper spacing
- Added comprehensive admin security documentation
2025-09-26 19:06:26 +01:00
5484548c30 yeah 2025-09-25 19:47:44 +01:00
eb041477dc Add comprehensive documentation and fix authentication config paths
- Add detailed README.md with installation, usage, and development guide
- Add CONFIG.md with complete configuration documentation
- Update connection and SASL authentication to use nested config paths
- Fix server password and SASL username/password config access
- Add config validation test script (test_config.py)
- Clean up config.json (removed invalid JSON comments)
- Improve error handling for config arrays and null values
2025-09-24 20:33:23 +01:00
74f3afdf4b Restructure config.json with nested hierarchy and dot notation access
- Reorganized config.json into logical sections: connection, duck_spawning, duck_types, player_defaults, gameplay, features, limits
- Enhanced get_config() method to support dot notation (e.g., 'duck_types.normal.xp')
- Added comprehensive configurable parameters for all game mechanics
- Updated player creation to use configurable starting values
- Added individual timeout settings per duck type
- Made XP rewards, accuracy mechanics, and game limits fully configurable
- Fixed syntax errors in duck_spawn_loop function
2025-09-24 20:26:49 +01:00
6ca624bd2f Add hidden duck types: Normal, Golden, and Fast ducks
Features:
- Three duck types spawn randomly with configurable chances
- All duck types use same spawn message - type is hidden until shot/timeout
- Golden ducks: 3-5 HP, 15 XP base, reveal type when hit but still alive
- Fast ducks: 1 HP, 12 XP, fly away in 30s instead of 60s
- Normal ducks: 1 HP, 10 XP, standard 60s timeout

Configuration options:
- golden_duck_chance: 0.15 (15% spawn rate)
- fast_duck_chance: 0.25 (25% spawn rate)
- golden_duck_xp: 15, golden_duck_min/max_hp: 3-5
- fast_duck_xp: 12, fast_duck_timeout: 30s

Duck type is revealed when:
- Shot (different messages for each type)
- Flies away (type-specific fly away messages)
- Golden ducks reveal immediately when hit (before death)

Maintains backward compatibility with existing game mechanics.
2025-09-24 16:35:45 +01:00
f9883758f3 Add configurable auto-rearm feature when duck is shot/befriended
- Add 'rearm_on_duck_shot' config option (defaults to true)
- Automatically rearm all disarmed players when any duck is successfully shot
- Also applies when ducks are successfully befriended
- Includes error handling and logging for the rearm process
- Improves game flow by reducing downtime for players who made wild shots
2025-09-24 16:03:03 +01:00
688aca759f Fix indentation and duplicate function errors in duckhuntbot.py
- Remove duplicate handle_rearm function definition
- Fix indentation in setup_signal_handlers function
- Add missing handle_disarm method
- Remove duplicate send_message in handle_ducklaunch
- All syntax errors resolved, bot should now start properly
2025-09-24 01:56:18 +01:00
78caccd8b4 Fix ASCII encoding issues and add robust error handling
- Add comprehensive UTF-8 decoding error handling for IRC messages
- Implement robust error handling for all command processing
- Add network connection error resilience
- Add database operation error handling
- Ensure bot doesn't crash on any input or network issues
- Maintain original duck hunt functionality without feature additions
2025-09-24 01:51:24 +01:00
73582f7a44 more fixes 2025-09-23 20:20:53 +01:00
d6e64d5eab more fixes 2025-09-23 20:20:06 +01:00
0c8b4f9543 Implement magazine system and inventory management
- Add level-based magazine system (3 mags at L1, 2 at L3-5, 1 at L6-8)
- Replace ammo/chargers with current_ammo/magazines/bullets_per_magazine
- Add inventory system for storing and using shop items
- Add Magazine item to shop (15 XP, adds 1 magazine)
- Auto-migrate existing players from old ammo system
- Auto-update magazines when players level up
- Fix method name bugs (get_player_level -> calculate_player_level)
2025-09-23 20:13:01 +01:00