Merc checklist for MUDs
This checklist provides a technical roadmap for preparing a Merc-based MUD for production, focusing on modernizing legacy C code, ensuring data integrity, and stabilizing the server environment.

Modern Compiler Compatibility
0/5Fix Implicit Declarations
criticalEnsure all functions in merc.h are properly prototyped to avoid implicit-function-declaration errors in GCC 10+.
Update Makefile Linkage
criticalVerify the Makefile includes -lcrypt and -lz if using MCCP or standard password hashing on modern Linux distributions.
64-bit Pointer Safety
criticalAudit casts between pointers and integers (e.g., long vs int) to ensure compatibility with 64-bit architectures.
Enable Warning Flags
recommendedAdd -Wall and -Wextra to CFLAGS and resolve all warnings to prevent undefined behavior in the game loop.
Standardize Header Includes
recommendedReplace outdated system headers in comm.c and db.c with modern equivalents (e.g., time.h, stdlib.h, unistd.h).
Memory and Stability
0/5Valgrind Memory Audit
criticalRun the binary through Valgrind for at least 30 minutes of active play to identify leaks in the recycle.c or memory allocation routines.
Buffer Overflow Audit
criticalScan comm.c and act_wiz.c for strcpy and strcat usage; replace with strncpy or strlcpy to prevent stack-based overflows.
Signal Handler Verification
criticalConfirm that SIGTERM and SIGINT triggers a clean shutdown sequence that saves all online player files.
String Space Monitoring
recommendedVerify that the MAX_STRING limit in merc.h is sufficient for the loaded area files and current player count.
Infinite Loop Protection
recommendedCheck the 'while' loops in the command parser and mob AI for exit conditions to prevent CPU lockups.
Data and Area Integrity
0/5VNUM Range Validation
criticalVerify that no two area files have overlapping VNUM ranges for rooms, mobiles, or objects.
Area File Syntax Check
criticalConfirm that all area files end with the proper '$' or '#$' terminator to prevent boot-time crashes in db.c.
Player File Persistence
criticalTest the save_char_obj function by forcefully disconnecting a client and verifying the .plr file integrity.
Limbo.are Verification
recommendedEnsure room 2 (Limbo) and room 1200 (Chat Room) exist and are accessible, as hardcoded logic often refers to these.
Help File Coverage
recommendedConfirm that mandatory help entries for 'greeting', 'motd', and 'rules' are present in help.are.
Networking and Security
0/5Port Binding Verification
criticalEnsure the MUD binds correctly to the target port (default 4000) and handles 'Address already in use' errors gracefully.
Descriptor Leak Test
criticalVerify that the close_socket function properly decrements the descriptor count and frees memory on disconnect.
IP Logging Implementation
recommendedConfirm that log_string captures the IP address of every connection attempt for security auditing.
Ban System Persistence
recommendedTest the 'ban' command and verify that banned IP addresses are saved to a file and reloaded on reboot.
Telnet Protocol Handling
optionalValidate that the MUD correctly ignores Telnet negotiation sequences to prevent garbage characters in the input buffer.
Administrative Tools
0/5Wiznet/Log Monitoring
recommendedEnable Wiznet to allow immortals to monitor system events, logins, and crashes in real-time.
Automated Backup Script
recommendedImplement a shell script to rsync the 'player' and 'area' directories to a remote location every 24 hours.
Hot-Reboot Implementation
optionalTest the 'copyover' or 'reboot' command to ensure it maintains descriptor connections without dropping players.
Log Rotation
optionalConfigure logrotate for the MUD's stderr/stdout logs to prevent disk space exhaustion.
Staff Level Audit
criticalVerify that the MAX_LEVEL and implementor permissions are correctly assigned in the god/staff files.