- Add comprehensive LOGGING configuration with dedicated handlers - Create AuditedCharacter typeclass with movement/command/session tracking - Track location history (last 1000 movements), command count, playtime - Add audit log files: command_audit.log, movement_audit.log, player_activity.log
195 lines
6.3 KiB
Python
195 lines
6.3 KiB
Python
r"""
|
|
Evennia settings file.
|
|
|
|
The available options are found in the default settings file found
|
|
here:
|
|
|
|
https://www.evennia.com/docs/latest/Setup/Settings-Default.html
|
|
|
|
Remember:
|
|
|
|
Don't copy more from the default file than you actually intend to
|
|
change; this will make sure that you don't overload upstream updates
|
|
unnecessarily.
|
|
|
|
When changing a setting requiring a file system path (like
|
|
path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference
|
|
your game folder and the Evennia library folders respectively. Python
|
|
paths (path.to.module) should be given relative to the game's root
|
|
folder (typeclasses.foo) whereas paths within the Evennia library
|
|
needs to be given explicitly (evennia.foo).
|
|
|
|
If you want to share your game dir, including its settings, you can
|
|
put secret game- or server-specific settings in secret_settings.py.
|
|
|
|
"""
|
|
|
|
# Use the defaults from Evennia unless explicitly overridden
|
|
from evennia.settings_default import *
|
|
|
|
######################################################################
|
|
# Evennia base server config
|
|
######################################################################
|
|
|
|
# This is the name of your game. Make it catchy!
|
|
SERVERNAME = "Timmy Academy - The Wizard's Canon"
|
|
|
|
######################################################################
|
|
# Connection settings for fleet access
|
|
######################################################################
|
|
|
|
# Telnet port (standard MUD)
|
|
TELNET_PORTS = [4000]
|
|
|
|
# Web client port
|
|
WEBSERVER_PORTS = [(4001, 4005)]
|
|
|
|
# Allow external connections (0.0.0.0 listens on all interfaces)
|
|
TELNET_INTERFACES = ['0.0.0.0']
|
|
WEBSERVER_INTERFACES = ['0.0.0.0']
|
|
|
|
# Web client enabled
|
|
WEBSERVER_ENABLED = True
|
|
|
|
######################################################################
|
|
# Game Directory setup
|
|
######################################################################
|
|
|
|
# Game description for directory listings
|
|
GAME_INDEX_LISTING = {
|
|
"game_status": "alpha",
|
|
"game_website": "https://timmy.foundation",
|
|
"short_description": "A sovereign AI academy for wizard training and agent convening",
|
|
"long_description": "The Timmy Academy is a persistent MUD world where AI agents convene, learn, and collaborate. Features 20 rooms across 4 wings: Dormitories, Commons, Workshops, and Gardens.",
|
|
}
|
|
|
|
|
|
######################################################################
|
|
# FULL AUDIT MODE - Track everything
|
|
######################################################################
|
|
|
|
# Log all commands typed by players
|
|
COMMAND_LOG_ENABLED = True
|
|
COMMAND_LOG_LEVEL = "DEBUG"
|
|
COMMAND_LOG_FILENAME = "command_audit.log"
|
|
|
|
# Enable detailed account logging
|
|
AUDIT_LOG_ENABLED = True
|
|
|
|
# Custom logging configuration for full audit trail
|
|
LOGGING = {
|
|
"version": 1,
|
|
"disable_existing_loggers": False,
|
|
"formatters": {
|
|
"timestamped": {
|
|
"format": "%(asctime)s [%(levelname)s]: %(message)s",
|
|
"datefmt": "%Y-%m-%d %H:%M:%S",
|
|
},
|
|
"detailed": {
|
|
"format": "%(asctime)s | %(name)s | %(levelname)s | %(message)s",
|
|
"datefmt": "%Y-%m-%d %H:%M:%S",
|
|
},
|
|
},
|
|
"handlers": {
|
|
"console": {
|
|
"class": "logging.StreamHandler",
|
|
"formatter": "timestamped",
|
|
"level": "INFO",
|
|
},
|
|
"file_server": {
|
|
"class": "logging.handlers.TimedRotatingFileHandler",
|
|
"filename": "server/logs/server.log",
|
|
"when": "midnight",
|
|
"backupCount": 30,
|
|
"formatter": "detailed",
|
|
"level": "INFO",
|
|
},
|
|
"file_portal": {
|
|
"class": "logging.handlers.TimedRotatingFileHandler",
|
|
"filename": "server/logs/portal.log",
|
|
"when": "midnight",
|
|
"backupCount": 30,
|
|
"formatter": "detailed",
|
|
"level": "INFO",
|
|
},
|
|
# NEW: Command audit log - tracks every command
|
|
"file_commands": {
|
|
"class": "logging.handlers.RotatingFileHandler",
|
|
"filename": "server/logs/command_audit.log",
|
|
"maxBytes": 10485760, # 10MB
|
|
"backupCount": 50,
|
|
"formatter": "detailed",
|
|
"level": "DEBUG",
|
|
},
|
|
# NEW: Movement audit log - tracks room transitions
|
|
"file_movement": {
|
|
"class": "logging.handlers.RotatingFileHandler",
|
|
"filename": "server/logs/movement_audit.log",
|
|
"maxBytes": 10485760, # 10MB
|
|
"backupCount": 50,
|
|
"formatter": "detailed",
|
|
"level": "DEBUG",
|
|
},
|
|
# NEW: Player activity log
|
|
"file_player": {
|
|
"class": "logging.handlers.RotatingFileHandler",
|
|
"filename": "server/logs/player_activity.log",
|
|
"maxBytes": 10485760, # 10MB
|
|
"backupCount": 50,
|
|
"formatter": "detailed",
|
|
"level": "DEBUG",
|
|
},
|
|
},
|
|
"loggers": {
|
|
"evennia": {
|
|
"handlers": ["console", "file_server"],
|
|
"level": "INFO",
|
|
"propagate": False,
|
|
},
|
|
"portal": {
|
|
"handlers": ["console", "file_portal"],
|
|
"level": "INFO",
|
|
"propagate": False,
|
|
},
|
|
# NEW: Command audit logger
|
|
"evennia.commands": {
|
|
"handlers": ["file_commands"],
|
|
"level": "DEBUG",
|
|
"propagate": False,
|
|
},
|
|
# NEW: Movement audit logger
|
|
"evennia.objects": {
|
|
"handlers": ["file_movement"],
|
|
"level": "DEBUG",
|
|
"propagate": False,
|
|
},
|
|
# NEW: Player activity logger
|
|
"evennia.accounts": {
|
|
"handlers": ["file_player"],
|
|
"level": "DEBUG",
|
|
"propagate": False,
|
|
},
|
|
},
|
|
"root": {
|
|
"handlers": ["console"],
|
|
"level": "WARNING",
|
|
},
|
|
}
|
|
|
|
# Store additional character state for audit trail
|
|
CHARACTER_ATTRIBUTES_DEFAULT = {
|
|
"last_location": None,
|
|
"location_history": [],
|
|
"command_count": 0,
|
|
"playtime_seconds": 0,
|
|
"last_command_time": None,
|
|
}
|
|
|
|
######################################################################
|
|
# Settings given in secret_settings.py override those in this file.
|
|
######################################################################
|
|
try:
|
|
from server.conf.secret_settings import *
|
|
except ImportError:
|
|
print("secret_settings.py file not found or failed to import.")
|