Add comprehensive startup script validation and enhanced pet system
- Enhanced start_petbot.sh with extensive validation and error checking - Added emoji support to pet species system with database migration - Expanded pet species from 9 to 33 unique pets with balanced spawn rates - Improved database integrity validation and orphaned pet detection - Added comprehensive pre-startup testing and configuration validation - Enhanced locations with diverse species spawning across all areas - Added dual-type pets and rarity-based spawn distribution - Improved startup information display with feature overview - Added background monitoring and validation systems 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
add7731d80
commit
fca0423c84
8 changed files with 640 additions and 81 deletions
22
webserver.py
22
webserver.py
|
|
@ -2222,7 +2222,9 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
async with aiosqlite.connect(database.db_path) as db:
|
||||
# Get all pet species with evolution information (no duplicates)
|
||||
cursor = await db.execute("""
|
||||
SELECT DISTINCT ps.*,
|
||||
SELECT DISTINCT ps.id, ps.name, ps.type1, ps.type2, ps.base_hp, ps.base_attack,
|
||||
ps.base_defense, ps.base_speed, ps.evolution_level, ps.evolution_species_id,
|
||||
ps.rarity, ps.emoji,
|
||||
evolve_to.name as evolves_to_name,
|
||||
(SELECT COUNT(*) FROM location_spawns ls WHERE ls.species_id = ps.id) as location_count
|
||||
FROM pet_species ps
|
||||
|
|
@ -2237,8 +2239,8 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
'id': row[0], 'name': row[1], 'type1': row[2], 'type2': row[3],
|
||||
'base_hp': row[4], 'base_attack': row[5], 'base_defense': row[6],
|
||||
'base_speed': row[7], 'evolution_level': row[8],
|
||||
'evolution_species_id': row[9], 'rarity': row[10],
|
||||
'evolves_to_name': row[11], 'location_count': row[12]
|
||||
'evolution_species_id': row[9], 'rarity': row[10], 'emoji': row[11],
|
||||
'evolves_to_name': row[12], 'location_count': row[13]
|
||||
}
|
||||
pets.append(pet_dict)
|
||||
|
||||
|
|
@ -2359,7 +2361,7 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
petdex_html += f"""
|
||||
<div class="pet-card" style="border-left: 4px solid {rarity_color};">
|
||||
<div class="pet-header">
|
||||
<h3 style="color: {rarity_color};">{pet['name']}</h3>
|
||||
<h3 style="color: {rarity_color};">{pet.get('emoji', '🐾')} {pet['name']}</h3>
|
||||
<span class="type-badge">{type_str}</span>
|
||||
</div>
|
||||
<div class="pet-stats">
|
||||
|
|
@ -2478,7 +2480,7 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
|
||||
# Get player pets
|
||||
cursor = await db.execute("""
|
||||
SELECT p.*, ps.name as species_name, ps.type1, ps.type2
|
||||
SELECT p.*, ps.name as species_name, ps.type1, ps.type2, ps.emoji
|
||||
FROM pets p
|
||||
JOIN pet_species ps ON p.species_id = ps.id
|
||||
WHERE p.player_id = ?
|
||||
|
|
@ -2493,7 +2495,8 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
'hp': row[6], 'max_hp': row[7], 'attack': row[8],
|
||||
'defense': row[9], 'speed': row[10], 'happiness': row[11],
|
||||
'caught_at': row[12], 'is_active': bool(row[13]), # Convert to proper boolean
|
||||
'team_order': row[14], 'species_name': row[15], 'type1': row[16], 'type2': row[17]
|
||||
'team_order': row[14], 'species_name': row[15], 'type1': row[16], 'type2': row[17],
|
||||
'emoji': row[18] if row[18] else '🐾' # Add emoji support
|
||||
}
|
||||
pets.append(pet_dict)
|
||||
|
||||
|
|
@ -2717,7 +2720,7 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
pets_html += f"""
|
||||
<tr>
|
||||
<td class="{status_class}">{status}</td>
|
||||
<td><strong>{name}</strong></td>
|
||||
<td><strong>{pet.get('emoji', '🐾')} {name}</strong></td>
|
||||
<td>{pet['species_name']}</td>
|
||||
<td><span class="type-badge">{type_str}</span></td>
|
||||
<td>{pet['level']}</td>
|
||||
|
|
@ -3456,6 +3459,9 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
if pet['type2']:
|
||||
type_str += f"/{pet['type2']}"
|
||||
|
||||
# Get emoji for the pet species
|
||||
emoji = pet.get('emoji', '🐾') # Default to paw emoji if none specified
|
||||
|
||||
# Debug logging
|
||||
print(f"Making pet card for {name} (ID: {pet['id']}): is_active={pet['is_active']}, passed_is_active={is_active}, status_class={status_class}, team_order={pet.get('team_order', 'None')}")
|
||||
|
||||
|
|
@ -3466,7 +3472,7 @@ class PetBotRequestHandler(BaseHTTPRequestHandler):
|
|||
return f"""
|
||||
<div class="pet-card {status_class}" draggable="true" data-pet-id="{pet['id']}" data-active="{str(is_active).lower()}" data-team-order="{pet.get('team_order', '')}">
|
||||
<div class="pet-header">
|
||||
<h4 class="pet-name">{name}</h4>
|
||||
<h4 class="pet-name">{emoji} {name}</h4>
|
||||
<div class="status-badge">{status}</div>
|
||||
</div>
|
||||
<div class="pet-species">Level {pet['level']} {pet['species_name']}</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue