mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 19:05:39 +02:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27ff04092b | ||
|
|
a695d32ee3 | ||
|
|
3f33b2a166 | ||
|
|
174dccbe1a | ||
|
|
8917701a19 | ||
|
|
8e28b5b735 | ||
|
|
b07ec7b9c3 | ||
|
|
d591da2c43 | ||
|
|
174bb1e2ef | ||
|
|
a4ce9ed254 | ||
|
|
ff268a47e4 | ||
|
|
37fd76c8ae | ||
|
|
167f3e9021 | ||
|
|
4723702d28 | ||
|
|
f6d1ec82d5 | ||
|
|
fd6b0a65ab |
@@ -22,7 +22,7 @@ Perun.MOTD_L2 = "Wymagamy obecnosci DCS SRS oraz TeamSpeak - szczegoly na forum"
|
||||
-- ###################### END OF SETTINGS - DO NOT MODIFY OUTSIDE THIS SECTION ######################
|
||||
|
||||
-- Variable init
|
||||
Perun.Version = "v0.10.1"
|
||||
Perun.Version = "v0.11.1"
|
||||
Perun.StatusData = {}
|
||||
Perun.SlotsData = {}
|
||||
Perun.MissionData = {}
|
||||
|
||||
@@ -93,6 +93,38 @@ public class DatabaseController
|
||||
SQLQueryTxt += "UPDATE `pe_DataRaw` SET `pe_dataraw_payload` = @PAR_TCPFramePayload, `pe_dataraw_updated`=" + TCPFrameTimestamp + " WHERE `pe_dataraw_type`=" + TCPFrameType + " AND `pe_dataraw_instance` = " + TCPFrameInstance + ";";
|
||||
}
|
||||
|
||||
// Handling of special data (like parsing JSONs to DB)
|
||||
switch (Int32.Parse(TCPFrameType))
|
||||
{
|
||||
case 1:
|
||||
// General status information
|
||||
SQLQueryTxt += "INSERT INTO `pe_OnlineStatus` (`pe_OnlineStatus_instance`) SELECT '" + Int32.Parse(TCPFrameInstance) + "' FROM DUAL WHERE NOT EXISTS(SELECT * FROM `pe_OnlineStatus` WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "');";
|
||||
SQLQueryTxt += "UPDATE `pe_OnlineStatus` SET `pe_OnlineStatus_perunversion_winapp` = '" + TCPFrame.payload.v_win + "', `pe_OnlineStatus_perunversion_dcshook` ='" + TCPFrame.payload.v_dcs_hook + "' WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "' ;";
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// SRS Data
|
||||
SQLQueryTxt += "DELETE FROM pe_OnlinePlayers WHERE pe_OnlinePlayers_instance = " + Int32.Parse(TCPFrameInstance) +";";
|
||||
|
||||
int player_count = 0;
|
||||
foreach (var record_player in TCPFrame.payload.players)
|
||||
{
|
||||
SQLQueryTxt += "INSERT INTO `pe_OnlinePlayers` (`pe_OnlinePlayers_id`, `pe_OnlinePlayers_instance`, `pe_OnlinePlayers_ping`, `pe_OnlinePlayers_side`, `pe_OnlinePlayers_slot`, `pe_OnlinePlayers_ucid`) VALUES ("+ record_player.id + ", '"+ Int32.Parse(TCPFrameInstance) + "', '" + record_player.ping + "', '" + record_player.side + "', '" + record_player.slot + "', '" + record_player.ucid + "');";
|
||||
player_count++;
|
||||
}
|
||||
|
||||
//SQLQueryTxt += "DELETE FROM pe_OnlineStatus WHERE pe_OnlineStatus_instance = " + Int32.Parse(TCPFrameInstance) + ";";
|
||||
SQLQueryTxt += "INSERT INTO `pe_OnlineStatus` (`pe_OnlineStatus_instance`) SELECT '" + Int32.Parse(TCPFrameInstance) + "' FROM DUAL WHERE NOT EXISTS(SELECT * FROM `pe_OnlineStatus` WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "');";
|
||||
SQLQueryTxt += "UPDATE `pe_OnlineStatus` SET `pe_OnlineStatus_theatre` = '" + TCPFrame.payload.mission.theatre + "', `pe_OnlineStatus_name` = '" + TCPFrame.payload.mission.name + "' , `pe_OnlineStatus_pause` = '" + TCPFrame.payload.mission.pause + "', `pe_OnlineStatus_multiplayer` = '" + TCPFrame.payload.mission.multiplayer + "', `pe_OnlineStatus_realtime` = '" + TCPFrame.payload.mission.realtime + "', `pe_OnlineStatus_modeltime` = '" + TCPFrame.payload.mission.modeltime + "', `pe_OnlineStatus_players` = " + player_count + " WHERE `pe_OnlineStatus_instance` = '" + Int32.Parse(TCPFrameInstance) + "';";
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Connect to mysql and execute sql
|
||||
try
|
||||
{
|
||||
|
||||
@@ -37,7 +37,10 @@ namespace Perun_v1
|
||||
// Get argument server port
|
||||
if (args[1] != null)
|
||||
{
|
||||
con_txt_dcs_server_port.Text = args[1];
|
||||
if (args[1] != "-1")
|
||||
{
|
||||
con_txt_dcs_server_port.Text = args[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (args.Length > 2)
|
||||
@@ -45,16 +48,23 @@ namespace Perun_v1
|
||||
// Get argument instance id
|
||||
if (args[2] != null)
|
||||
{
|
||||
con_txt_dcs_instance.Text = args[2];
|
||||
if (args[2] != "-1")
|
||||
{
|
||||
con_txt_dcs_instance.Text = args[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (args.Length > 3)
|
||||
{
|
||||
// Get argument DCS SRS file path
|
||||
if (args[3] != null)
|
||||
{
|
||||
con_txt_3rd_srs.Text = args[3];
|
||||
con_check_3rd_srs.Checked = true;
|
||||
if (args[3] != "-1")
|
||||
{
|
||||
con_txt_3rd_srs.Text = args[3];
|
||||
con_check_3rd_srs.Checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (args.Length > 4)
|
||||
@@ -62,8 +72,11 @@ namespace Perun_v1
|
||||
// Get argument lotATC file path
|
||||
if (args[4] != null)
|
||||
{
|
||||
con_txt_3rd_lotatc.Text = args[4];
|
||||
con_check_3rd_lotatc.Checked = true;
|
||||
if (args[4] != "-1")
|
||||
{
|
||||
con_txt_3rd_lotatc.Text = args[4];
|
||||
con_check_3rd_lotatc.Checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +87,11 @@ namespace Perun_v1
|
||||
{
|
||||
if (args[5] == "1")
|
||||
{
|
||||
TIM_Autostart.Enabled = true;
|
||||
PerunHelper.AddLog(ref Globals.AppLogHistory, "Autostart parameter provided", 0, 1);
|
||||
if (args[5] != "-1")
|
||||
{
|
||||
TIM_Autostart.Enabled = true;
|
||||
PerunHelper.AddLog(ref Globals.AppLogHistory, "Autostart parameter provided", 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<PublisherName>szporwolik</PublisherName>
|
||||
<SuiteName>Perun</SuiteName>
|
||||
<WebPage>Perun.htm</WebPage>
|
||||
<ApplicationRevision>2</ApplicationRevision>
|
||||
<ApplicationVersion>0.10.1.%2a</ApplicationVersion>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>0.11.1.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
|
||||
@@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
|
||||
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
|
||||
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.10.1.0")]
|
||||
[assembly: AssemblyFileVersion("0.10.1.0")]
|
||||
[assembly: AssemblyVersion("0.11.1.0")]
|
||||
[assembly: AssemblyFileVersion("0.11.1.0")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS `pe_Config` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `pe_Config` (`pe_Config_id`, `pe_Config_payload`) VALUES
|
||||
(1, 'v0.10.1');
|
||||
(1, 'v0.11.1');
|
||||
|
||||
DROP TABLE IF EXISTS `pe_DataMissionHashes`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_DataMissionHashes` (
|
||||
@@ -41,7 +41,6 @@ CREATE TABLE IF NOT EXISTS `pe_DataPlayers` (
|
||||
UNIQUE KEY `UNIQUE_UCID` (`pe_DataPlayers_ucid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `pe_DataRaw`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_DataRaw` (
|
||||
`pe_dataraw_type` tinyint(4) NOT NULL,
|
||||
@@ -116,6 +115,7 @@ CREATE TABLE IF NOT EXISTS `pe_LogStats` (
|
||||
`pe_LogStats_typeid` int(11) DEFAULT NULL,
|
||||
`pe_LogStats_masterslot` int(11) DEFAULT NULL,
|
||||
`pe_LogStats_seat` int(10) DEFAULT NULL,
|
||||
`ps_kills_X` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_pvp` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_deaths` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_ejections` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
@@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS `pe_LogStats` (
|
||||
`ps_kills_infantry` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_ships` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_fortification` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_artillery` int(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_kills_artillery` int(10) NOT NULL DEFAULT '0',
|
||||
`ps_kills_other` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_airfield_takeoffs` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`ps_airfield_landings` int(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
@@ -150,7 +150,6 @@ CREATE TABLE IF NOT EXISTS `pe_LogStats` (
|
||||
KEY `pe_LogStats_mstatus` (`pe_LogStats_mstatus`),
|
||||
KEY `pe_LogStats_seat` (`pe_LogStats_seat`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TRIGGER IF EXISTS `pe_LogStats_UPDATE`;
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `pe_LogStats_UPDATE` BEFORE UPDATE ON `pe_LogStats` FOR EACH ROW BEGIN
|
||||
@@ -173,6 +172,32 @@ END
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
DROP TABLE IF EXISTS `pe_OnlinePlayers`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_OnlinePlayers` (
|
||||
`pe_OnlinePlayers_id` int(11) NOT NULL,
|
||||
`pe_OnlinePlayers_instance` int(11) NOT NULL,
|
||||
`pe_OnlinePlayers_ping` int(11) DEFAULT NULL,
|
||||
`pe_OnlinePlayers_side` int(11) DEFAULT NULL,
|
||||
`pe_OnlinePlayers_slot` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlinePlayers_ucid` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlinePlayers_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `pe_OnlineStatus`;
|
||||
CREATE TABLE IF NOT EXISTS `pe_OnlineStatus` (
|
||||
`pe_OnlineStatus_instance` int(11) NOT NULL,
|
||||
`pe_OnlineStatus_theatre` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_name` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_pause` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_multiplayer` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_realtime` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_modeltime` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_players` int(11) DEFAULT NULL,
|
||||
`pe_OnlineStatus_perunversion_winapp` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_perunversion_dcshook` varchar(255) DEFAULT NULL,
|
||||
`pe_OnlineStatus_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE `pe_DataMissionHashes` ADD FULLTEXT KEY `pe_DataMissionHashes_hash` (`pe_DataMissionHashes_hash`);
|
||||
|
||||
|
||||
18
README.md
18
README.md
@@ -2,6 +2,7 @@
|
||||

|
||||

|
||||

|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZBW8R5L25A8QW¤cy_code=EUR&source=url)
|
||||
|
||||

|
||||
|
||||
@@ -30,10 +31,11 @@ Core:
|
||||
* Download latest [release](https://github.com/szporwolik/perun/releases)
|
||||
* Copy contents of [01_DCS](https://github.com/szporwolik/perun/tree/master/01_DCS) to your \Scripts folder (located inside DCS folder in your Saved Games)
|
||||
* Create MySQL database using SQL script located in [03_MySQL](https://github.com/szporwolik/perun/tree/master/03_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
|
||||
|
||||
## Running
|
||||
* Start DCS World and host multiplayer session
|
||||
* by default the TCP port 48620 is in use as target port - ensure that port and instance ID in the options sections of the Lua file matches data
|
||||
* 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
|
||||
@@ -47,8 +49,8 @@ Windows app supports command line arguments, what may be handy in case of multip
|
||||
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
|
||||
* path to LotATC stats.json
|
||||
* 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:
|
||||
@@ -86,8 +88,10 @@ DCS API does not track carrier or FARP operations natively, so there is a trick
|
||||
* 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
|
||||
|
||||

|
||||

|
||||
|
||||
## Data packets - send from lua to TCP port
|
||||
* ```ID: 1```, contains version/diagnostic information
|
||||
@@ -132,7 +136,13 @@ See also the list of [contributors](https://github.com/szporwolik/perun/contribu
|
||||
## License
|
||||
This project is licensed under the MIT License - see the [LICENSE.md](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
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZBW8R5L25A8QW¤cy_code=EUR&source=url)
|
||||
|
||||
## Acknowledgments
|
||||

|
||||
|
||||
Thanks to [Gildia DCS](https://forum.gildia.org) Polish community of DCS World pilots.
|
||||
|
||||
Thanks to our Discord community for all the disussions, tests and proposals!
|
||||
|
||||
Reference in New Issue
Block a user