Class ConnectedUser

java.lang.Object
org.deltava.beans.servinfo.NetworkUser
org.deltava.beans.servinfo.ConnectedUser
All Implemented Interfaces:
Serializable, Comparable<NetworkUser>, GeoLocation, MapEntry, MarkerMapEntry, ViewEntry
Direct Known Subclasses:
Controller, Pilot

public abstract class ConnectedUser extends NetworkUser implements MarkerMapEntry
A bean to store information about users connected to an FSD server.
Since:
3.4
Version:
10.3
Author:
Luke
See Also:
  • Field Details

    • _position

      protected GeoLocation _position
      The user's position, or null if not set.
  • Constructor Details

    • ConnectedUser

      public ConnectedUser(int id, OnlineNetwork net)
      Initializes the user.
      Parameters:
      id - the network ID
      net - the OnlineNetwork
  • Method Details

    • getCallsign

      public String getCallsign()
      Returns the user's callsign.
      Returns:
      the callsign
      See Also:
    • getLatitude

      public final double getLatitude()
      Description copied from interface: GeoLocation
      Returns the latitude of this location.
      Specified by:
      getLatitude in interface GeoLocation
      Returns:
      the latitude in degrees
    • getLongitude

      public final double getLongitude()
      Description copied from interface: GeoLocation
      Returns the longitude of this location.
      Specified by:
      getLongitude in interface GeoLocation
      Returns:
      the longitude in degrees
    • hasLocation

      public boolean hasLocation()
      Returns if the User has a location set.
      Returns:
      TRUE if a location has been set, otherwise FALSE
    • getLoginTime

      public Instant getLoginTime()
      Returns the date/time of the user's connection.
      Returns:
      the login date/time
    • getPosition

      public GeoLocation getPosition()
      Returns the User's current position.
      Returns:
      a GeoPosition bean containing latitude and longitude
      See Also:
    • getServer

      public String getServer()
      Returns the FSD Server this user is connected to.
      Returns:
      the server name
      See Also:
    • setPosition

      public void setPosition(double lat, double lon)
      Updates the User's position. This has a ServInfo hack where latitudes of -290 to -350 are mapped to latitudes in the Northern Hemisphere.
      Parameters:
      lat - the latitude in degrees
      lon - the longitude in degrees
      See Also:
    • setLoginTime

      public void setLoginTime(Instant dt)
      Updates the date/time of the user's last connection.
      Parameters:
      dt - the connection date/time
    • setCallsign

      public void setCallsign(String cs)
      Updates the user's callsign.
      Parameters:
      cs - the callsign
      Throws:
      NullPointerException - if cs is null
      See Also:
    • setServer

      public void setServer(String srv)
      Updates the FSD Server this user is connected to.
      Parameters:
      srv - the server name
      Throws:
      NullPointerException - if srv is null
      See Also: