The leaked server files from 2012 are unstable by modern standards. A better, though harder, path is to contribute to or use an open-source emulator written in C++ or C# (similar to how WoW has TrinityCore). Projects like OpenTO (if active) reverse-engineer the network protocol.
Benefits of emulators:
Drawbacks:
If you are a programmer, capturing packets from the official client to write your own emulator is the ultimate DIY project.
.sql files from your server repack in the correct order (usually 1_account.sql, then 2_characters.sql).Handles game logic: