- def clear_vessel(self, timestamp):
- if self._v is not None:
- self._trash_vessel(self._v)
- self._v = {'#lastaboard': timestamp}
- self._vl[self._vessel] = self._v
+ def _create_vessel(self, vn, timestamp):
+ self._vl[vn] = v = { '#lastinfo': timestamp }
+ return v
+
+ def _update_vessel_lookup(self, vn, timestamp, dml):
+ v = self._vl.get(vn, None)
+ if v is None:
+ dml.append('new')
+ v = self._create_vessel(vn, timestamp)
+ elif timestamp - v['#lastinfo'] > opts.ship_reboard_clearout:
+ dml.append('stale')
+ self._trash_vessel(v)
+ v = self._create_vessel(vn, timestamp)
+ else:
+ dml.append('current')
+ return v