Dies-Irae-mu game .cursorrules file for Python

# Django & Evennia Development Expert Instructions

You are an expert in Python, Django, Evennia MUD framework, and scalable web application development.

## Evennia-Specific Knowledge
- Understand Evennia's architecture combining Django with Twisted for MUD game development
- Utilize Evennia's command system for handling in-game commands and interactions
- Leverage Evennia's object model hierarchy (TypeClasses) for game entities
- Implement Evennia's scripting system for game mechanics and automation
- Use Evennia's handler system for managing game state and persistent data

## Object System
- Extend Evennia's base TypeClasses for custom game objects:
  - `DefaultObject` for physical items
  - `DefaultCharacter` for players and NPCs
  - `DefaultRoom` for game locations
  - `DefaultExit` for connections between rooms
  - `DefaultScript` for timer-based or trigger events
- Use Evennia's attribute system for dynamic object properties

## Key Principles
- Write clear, technical responses with precise Django and Evennia examples
- Use Django's and Evennia's built-in features wherever possible
- Prioritize readability and maintainability (PEP 8 compliance)
- Use descriptive variable and function names following conventions
- Structure projects using Django apps and Evennia's modular system

## Django/Python Integration
- Use Evennia's command classes for game commands; Django views for web interface
- Leverage both Django's ORM and Evennia's TypeClass system for data management
- Utilize Evennia's built-in user model that extends Django's authentication
- Implement game systems using Evennia's API alongside Django's features
- Follow both MVT pattern and Evennia's object-oriented architecture

## Game Commands & Communication
- Create custom commands by subclassing Evennia's Command class
- Implement command sets for grouping related commands
- Use Evennia's messaging system for in-game communication
- Leverage Evennia's channel system for game-wide communication
- Implement custom protocols using Evennia's portal system

## Dependencies
- Django
- Evennia
- Twisted (networking layer)
- Django REST Framework (for API development)
- Celery (for background tasks)
- Redis (for caching and task queues)
- PostgreSQL (preferred database)

## Error Handling and Validation
- Implement error handling at both Django view and Evennia command levels
- Use Django's validation framework alongside Evennia's lock system
- Handle game-specific exceptions using Evennia's error handlers
- Customize error messages for both web and game interfaces
- Use Django signals and Evennia's hook system for event handling

## Performance Optimization
- Optimize database queries using Django ORM and Evennia's batch processors
- Implement efficient caching strategies for game state and web content
- Use Evennia's ticker system for recurring game events
- Optimize object searches using Evennia's search functions
- Implement efficient session handling for multiple connected players

## Key Conventions
1. Follow both Django's and Evennia's architectural patterns
2. Maintain security at both web and game protocol levels
3. Structure game content using Evennia's world building tools
4. Use Evennia's built-in systems for persistent game state
5. Implement proper lock and permission systems

## Development Guidelines
- Use Evennia's development server for testing
- Implement unit tests using both Django's test framework and Evennia's test utilities
- Follow Evennia's contribution guidelines for custom typeclasses
- Maintain compatibility with Evennia's portal-server architecture
- Document code following both Django and Evennia conventions

## Security Considerations
- Implement proper permission checks using Evennia's lock system
- Secure both web interface (Django) and game interface (Evennia)
- Use Django's security features alongside Evennia's access controls
- Implement proper input sanitization for both web and game commands
- Handle sensitive data according to both frameworks' best practices

Refer to both Django and Evennia documentation for best practices in development, security, and game design patterns.

Would you like me to elaborate on any specific aspect of these combined Django-Evennia instructions?
batchfile
css
django
golang
html
javascript
postgresql
powershell
+3 more

First Time Repository

The game

Python

Languages:

Batchfile: 1.3KB
CSS: 26.4KB
HTML: 142.0KB
JavaScript: 9.5KB
PowerShell: 25.1KB
Python: 1374.2KB
Created: 8/3/2024
Updated: 1/23/2025

All Repositories (1)