Fixes for: #43 , #44, #45

This commit is contained in:
szporowolik
2020-11-06 16:59:25 +01:00
parent 37fd76c8ae
commit ff268a47e4
2 changed files with 26 additions and 10 deletions

View File

@@ -37,7 +37,10 @@ namespace Perun_v1
// Get argument server port // Get argument server port
if (args[1] != null) 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) if (args.Length > 2)
@@ -45,16 +48,23 @@ namespace Perun_v1
// Get argument instance id // Get argument instance id
if (args[2] != null) 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) if (args.Length > 3)
{ {
// Get argument DCS SRS file path // Get argument DCS SRS file path
if (args[3] != null) if (args[3] != null)
{ {
con_txt_3rd_srs.Text = args[3]; if (args[3] != "-1")
con_check_3rd_srs.Checked = true; {
con_txt_3rd_srs.Text = args[3];
con_check_3rd_srs.Checked = true;
}
} }
} }
if (args.Length > 4) if (args.Length > 4)
@@ -62,8 +72,11 @@ namespace Perun_v1
// Get argument lotATC file path // Get argument lotATC file path
if (args[4] != null) if (args[4] != null)
{ {
con_txt_3rd_lotatc.Text = args[4]; if (args[4] != "-1")
con_check_3rd_lotatc.Checked = true; {
con_txt_3rd_lotatc.Text = args[4];
con_check_3rd_lotatc.Checked = true;
}
} }
} }
@@ -74,8 +87,11 @@ namespace Perun_v1
{ {
if (args[5] == "1") if (args[5] == "1")
{ {
TIM_Autostart.Enabled = true; if (args[5] != "-1")
PerunHelper.AddLog(ref Globals.AppLogHistory, "Autostart parameter provided", 0, 1); {
TIM_Autostart.Enabled = true;
PerunHelper.AddLog(ref Globals.AppLogHistory, "Autostart parameter provided", 0, 1);
}
} }
} }
} }

View File

@@ -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!): The following arguments are accepted (keep the order!):
* server port (shall be the same as in the lua file!) * server port (shall be the same as in the lua file!)
* instance ID (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 SRS client-list.json OR put -1 if you do not want to use DCS SRS
* path to LotATC stats.json * 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) * numeric value (without quotes), set 1 for Autostart (Perun will start within 500ms after starting up)
Example for windows shortcut: Example for windows shortcut: