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; bool boolLotATCdefault = true;
// Handle SRS // Handle SRS
if (Globals.bClientConnected)
{
if (con_check_3rd_srs.Checked) if (con_check_3rd_srs.Checked)
{ {
try try
@@ -534,12 +536,12 @@ namespace Perun_v1
strSRSJson = "{'type':'100','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'false'}}"; // No SRS clients connected strSRSJson = "{'type':'100','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'false'}}"; // No SRS clients connected
} }
boolSRSdefault = false; boolSRSdefault = false;
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "SRS data loaded",3,0,"100",true); PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "SRS data loaded", 3, 0, "100", true);
bSRSStatus = true; bSRSStatus = true;
} }
catch (Exception exc_srs) catch (Exception exc_srs)
{ {
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "SRS data ERROR , error: " + exc_srs.Message,3,1,"100"); PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "SRS data ERROR , error: " + exc_srs.Message, 3, 1, "100");
bSRSStatus = false; bSRSStatus = false;
Globals.intSRSErros++; Globals.intSRSErros++;
} }
@@ -551,8 +553,11 @@ namespace Perun_v1
strSRSJson = "{'type':'100','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'true'}}"; strSRSJson = "{'type':'100','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'true'}}";
} }
dcConnection.SendToMySql(strSRSJson); dcConnection.SendToMySql(strSRSJson);
}
// Handle LotATC // Handle LotATC
if (Globals.bClientConnected)
{
if (con_check_3rd_lotatc.Checked) if (con_check_3rd_lotatc.Checked)
{ {
try try
@@ -562,12 +567,12 @@ namespace Perun_v1
strLotATCJson = "{'type':'101','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':'" + strLotATCJson + "'}"; strLotATCJson = "{'type':'101','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':'" + strLotATCJson + "'}";
boolLotATCdefault = false; boolLotATCdefault = false;
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "LotATC data loaded",3,0,"101",true); PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "LotATC data loaded", 3, 0, "101", true);
bLotATCStatus = true; bLotATCStatus = true;
} }
catch (Exception exc_lotatc) catch (Exception exc_lotatc)
{ {
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "LotATC data ERROR, error: " + exc_lotatc.Message,3,1,"101"); PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "LotATC data ERROR, error: " + exc_lotatc.Message, 3, 1, "101");
bLotATCStatus = false; bLotATCStatus = false;
Globals.intLotATCErros++; Globals.intLotATCErros++;
} }
@@ -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 strLotATCJson = "{'type':'101','instance':'" + Int32.Parse(con_txt_dcs_instance.Text) + "','payload':{'ignore':'true'}}"; // No LotATC controller connected
} }
dcConnection.SendToMySql(strLotATCJson); dcConnection.SendToMySql(strLotATCJson);
}
// Let's do not risk int overload // Let's do not risk int overload
Globals.intMysqlErros = (Globals.intMysqlErros > 999) ? 999 : Globals.intMysqlErros; Globals.intMysqlErros = (Globals.intMysqlErros > 999) ? 999 : Globals.intMysqlErros;