VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtWaitingForHostState Class Reference

Detailed Description

This state is activated when the user chooses to join a session. It displays a waiting page and monitors for session status updates. When a hosted session with a terrain becomes available, it transitions to the joined session state. If configured, it can also start an ownship simulation.

#include <waitingForHostState.h>

Inheritance diagram for makVre::DtWaitingForHostState:
[legend]

Public Member Functions

 DtWaitingForHostState (DtPlayerStationApp &app)
 
virtual ~DtWaitingForHostState () override
 
virtual void onEnter (const DtPlayerStationStateArgs *args) override
 
virtual void onExit () override
 
virtual void tick (double dt) override
 
- Public Member Functions inherited from makVre::DtPlayerStationState
 DtPlayerStationState (DtPlayerStationApp &app, std::string stateType)
 
virtual ~DtPlayerStationState ()
 
 DtPlayerStationState (const DtPlayerStationState &)=delete
 
DtPlayerStationStateoperator= (const DtPlayerStationState &)=delete
 
virtual void onEnter ()
 
virtual void onStacked ()
 
virtual void onExposed (const DtPlayerStationStateArgs *args)
 
virtual void onExposed ()
 
bool active () const
 
bool exposed () const
 
bool exiting () const
 
bool stacking () const
 
const std::string & stateType () const
 
DtPlayerStationAppapp () const
 

Protected Member Functions

virtual DtVreMessageResult handleVrfSessionStatus (DtVreMessage *msg)
 
virtual bool startOwnship ()
 
- Protected Member Functions inherited from makVre::DtPlayerStationState
bool pushState (const std::string &newState, DtPlayerStationStateArgs *args=NULL)
 
bool popSelf ()
 
bool popUntilSelf ()
 
bool popUntilState (const std::string &parentState, DtPlayerStationStateArgs *args=NULL)
 
bool switchToState (const std::string &newState, DtPlayerStationStateArgs *args=NULL)
 
bool pushSelf ()
 

Protected Attributes

std::shared_ptr< DtVreWaitingPagemyWaitingPage
 
bool myJoinOnlyMode
 
std::shared_ptr< VrfSessionStatusMessagemySessionData
 
- Protected Attributes inherited from makVre::DtPlayerStationState
DtPlayerStationAppmyApp
 

Constructor & Destructor Documentation

◆ DtWaitingForHostState()

makVre::DtWaitingForHostState::DtWaitingForHostState ( DtPlayerStationApp & app)

Constructor for the waiting for host state.

Parameters
appReference to the player station application

Initializes the state with a reference to the application and sets default values.

References makVre::DtPlayerStationState::app().

◆ ~DtWaitingForHostState()

virtual makVre::DtWaitingForHostState::~DtWaitingForHostState ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ onEnter()

virtual void makVre::DtWaitingForHostState::onEnter ( const DtPlayerStationStateArgs * args)
overridevirtual

Called when entering this state.

Parameters
argsPointer to arguments containing a VrfSessionStatusMessage

Sets up the waiting page UI, registers message handlers, and checks the startup configuration. If configured, it may start an ownship simulation. It also determines if the application is in join-only mode based on the application mode or startup configuration.

Reimplemented from makVre::DtPlayerStationState.

◆ onExit()

virtual void makVre::DtWaitingForHostState::onExit ( )
overridevirtual

Called when exiting this state.

Removes message handlers and closes the waiting page UI.

Reimplemented from makVre::DtPlayerStationState.

◆ tick()

virtual void makVre::DtWaitingForHostState::tick ( double dt)
overridevirtual

Called every frame to update the state.

Parameters
dtTime elapsed since the last frame in seconds

Performs periodic updates for this state, currently minimal implementation.

Reimplemented from makVre::DtPlayerStationState.

◆ handleVrfSessionStatus()

virtual DtVreMessageResult makVre::DtWaitingForHostState::handleVrfSessionStatus ( DtVreMessage * msg)
protectedvirtual

Handles session status messages.

Parameters
msgThe session status message
Returns
Message handling result (HANDLED or IGNORED)

Processes session status updates. If a terrain is available, creates a SessionLoadDataMessage and transitions to the JOINED_SESSION_STATE. If no terrain is available and not in join-only mode, transitions back to the SESSION_MENU_STATE and stops the ownship simulation if it was started.

◆ startOwnship()

virtual bool makVre::DtWaitingForHostState::startOwnship ( )
protectedvirtual

Starts the ownship simulation backend.

Returns
True if the ownship simulation was started, false if it was already running

This method initiates the ownship simulation backend by creating and queuing a StartBackendMessage. It checks whether the simulation has already been started by examining the "ownshipSimStarted" attribute in the application attribute store. If the simulation is not running, it:

  • Creates a StartBackendMessage with appropriate host/ownship settings
  • Displays a notification with the simulation address
  • Sets the "ownshipSimStarted" attribute to true
Note
This method will not start the simulation if it has already been started
The ownship mode is determined by checking if a VRF host exists

Member Data Documentation

◆ myWaitingPage

std::shared_ptr<DtVreWaitingPage> makVre::DtWaitingForHostState::myWaitingPage
protected

Reference to the waiting page UI component.

◆ myJoinOnlyMode

bool makVre::DtWaitingForHostState::myJoinOnlyMode
protected

Flag indicating if the application is in join-only mode.

When true, the application will only attempt to join sessions and will not return to the session menu if no host is available.

◆ mySessionData

std::shared_ptr<VrfSessionStatusMessage> makVre::DtWaitingForHostState::mySessionData
protected

Cached copy of the session status message.

Contains information about the current session status, including whether the session is hosted and what terrain is being used.


The documentation for this class was generated from the following file: