Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 3.39 KB

README.md

File metadata and controls

33 lines (28 loc) · 3.39 KB

Plugin RestAPI

This API provides a very simple RestAPI that you can call from your webserver to receive data from DCSServerBot. It is WIP, and it will be enhanced in the future.

Configuration

As RestAPI is an optional plugin, you need to activate it in main.yaml first like so:

opt_plugins:
  - restapi

There is some very basic endpoint configuration available as of now, which you can add in your config/plugins/restapi.yaml like so:

DEFAULT:
  listen: 0.0.0.0   # the interface to bind the internal webserver to
  port: 9876        # the port the internal webserver is listening on
  prefix: /stats    # use this prefix (optional)

RestAPI

The following commands are available through the API

API GET / POST Parameters Return Description
/getuser POST nick: string {"name": string, "last_seen": date} Return a list of players ordered by last seen that match this nick.
/stats POST nick: string, date: date {
"deaths": int,
"aakills": int,
"aakdr": float,
"lastSessionKills": int,
"lastSessionDeaths": int,
"killsbymodule": [
{"module": string, "kills": int}
],
"kdrByModule": [
{"module": string, "kdr": float}
]
}
Statistics of this player
/topkills GET {"fullNickname": string, "AAkills": int, "deaths": int, "AAKDR": float} Top 10 of players ordered by kills descending.
/topkdr GET {"fullNickname": string, "AAkills": int, "deaths": int, "AAKDR": float} Same as /topkills but ordered by AAKDR descending.
/missilepk POST nick: string, date: date {"weapon": {"weapon-name": string, "pk": float}} Probability of kill for each weapon per given user.

Important

It is advisable to use a reverse proxy like nginx and maybe an SSL encryption between your webserver and this endpoint.