-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Feature Request
Summary
Add a new API endpoint that retrieves all ships currently in the user's dock (ship hold/船舱) via OCR or game data parsing, and saves the result to a local JSON file.
Motivation
The GUI frontend (AutoWSGR-GUI) now supports fleet presets — users can define named fleet compositions (e.g. 传统AIII双装母: [飞龙, AIII, 鞍山, 长春, 大凤, 不挠]) in their plan YAML files. To provide a good user experience, the frontend needs to know which ships the user actually owns, so it can:
- Validate fleet presets — highlight presets where one or more ships are missing from the user's dock
- Guide fleet selection — only show presets that the user can actually form
- Auto-complete ship names — provide suggestions when editing fleet compositions
Proposed API
GET /api/game/dock
Response:
{
success: true,
data: {
ships: [
{ name: 飞龙, ship_type: cv, level: 110 },
{ name: AIII, ship_type: bbv, level: 105 },
...
],
total: 500,
saved_to: dock_ships.json
}
}Behavior
- Navigate to the dock/ship hold screen in-game (or use existing game data if available without navigation)
- Enumerate all ships the user owns (name, type, level at minimum)
- Save the full list to a local JSON file (e.g.
dock_ships.jsonin the autowsgr data directory) - Return the list in the API response
Notes
- This can be implemented using OCR on the dock screen, or by parsing game network data if the protocol supports it
- The saved file can be cached and reused by the frontend without re-calling the API each time
- Ship names should match the standard naming used in
fleetfields (e.g.change_ships) - Level and type information helps the frontend provide richer UI (e.g. sorting by level, filtering by type)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels