правки по лаунчеру
This commit is contained in:
@@ -21,17 +21,30 @@ The launcher API base URL is provided via:
|
||||
|
||||
Current integration mode is compile-time:
|
||||
|
||||
- `fvm flutter run -d windows --dart-define=MOONWELL_API_BASE_URL=https://host`
|
||||
- `fvm flutter build windows --dart-define=MOONWELL_API_BASE_URL=https://host`
|
||||
- `flutter run -d windows --dart-define=MOONWELL_API_BASE_URL=https://host`
|
||||
- `flutter build windows --dart-define=MOONWELL_API_BASE_URL=https://host`
|
||||
|
||||
## API Flow
|
||||
|
||||
The launcher uses these endpoints from `openapi.json`:
|
||||
|
||||
1. `POST /api/launcher/login`
|
||||
2. `GET /api/launcher/manifest`
|
||||
3. `GET /api/launcher/download/{path}`
|
||||
4. `GET /api/launcher/news`
|
||||
2. `POST /api/launcher/register`
|
||||
3. `GET /api/launcher/manifest`
|
||||
4. `GET /api/launcher/download/{path}`
|
||||
5. `GET /api/launcher/news`
|
||||
6. `GET /api/launcher/realms`
|
||||
7. `GET /api/launcher/account`
|
||||
|
||||
Registration sequence:
|
||||
|
||||
1. User opens the registration tab and provides `username`, `email`,
|
||||
`password`, `password_confirmation`, optional `invite_code`, and accepts
|
||||
`terms`.
|
||||
2. Launcher sends the payload to `POST /api/launcher/register`.
|
||||
3. After a successful `201` response, the form returns to the login tab and
|
||||
displays the API success message.
|
||||
4. Validation and invite errors returned by the API are shown in the form.
|
||||
|
||||
Authentication sequence:
|
||||
|
||||
@@ -41,6 +54,11 @@ Authentication sequence:
|
||||
4. Successful login persists `LauncherSession` locally.
|
||||
5. On next launcher start, saved session is reused to fetch manifest again.
|
||||
6. `LauncherSession` and `ClientManifest` are passed into the home screen.
|
||||
7. If an installation directory is saved, synchronization starts
|
||||
automatically with the fetched manifest.
|
||||
8. While the launcher is open, it refreshes the manifest every five minutes.
|
||||
9. A server build hash that differs from the verified local build hash starts
|
||||
synchronization automatically.
|
||||
|
||||
Logout sequence:
|
||||
|
||||
@@ -65,6 +83,28 @@ News sequence:
|
||||
2. The response payload is read from the top-level `data` array.
|
||||
3. Each news item provides `id`, `title`, `body`, optional `image_url`, and `created_at`.
|
||||
4. News failures do not block patching or play flow; the launcher shows a local error state only inside the news panel.
|
||||
5. Pressing a news item opens `<MOONWELL_API_BASE_URL>/news/{id}` in the
|
||||
system browser.
|
||||
|
||||
Realm status sequence:
|
||||
|
||||
1. After the authenticated home screen opens, the launcher requests
|
||||
`GET /api/launcher/realms`.
|
||||
2. The first item in the top-level `data` array supplies the realm name,
|
||||
online state, and game build shown in the sync panel.
|
||||
3. Realm information is refreshed every minute while the launcher remains
|
||||
open.
|
||||
4. A failed refresh keeps the last known realm state and is retried on the next
|
||||
interval.
|
||||
|
||||
Account sequence:
|
||||
|
||||
1. After the authenticated home screen opens, the launcher requests
|
||||
`GET /api/launcher/account` with bearer authentication.
|
||||
2. Only `username` is stored in launcher UI state and displayed in the account
|
||||
menu.
|
||||
3. The response `balance` field is intentionally ignored and never displayed.
|
||||
4. Account metadata failures do not block patching or launching the game.
|
||||
|
||||
## Installation Directory Rules
|
||||
|
||||
@@ -193,6 +233,10 @@ When the user presses `Play`:
|
||||
1. launcher resolves `<install-root>/Wow.exe`
|
||||
2. launcher clears `<install-root>/Cache`
|
||||
3. launcher starts `Wow.exe` with working directory set to installation root
|
||||
and retains a process handle
|
||||
4. while the process is alive, the launcher disables repeated game launches
|
||||
and client synchronization
|
||||
5. when the process exits, the launcher returns to the ready-to-play state
|
||||
|
||||
If `Wow.exe` is missing, launch fails with an error.
|
||||
|
||||
@@ -202,6 +246,7 @@ The launcher surfaces errors for:
|
||||
|
||||
- invalid API configuration
|
||||
- authentication failure
|
||||
- registration validation or server failure
|
||||
- manifest load failure
|
||||
- path traversal attempts
|
||||
- checksum mismatch after download
|
||||
|
||||
Reference in New Issue
Block a user