GithubHelp home page GithubHelp logo

dcs-export-core's Introduction

Setup

  • Copy the DcsExportCoreGameGUI.lua and the DcsExportCore folder to %USERPROFILE%\Saved Games\DCS\Scripts\

Network Ports

  • UDP 12823 on localhost to get data from device environment to Export.lua environment
  • Export.lua sends to UDP mutlicast 239.255.50.10:12800
  • Export.lua listens on TCP 12800 and UDP 12801

Protocol

All communication happens over newline-separated JSON messages. To send a message to DCS, either send it in a UDP packet to localhost:12801 (make sure to add a newline to the end even if sending a single message) or open a TCP connection to localhost:12800 and send it over that.

To receive messages from DCS, listen to the multicast UDP stream (see DCS-BIOS developer guide for details) or open a TCP connection to localhost:12800.

The top-level data type is always a JSON object.

Data Model

Every piece of data that is exported from DCS is assigned a key. Cockpit arguments start with "c", external draw model arguments start with "e", special keys start with "_".

Examples:

  • c404 is the Master Caution light in the A-10C
  • e182 is the right speed brake in the A-10C
  • _UNITTYPE is the type of the currently active unit (the only "special" key right now). _UNITTYPE is always exported even if it did not change.

Messages from DCS

newdata

Example: {"msg_type":"newdata", "data":{"_UNITTYPE":"A-10C","c404":0}}

If the "msg_type" attribute is "newdata", the "data" attribute is an object that contains a key => value mapping of all keys that have changed since the last "newdata" event.

new_unit

Example: {"msg_type":"new_unit","type":"A-10C"}

When a new unit is entered, this event is sent out. The "type" attribute lists the unit type. "type" can also be "NONE" when there is no active unit (e.g. spectator mode in multiplayer).

Whenever a new unit is entered, you have to re-send all of your "subscribe" messages!

Messages to DCS

subscribe

Example: {"action":"subscribe","keys":["c404","e182"]}

If the "action" attribute is "subscribe", the "keys" attribute is a JSON array of keys. This message tells DCS that you are interested in these keys and they will be monitored and included in all "newdata" events until a new unit is entered.

Example usage

  • Hop into an A-10C
  • Connect to <IP of DCS PC>:12800 via TCP (e.g. telnet dcs-pc-ip 12800). You will get 30 "newdata" messages per second which will tell you the unit type.
  • Type the following and press return: {"action":"subscribe","keys":["c404","e182"]}
  • Move the speed brakes or cause a master caution and watch the output in your terminal window

dcs-export-core's People

Contributors

jboecker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dcs-export-core's Issues

I am wondering if this will works

C:\Users\marce>TELNET 127.0.0.1:12800
Connecting To 127.0.0.1:12800...Could not open connection to the host, on port 23: Connect failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.