Connecting an Add-On

Connecting an add-on to a multiplayer session accomplishes the following, in order:

To connect an add-on to a Flight Simulator multiplayer session

  1. Start Flight Simulator 98, as a host, making sure that there is room in the session for another player or observer.

  2. Scan for available sessions using the DirectPlay EnumSessions function with the following application GUID specified in the SESSIONDESC2 structure.
    GUID_FS6 = {0xcc080a27, 0x6d4e, 0x11d0, 0x8e, 0x21, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0xef};

  3. Using the DirectPlay Open function, connect to the appropriate session.

  4. Broadcast a packet to all players in the session using ADD_PLAYER_REQUEST or ADD_OBSERVER_REQUEST, depending on what type of add-on ("player" or "observer") you want to add to the session.
    Wait for a response from the host player, such as CHANGE_TO_PLAYER, CHANGE_TO_OBSERVER, ADD_PLAYER_REFUSED, or ADD_OBSERVER_REFUSED.

  5. If the host hasn't responded to a player's join request in a specified amount of time (30 seconds), send a RETRANSMIT_JOIN_PLAYER or RETRANSMIT_JOIN_OBSERVER packet and return to step 4.

  6. If the response from the host is CHANGE_TO_PLAYER or CHANGE_TO_OBSERVER, check the player ID in the message data. If the player ID matches the player ID of the local player, the add-on is successfully connected to the session.
    -Or-
    If the response from the host is ADD_PLAYER_REFUSED or ADD_OBSERVER_REFUSED, the add-on wasn't able to connect to the session and needs to take appropriate action. For example, if the response from the host was ADD_PLAYER_REFUSED, the add-on could display a message informing the user that they couldn't join as a player and ask them if they want to join as an observer, instead.

Note: If the host doesn't allow the add-on to join the session, the add-on should end its connection to the session.