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
A bean to store information about users connected to an FSD server.
- Since:
- 3.4
- Version:
- 10.3
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.deltava.beans.servinfo.NetworkUser
NetworkUser.Type
-
Field Summary
FieldsFields inherited from interface org.deltava.beans.GeoLocation
ALL, DEGREE_FEET, DEGREE_MILES, FEET_MILES, LAT_DIRECTIONS, LATITUDE, LON_DIRECTIONS, LONGITUDE, RADIAN_MILES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the user's callsign.final double
Returns the latitude of this location.Returns the date/time of the user's connection.final double
Returns the longitude of this location.Returns the User's current position.Returns the FSD Server this user is connected to.boolean
Returns if the User has a location set.void
setCallsign
(String cs) Updates the user's callsign.void
setLoginTime
(Instant dt) Updates the date/time of the user's last connection.void
setPosition
(double lat, double lon) Updates the User's position.void
Updates the FSD Server this user is connected to.Methods inherited from class org.deltava.beans.servinfo.NetworkUser
compareTo, equals, getFirstName, getID, getLastName, getName, getNetwork, getPilotID, getRating, getRowClassName, getType, hashCode, setFirstName, setLastName, setName, setPilotID, setRating, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.GeoLocation
distanceFeet, distanceTo
Methods inherited from interface org.deltava.beans.MapEntry
getInfoBox
Methods inherited from interface org.deltava.beans.MarkerMapEntry
getIconColor
-
Field Details
-
_position
The user's position, or null if not set.
-
-
Constructor Details
-
ConnectedUser
Initializes the user.- Parameters:
id
- the network IDnet
- the OnlineNetwork
-
-
Method Details
-
getCallsign
-
getLatitude
public final double getLatitude()Description copied from interface:GeoLocation
Returns the latitude of this location.- Specified by:
getLatitude
in interfaceGeoLocation
- 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 interfaceGeoLocation
- 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
Returns the date/time of the user's connection.- Returns:
- the login date/time
-
getPosition
Returns the User's current position.- Returns:
- a GeoPosition bean containing latitude and longitude
- See Also:
-
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 degreeslon
- the longitude in degrees- See Also:
-
setLoginTime
Updates the date/time of the user's last connection.- Parameters:
dt
- the connection date/time
-
setCallsign
Updates the user's callsign.- Parameters:
cs
- the callsign- Throws:
NullPointerException
- if cs is null- See Also:
-
setServer
Updates the FSD Server this user is connected to.- Parameters:
srv
- the server name- Throws:
NullPointerException
- if srv is null- See Also:
-