Added version checking of database, dcs hook and windows app - in case of mismatch , app is terminating

This commit is contained in:
szporowolik
2019-10-22 17:36:36 +02:00
parent a0c9a249f6
commit 9770c26b93
4 changed files with 95 additions and 35 deletions

View File

@@ -126,7 +126,7 @@ public class TCPController
if (Int32.Parse(strRawTCPFrameType) != 0)
{
// Add to mySQL send buffer (find first empty slot)
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "Packet received" , 2,0, strRawTCPFrameType,true);
PerunHelper.AddLog(ref arrGUILogHistory, "Packet received" , 2,0, strRawTCPFrameType,true);
bool AddedDataToBuffer = false;
for (int i = 0; i < arrMySQLSendBuffer.Length - 1; i++)
{
@@ -139,12 +139,12 @@ public class TCPController
}
if (!AddedDataToBuffer)
{
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "ERROR package was dropped", 1, 1, strRawTCPFrameType);
PerunHelper.AddLog(ref arrGUILogHistory, "ERROR package was dropped", 1, 1, strRawTCPFrameType);
}
} else
{
// Keep alive
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "Keep-alive received", 2,0,"0",true);
PerunHelper.AddLog(ref arrGUILogHistory, "Keep-alive received", 2,0,"0",true);
}
}
else
@@ -156,7 +156,7 @@ public class TCPController
{
Globals.ErrorsGame++;
Console.WriteLine(e.ToString());
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "ERROR while message parsing , error: " + e.Message,2,1,"?");
PerunHelper.AddLog(ref arrGUILogHistory, "ERROR while message parsing , error: " + e.Message,2,1,"?");
bTCPConnectionOnline = false;
}
@@ -168,7 +168,7 @@ public class TCPController
catch (SocketException e)
{
Console.WriteLine(e.ToString());
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP ERROR cannot check connection, error: " + e.Message,2,1,"?");
PerunHelper.AddLog(ref arrGUILogHistory, "TCP ERROR cannot check connection, error: " + e.Message,2,1,"?");
}
}
@@ -182,7 +182,7 @@ public class TCPController
{
Globals.ErrorsGame++;
Console.WriteLine(e.ToString());
PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP error - connection closed or port in use, error: " + e.Message,1,1,"?");
PerunHelper.AddLog(ref arrGUILogHistory, "TCP error - connection closed or port in use, error: " + e.Message,1,1,"?");
bTCPConnectionOnline = false;
}