Not send srs/lotatc data if there is no game connection.

This commit is contained in:
szporowolik
2019-10-21 20:21:01 +02:00
parent efc215f58a
commit 1f110321b4

View File

@@ -486,6 +486,8 @@ namespace Perun_v1
bool boolLotATCdefault = true;
// Handle SRS
if (Globals.bClientConnected)
{
if (con_check_3rd_srs.Checked)
{
try
@@ -551,8 +553,11 @@ namespace Perun_v1
strSRSJson = "{'type':'100','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'true'}}";
}
dcConnection.SendToMySql(strSRSJson);
}
// Handle LotATC
if (Globals.bClientConnected)
{
if (con_check_3rd_lotatc.Checked)
{
try
@@ -579,6 +584,7 @@ namespace Perun_v1
strLotATCJson = "{'type':'101','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'true'}}"; // No LotATC controller connected
}
dcConnection.SendToMySql(strLotATCJson);
}
// Let's do not risk int overload
Globals.intMysqlErros = (Globals.intMysqlErros > 999) ? 999 : Globals.intMysqlErros;