From 403b3df59a3a1ad22115af8ce246d68c344a717d Mon Sep 17 00:00:00 2001 From: szporowolik Date: Mon, 14 Sep 2020 23:59:20 +0200 Subject: [PATCH 1/5] - Prepared for 0.10.1 build - Added autostart parameter --- .../Perun_v1/02_Forms/form_Main.Designer.cs | 11 +++++- 02_Windows_App/Perun_v1/02_Forms/form_Main.cs | 35 ++++++++++++++----- .../Perun_v1/02_Forms/form_Main.resx | 3 ++ 02_Windows_App/Perun_v1/Perun_v1.csproj | 4 +-- .../Perun_v1/Properties/AssemblyInfo.cs | 4 +-- 5 files changed, 44 insertions(+), 13 deletions(-) diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs b/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs index 5880617..53d69d5 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs @@ -77,6 +77,7 @@ this.con_img_dcs = new System.Windows.Forms.PictureBox(); this.con_img_db = new System.Windows.Forms.PictureBox(); this.con_Button_Add_Marker = new System.Windows.Forms.Button(); + this.TIM_Autostart = new System.Windows.Forms.Timer(this.components); this.con_GroupBox_1.SuspendLayout(); this.con_GroupBox_2.SuspendLayout(); this.con_GroupBox_3.SuspendLayout(); @@ -524,6 +525,10 @@ this.con_Button_Add_Marker.UseVisualStyleBackColor = true; this.con_Button_Add_Marker.Click += new System.EventHandler(this.con_Button_Add_Marker_Click); // + // TIM_Autostart + // + this.TIM_Autostart.Interval = 5000; + // // form_Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -573,7 +578,10 @@ ((System.ComponentModel.ISupportInitialize)(this.con_img_db)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); - + // TIM_Autostart + // + this.TIM_Autostart.Tick += new System.EventHandler(this.TIM_Autostart_Tick); + // } #endregion @@ -625,6 +633,7 @@ private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; private System.Windows.Forms.Button con_Button_Add_Marker; + private System.Windows.Forms.Timer TIM_Autostart; } } diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs index e3c3c16..e815f6c 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs @@ -67,6 +67,18 @@ namespace Perun_v1 } } + if (args.Length > 5) + { + // Get argument lotATC file path + if (args[5] != null) + { + if (args[5] == "1") + { + TIM_Autostart.Enabled = true; + } + } + } + // Initialize controls con_img_db.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected"); con_img_dcs.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected"); @@ -157,7 +169,7 @@ namespace Perun_v1 con_check_3rd_srs.Enabled = true; con_txt_dcs_server_port.Enabled = true; con_txt_dcs_instance.Enabled = true; - + } // ################################ User input ################################ @@ -183,7 +195,7 @@ namespace Perun_v1 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; // Start listening - PerunHelper.AddLog(ref Globals.AppLogHistory, "Opening connections",0,1); + PerunHelper.AddLog(ref Globals.AppLogHistory, "Opening connections", 0, 1); TCPServer.Create(Int32.Parse(con_txt_dcs_server_port.Text), ref Globals.AppLogHistory, ref DatabaseSendBuffer); TCPServer.thrTCPListener = new Thread(TCPServer.StartListen); TCPServer.thrTCPListener.Start(); @@ -203,7 +215,7 @@ namespace Perun_v1 { // Stop listening // Prepare GUI - PerunHelper.AddLog(ref Globals.AppLogHistory, "Closing connections",0,1); + PerunHelper.AddLog(ref Globals.AppLogHistory, "Closing connections", 0, 1); con_Button_Listen_OFF.Enabled = false; Tim_GUI_Tick(null, null); this.Refresh(); @@ -239,7 +251,7 @@ namespace Perun_v1 con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("status_disconnected"); // Display information about closed connections - PerunHelper.AddLog(ref Globals.AppLogHistory, "Connections closed",0,1); + PerunHelper.AddLog(ref Globals.AppLogHistory, "Connections closed", 0, 1); Tim_GUI_Tick(null, null); // Set title bar @@ -483,9 +495,9 @@ namespace Perun_v1 // Send ping to check for possible connection issues DatabaseConnection.SendToMySql("", true); - if (PerunHelper.CheckVersions()==0) + if (PerunHelper.CheckVersions() == 0) { - MessageBox.Show("Version mismatch detected - please check log files and update.\n\nPerun will now terminate.", "Perun ERROR!",MessageBoxButtons.OK,MessageBoxIcon.Error); + MessageBox.Show("Version mismatch detected - please check log files and update.\n\nPerun will now terminate.", "Perun ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error); con_Button_Listen_OFF_Click(null, null); } @@ -609,7 +621,7 @@ namespace Perun_v1 Globals.AppForceIconReload = true; // Add information - PerunHelper.AddLog(ref Globals.AppLogHistory, "Resetted error counter",0,1); + PerunHelper.AddLog(ref Globals.AppLogHistory, "Resetted error counter", 0, 1); } else if (dialogResult == DialogResult.No) { @@ -621,7 +633,14 @@ namespace Perun_v1 private void con_Button_Add_Marker_Click(object sender, EventArgs e) { // Added user marker - PerunHelper.AddLog(ref Globals.AppLogHistory, "User Marker",0,1); + PerunHelper.AddLog(ref Globals.AppLogHistory, "User Marker", 0, 1); + } + + private void TIM_Autostart_Tick(object sender, EventArgs e) + { + // Handle autostart parameter from command line + TIM_Autostart.Enabled = false; // Disable timer + con_Button_Listen_ON_Click(sender,e); // Simulate button click } } } diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.resx b/02_Windows_App/Perun_v1/02_Forms/form_Main.resx index d3bd974..11d5fd4 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.resx +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.resx @@ -419,6 +419,9 @@ 687, 19 + + 800, 4 + 26 diff --git a/02_Windows_App/Perun_v1/Perun_v1.csproj b/02_Windows_App/Perun_v1/Perun_v1.csproj index ea7daa7..8998594 100644 --- a/02_Windows_App/Perun_v1/Perun_v1.csproj +++ b/02_Windows_App/Perun_v1/Perun_v1.csproj @@ -31,8 +31,8 @@ szporwolik Perun Perun.htm - 1 - 0.10.0.%2a + 0 + 0.10.1.%2a false true true diff --git a/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs b/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs index de90295..63e1ada 100644 --- a/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs +++ b/02_Windows_App/Perun_v1/Properties/AssemblyInfo.cs @@ -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.0.0")] -[assembly: AssemblyFileVersion("0.10.0.0")] +[assembly: AssemblyVersion("0.10.1.0")] +[assembly: AssemblyFileVersion("0.10.1.0")] [assembly: NeutralResourcesLanguage("en")] From 9f22b0e4dfd082188e75edaae35f8bcd3e993592 Mon Sep 17 00:00:00 2001 From: szporowolik Date: Tue, 15 Sep 2020 00:09:38 +0200 Subject: [PATCH 2/5] Fixed #38 - Scuds shall be counted now --- 01_DCS/Hooks/Perun.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01_DCS/Hooks/Perun.lua b/01_DCS/Hooks/Perun.lua index 30de3b3..932c559 100644 --- a/01_DCS/Hooks/Perun.lua +++ b/01_DCS/Hooks/Perun.lua @@ -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.0" +Perun.Version = "v0.10.1" Perun.StatusData = {} Perun.SlotsData = {} Perun.MissionData = {} @@ -842,7 +842,7 @@ Perun.onGameEvent = function (eventName,arg1,arg2,arg3,arg4,arg5,arg6,arg7) _temp_event_type="kill_Infantry" elseif _temp_category == "Fortification" then _temp_event_type="kill_Fortification" - elseif _temp_category == "Artillery" then + elseif _temp_category == "Artillery" or _temp_category == "MissilesSS" then _temp_event_type="kill_Artillery" else _temp_event_type="kill_Other" From d35ceafab289f65c45a7da261c501406d836db28 Mon Sep 17 00:00:00 2001 From: szporowolik Date: Tue, 15 Sep 2020 00:24:36 +0200 Subject: [PATCH 3/5] Final build for 0.10.1 --- 02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs | 2 +- 02_Windows_App/Perun_v1/02_Forms/form_Main.cs | 2 ++ 02_Windows_App/Perun_v1/Perun_v1.csproj | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs b/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs index 53d69d5..eb8535b 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.Designer.cs @@ -527,7 +527,7 @@ // // TIM_Autostart // - this.TIM_Autostart.Interval = 5000; + this.TIM_Autostart.Interval = 500; // // form_Main // diff --git a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs index e815f6c..6a3776f 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs @@ -75,6 +75,7 @@ namespace Perun_v1 if (args[5] == "1") { TIM_Autostart.Enabled = true; + PerunHelper.AddLog(ref Globals.AppLogHistory, "Autostart parameter provided", 0, 1); } } } @@ -209,6 +210,7 @@ namespace Perun_v1 // Send initial data Tim_MySQL_Tick(null, null); tim_3rdparties_Tick(null, null); + TIM_Autostart.Enabled = false; } private void con_Button_Listen_OFF_Click(object sender, EventArgs e) diff --git a/02_Windows_App/Perun_v1/Perun_v1.csproj b/02_Windows_App/Perun_v1/Perun_v1.csproj index 8998594..b348fb5 100644 --- a/02_Windows_App/Perun_v1/Perun_v1.csproj +++ b/02_Windows_App/Perun_v1/Perun_v1.csproj @@ -31,7 +31,7 @@ szporwolik Perun Perun.htm - 0 + 1 0.10.1.%2a false true From dcb951080221f6031423c85eecee6453d314c4cb Mon Sep 17 00:00:00 2001 From: szporowolik Date: Tue, 15 Sep 2020 00:25:27 +0200 Subject: [PATCH 4/5] DB update for 0.10.1 --- 03_MySQL/m1081_perun.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03_MySQL/m1081_perun.sql b/03_MySQL/m1081_perun.sql index dfba49e..c7561cc 100644 --- a/03_MySQL/m1081_perun.sql +++ b/03_MySQL/m1081_perun.sql @@ -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.0'); +(1, 'v0.10.1'); DROP TABLE IF EXISTS `pe_DataMissionHashes`; CREATE TABLE IF NOT EXISTS `pe_DataMissionHashes` ( From 18b6d8b0ce1d6041d8d412a3ef0b9498521b522f Mon Sep 17 00:00:00 2001 From: szporowolik Date: Tue, 15 Sep 2020 00:38:53 +0200 Subject: [PATCH 5/5] Build for 0.10.1 --- 02_Windows_App/Perun_v1/Perun_v1.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_Windows_App/Perun_v1/Perun_v1.csproj b/02_Windows_App/Perun_v1/Perun_v1.csproj index b348fb5..c37da60 100644 --- a/02_Windows_App/Perun_v1/Perun_v1.csproj +++ b/02_Windows_App/Perun_v1/Perun_v1.csproj @@ -31,7 +31,7 @@ szporwolik Perun Perun.htm - 1 + 2 0.10.1.%2a false true