techdr1ve / perun

Perun toolset for DCS World server admins. Reads simulation data and pushes it MySQL database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord alt text alt text alt text

Perun logo

Perun for DCS World

Included lua script extracts data from DCS World multiplayer server and sends information to TCP port for further processing.

Provided windows app puts received TCP packets to MySQL database; additionaly Perun windows application can be used to merge LotATC and DCS SRS data in one database making Perun for DCS World wannabe ultimate integration tool for the server admins.

However, this software is intended to be used by experienced users - the output is MySQL data; you will need to process/display it yourself.

Perun in action Data flow

Discord server: https://discord.gg/MTahREx

Prerequisites

Core:

  • MySQL database with read/write access running at min. 5.7 server (tested with v5.7.21; native JSON support is required)
  • .NET Framework 4.8.0

3rd party applications support:

  • for DCS SRS integration location of the clients-list.json file will be required (by default: SRS Server folder), "Auto Export List" option has to be enabled - see SRS documentation
  • for LotATC you will need location of stats.json file and proper LotATC configuration with JSON data export enabled - see LotATC documentation

Installing

  • Download latest release
  • Copy contents of 01_DCS to your DCS folder in your Saved Games
  • From the downloaded release package, put perun.dll into your DCS folder in your Saved Games,Mods/services/Perun/bin
  • You can change your configuration settings in DCS\Mods\services\Perun\lua\perun_config
  • Create MySQL database using SQL script located in 04_MySQL; note that you need just a one database per DCS server machine - multiple instances pushing data to the one database are supported
  • Ensure that your MySQL config is not using STRICT_TRANS_TABLES

Create mySQL Database (if you do not already have one)

  • Simplest, most integrated way is download latest version of XAMPP
  • Then head over to the perun Discord and in 'general' section and search for 'How to get mySQL & PHP Server Running' for instructions and troubleshooting
  • Once you have read the above instructions and gotten mySQL and the FE webpage to work pst config and turning on both the mySQL DB server and Apache(FrontEnd Webhost server)... then do the following
  • Copy over the HERE folder to your C:\xampp\htdocs directory ... note this folder name will be called
  • Make sure the new SQL DB is linked up with the myPHPAdmin page DB
  • Use .htaccess only if you want to lock your webpage up with at password
  • Edit config.inc.php with user/pass/database_name
  • Once all connected up with perun check the webpage from in your web browser localhost/fullstatsdcswebpagephp ... or whatever your db and webpage are named, webpage should show up
  • Next goto localhost/fullstatsdcswebpagephp/install.php and hit the button 1 (wait for completion prompt to finish), then click button 2 (wait for completion prompt to finish). New full webpage stats are completed.
  • Next go back to localhost/fullstatsdcswebpagephp/ and hit the 'update' button in the upper-right-hand-corner
  • Should be all set to accumulate full dcs stats
  • Admin Controls: localhost/fullstatsdcswebpagephp/admin.php page for some admin controls (can adjust pwd by using a new .htaccess for this page if needed)
  • Reset Controls: localhost/fullstatsdcswebpagephp/ and Hit reset in top right hand corner and anyone with more than 30 deaths is up for stats reset for their name

Running

  • Start DCS World and host multiplayer session
    • by default the TCP port 48621 is in use as target port - ensure that port and instance ID in the options sections of the Lua file matches data
  • run the Win32 application
    • set MySQL connection data
    • optionaly point LotATC json file location
    • optionaly point DCS SRS json file location
    • click connect and leave the app running in the background
    • data shall now be filling your MySQL database

Windows APP - command line arguments (for expert users)

Windows app supports command line arguments, what may be handy in case of multiple instance of DCS servers running at the same machine.

The following arguments are accepted (keep the order!):

  • server port (shall be the same as in the lua file!)
  • instance ID (shall be the same as in the lua file!)
  • path to SRS client-list.json OR put -1 if you do not want to use DCS SRS
  • path to LotATC stats.json OR put -1 if you do not want to use LotATC
  • numeric value (without quotes), set 1 for Autostart (Perun will start within 500ms after starting up)

Example for windows shortcut:

C:\Perun_v1\Perun.exe 48621 1 "G:\DCS SRS\clients-list.json" "C:\Users\DCS\Saved Games\DCS\Mods\tech\LotAtc\stats.json"

Displaying data

Data displaying and handling is not in the current scope of this project. Since the end of 2018 the Perun data displaying has been hardcoded at forum.gildia.org , website for the Polish DCS community; examples: Who is online Mission statistics Due to resource limitations, "Perun for DCS World" will focus on pulling the data from DCS (and external modules) and pushing it to MySQL server, but if anyone would like to develop open sourced PHP applets for data/statistics displaying we're willing to cooperate and support such projects. Unfortunetly it's not possible to share the hardcoded code from forum.gildia.org.

Basic example was provided HERE , support is available via Perun community at our Discord.

Troubleshooting - FAQ

I keep getting 1305 MySQL error

That probably means that your database does not support JSON functions, you shall upgrade your MySQL server to at lease 5.7 version.

I keep getting 1364 MySQL error

Make sure that STRICT_TRANS_TABLES is disabled at your MySQL server, see: https://stackoverflow.com/questions/37964325/how-to-find-and-disable-mysql-strict-mode

Carrier landing are not tracked correctly

DCS API does not track carrier or FARP operations natively, so there is a trick to achive that. At this point of time to detect FARP operations, the FARPs shall have "FARP" string in the group name (set in mission editor). For carrier operations the string "SHIP" is required within group name.

API documentation (for expert users)

MySQL database structure

  • table: pe_DataMissionHashes - holds mission hashes, unique hashes created per each mission start at server
  • table: pe_DataPlayers - holds players UCIDs together with last login information
  • table: pe_DataRaw - holds raw data received from perun windows app, containing debug/version information together with DCS SRS and LotATC data
  • table: pe_DataTypes - names of all model depende class names detected in DCS
  • table: pe_LogChat - holds chat history
  • table: pe_LogEvent - holds event history
  • table: pe_LogLogins - holds login to server event history
  • table: pe_LogStats - holds static information
  • table: pe_OnlinePlayers - holds the list of actual players connected to the server
  • table: pe_OnlineStatus - holds the information about server status of all instantes

Database Scheme

Data packets - send from lua to TCP port

  • ID: 1, stats update [periodic update]
    • server - various information for server administration usage
    • mission - short information about runing mission
      • mission name - name of the mission file
      • model time - simulation time
      • real time - real time
      • pause - information if server is paused
      • multiplayer - information if this is multiplayer game (always true for dedicated server usage)
      • theather - information about area of operation
    • clients - list of connected players
  • ID: 2, available slots list and coalitions [updated on mision start or Perun reconnection]
    • coalitions - available coalitions
    • slots - available slots
  • ID: 3, stores mission data [updated on mision start or Perun reconnection]
  • ID: 50, chat event [event triggered]
  • ID: 51, game event [event triggered]
  • ID: 52, player stats ; note that as DSC native stats are not reliable, seperate stats couting methods are used [event triggered]
  • ID: 53, player login to DCS server [event triggered]
  • ID: 100, DCS SRS's client-list.json [updated every 60s, only between Perun and database]
  • ID: 101, LotATC's stats.json [updated every 60s,only between Perun and database]

Project information

Built With

Contributing

Original author is long gone a couple years ago, contact me by making and issue or make a new branch to this update and i'll merge it.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Szymon Porwolik - Initial work - szporwolik
  • Dr. No - Finalized Webpage Stats Work - techdr1ve See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Donation

This software is provide "as it is" without any warranties, but if you would like to thank me for development/support please Donate

Acknowledgments

Gildia.org Logo

Thanks to Gildia DCS Polish community of DCS World pilots.

Thanks to our Discord community for all the disussions, tests and proposals!

About

Perun toolset for DCS World server admins. Reads simulation data and pushes it MySQL database.

License:MIT License


Languages

Language:PHP 82.6%Language:C 8.7%Language:HTML 5.5%Language:C# 1.6%Language:Lua 0.9%Language:Makefile 0.2%Language:C++ 0.1%Language:Roff 0.1%Language:Hack 0.1%Language:CSS 0.0%Language:Batchfile 0.0%Language:CMake 0.0%Language:JavaScript 0.0%