How multimc/launcher works
Project’s Main Components
• Launcher Core: This is the heart of the application (files in the “launcher” directory, including Application.cpp, Commandline.cpp, and the overall task and update management code). It coordinates startup routines, instance management, and overall orchestration.
• User Interface (UI): Extensive UI modules (in launcher/ui, launcher/ui/dialogs, launcher/ui/pages, etc.) manage the graphical interface, dialogs, settings views, and dynamic page components.
• Authentication & Account Management: Inside “launcher/minecraft/auth” and its subdirectories, the code implements multiple authentication flows (including Microsoft Account integration) and related account tasks.
• Mod and Pack Platforms: The “launcher/modplatform” directory shows integration with different mod/platform formats (e.g. Modrinth, Technic, ATLauncher, etc.), implying plugins or adapters that let the launcher support various community formats.
• Networking/Update Modules: Several parts (in “launcher/net” and “launcher/updater”) handle downloads, file and meta cache management, and update checking mechanisms; these modules coordinate with external services.
• Build and Configuration: The “buildconfig”, “cmake”, and other files such as CMakeLists.txt control the build process, indicating a multi-platform build system.
Relationships and Interactions
• The Launcher Core interacts directly with the UI modules to render windows/dialogs and also coordinates with the Minecraft-specific modules for launching games.
• Authentication and account management services are integrated as part of the instance‐startup and login flows, connecting the launcher core with external platforms (such as Microsoft’s identity platform).
• Networking, download tasks, and update checks work in tandem with the core to keep the launcher and its related assets (e.g., mod platforms, versions) up-to-date.
• The Mod/Pack platforms are used by both the UI (for instance pages) and the core task system, meaning that the launcher must abstract different mod standards and install protocols.
Architectural Patterns and Design Principles
• Modularity and Separation of Concerns: The project is clearly partitioned—UI vs. core launcher vs. Minecraft-specific functionality vs. mod management.
• Task and Update Controller Patterns: The launcher makes heavy use of task management (sequential tasks, instance tasks) to sequentially and asynchronously handle various operations.
• Build Abstraction: The usage of CMake and clearly separated build configurations supports cross-platform development.
Including Specific Technologies and Tools
• C++: The code is primarily written in C++.
• CMake: Used extensively for build configuration.
• Java: Found in parts (like launcher/java and libraries/launcher/org/multimc) for portions of Minecraft interaction (likely bridging between Java components and native code).
• Specialized libraries: Such as hoedown for markdown processing, tomlc99 for configuration parsing, and various other libraries (javacheck, iconfix, etc.) are included to facilitate non-core operations.
• Avoid oversimplification—capturing as many modules as feasible is best. For instance, even though “launcher/updater” and “launcher/net” might be subparts, they are critical for understanding update routines and network interactions.