How gravitlauncher/launcher works
Purpose and topology
A multi-module Java/Gradle launcher platform: it operates a LaunchServer, builds/distributes launcher binaries and game assets, authenticates users, and starts configured client/server processes. Shared protocol, profile, module, and filesystem abstractions separate server and local-launcher concerns.
• settings.gradle.kts
• components/build.gradle.kts
• openapi.yaml
Entry points and deployment
The server process starts through Main, which constructs and runs LaunchServer; launcher-side startup uses a wrapper before entering the runtime engine. The repository includes Docker packaging and CI publication workflows.
• components/launchserver/src/main/java/pro/gravit/launchserver/Main.java
• components/launchserver/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java
• components/launcher-start/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java
Shared contracts and extensibility
launcher-api defines the client/server request-event protocol, client/game profiles, configuration conventions, and lifecycle-based modules. launcher-core supplies API façades, serialization, hashing, launch primitives, and trust/network foundations. Module managers and phase events are the primary extension boundary for both client and server code.
• components/launcher-api/src/main/java/pro/gravit/launcher/base/request/Request.java
• components/launcher-api/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesManager.java
• components/launcher-core/src/main/java/pro/gravit/launcher/core/api/LauncherAPI.java
Network request flow
Launcher clients issue typed requests through request services, principally WebSocket implementations, with offline/HTTP feature alternatives. LaunchServer’s Netty endpoint dispatches these to response handlers for authentication, profiles, updates, security, and management; it also exposes HTTP/file-serving handlers.
• components/launcher-api/src/main/java/pro/gravit/launcher/base/request/websockets/ClientWebSocketService.java
• components/launchserver/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java
• components/launchserver/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java
Identity, authorization, and protection
Server authentication is provider-based: in-memory, SQL-backed MySQL/PostgreSQL, merged, and OpenID implementations are available. Password verifiers, sessions, permissions/features, texture/profile integration, hardware reports, secure-level key verification, and join-server protection are handled behind authentication/protection interfaces. External dependencies can therefore include SQL databases and an OpenID provider.
• components/launchserver/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java
• components/launchserver/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java
• components/launchserver/src/main/java/pro/gravit/launchserver/auth/protect/ProtectHandler.java
Artifact, update, and runtime pipeline
The server maintains profiles and update sources, then composes signed JAR or EXE launcher binaries through an ordered binary pipeline. At runtime, LauncherEngine obtains backend settings/resources, downloads and verifies client content, applies profile-selected options, and creates the client JVM process. VFS abstractions support local, cached, URL, overlay, and encrypted resource layers.
• components/launchserver/src/main/java/pro/gravit/launchserver/binary/BinaryPipeline.java
• components/launcher-runtime/src/main/java/pro/gravit/launcher/runtime/LauncherEngine.java
• components/launcher-runtime/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java>
Trust and operational boundaries
Certificate generation/pinning and key agreement protect launcher/server communication and signed artifacts. Server console commands manage builds, profiles, modules, keys, and service state; deployers configure the process and optional modules rather than changing protocol code.
• components/launcher-core/src/main/java/pro/gravit/launcher/core/CertificatePinningTrustManager.java
• components/launchserver/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java
• components/launchserver/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java
Components 20
Shared Platform
- Launcher API · Requests, profiles, configuration conventions, and module lifecycle contracts.
components/launcher-api/src/main/java/pro/gravit/launcher/base/request/Request.java - Module Manager · Primary client and server extension boundary.
components/launcher-api/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesManager.java - Launcher Core · API façades, serialization, hashing, launch, trust, and network primitives.
components/launcher-core/src/main/java/pro/gravit/launcher/core/api/LauncherAPI.java - Certificate Pinning
components/launcher-core/src/main/java/pro/gravit/launcher/core/CertificatePinningTrustManager.java
LaunchServer
- Server Main
components/launchserver/src/main/java/pro/gravit/launchserver/Main.java - LaunchServer Starter
components/launchserver/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java - Server Configuration · Configures the server process and optional modules.
components/launchserver/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java - Netty Endpoint · Serves WebSocket, HTTP, and files.
components/launchserver/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java - Request Dispatch · Routes authentication, profile, update, security, and management requests.
components/launchserver/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java - Authentication & Protection · Provider-backed identity, sessions, permissions, secure-level checks, and join protection.
components/launchserver/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java - Auth Providers · Supports memory, SQL, merged, and OpenID implementations.
components/launchserver/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java - Protection Handler
components/launchserver/src/main/java/pro/gravit/launchserver/auth/protect/ProtectHandler.java - Certificate Manager · Generates and manages server certificates and keys.
components/launchserver/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java - Binary Pipeline · Builds signed JAR or EXE launcher binaries in ordered stages.
components/launchserver/src/main/java/pro/gravit/launchserver/binary/BinaryPipeline.java
Launcher Client
- Client Wrapper
components/launcher-start/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java - Client WebSocket Service · Typed request transport with offline and HTTP alternatives.
components/launcher-api/src/main/java/pro/gravit/launcher/base/request/websockets/ClientWebSocketService.java - Launcher Engine · Obtains settings and resources, verifies content, and applies profile options.
components/launcher-runtime/src/main/java/pro/gravit/launcher/runtime/LauncherEngine.java - Client JVM Process
External Services
- SQL / OpenID Services · Optional database-backed identity and OpenID provider dependencies.
Other components
- Gradle Multi-Module Build · Assembles the shared, server, and launcher modules.
settings.gradle.kts
Connections 24
- Gradle Multi-Module Build → Launcher API: builds
- Gradle Multi-Module Build → Launcher Core: builds
- Gradle Multi-Module Build → Server Main: packages
- Gradle Multi-Module Build → Client Wrapper: packages
- Launcher API → Module Manager: defines lifecycle
- Launcher Core → Certificate Pinning: provides
- Server Main → LaunchServer Starter: starts
- LaunchServer Starter → Server Configuration: loads
- LaunchServer Starter → Netty Endpoint: runs
- LaunchServer Starter → Module Manager: loads extensions
- Netty Endpoint → Request Dispatch: dispatches requests
- Request Dispatch → Authentication & Protection: auth requests
- Request Dispatch → Binary Pipeline: update artifacts
- Authentication & Protection → Auth Providers: uses
- Authentication & Protection → Protection Handler: enforces
- Auth Providers → SQL / OpenID Services: integrates
- Certificate Manager → Netty Endpoint: secures
- Certificate Pinning → Netty Endpoint: pins trust
- Binary Pipeline → Client Wrapper: distributes launcher
- Client Wrapper → Launcher Engine: enters runtime
- Launcher Engine → Client WebSocket Service: obtains backend settings
- Client WebSocket Service → Netty Endpoint: typed WebSocket requests
- Launcher Engine → Client JVM Process: creates
- Module Manager → Launcher Engine: extends lifecycle