rkusa / DATIS

DCS World Automatic Terminal Information Service (ATIS) broadcasted through Simple Radio Standalone (SRS)
MIT License
91 stars 22 forks source link

RadioInfo in the SRS client list for ATIS stations is null #10

Closed Lugghawk closed 5 years ago

Lugghawk commented 5 years ago

SRS has a client-list export that it can perform which lets server owners know who is connected, what frequencies they're on, and what unit they're in. The ATIS channels show up there, as expected, but their RadioInfo object is null, which is not expected.

We're looking to report on SRS users (including the ATIS stations) outside of the game, and having a single export for it would be handy.

{
    "ClientGuid": "qu2JrJyoQCyFOBjIa3jbLA",
    "Name": "Maykop-Khanskaya",
    "Coalition": 2,
    "RadioInfo": null,
    "Position": {
        "x": -26437.275391,
        "y": 180.01018977563476,
        "z": 458048.84375
    },
    "ClientChannelId": "5428d6f1"
}
rkusa commented 5 years ago

I had a look into what the RadioInfo contains, here is an example radio update message:

{
  "Client":{
    "ClientGuid":"GSs9rCCSZkaxOUNRQpg-Nw",
    "Name":"player",
    "Coalition":0,
    "RadioInfo":{
      "name":"New callsign",
      "pos":{
        "x":-281491.3084954,
        "y":15.074724035112,
        "z":646524.85985857
      },
      "ptt":false,
      "radios":[
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":264000000.0,
          "modulation":0,
          "name":"AN/ARC-210 - 1",
          "secFreq":0.0,
          "volume":0.8,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":0,
          "encMode":2,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":305000000.0,
          "modulation":0,
          "name":"AN/ARC-210 - 2",
          "secFreq":0.0,
          "volume":0.7,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":1,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":1,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":1,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":1,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        },
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":1.0,
          "modulation":3,
          "name":"No Radio",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        }
      ],
      "control":0,
      "selected":1,
      "unit":"FA-18C_hornet",
      "unitId":16782080,
      "simultaneousTransmission":false
    },
    "Position":{
      "x":-281491.30849666003,
      "y":15.074722124461,
      "z":646524.85985991
    },
    "ClientChannelId":null
  },
  "MsgType":3,
  "Clients":null,
  "ServerSettings":null,
  "ExternalAWACSModePassword":null,
  "Version":"1.5.6.0"
}

Out of curiosity, what information from the RadioInfo object are looking into including in the client-list export - the freq?

Lugghawk commented 5 years ago

Yeah the frequencies. The array of radios and the selected attribute are what I use to determine the frequency of that unit in our export. I might change that to include all frequencies that aren't == 1.0 though.

rkusa commented 5 years ago

Have you maybe already figured out whether selected starts at 0 or 1?

Lugghawk commented 5 years ago

I use it as the index to the array in python, so I believe 0.

On December 19, 2018 17:03:37 Markus Ast notifications@github.com wrote:

Have you maybe already figured out whether selected starts at 0 or 1? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

rkusa commented 5 years ago

Exported entry should now look like:

  {
    "ClientGuid":"7dGhsJQ9SG-S34G_z4pZhQ",
    "Name":"ATIS Kutaisi",
    "Coalition":2,
    "RadioInfo":{
      "name":"ATIS",
      "pos":{
        "x":-284379.67771414,
        "y":45.010047146232608,
        "z":683661.18694222
      },
      "ptt":false,
      "radios":[
        {
          "enc":false,
          "encKey":0,
          "encMode":0,
          "freqMax":1.0,
          "freqMin":1.0,
          "freq":257500000.0,
          "modulation":0,
          "name":"ATIS",
          "secFreq":0.0,
          "volume":1.0,
          "freqMode":0,
          "volMode":0,
          "expansion":false,
          "channel":-1,
          "simul":false
        }
      ],
      "control":0,
      "selected":0,
      "unit":"ATIS Kutaisi",
      "unitId":0,
      "simultaneousTransmission":true
    },
    "Position":{
      "x":-284379.67771414,
      "y":45.010047146232608,
      "z":683661.18694222
    },
    "ClientChannelId":"186d6c88"
  },

Here is a precompiled version for testing: ATIS.zip

rkusa commented 5 years ago

Released with 0.7.0. Feel free to reopen if there is still something missing