From ff268a47e458c9ddf3414dcbe82690d589f14dd6 Mon Sep 17 00:00:00 2001 From: szporowolik Date: Fri, 6 Nov 2020 16:59:25 +0100 Subject: [PATCH] Fixes for: #43 , #44, #45 --- 02_Windows_App/Perun_v1/02_Forms/form_Main.cs | 32 ++++++++++++++----- README.md | 4 +-- 2 files changed, 26 insertions(+), 10 deletions(-) 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 6a3776f..b0a4fed 100644 --- a/02_Windows_App/Perun_v1/02_Forms/form_Main.cs +++ b/02_Windows_App/Perun_v1/02_Forms/form_Main.cs @@ -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); + } } } } diff --git a/README.md b/README.md index 4badf69..5280730 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,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: