szporwolik / perun Goto Github PK
View Code? Open in Web Editor NEWPerun toolset for DCS World server admins. Reads simulation data and pushes it MySQL database.
License: MIT License
Perun toolset for DCS World server admins. Reads simulation data and pushes it MySQL database.
License: MIT License
Hi,
We regularily encouter this kind of errors on several columns, leading to a lot of log messages, and a logfile of a few GiB.
As a countermeasure, we decided to set all the columns of our database with the UTF8mb4_unicode_ci
codepage, but we still have this error.
Is it possible that something could be done in Perun to alleviate this problem ?
Also, is there a configuration option to enable/disable logging all the chat messages ? This error made us realize that they're all logged and we don't want that.
If there isn't an existing option, tell me and I'll try and add one in my fork, then request a pull.
Cheers, and thanks for all your hard work on Perun !
2021-05-04 00:00:00.006 | 8.72 | 44.51 | 000002 | 000152 | 2 | X | > | 50 | ERROR MySQL - error id: 1366
2021-05-04 00:00:00.006 | 8.72 | 44.51 | 000002 | 000152 | 2 | X | > | 50 | ERROR MySQL - query: INSERT INTO `pe_DataPlayers` (`pe_DataPlayers_ucid`) SELECT 'aeb5d73b82df24360a8f53a23a28d564' FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_DataPlayers` where `pe_DataPlayers_ucid` = 'aeb5d73b82df24360a8f53a23a28d564' );UPDATE `pe_DataPlayers` SET `pe_DataPlayers_updated` = '2021-05-02 22:11:54',`pe_DataPlayers_lastname`=@PAR_payload_player WHERE `pe_DataPlayers_ucid`='aeb5d73b82df24360a8f53a23a28d564' ;INSERT INTO `pe_DataMissionHashes` (`pe_DataMissionHashes_hash`,`pe_DataMissionHashes_instance`) SELECT 'VEAF_OpenTraining_Syria-morning-real@[email protected]@20210502_205419','2' FROM DUAL WHERE NOT EXISTS (SELECT * FROM `pe_DataMissionHashes` where `pe_DataMissionHashes_hash` ='VEAF_OpenTraining_Syria-morning-real@[email protected]@20210502_205419' AND `pe_DataMissionHashes_instance`=2);UPDATE `pe_DataMissionHashes` SET `pe_DataMissionHashes_datetime` = '2021-05-02 22:11:54' WHERE `pe_DataMissionHashes_hash` = 'VEAF_OpenTraining_Syria-morning-real@[email protected]@20210502_205419' AND `pe_DataMissionHashes_instance`=2 ;INSERT INTO `pe_LogChat` (`pe_LogChat_id`,`pe_LogChat_datetime`, `pe_LogChat_playerid`, `pe_LogChat_msg`, `pe_LogChat_all`,`pe_LogChat_missionhash_id`) VALUES (NULL,'2021-05-02 22:11:54', (SELECT `pe_DataPlayers_id` from `pe_DataPlayers` WHERE `pe_DataPlayers_ucid` = 'aeb5d73b82df24360a8f53a23a28d564'), @PAR_payload_msg, '3',(SELECT `pe_DataMissionHashes_id` FROM `pe_DataMissionHashes` WHERE `pe_DataMissionHashes_hash` = 'VEAF_OpenTraining_Syria-morning-real@[email protected]@20210502_205419'));
2021-05-04 00:00:00.006 | 8.72 | 44.51 | 000002 | 000152 | 2 | X | > | 50 | ERROR MySQL - error: Incorrect string value: '\xE9 de l...' for column 'pe_LogChat_msg' at row 675
LandingQualityMark is especially new and now that we can get the LSO grades with a player you can do a lot with that in a database, There's some others that im still investigating.
Hello, a suggestion, would it be possible to add a php file of how tables are made? I know it's not part of the project, but it would help beginners like me. Thank you very much.
Implement basic statistics.
I'm not 100% sure, but it seems that the LUA hook only refreshes the mission and slots data at start, and when reconnecting to the TCP socket.
Does that mean what I think ? If the server switches mission (without restarting the server itself, only loading a new mission) then the mission and slots data will not be updated ?
There's a mix of 12.1 and 12.0 and if you take the mix you end up with database issues because the version will be out. The 12.1 verison of the app is not in latest releases.
Please change the SQL template character set to utf8mb4 and collation utf8mb4_unicode_ci
Please modify in the next version of the program line form_Main.cs -> Globals.DatabaseConnection.DatabaseConnectionString = $"server={con_txt_mysql_server.Text};user={con_txt_mysql_username.Text};database={con_txt_mysql_database.Text};port={con_txt_mysql_port.Text};password={con_txt_mysql_password.Text}";
TO
Globals.DatabaseConnection.DatabaseConnectionString = $"server={con_txt_mysql_server.Text};user={con_txt_mysql_username.Text};database={con_txt_mysql_database.Text};port={con_txt_mysql_port.Text};password={con_txt_mysql_password.Text};CharSet=utf8";
We use accented characters in our server's chat so this is a solution for the correct character displaying.
After a while (people coming in and out from server) not all players are exported.
When windows app is not running or the connections is not set properly, the DCS will constantly try to send the package which will lag and possibly block DCS.
Please add the time spend on slot
The disconnect event handler is not triggered, so it's not logged.
The polish characters are changed to "??".
MySQL send buffer in app has to be rewritten - it works, but can be easily overloaded and shifting array is not optimal.
In the app, the default port offered is 48621 and all documentaiton refers to that. Except in the actual config the port is for some reason 48620 and I don't think this offers any value and only confusion.
Server status shall be available in the separate table/columns, currently this is available as the raw JSON data.
Such a small thing, yet we've seen lots of people on Discord get caught out and place the DLL into the DLL folder instead of the Bin folder as per the instructions.
What is the DLL folder for?
Plane and Heli kills shall be counted only when those are in flight.
Current approach will couse quick increase of the IDs, new solution shall be developet to keep the IDs in order ; see solution at https://stackoverflow.com/questions/23516958/on-duplicate-key-auto-increment-issue-mysql
Only one instance of Win app shall be allowed .
No possibility to autostart the app from command line without LotATC enabled.
Make input arguments optional.
As in title - work to improve game loop latency issues
When mission data is to be added to JSON, file does not get generated,
Seems DCS has category "Artillery" which is currently not handled (falls into kills other category).
User requested autostart of app once it's started from command line. Proper command line parameter shall be available.
Hi, dear Perun authors and contributors !
We, at VEAF, have updated our website and it now sports real-time and aggregated statistics, thanks to Perun.
I take the liberty of hijacking this fine issue system to provide with a detailed, yet synthetic report of what we've done.
Our site is accessible to all, here.
We hope you'll find this little presentation interesting, and are available to answer any question either here or on our Discord.
The actual ping shall come with the connected players table.
The max. user ping rate during session is also a good idea.
Current startup procedures for CLI and auto connect are not valid.
Seemingly none of the values are passing into the Perun. application. Please update wiki and or ticket here with propper flags to start.
C:\Perun_v1\Perun.exe 48621 1 "G:\DCS SRS\clients-list.json" "C:\Users\DCS\Saved Games\DCS\Mods\tech\LotAtc\stats.json"
Start C:\Users"DCS server"\Downloads\Perun_v_0_12_0\Perun\Perun.application 48620 1 "C:"Program Files"\DCS-SimpleRadio-Standalone\clients-list.json" "1" "1"
Thanks
Data is not available or the API function is not working correctly
p_stats['PS_CAR']=net.get_stat(playerID,2) p_stats['PS_PLANE']=net.get_stat(playerID,3) p_stats['PS_SHIP']=net.get_stat(playerID,4) p_stats['PS_SCORE']=net.get_stat(playerID,5) p_stats['PS_LAND']=net.get_stat(playerID,6) p_stats['PS_PING']=net.get_stat(playerID,0) p_stats['PS_CRASH']=net.get_stat(playerID,1) p_stats['PS_EJECT']=net.get_stat(playerID,7)
User name example:
'; select * from users;--
etc...
Just letting you know your sql table dump for creation is missing a ) on line 31 you have
DROP TABLE IF EXISTS `pe_DataMissionHashes`;
CREATE TABLE IF NOT EXISTS `pe_DataMissionHashes` (
`pe_DataMissionHashes_id` bigint(20) NOT NULL AUTO_INCREMENT,
`pe_DataMissionHashes_instance` smallint(5) UNSIGNED NOT NULL,
`pe_DataMissionHashes_hash` varchar(150) NOT NULL,
`pe_DataMissionHashes_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`pe_DataMissionHashes_id`),
UNIQUE KEY `UNIQUE_hash` (`pe_DataMissionHashes_hash`),
KEY `pe_DataMissionHashes_instance` (`pe_DataMissionHashes_instance`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
should be
DROP TABLE IF EXISTS `pe_DataMissionHashes`;
CREATE TABLE IF NOT EXISTS `pe_DataMissionHashes` (
`pe_DataMissionHashes_id` bigint(20) NOT NULL AUTO_INCREMENT,
`pe_DataMissionHashes_instance` smallint(5) UNSIGNED NOT NULL,
`pe_DataMissionHashes_hash` varchar(150) NOT NULL,
`pe_DataMissionHashes_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`pe_DataMissionHashes_id`),
UNIQUE KEY `UNIQUE_hash` (`pe_DataMissionHashes_hash`),
KEY `pe_DataMissionHashes_instance` (`pe_DataMissionHashes_instance`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;```
From some reason - sometimes helicopter kill counter is increased, even if no helis were killed.
Timestamps update has to be forced to show actual last updated timestamps.
Fixed codeblock:
Perun.GetMulticrewAllParameters = function (PlayerId)
function DCSBot.GetMulticrewAllParameters(PlayerId)
-- Gets all multicrew parameters
local _result = ""
local _master_type= "?"
local _master_slot = nil
local _sub_slot = nil
local _player_slot = net.get_player_info(PlayerId, 'slot')
if _player_slot and _player_slot ~= '' then
if not(string.find(_player_slot, 'red') or string.find(_player_slot, 'blue')) then
-- Player took model
_master_slot = _player_slot
_sub_slot = 0
if (not tonumber(_player_slot)) then
-- If this is multiseat slot parse master slot and look for seat number
_t_start, _t_end = string.find(_player_slot, '_%d+')
if _t_start then
-- This is co-player
_master_slot = string.sub(_player_slot, 0 , _t_start -1 )
_sub_slot = string.sub(_player_slot, _t_start + 1, _t_end )
end
end
_master_type = DCS.getUnitType(_master_slot)
else
-- Deal with the special slots addded by Combined Arms and Spectators
if string.find(_player_slot, 'artillery_commander') then
_master_type = "artillery_commander"
elseif string.find(_player_slot, 'instructor') then
_master_type = "instructor"
elseif string.find(_player_slot, 'forward_observer') then
_master_type = "forward_observer"
elseif string.find(_player_slot, 'observer') then
_master_type = "observer"
end
_master_slot = -1
_sub_slot = 0
end
else
_master_slot = -1
_sub_slot = -1
end
return _master_type,_master_slot,_sub_slot
end
When a player name contains a single quote (as for example my friend Ti'rco), the json containing the list of players cannot be parsed and an error is thrown back to the user in the windows app.
Here's the exception that's thrown :
Here's a saved payload that triggers the bug :
Perun_LogContent_2021-02-16-00-00-00.0000000-01-00.zip
This is easily solved by removing the quotes around the payload property value :
(I said "easily" but I know that it's never as simple as just saying it ^^ - the JSON is created in the LUA script, which is probably difficult to correct)
Not an issue, yet.
In the commit #9569762eac2a5822b9c0852621ca337e6780412a, you separated Perun's LUA configuration from its code.
That's a good thing to do imho.
However, the generic name you chose ("Config") could lead to collisitions with other scripts, in the future (or maybe now, with scripts we don't know yet).
I'd recommend initializing the "Perun" table in the configuration file, and using it (completing it with code) in the code script.
This is the list of the possible categories - not all are counted at the moment (MissilesSS and Warehouse):
https://i.imgur.com/c7QoxpP.png
List of players shall be available in the separate table/columns, currently this is available as the raw JSON data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.