public class Session
extends java.lang.Object
Session.Type
.
Each session contains a reference to the Track
.
The track's instance can be obtained by calling getTrack()
.
Each session contains references to all the cars, both in the session and not.
An instance to a can be obtained by calling getCar(String)
,
where the String defines which car to return. If omitted, it returns the Reference Car.
The session also controls what the reference car is. The default reference car is "ME", but clients can change it. The Reference Car impacts how some lookups for the car are calculated, such as the relative lookups, which means relative to the Reference Car. NOTE: When it's changed, all connected clients will assume the new reference car.
Modifier and Type | Class and Description |
---|---|
static class |
Session.CarIdentifiers
This class enumerates the various car identifiers.
|
static class |
Session.Message
This class enumerates the various messages that a SIM can raise that applies to all cars.
|
static class |
Session.RestartMethod
This class enumerates the values return by
getRestart()
DOUBLEFILE
SINGLEFILE
|
static class |
Session.Status
This class enumerates the values return by
getStatus()
UNKNOWN
ENGINES_STARTED
GREEN
CAUTION
RED
FINISHED
|
static class |
Session.Type
This class enumerates the values returned by
getType()
UNKNOWN
OPEN_QUALIFY
LONE_QUALIFY
OFFLINE
OFFLINE_TESTING
PRACTICE
RACE
|
Modifier and Type | Field and Description |
---|---|
static int |
UNLIMITEDLAPS
number of laps to return if the session has unlimited laps
|
Modifier and Type | Method and Description |
---|---|
Data |
getCamera()
Returns the name of the current camera.
|
Data |
getCameraFocus()
Returns the name of what the camera is focused on.
|
Data |
getCameras()
Returns an array of the camera names for this session.
|
Car |
getCar(java.lang.String carIndentifier)
Returns an instance of a Car object as defined by the "car" argument.
|
Data |
getCars()
Returns the actual number of cars registered for this session.
|
Data |
getCautionLaps()
Returns the number of caution laps.
|
Data |
getCautions()
Returns the number of cautions as seen by the leader.
|
Data |
getClassNames()
Returns an array of the class names sorted fastest to slowest.
|
Data |
getDataVersion()
Returns a SIM specific string indicating the version of the data just returned.
|
Data |
getDiffCars() |
Data |
getDiffCars(java.lang.String carIdentifier) |
Data |
getDiffCars(java.lang.String carIdentifier1,
java.lang.String carIdentifier2)
Returns the difference between 2 cars as either laps or seconds (if on the same lap).
|
Data |
getDiffCarsRelative() |
Data |
getDiffCarsRelative(java.lang.String carIdentifier) |
Data |
getDiffCarsRelative(java.lang.String carIdentifier1,
java.lang.String carIdentifier2)
Calculates the difference between the 2 cars based on their physical distance from each other.
|
Data |
getId()
Returns a SIM specific ID for the current session.
|
Data |
getIncidentLimit()
Returns the total number of incidents allowed for this session.
|
Data |
getIsAppsHidden()
Returns true if the client should hide the App windows.
|
Data |
getIsCautionFlag()
Returns true if the caution flag is waving.
|
Data |
getIsCheckeredFlag()
Returns true if the checkered flag is waving.
|
Data |
getIsCrossedFlag()
Returns true if the crossed flag is waving.
|
Data |
getIsGarageVisible()
Returns true if the garage screen is visible so apps/widgets can hide it.
|
Data |
getIsGreenFlag()
Returns true if the green flag is waving.
|
Data |
getIsPitRoadOpen()
Returns true if pit road is open.
|
Data |
getIsRedFlag()
Returns true if the red flag is waving.
|
Data |
getIsReplay()
Returns true if the session is in replay mode.
|
Data |
getIsReplayLive()
Returns true if the session is in replay mode and has not been rewound to a time in the past.
|
Data |
getIsWhiteFlag()
Returns true if the white flag is waving.
|
Data |
getLap()
Returns the current lap of the race or REFERENCE car if in a different type of session.
|
Data |
getLaps() |
Data |
getLaps(java.lang.String sessionType)
Returns the total number of laps in the specified session.
|
Data |
getLapsToGo()
Returns the number of laps to go in sessions that define a total number of laps
See
getLaps() |
Data |
getLeagueId()
Returns a SIM specific League ID for the current session.
|
Data |
getMessages()
Returns a string of a semicolon separate list of messages that are currently active.
|
Data |
getName() |
Data |
getName(java.lang.String session)
Returns the name of the session.
|
Data |
getNumberOfCarClasses()
Returns the number of car classes.
|
Data |
getRadioChannelActive()
Returns the active radio channel.
|
Data |
getRadioChannelIsDeleteable() |
Data |
getRadioChannelIsDeleteable(int channel)
Returns if the radio channel can be deleted.
|
Data |
getRadioChannelIsDeleteable(java.lang.String channel) |
Data |
getRadioChannelIsListenOnly() |
Data |
getRadioChannelIsListenOnly(int channel)
Returns if the radio channel can only be listened to.
|
Data |
getRadioChannelIsListenOnly(java.lang.String channel) |
Data |
getRadioChannelIsMutable() |
Data |
getRadioChannelIsMutable(int channel)
Returns if the radio channel can be muted.
|
Data |
getRadioChannelIsMutable(java.lang.String channel) |
Data |
getRadioChannelIsMuted() |
Data |
getRadioChannelIsMuted(int channel)
Returns if the radio channel is currently muted.
|
Data |
getRadioChannelIsMuted(java.lang.String channel) |
Data |
getRadioChannelIsScanable() |
Data |
getRadioChannelIsScanable(int channel)
Returns if the radio channel can be scanned.
|
Data |
getRadioChannelIsScanable(java.lang.String channel) |
Data |
getRadioChannelName() |
Data |
getRadioChannelName(int channel)
Returns the radio channel name.
|
Data |
getRadioChannelName(java.lang.String channel) |
Data |
getRadioChannels()
Returns the number of radio channels that is scannable by you.
|
Data |
getRadioScan()
Returns the radio's scanning state
|
Data |
getReferenceCar()
Returns the reference car identifier as defined by
getCar(String) . |
Data |
getReplay()
Returns the state of the current replay position.
|
Data |
getRestart()
Returns the type of restart, double or single file.
|
java.lang.String |
getSendKeys(java.lang.String group,
java.lang.String command)
Returns the string of keys strokes to send to the SIM to
issue the command from the group.
|
Data |
getSpotterPitCountDown()
Returns if the SIM has own pit count down spotter enabled.
|
Data |
getStartTime()
Returns the time the current session started as the number of seconds since Jan 1, 1970 UTC.
|
Data |
getStatus()
Returns the status of the session as one of the following defined in
Session.Status . |
Data |
getStrengthOfField()
Returns a String that is SIM specific that represents the strength of the field.
|
Data |
getTime()
Returns the time of the current session as the number of seconds since Jan 1, 1970 UTC.
|
Data |
getTimeElapsed()
Returns the number of seconds since the current session started.
|
Data |
getTimeRemaining()
If the current session has a time restriction, this returns the number of seconds remaining.
|
Data |
getTimeString()
Returns the time of the current session in the time zone of the track using the following format.
|
Track |
getTrack()
Returns an instance to the Track in this session
Each SIM will have to provide an override that does not return a null
|
Data |
getType()
Returns the type of the current session as defined by
Session.Type |
Data |
setAdvanceFlag()
Advance to next Session.
|
Data |
setAppsHidden() |
Data |
setAppsHidden(boolean isHidden)
Sets the flag returned by getIsAppsHidden().
|
Data |
setAppsHidden(java.lang.String isHidden) |
Data |
setCamera(java.lang.String cameraName) |
Data |
setCamera(java.lang.String cameraName,
java.lang.String focusOn) |
Data |
setCamera(java.lang.String cameraName,
java.lang.String focusOn,
java.lang.String carIdentifier)
Changes the camera.
|
Data |
setCameraFocus(java.lang.String focusOn) |
Data |
setCameraFocus(java.lang.String focusOn,
java.lang.String carIdentifier)
Changes the focus of the current camera.
|
Data |
setCautionFlag()
Set Full Course Caution Flag on.
|
Data |
setCautionLaps() |
Data |
setCautionLaps(int laps)
Sets the number of caution laps.
|
Data |
setCautionLaps(java.lang.String laps) |
Data |
setCautionLapsAdjust() |
Data |
setCautionLapsAdjust(int laps)
Add or subtract laps to the current caution laps.
|
Data |
setCautionLapsAdjust(java.lang.String laps) |
Data |
setChat(java.lang.String text)
Sends the text string as a chat message to all drivers.
|
Data |
setChatFlag(boolean onOffFlag)
Set Chat on or off for all drivers.
|
Data |
setChatFlag(java.lang.String onOffFlag) |
Data |
setChatReply(java.lang.String text)
Sends the text string as a chat message to the last driver to send you a private message.
|
Data |
setPitClose()
Sets the Pits to be closed.
|
Data |
setPitOpen()
Sets the Pits to be open.
|
Data |
setRadioChannel(int channel)
Makes the specified radio channel the active channel to transmit on.
|
Data |
setRadioChannel(java.lang.String channel) |
Data |
setRadioChannelDelete(int channel)
Deletes the specified radio channel.
|
Data |
setRadioChannelDelete(java.lang.String channel) |
Data |
setRadioChannelMute() |
Data |
setRadioChannelMute(int channel,
boolean flag)
Mutes or Unmutes the specified radio channel.
|
Data |
setRadioChannelMute(java.lang.String channel) |
Data |
setRadioChannelMute(java.lang.String channel,
java.lang.String flag) |
Data |
setRadioChannelName(java.lang.String channelName)
Makes the specified radio channel the active channel to transmit on.
|
Data |
setRadioScan(boolean flag)
Turns the scanning of the channels on and off, such that, you are only listening on the active channel.
|
Data |
setRadioScan(java.lang.String flag) |
Data |
setReferenceCar() |
Data |
setReferenceCar(java.lang.String carIdentifier)
Sets the reference car.
|
Data |
setReloadPaint()
Tell the SIM to reload the paint files for all cars.
|
Data |
setReplay(java.lang.String command)
Tells the replay system what to do.
|
Data |
setReplayPosition(java.lang.String command)
Tells the replay system what position to start playing at.
|
Data |
setRestart(java.lang.String command)
Tells the system what type of restart you want.
|
public static final int UNLIMITEDLAPS
public Session(SIMPlugin SIMPlugin)
public java.lang.String getSendKeys(java.lang.String group, java.lang.String command)
group
- The group to get the commands from (i.e. ADMIN_COMMANDS, RADIO_COMMANDS)command
- The command within the group to retrieve (i.e. BLACK, ADD)SendKeys
public Data getCamera()
PATH = /Session/Camera
Data
container.public Data getCameraFocus()
PATH = /Session/CameraFocus
Data
container.public Data getCameras()
PATH = /Session/Cameras
Data
container.public Car getCar(java.lang.String carIndentifier)
carIndentifier
- A string representing the car you want. Values accepted are:
Car
public Data getCars()
PATH = /Session/Cars
Data
container.public Data getCautionLaps()
PATH = /Session/CautionLaps
Data
container.public Data getCautions()
PATH = /Session/Cautions
Data
container.public Data getClassNames()
PATH = /Session/ClassNames
Data
container.public Data getDataVersion()
PATH = /Session/DataVersion
Data
container.public Data getDiffCars(java.lang.String carIdentifier1, java.lang.String carIdentifier2)
This sign of the result will be car2 is behind car1, where car2 is the REFERENCE car and car1 is the LEADER, it will return seconds/laps behind as a negative number.
carIdentifier1
- Car as defined by getCar(String)
, default LEADERxxx.carIdentifier2
- Car as defined by getCar(String)
, default REFERENCE.Data
container.public Data getDiffCars(java.lang.String carIdentifier)
public Data getDiffCars()
public Data getDiffCarsRelative(java.lang.String carIdentifier1, java.lang.String carIdentifier2)
PATH = /Session/DiffCarsRelative/(CARIDENTIFIER1)/(CARIDENTIFIER2)
carIdentifier1
- Car as defined by getCar(String)
carIdentifier2
- Car as defined by getCar(String)
Data
container.public Data getDiffCarsRelative(java.lang.String carIdentifier)
public Data getDiffCarsRelative()
public Data getId()
PATH = /Session/Id
1.2
Data
container.public Data getIncidentLimit()
PATH = /Session/IncidentLimit
Data
container.public Data getIsAppsHidden()
PATH = /Session/IsAppsHidden
Data
container.public Data getIsGarageVisible()
PATH = /Session/IsGarageVisible
Data
container.public Data getIsGreenFlag()
PATH = /Session/IsGreenFlag
Data
container.public Data getIsCautionFlag()
PATH = /Session/IsCautionFlag
Data
container.public Data getIsCheckeredFlag()
PATH = /Session/IsCheckeredFlag
Data
container.public Data getIsCrossedFlag()
PATH = /Session/IsCrossedFlag
Data
container.public Data getIsWhiteFlag()
PATH = /Session/IsWhiteFlag
Data
container.public Data getIsRedFlag()
PATH = /Session/IsRedFlag
Data
container.public Data getIsPitRoadOpen()
PATH = /Session/IsPitRoadOpen
Data
container.public Data getIsReplay()
PATH = /Session/IsReplay
Data
container.public Data getIsReplayLive()
PATH = /Session/IsReplayLive
Data
container.public Data getLap()
Current lap is defined as the lap you are about to complete. Meaning that, if you're on lap 1, you just took the green flag.
PATH = /Session/Lap
Data
container.public Data getLaps(java.lang.String sessionType)
PATH = /Session/Laps/(SESSIONTYPE)
sessionType
- The session type, Session.Type
, to get the laps from. Defaults to current session.Data
container.public Data getLaps()
public Data getLapsToGo()
getLaps()
PATH = /Session/LapsToGo
Data
container.public Data getLeagueId()
PATH = /Session/LeagueId
1.2
Data
container.public Data getMessages()
Session.Message
.
You can display as is, or use it as an index to the the translation for a particular language.
For example: ";ONELAPTOGREEN;"
PATH = /Session/Messages
Data
container.public Data getName(java.lang.String session)
PATH = /Session/Name/(session)
session
- (optional) The session identifier. Defaults to current session.Data
container.public Data getName()
public Data getNumberOfCarClasses()
getNumberOfCarClasses()
PATH = /Session/NumberOfCarClasses
Data
container.public Data getRadioChannels()
PATH = /Session/RadioChannels
Data
container.public Data getRadioChannelActive()
PATH = /Session/RadioChannelActive
Data
container.public Data getRadioChannelIsDeleteable(int channel)
channel
- (Optional) The channel number. Defaults to the active channel.Data
container.public Data getRadioChannelIsDeleteable(java.lang.String channel)
public Data getRadioChannelIsDeleteable()
public Data getRadioChannelIsListenOnly(int channel)
channel
- (Optional) The channel number. Defaults to the active channel.Data
container.public Data getRadioChannelIsListenOnly(java.lang.String channel)
public Data getRadioChannelIsListenOnly()
public Data getRadioChannelIsMutable(int channel)
channel
- (Optional) The channel number. Default to the active channel.Data
container.public Data getRadioChannelIsMutable(java.lang.String channel)
public Data getRadioChannelIsMutable()
public Data getRadioChannelIsMuted(int channel)
channel
- (Optional) The channel number. Defaults to the active channel.Data
container.public Data getRadioChannelIsMuted(java.lang.String channel)
public Data getRadioChannelIsMuted()
public Data getRadioChannelIsScanable(int channel)
channel
- (Optional) The channel number. Defaults to the active channel.Data
container.public Data getRadioChannelIsScanable(java.lang.String channel)
public Data getRadioChannelIsScanable()
public Data getRadioChannelName(int channel)
channel
- (Optional) The channel number. Defaults to the active channel.Data
container.public Data getRadioChannelName(java.lang.String channel)
public Data getRadioChannelName()
public Data getRadioScan()
PATH = /Session/RadioScan
Data
container.public Data setRadioChannel(int channel)
channel
- The channel number.Data
container.public Data setRadioChannel(java.lang.String channel)
public Data setRadioChannelDelete(int channel)
channel
- The channel number.Data
container.public Data setRadioChannelDelete(java.lang.String channel)
public Data setRadioChannelMute(int channel, boolean flag)
channel
- (Optional) The channel number. Defaults to the active channel.flag
- (Optional) Y to mute, N to unmute. Default is Y.Data
container.public Data setRadioChannelMute(java.lang.String channel, java.lang.String flag)
public Data setRadioChannelMute(java.lang.String channel)
public Data setRadioChannelMute()
public Data setRadioChannelName(java.lang.String channelName)
channelName
- The channel name, limited to 15 characters.Data
container.public Data setRadioScan(boolean flag)
PATH = /Session/setRadioScan/(Y/N)
flag
- Y to enable scanning, N to disable scanningData
container.public Data setRadioScan(java.lang.String flag)
public Data getReplay()
PATH = /Session/Replay
Data
container.public Data getRestart()
PATH = /Session/Restart
Data
container.public Data setReplay(java.lang.String command)
PATH = /Session/setReplay/(COMMAND)
command
- The command to execute. Defaults to PLAY.Data
container.public Data setReplayPosition(java.lang.String command)
command
- The position to go to.Data
container.public Data setRestart(java.lang.String command)
command
- The restart method.Data
container.public Data getSpotterPitCountDown()
PATH = /Session/SpotterPitCountDown
Data
container.public Data getStartTime()
PATH = /Session/StartTime
Data
container.public Data getStatus()
Session.Status
.
PATH = /Session/Status
1.12
Data
container.public Data getStrengthOfField()
PATH = /Session/StrengthOfField
Data
container.public Data getTime()
PATH = /Session/Time
Data
container.public Data getTimeString()
PATH = /Session/TimeString
Data
container.public Data getTimeElapsed()
PATH = /Session/TimeElapsed
Data
container.public Data getTimeRemaining()
PATH = /Session/TimeRemaining
Data
container.public Track getTrack()
Track
public Data getType()
Session.Type
PATH = /Session/Type
Data
container.public Data getReferenceCar()
getCar(String)
.
The default reference car is "ME", but can be changed by calling setReferenceCar(String)
PATH = /Session/ReferenceCar
Data
container.public Data setAdvanceFlag()
PATH = /Session/setAdvanceFlag
Data
container.public Data setAppsHidden(boolean isHidden)
PATH = /Session/setAppsHidden
isHidden
- true to hide the apps, false to unhide themData
container.public Data setAppsHidden(java.lang.String isHidden)
public Data setAppsHidden()
public Data setCamera(java.lang.String cameraName, java.lang.String focusOn, java.lang.String carIdentifier)
PATH = /Session/setCamera/(CAMERA)/(FOCUSON)/(CARIDENTIFIER)
cameraName
- The name of the camera. Can be the string CURRENT or blank to use the currently selected camera.focusOn
- (Optional) What to focus on. Valid values are (CRASHES,LEADER,EXCITING,DRIVER). Default is DRIVER.carIdentifier
- (Optional) A car identifier as defined by getCar(String)
. Default is REFERENCE.Data
container.public Data setCamera(java.lang.String cameraName, java.lang.String focusOn)
public Data setCamera(java.lang.String cameraName)
public Data setCameraFocus(java.lang.String focusOn, java.lang.String carIdentifier)
focusOn
- What to focus on. Valid values are (CRASHES,LEADER,EXCITING,DRIVER). Default is DRIVER.carIdentifier
- (Optional) A car identifier as defined by getCar(String)
. Default is REFERENCE.Data
container.public Data setCameraFocus(java.lang.String focusOn)
public Data setChat(java.lang.String text)
PATH = /Session/setChat/(TEXT)
text
- The text to send to the chat windowData
container.public Data setChatReply(java.lang.String text)
PATH = /Session/setChatReply/(TEXT)
text
- The text to send to the chat windowData
container.public Data setChatFlag(boolean onOffFlag)
PATH = /Session/setChatFlag/(Y/N)
onOffFlag
- Y/N to turn chat on or off for all drivers.Data
container.public Data setChatFlag(java.lang.String onOffFlag)
public Data setReferenceCar(java.lang.String carIdentifier)
carIdentifier
- A car identifier as defined by getCar(String)
.
You cannot set the reference car to "REFERENCE".
Default to "ME".Data
container.public Data setReferenceCar()
public Data setCautionFlag()
PATH = /Session/setCautionFlag
Data
container.public Data setCautionLaps(int laps)
laps
- The number of laps for the caution.Data
container.public Data setCautionLaps(java.lang.String laps)
public Data setCautionLaps()
public Data setCautionLapsAdjust(int laps)
laps
- +/- the number of laps to add to the current caution laps.Data
container.public Data setCautionLapsAdjust(java.lang.String laps)
public Data setCautionLapsAdjust()
public Data setPitClose()
PATH = /Session/setPitClose
Data
container.public Data setPitOpen()
PATH = /Session/setPitOpen
Data
container.public Data setReloadPaint()
PATH = /Session/setReloadPaint
Data
container.