$ show MSLTeam/MSL
MSL (Minecraft Server Launcher) is a Windows desktop application for managing Minecraft server instances. It allows users to create, configure, launch, and monitor Java and Bedrock Minecraft servers, including mod/plugin management, server core downloading, world backups, and crash analysis. The application also provides networking capabilities through FRP tunneling (supporting multiple providers like MSLFrp, OpenFrp, SakuraFrp, ChmlFrp, and custom frpc) and P2P/STUN connections for online play. It includes a download manager for concurrent file downloads, a system resource monitor, and a terminal emulator (ConPTY) for server console interaction. The architecture is a monolithic desktop application built with .NET Framework 4.7.2 using WPF and the HandyControl UI library. The UI is composed of pages loaded into a main window, with separate modules for server runner (dashboard, console, settings), FRP management, download manager, and settings. Configuration is stored in JSON files with atomic writes. The application integrates with several external APIs (MSL backend, CurseForge, Modrinth, BMCLAPI, and various FRP provider APIs) via a custom HTTP service. Key entry points include App.xaml.cs (application initialization), MainWindow.xaml.cs (navigation hub), and ServerRunner.xaml.cs (per-server window with child pages). Data flows involve HTTP requests to external APIs, local JSON config files, and process I/O for server and FRP binaries. The application uses a custom ConPTY terminal emulation library for server console I/O and a language system for internationalization. External dependencies include .NET Framework 4.7.2, HandyControl (submodule), Newtonsoft.Json, SharpZipLib, AvalonEdit, CurseForge .NET API client, Modrinth .NET client, QR code library, and ConPtyTermEmulatorLib. The application relies on external services: MSL API (mslmc.cn), CurseForge, Modrinth, BMCLAPI, and various FRP provider APIs.
The LLM identified 7 files worth highlighting for reuse:
Thread-safe configuration writer that uses atomic file operations (write to .tmp, rename to .bak, then to target) to prevent corruption. Includes retry logic and backup restoration. Reusable for any application needing robust JSON config persistence.
Manages download groups with configurable concurrency, progress tracking, pause/resume, SHA256 verification, and fallback mirrors. Uses a producer-consumer pattern with async callbacks. Can be extracted for any application requiring reliable multi-file downloads.
Singleton that collects CPU and memory usage using Windows API (via ManagementObjectSearcher) and notifies subscribers via a callback list. Thread-safe and lazy-initialized. Reusable for any Windows application needing periodic resource monitoring.
Static thread-safe logger with automatic log file rotation (keeps last 5 files). Provides methods for Info, Warning, Error levels. Uses mutex for thread safety. Can be extracted as a standalone logging utility.
Scans all drives for Java installations by looking for specific file patterns and parsing release files. Uses heuristics to identify Java versions and paths. Reusable for any tool that needs to locate Java runtimes on Windows.
Implements X25519 key exchange and XSalsa20-Poly1305 authenticated encryption (PublicKeyBox). Provides key pair generation and encryption/decryption methods. Reusable for secure communication in any .NET application.
Defines reusable custom controls like MagicCard, MagicScrollViewer, ListBoxSideMenu, and behaviors for list box interactions (disable drag selection, side menu collapse). These are used throughout the application and could be extracted as a standalone UI component library.