mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
feat(vessels): key vessels by their source's stable id, and share a selected vessel
AIS Vessels are keyed by the id their live source gives, with the MMSI as an attribute: an MMSI can be shared, spoofed or reused, so two vessels with one MMSI are now two vessels. Looking a vessel up or selecting it by MMSI still finds it. A share link made while a vessel is selected opens that vessel. A UUID vessel id travels as 16 bytes in a new thing field (13). A shared thing that is not reporting now says so in a sentence per kind, with its id (ICAO, NORAD, MMSI or vessel UUID) on a second line.
This commit is contained in:
1 parent
57ff81f723
commit
cbbf55cacd
74 files changed
+2481
-586
No files matched your search
@@ -128,7 +128,7 @@ function vesselSurfaceM(info, nowMs, at = info) {
|
||||
: 0;
|
||||
const scene = this.viewer.scene;
|
||||
let read =
|
||||
this.vesselWaterline?.mmsi === info.mmsi ? this.vesselWaterline : null;
|
||||
this.vesselWaterline?.vesselId === info.id ? this.vesselWaterline : null;
|
||||
if (
|
||||
typeof scene?.sampleHeightMostDetailed === 'function' &&
|
||||
(!read || nowMs - read.sampledMs >= VESSEL_WATERLINE_REFRESH_MS)
|
||||
@@ -138,7 +138,7 @@ function vesselSurfaceM(info, nowMs, at = info) {
|
||||
);
|
||||
if (!read) {
|
||||
read = {
|
||||
mmsi: info.mmsi,
|
||||
vesselId: info.id,
|
||||
heightM: loadedWaterlineM(scene, probes, seaM),
|
||||
sampledMs: nowMs,
|
||||
// Whether a full-detail read has answered for this ship.
|
||||
@@ -219,7 +219,7 @@ function updateVessel(nowMs) {
|
||||
return;
|
||||
}
|
||||
const info = this.readVesselInfo();
|
||||
if (!info || info.mmsi !== this.subjectId) {
|
||||
if (!info || info.id !== this.subjectId) {
|
||||
this.exit({ restoreTracking: false });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user