Implement comprehensive team management and fix critical bugs

Team Management Features:
- Added 6 new IRC commands: \!teamlist, \!activeteam, \!teamname, \!teamswap, \!heal, \!verifyteamswap
- \!teamlist shows teams with pet names in format "Team name - pet1 - pet2 - pet3"
- \!teamname redirects to web interface for secure PIN-based renaming
- \!teamswap enables team switching with PIN verification via IRC
- \!activeteam displays current team with health status indicators
- \!heal command with 1-hour cooldown for pet health restoration

Critical Bug Fixes:
- Fixed \!teamlist SQL binding error - handled new team data format correctly
- Fixed \!wild command duplicates - now shows unique species types only
- Removed all debug print statements and implemented proper logging
- Fixed data format inconsistencies in team management system

Production Improvements:
- Added logging infrastructure to BaseModule and core components
- Converted 45+ print statements to professional logging calls
- Database query optimization with DISTINCT for spawn deduplication
- Enhanced error handling and user feedback messages

Cross-platform Integration:
- Seamless sync between IRC commands and web interface
- PIN authentication leverages existing secure infrastructure
- Team operations maintain consistency across all interfaces

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
megaproxy 2025-08-01 15:53:26 +00:00
parent e920503dbd
commit e17705dc63
10 changed files with 2012 additions and 384 deletions

View file

@ -15,7 +15,7 @@ class NPCEventsModule(BaseModule):
self.events_manager = NPCEventsManager(database)
def get_commands(self):
return ['events', 'event', 'help', 'contribute', 'eventhelp']
return ['events', 'event', 'contribute', 'eventhelp']
async def handle_command(self, command, channel, nickname, args):
"""Handle NPC events commands"""
@ -27,8 +27,6 @@ class NPCEventsModule(BaseModule):
await self.cmd_events(channel, nickname)
elif command == 'event':
await self.cmd_event(channel, nickname, args)
elif command == 'help' and len(args) > 0 and args[0].lower() == 'events':
await self.cmd_event_help(channel, nickname)
elif command == 'contribute':
await self.cmd_contribute(channel, nickname, args)
elif command == 'eventhelp':
@ -74,7 +72,7 @@ class NPCEventsModule(BaseModule):
self.send_message(channel, message)
except Exception as e:
print(f"Error in cmd_events: {e}")
self.logger.error(f"Error in cmd_events: {e}")
self.send_message(channel, f"❌ Error fetching events: {str(e)}")
async def cmd_event(self, channel, nickname, args):
@ -132,7 +130,7 @@ class NPCEventsModule(BaseModule):
except ValueError:
self.send_message(channel, "❌ Invalid event ID. Please use a number.")
except Exception as e:
print(f"Error in cmd_event: {e}")
self.logger.error(f"Error in cmd_event: {e}")
self.send_message(channel, f"❌ Error fetching event details: {str(e)}")
async def cmd_contribute(self, channel, nickname, args):
@ -200,7 +198,7 @@ class NPCEventsModule(BaseModule):
except ValueError:
self.send_message(channel, "❌ Invalid event ID. Please use a number.")
except Exception as e:
print(f"Error in cmd_contribute: {e}")
self.logger.error(f"Error in cmd_contribute: {e}")
self.send_message(channel, f"❌ Error contributing to event: {str(e)}")
async def cmd_event_help(self, channel, nickname):