Launcher: out-of-game launcher with server selection#59
Merged
Conversation
Brings the windowed CEF launcher (HogwartsMP.exe) onto main and serves its React UI over hmp://app/ by mirroring a remote build (GitHub Pages) into a local cache: fresh when online, last-good when our hosting or the network is down. Fonts ship next to the exe under files/data and serve from hmp://app/local/ (MafiaMP convention), so there's no Google Fonts dependency. The frameless offline placeholder carries its own drag strip and close button.
One exe now does both the UI and the launch: code/launcher is folded into HogwartsMPLauncher (renamed from HogwartsMP) and deleted. On connect the UI writes connect.json, arms a launch, and closes; after CefShutdown() main() fetches the avatar pak, injects HogwartsMPClient.dll, and starts the game. Entry is main() not wWinMain — FrameworkLoader forces /ENTRY:mainCRTStartup (+ /SUBSYSTEM:windows, so no console) — and CEF children self-reexec this app so the hmp:// scheme + render-side router stay consistent.
The pre-launch launcher writes connect.json next to the client DLL; read it on the way through the Menu state and go straight to SessionConnection, skipping the manual prompt (kept as the fallback for direct dev injection). Consume the file so a disconnect -> menu doesn't reconnect-loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a standalone windowed launcher (HogwartsMPLauncher.exe) that takes server selection out of the game and into a pre-launch step: browse/pick a server in a native CEF UI, and the launcher then injects the client and the game auto-connects — no in-game host/port entry.
A windowed CEF host that serves a React/TS UI over a custom secure hmp://app/ scheme. The UI is not bundled in the exe — it's fetched from a remote (GitHub Pages) into a local cache: fresh when online, last-good from cache when the network or our host is down, with a baked-in offline page (its own drag bar + close button, since the window is frameless). Fonts (Cinzel/Spectral) ship locally under files/data/ and serve from hmp://app/local/. Dev overrides: HOGWARTSMP_LAUNCHER_REMOTE (mirror a local server) / HOGWARTSMP_LAUNCHER_URL (Vite dev server).
Collapses the old two-exe model (UI exe spawns a separate injector) rites connect.json, arms a launch, and closes; then main() — afterCEF fully tears down — fetches the avatar pak and injects HogwartsMPClient.dll (a Steam relaunch + injection can't share the process with a live CEF message loop). The old standalone code/launcher injector is removed/absorbed. Notable: entry is main() not wWinMain (FrameworkLoader forces /ENTRY:mainCRTStartup, still windowed/no-console), and CEF children self-reexec this app so the custom scheme stays consistent. The injected client reads connect.json from its own module dir on the way through the Menu state and goes straight to connection, skipping the in-game prompt (kept as the fallback for direct dev injection). The file is consumed so a disconnect → menu doesn't reconnect-loop.
Net UX: run HogwartsMPLauncher.exe → pick a server → game launches, injects, auto-connects.