Game extension to allow access to control Microsoft Flight simulator and also receive data from on of ten's of thousands of sim variables
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
Methods
    MSFS2020Disconnect()
    disconnect from the MSFS2020 interface and callbacks
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    (async) MSFS2020RegisterSimvars(handle)
    Registers with MSFS2020 for callbacks on simvars
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | handle | object | simconnecnt handle | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    SaveConfigToServer()
    Saves our config to the server
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    SaveDataToServer()
    Saves our data to the server
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    Creates and sends our large settings widget html code to the given extension
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | to | string |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    Parses and sends out our small settings widget to the given extension
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | to | string |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    addToTriggersArray(name, indexopt)
    Adds a simvar to our known list of names. A simvar may be an array and have an index (ie engines have an index for each engine)
others may not have index's
Parameters:
    
        
            
            | Name | Type | Attributes | Default | Description | 
    
    
        
        
            
            | name | string |  |  |  | 
        
        
            
            | index | number | <optional> 
 | 0 |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    findtriggerByMessageType(messagetype)
    Finds a specific trigger from the given name
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | messagetype | string |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    Handles user submitted code from our large settings widget/page
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | modalcode | object |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    heartBeatCallback()
    Sends out heartbeat messages so other extensions can see our status
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    initSimVarsandTriggers()
    initialises our sim variables dynamically creates triggers and actions based on what is available.
Note there can be thousands of possible options created here
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    initialise(app, host, port, heartbeat)
    Starts the extension using the given data.
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | app | object:Express |  | 
        
        
            
            | host | string |  | 
        
        
            
            | port | number |  | 
        
        
            
            | heartbeat | number |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    msfsapiconnect()
    connect to the MSFS2020 api interface
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    onDataCenterConnect(socket)
    Called when server connects
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | socket | object |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    onDataCenterDisconnect(reason)
    Called when connection is lost to StreamRoller
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | reason | string |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    onDataCenterMessage(server_packet)
    Called when we receive a message from the server
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | server_packet | object |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    An action was received to set/change a simvar or retrieve some data
A "trigger_onRequest_(simvarname)" will be fired on a request
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | data | object |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    Special simvar just for streamroller :D
Creates a simvar containing both lat and long rather
than having to create two requests actions and getting two responses back
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | data | object |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    pollMSFS()
    Poll MSFS for data we are monitoring for
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    postStartupActions()
    At this point we should have any config/credentials loaded
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    (async) postTriggers()
    posts a trigger out when a given symvar fires. Will also post a "changed" trigger
if the value was previously different
possible message types posted (NAME) is the simvar name and (INDEX) is the 
index if an indexed simvar
trigger_(NAME)
trigger_(NAME):(INDEX)
trigger_onChange_(NAME)
trigger_onChange_(NAME):(INDEX)
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    sendTriggersAndActions(to)
    Sends a list of our current triggers/actions ot the given extension
Parameters:
    
        
            
            | Name | Type | Description | 
    
    
        
        
            
            | to | string |  | 
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
- 
            
        
    startupCheck()
    waits for config and credentials files to set ready flag
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        - Source:
-