mirror of
https://github.com/db9979/uconsole_asw_game.git
synced 2026-12-05 20:34:16 +01:00
The crewed boat's mast now intercepts real radar signals through scan_for_signals with the boat as observer. The crew keeps an emitter list (fingerprint association, agile hops merged), classifies emitters against the library, sees the bearing history, a Gauss-Newton cross-fix from own motion with a 95 % error ellipse, the level trend, a warning when a radar can see the mast and a recommended mast time from the sea state. Bearing lines and fixes appear on the boat chart and web map and can be transferred to the boat plot. Save format v18 (crew.esm). The uConsole boat contact list shows quality as a percentage instead of the bare "q0.98". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BdXs5tkJ6kzdeubNWqPHtG
118 lines
3.3 KiB
JavaScript
118 lines
3.3 KiB
JavaScript
import { defaultSonarPage } from "./shared.js";
|
|
|
|
// Mutable client state shared by several modules. Transient: never sent to
|
|
// the host, stored or placed in the DOM.
|
|
export const S = {
|
|
language: (navigator.language || "en").toLowerCase().startsWith("de") ? "de" : "en",
|
|
catalog: {},
|
|
// Session metadata stays closure-local: no URL, DOM or persistence.
|
|
session: null,
|
|
pairingAvailable: false,
|
|
generation: 0,
|
|
snapshot: null,
|
|
chart: null,
|
|
chartSession: null,
|
|
chartEpoch: null,
|
|
chartRole: null,
|
|
selected: null,
|
|
connected: false,
|
|
linkState: "unpaired",
|
|
lastSuccess: 0,
|
|
lastSessionFetch: 0,
|
|
failures: 0,
|
|
pollTimer: null,
|
|
polling: false,
|
|
pending: null,
|
|
v2State: null,
|
|
roleStale: false,
|
|
// Solo host surface: the published host view and the one host command in flight.
|
|
hostView: null,
|
|
hostPending: null,
|
|
hostMessage: null,
|
|
hostMessageTimer: null,
|
|
stationRenderSignature: null,
|
|
nextCommandSeq: 0,
|
|
stationMutation: false,
|
|
activatingStation: null,
|
|
queuedSonarFocus: null,
|
|
// Focus this client last sent, until the state shows it or it is rejected.
|
|
requestedSonarFocus: null,
|
|
stationPickerOpen: false,
|
|
lobbyMessage: null,
|
|
// Unit chosen in the lobby ("frigate" | "opfor"); held stations decide otherwise.
|
|
lobbySide: "frigate",
|
|
commandMessage: null,
|
|
lastToastedMessage: null,
|
|
opzMarked: new Set(),
|
|
opzSuppressed: new Set(),
|
|
opzManage: false,
|
|
stationDrafts: new Set(),
|
|
// Emitter the mast station has selected in the boat's ESM list (by number).
|
|
ubootEsmSelected: null,
|
|
requestQueue: Promise.resolve(),
|
|
activeRequest: null,
|
|
languageRequest: 0,
|
|
audio: null,
|
|
soundEnabled: false,
|
|
sonarAudioEnabled: false,
|
|
sonarAudioController: null,
|
|
sonarAudioTimer: null,
|
|
sonarAudioSequence: null,
|
|
sonarAudioNextTime: 0,
|
|
helicopterAudioSource: null,
|
|
sonarAudioSources: [],
|
|
sonarAudioGain: null,
|
|
sonarAudioHighpass: null,
|
|
sonarAudioLowpass: null,
|
|
sonarAudioWorklet: null,
|
|
sonarAudioSocket: null,
|
|
sonarAudioReconnect: null,
|
|
sonarAudioMetrics: {buffered: 0, gaps: 0, concealed: 0, rate: 1, stale: false},
|
|
gameSoundContext: null,
|
|
gameSoundHighWater: 0,
|
|
chartHits: [],
|
|
drag: null,
|
|
activeTab: "operations",
|
|
contactAnalysis: null,
|
|
analysisSelected: null,
|
|
analysisImageKey: null,
|
|
lastSimlogFetch: 0,
|
|
proposals: null,
|
|
eventContext: null,
|
|
eventBaselinePending: false,
|
|
eventHighWater: 0,
|
|
eventHistory: [],
|
|
analysisError: false,
|
|
latestSimlogState: null,
|
|
simlogMapData: null,
|
|
simlogMapSeq: null,
|
|
simlogMapLatest: false,
|
|
simlogMapFit: "world",
|
|
roleMapHits: [],
|
|
// Hover information for the maps (tracks, own ship, assets, chart items);
|
|
// separate from the click hit lists so selection semantics are unchanged.
|
|
roleMapInfo: [],
|
|
chartInfo: [],
|
|
damageHits: [],
|
|
sonarVisualPage: defaultSonarPage(),
|
|
helicopterVisualPage: "acoustic",
|
|
helicopterPlot: "lofar",
|
|
weatherFrame: null,
|
|
weatherTimer: null,
|
|
weatherLastDraw: 0,
|
|
roleMapDrag: null,
|
|
plotAnchor: null,
|
|
plotListKey: "",
|
|
sonarBroadbandDrag: null,
|
|
opzSweepFrame: null,
|
|
opzSweepSample: null,
|
|
fireConfirmation: null,
|
|
fireConfirmationTimer: null,
|
|
sonarAudioGeneration: 0,
|
|
// World session/epoch the live audio last saw; a change resumes the stream.
|
|
sonarAudioWorld: null,
|
|
// Pointer position over the weather profile (CSS px), or null.
|
|
weatherCursor: null,
|
|
webHostAvailable: false,
|
|
};
|