diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index 5222be2..6f5b076 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -1,4 +1,4 @@ -#include "updatecontroller.h" +#include "UpdateController.h" UpdateController::UpdateController(DataParser *parser, QObject *parent) : QObject(parent) diff --git a/Core/dataparser.cpp b/Core/dataparser.cpp index 749b754..0d05a39 100644 --- a/Core/dataparser.cpp +++ b/Core/dataparser.cpp @@ -127,7 +127,7 @@ QByteArray DataParser::xmlAnswer_notify(QString code) SAttribute attribute1 = {"Code", code}; QList listAttr = {attribute1}; - SXmlAnswerTag tag = {"ServerNotify", listAttr}; + SXmlAnswerTag tag = {"ClientNotify", listAttr}; listTag.append(tag); diff --git a/Core/externalexecuter.cpp b/Core/externalexecuter.cpp index 97d5d9d..dee4125 100644 --- a/Core/externalexecuter.cpp +++ b/Core/externalexecuter.cpp @@ -20,7 +20,7 @@ void ExternalExecuter::callApp() args << "1"; myProcess->start(programPath,args); - myProcess->waitForFinished(3000); + myProcess->waitForStarted(); QCoreApplication::exit(); } diff --git a/Core/recognizesystem.cpp b/Core/recognizesystem.cpp index 75ffeca..a1c245b 100644 --- a/Core/recognizesystem.cpp +++ b/Core/recognizesystem.cpp @@ -262,11 +262,16 @@ void RecognizeSystem::xmlParser(QByteArray array) QString name = attr.name().toString(); QString value = attr.value().toString(); - if(name == "Code"){ - if (value == "END"){ - + if(name == "Code") + { + if (value == "END") + { emit sigSocketDisabled(); + } + if(value == "BLOCKED") + { + emit sigServerBlocked(); } } } diff --git a/Core/recognizesystem.h b/Core/recognizesystem.h index d3d2bfd..6c312e2 100644 --- a/Core/recognizesystem.h +++ b/Core/recognizesystem.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include class UpdateController; @@ -27,6 +27,7 @@ signals: void sigNeedUpdate(bool flag,qint64 size,quint64 fileCount); void sigSendDebugLog(QString message); void sigSocketDisabled(); + void sigServerBlocked(); void sigSaveLoginData(ServerAuthorization *serverAuth); void sigSocketWaitForReadyRead(int waitTime); diff --git a/Core/tcpclient.cpp b/Core/tcpclient.cpp index 048e570..d595ede 100644 --- a/Core/tcpclient.cpp +++ b/Core/tcpclient.cpp @@ -89,11 +89,11 @@ void TCPClient::sendFile() countSend = 0; } -void TCPClient::sendUnityConnect() + +void TCPClient::sendQTConnect() { - QDataStream stream(socket); - stream.setVersion(QDataStream::Qt_DefaultCompiledVersion); - stream << PacketType::TYPE_CHANGEPACKAGERESPONSE; + QString value = QString::number(PacketType::TYPE_QT); + socket->write(value.toUtf8()); socket->waitForBytesWritten(); } @@ -106,15 +106,15 @@ void TCPClient::setDisconnect() void TCPClient::sendDisable() { -// QDataStream stream(socket); -// stream.setVersion(QDataStream::Qt_DefaultCompiledVersion); + QDataStream stream(socket); + stream.setVersion(QDataStream::Qt_DefaultCompiledVersion); -// QByteArray data; -// data = emit sigGetXmlAnswer("END"); + QByteArray data; + data = emit sigGetXmlAnswer("DISABLE"); -// stream << PacketType::TYPE_XMLANSWER; -// stream << data; -// socket->waitForBytesWritten(); + stream << PacketType::TYPE_XMLANSWER; + stream << data; + socket->waitForBytesWritten(); } void TCPClient::waitRead(int time) @@ -162,14 +162,18 @@ void TCPClient::slotMessageEntered(QString message) void TCPClient::slotConnectNotify() { - if(socket->state() != QTcpSocket::ConnectedState){ - emit sigSendDebugLog("Connect invalid"); - emit sigConnectionState(false); - return; - }else{ - emit sigSendDebugLog("Connect complete"); - emit sigConnectionState(true); - } + if(socket->state() != QTcpSocket::ConnectedState) + { + emit sigSendDebugLog("Connect invalid"); + emit sigConnectionState(false); + return; + } + else + { + emit sigSendDebugLog("Connect complete"); + emit sigConnectionState(true); + sendQTConnect(); + } } void TCPClient::slotReadyRead() @@ -178,9 +182,10 @@ void TCPClient::slotReadyRead() emit sigSendDebugLog("WRONG SOCKET"); return; } -// qDebug() << "Transaction before recognize: " << socket->isTransactionStarted(); -// if(socket->isTransactionStarted()) return; + // qDebug() << "Transaction before recognize: " << socket->isTransactionStarted(); + + // if(socket->isTransactionStarted()) return; emit sigRecognize(socket); } diff --git a/Core/tcpclient.h b/Core/tcpclient.h index bea2188..6fcac8f 100644 --- a/Core/tcpclient.h +++ b/Core/tcpclient.h @@ -26,7 +26,7 @@ public: void initialize(RecognizeSystem *recognize,ExternalExecuter *externalExecuter); void setConnect(ServerSettings *serverSettings); void sendClientAutorization(); - void sendUnityConnect(); + void sendQTConnect(); void sendDisable(); void waitRead(int time); diff --git a/Core/tools.h b/Core/tools.h index 7febf34..6110634 100644 --- a/Core/tools.h +++ b/Core/tools.h @@ -18,7 +18,7 @@ static QString displayTemp = staticDataFolderName + "/displayData.xml"; enum PacketType{ TYPE_NONE = 0, - TYPE_MSG = 1, + TYPE_UNITY = 1, TYPE_FILE = 2, TYPE_COMMAND = 3, TYPE_FOLDER = 4, @@ -26,7 +26,7 @@ enum PacketType{ TYPE_FINISH = 6, TYPE_NEEDUPDATE = 7, TYPE_XMLANSWER = 8, - TYPE_CHANGEPACKAGERESPONSE = 9, + TYPE_QT = 9, TYPE_DISABLE = 11 }; diff --git a/Makefile.Debug b/Makefile.Debug index b55e488..c6cc38e 100644 --- a/Makefile.Debug +++ b/Makefile.Debug @@ -328,6 +328,7 @@ debug/moc_updatecontroller.cpp: Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/UpdateController.h \ Core/externalexecuter.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ @@ -629,7 +630,7 @@ debug/moc_recognizesystem.cpp: Core/recognizesystem.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -662,6 +663,7 @@ debug/moc_recognizesystem.cpp: Core/recognizesystem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ debug/moc_predefs.h \ D:/QT/5.14.2/mingw73_64/bin/moc.exe D:\QT\5.14.2\mingw73_64\bin\moc.exe $(DEFINES) --include E:/Projects/QT/GUIProj/RRJClient/RRJClient/debug/moc_predefs.h -ID:/QT/5.14.2/mingw73_64/mkspecs/win32-g++ -IE:/Projects/QT/GUIProj/RRJClient/RRJClient -ID:/QT/5.14.2/mingw73_64/include -ID:/QT/5.14.2/mingw73_64/include/QtWidgets -ID:/QT/5.14.2/mingw73_64/include/QtGui -ID:/QT/5.14.2/mingw73_64/include/QtANGLE -ID:/QT/5.14.2/mingw73_64/include/QtNetwork -ID:/QT/5.14.2/mingw73_64/include/QtCore -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -ID:/QT/Tools/mingw730_32/i686-w64-mingw32/include Core\recognizesystem.h -o debug\moc_recognizesystem.cpp @@ -945,7 +947,7 @@ debug/moc_tcpclient.cpp: Core/tcpclient.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -978,6 +980,7 @@ debug/moc_tcpclient.cpp: Core/tcpclient.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ debug/moc_predefs.h \ D:/QT/5.14.2/mingw73_64/bin/moc.exe D:\QT\5.14.2\mingw73_64\bin\moc.exe $(DEFINES) --include E:/Projects/QT/GUIProj/RRJClient/RRJClient/debug/moc_predefs.h -ID:/QT/5.14.2/mingw73_64/mkspecs/win32-g++ -IE:/Projects/QT/GUIProj/RRJClient/RRJClient -ID:/QT/5.14.2/mingw73_64/include -ID:/QT/5.14.2/mingw73_64/include/QtWidgets -ID:/QT/5.14.2/mingw73_64/include/QtGui -ID:/QT/5.14.2/mingw73_64/include/QtANGLE -ID:/QT/5.14.2/mingw73_64/include/QtNetwork -ID:/QT/5.14.2/mingw73_64/include/QtCore -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -ID:/QT/Tools/mingw730_32/i686-w64-mingw32/include Core\tcpclient.h -o debug\moc_tcpclient.cpp @@ -1152,6 +1155,7 @@ debug/moc_mainwindow.cpp: mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/UpdateController.h \ Core/externalexecuter.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ @@ -1183,7 +1187,7 @@ compiler_clean: compiler_rcc_clean compiler_moc_predefs_clean compiler_moc_heade ####### Compile -debug/updatecontroller.o: Core/updatecontroller.cpp Core/updatecontroller.h \ +debug/updatecontroller.o: Core/updatecontroller.cpp Core/UpdateController.h \ Core/FileData.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QList \ D:/QT/5.14.2/mingw73_64/include/QtCore/qlist.h \ @@ -1339,23 +1343,24 @@ debug/updatecontroller.o: Core/updatecontroller.cpp Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ - Core/tools.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/externalexecuter.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qdir.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qfileinfo.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QDirIterator \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qdiriterator.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qprocess.h \ + Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ D:/QT/5.14.2/mingw73_64/include/QtCore/qcryptographichash.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QDirIterator \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qdiriterator.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qdir.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qfileinfo.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTextStream \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QDateTime + D:/QT/5.14.2/mingw73_64/include/QtCore/QDateTime \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ + Core/tools.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/externalexecuter.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qprocess.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\updatecontroller.o Core\updatecontroller.cpp debug/externalexecuter.o: Core/externalexecuter.cpp Core/externalexecuter.h \ @@ -1667,7 +1672,7 @@ debug/recognizesystem.o: Core/recognizesystem.cpp Core/recognizesystem.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -1699,7 +1704,8 @@ debug/recognizesystem.o: Core/recognizesystem.cpp Core/recognizesystem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qboxlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ - D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h + D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\recognizesystem.o Core\recognizesystem.cpp debug/screenchecker.o: Core/screenchecker.cpp Core/screenchecker.h \ @@ -2010,6 +2016,7 @@ debug/tcpclient.o: Core/tcpclient.cpp Core/tcpclient.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/UpdateController.h \ Core/externalexecuter.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ @@ -2231,7 +2238,7 @@ debug/main.o: main.cpp mainwindow.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -2264,6 +2271,7 @@ debug/main.o: main.cpp mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/QApplication \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qapplication.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qdesktopwidget.h @@ -2409,7 +2417,7 @@ debug/mainwindow.o: mainwindow.cpp mainwindow.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -2442,6 +2450,7 @@ debug/mainwindow.o: mainwindow.cpp mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ ui_mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTimer \ D:/QT/5.14.2/mingw73_64/include/QtCore/qtimer.h \ diff --git a/Makefile.Release b/Makefile.Release index 9acbaad..9823f8a 100644 --- a/Makefile.Release +++ b/Makefile.Release @@ -328,6 +328,7 @@ release/moc_updatecontroller.cpp: Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/UpdateController.h \ Core/externalexecuter.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ @@ -629,7 +630,7 @@ release/moc_recognizesystem.cpp: Core/recognizesystem.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -662,6 +663,7 @@ release/moc_recognizesystem.cpp: Core/recognizesystem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ release/moc_predefs.h \ D:/QT/5.14.2/mingw73_64/bin/moc.exe D:\QT\5.14.2\mingw73_64\bin\moc.exe $(DEFINES) --include E:/Projects/QT/GUIProj/RRJClient/RRJClient/release/moc_predefs.h -ID:/QT/5.14.2/mingw73_64/mkspecs/win32-g++ -IE:/Projects/QT/GUIProj/RRJClient/RRJClient -ID:/QT/5.14.2/mingw73_64/include -ID:/QT/5.14.2/mingw73_64/include/QtWidgets -ID:/QT/5.14.2/mingw73_64/include/QtGui -ID:/QT/5.14.2/mingw73_64/include/QtANGLE -ID:/QT/5.14.2/mingw73_64/include/QtNetwork -ID:/QT/5.14.2/mingw73_64/include/QtCore -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -ID:/QT/Tools/mingw730_32/i686-w64-mingw32/include Core\recognizesystem.h -o release\moc_recognizesystem.cpp @@ -945,7 +947,7 @@ release/moc_tcpclient.cpp: Core/tcpclient.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -978,6 +980,7 @@ release/moc_tcpclient.cpp: Core/tcpclient.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ release/moc_predefs.h \ D:/QT/5.14.2/mingw73_64/bin/moc.exe D:\QT\5.14.2\mingw73_64\bin\moc.exe $(DEFINES) --include E:/Projects/QT/GUIProj/RRJClient/RRJClient/release/moc_predefs.h -ID:/QT/5.14.2/mingw73_64/mkspecs/win32-g++ -IE:/Projects/QT/GUIProj/RRJClient/RRJClient -ID:/QT/5.14.2/mingw73_64/include -ID:/QT/5.14.2/mingw73_64/include/QtWidgets -ID:/QT/5.14.2/mingw73_64/include/QtGui -ID:/QT/5.14.2/mingw73_64/include/QtANGLE -ID:/QT/5.14.2/mingw73_64/include/QtNetwork -ID:/QT/5.14.2/mingw73_64/include/QtCore -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -ID:/QT/Tools/mingw730_32/i686-w64-mingw32/include Core\tcpclient.h -o release\moc_tcpclient.cpp @@ -1152,6 +1155,7 @@ release/moc_mainwindow.cpp: mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/UpdateController.h \ Core/externalexecuter.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ @@ -1183,7 +1187,7 @@ compiler_clean: compiler_rcc_clean compiler_moc_predefs_clean compiler_moc_heade ####### Compile -release/updatecontroller.o: Core/updatecontroller.cpp Core/updatecontroller.h \ +release/updatecontroller.o: Core/updatecontroller.cpp Core/UpdateController.h \ Core/FileData.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QList \ D:/QT/5.14.2/mingw73_64/include/QtCore/qlist.h \ @@ -1339,23 +1343,24 @@ release/updatecontroller.o: Core/updatecontroller.cpp Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ - Core/tools.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/externalexecuter.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qdir.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qfileinfo.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QDirIterator \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qdiriterator.h \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ - D:/QT/5.14.2/mingw73_64/include/QtCore/qprocess.h \ + Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ D:/QT/5.14.2/mingw73_64/include/QtCore/qcryptographichash.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QDirIterator \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qdiriterator.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qdir.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qfileinfo.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTextStream \ - D:/QT/5.14.2/mingw73_64/include/QtCore/QDateTime + D:/QT/5.14.2/mingw73_64/include/QtCore/QDateTime \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ + Core/tools.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/externalexecuter.h \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ + D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ + D:/QT/5.14.2/mingw73_64/include/QtCore/qprocess.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\updatecontroller.o Core\updatecontroller.cpp release/externalexecuter.o: Core/externalexecuter.cpp Core/externalexecuter.h \ @@ -1667,7 +1672,7 @@ release/recognizesystem.o: Core/recognizesystem.cpp Core/recognizesystem.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -1699,7 +1704,8 @@ release/recognizesystem.o: Core/recognizesystem.cpp Core/recognizesystem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qboxlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ - D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h + D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\recognizesystem.o Core\recognizesystem.cpp release/screenchecker.o: Core/screenchecker.cpp Core/screenchecker.h \ @@ -2010,6 +2016,7 @@ release/tcpclient.o: Core/tcpclient.cpp Core/tcpclient.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ + Core/UpdateController.h \ Core/externalexecuter.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QDir \ D:/QT/5.14.2/mingw73_64/include/QtCore/QProcess \ @@ -2231,7 +2238,7 @@ release/main.o: main.cpp mainwindow.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -2264,6 +2271,7 @@ release/main.o: main.cpp mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/QApplication \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qapplication.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qdesktopwidget.h @@ -2409,7 +2417,7 @@ release/mainwindow.o: mainwindow.cpp mainwindow.h \ Core/tools.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTime \ D:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ - Core/updatecontroller.h \ + Core/UpdateController.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamReader \ D:/QT/5.14.2/mingw73_64/include/QtCore/QXmlStreamAttribute \ D:/QT/5.14.2/mingw73_64/include/QtCore/QCryptographicHash \ @@ -2442,6 +2450,7 @@ release/mainwindow.o: mainwindow.cpp mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayout.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qlayoutitem.h \ D:/QT/5.14.2/mingw73_64/include/QtWidgets/qgridlayout.h \ + Core/updatecontroller.h \ ui_mainwindow.h \ D:/QT/5.14.2/mingw73_64/include/QtCore/QTimer \ D:/QT/5.14.2/mingw73_64/include/QtCore/qtimer.h \ diff --git a/RRJClient.pro.user b/RRJClient.pro.user index ea953d4..90f62d0 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -67,7 +67,7 @@ Desktop Qt 5.14.2 MinGW 64-bit Desktop Qt 5.14.2 MinGW 64-bit qt.qt5.5142.win64_mingw73_kit - 0 + 1 0 0 @@ -299,7 +299,7 @@ false true - E:/Projects/QT/GUIProj/RRJClient/RRJClient + E:/Projects/QT/GUIProj/RRJClient/Deploy 1 diff --git a/StaticData/authData.xml b/StaticData/authData.xml index eb91cc9..d128b5a 100644 --- a/StaticData/authData.xml +++ b/StaticData/authData.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/StaticData/hash.xml b/StaticData/hash.xml index d72dd6f..10e0b53 100644 --- a/StaticData/hash.xml +++ b/StaticData/hash.xml @@ -53,12 +53,10 @@ - - @@ -186,9 +184,8 @@ - - - + + @@ -198,7 +195,7 @@ - + diff --git a/StaticData/temp.xml b/StaticData/temp.xml index 592c5a2..d67ab92 100644 --- a/StaticData/temp.xml +++ b/StaticData/temp.xml @@ -1,2 +1,2 @@ - + diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index c2714df..08b98c7 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/dataparser.o b/debug/dataparser.o index cb0d3b3..c9ce466 100644 Binary files a/debug/dataparser.o and b/debug/dataparser.o differ diff --git a/debug/externalexecuter.o b/debug/externalexecuter.o index 5cab441..1eecaab 100644 Binary files a/debug/externalexecuter.o and b/debug/externalexecuter.o differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index 231edca..97ffedb 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/moc_mainwindow.o b/debug/moc_mainwindow.o index b7a93a1..4a03039 100644 Binary files a/debug/moc_mainwindow.o and b/debug/moc_mainwindow.o differ diff --git a/debug/moc_recognizesystem.cpp b/debug/moc_recognizesystem.cpp index 2c8b7f1..ac2e3d5 100644 --- a/debug/moc_recognizesystem.cpp +++ b/debug/moc_recognizesystem.cpp @@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_RecognizeSystem_t { - QByteArrayData data[17]; - char stringdata0[224]; + QByteArrayData data[18]; + char stringdata0[241]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -44,19 +44,21 @@ QT_MOC_LITERAL(8, 88, 9), // "fileCount" QT_MOC_LITERAL(9, 98, 15), // "sigSendDebugLog" QT_MOC_LITERAL(10, 114, 7), // "message" QT_MOC_LITERAL(11, 122, 17), // "sigSocketDisabled" -QT_MOC_LITERAL(12, 140, 16), // "sigSaveLoginData" -QT_MOC_LITERAL(13, 157, 20), // "ServerAuthorization*" -QT_MOC_LITERAL(14, 178, 10), // "serverAuth" -QT_MOC_LITERAL(15, 189, 25), // "sigSocketWaitForReadyRead" -QT_MOC_LITERAL(16, 215, 8) // "waitTime" +QT_MOC_LITERAL(12, 140, 16), // "sigServerBlocked" +QT_MOC_LITERAL(13, 157, 16), // "sigSaveLoginData" +QT_MOC_LITERAL(14, 174, 20), // "ServerAuthorization*" +QT_MOC_LITERAL(15, 195, 10), // "serverAuth" +QT_MOC_LITERAL(16, 206, 25), // "sigSocketWaitForReadyRead" +QT_MOC_LITERAL(17, 232, 8) // "waitTime" }, "RecognizeSystem\0sigUpdateBytesAvailable\0" "\0size\0sended\0sigLoadComplete\0sigNeedUpdate\0" "flag\0fileCount\0sigSendDebugLog\0message\0" - "sigSocketDisabled\0sigSaveLoginData\0" - "ServerAuthorization*\0serverAuth\0" - "sigSocketWaitForReadyRead\0waitTime" + "sigSocketDisabled\0sigServerBlocked\0" + "sigSaveLoginData\0ServerAuthorization*\0" + "serverAuth\0sigSocketWaitForReadyRead\0" + "waitTime" }; #undef QT_MOC_LITERAL @@ -66,21 +68,22 @@ static const uint qt_meta_data_RecognizeSystem[] = { 8, // revision 0, // classname 0, 0, // classinfo - 7, 14, // methods + 8, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 7, // signalCount + 8, // signalCount // signals: name, argc, parameters, tag, flags - 1, 2, 49, 2, 0x06 /* Public */, - 5, 0, 54, 2, 0x06 /* Public */, - 6, 3, 55, 2, 0x06 /* Public */, - 9, 1, 62, 2, 0x06 /* Public */, - 11, 0, 65, 2, 0x06 /* Public */, - 12, 1, 66, 2, 0x06 /* Public */, - 15, 1, 69, 2, 0x06 /* Public */, + 1, 2, 54, 2, 0x06 /* Public */, + 5, 0, 59, 2, 0x06 /* Public */, + 6, 3, 60, 2, 0x06 /* Public */, + 9, 1, 67, 2, 0x06 /* Public */, + 11, 0, 70, 2, 0x06 /* Public */, + 12, 0, 71, 2, 0x06 /* Public */, + 13, 1, 72, 2, 0x06 /* Public */, + 16, 1, 75, 2, 0x06 /* Public */, // signals: parameters QMetaType::Void, QMetaType::LongLong, QMetaType::ULongLong, 3, 4, @@ -88,8 +91,9 @@ static const uint qt_meta_data_RecognizeSystem[] = { QMetaType::Void, QMetaType::Bool, QMetaType::LongLong, QMetaType::ULongLong, 7, 3, 8, QMetaType::Void, QMetaType::QString, 10, QMetaType::Void, - QMetaType::Void, 0x80000000 | 13, 14, - QMetaType::Void, QMetaType::Int, 16, + QMetaType::Void, + QMetaType::Void, 0x80000000 | 14, 15, + QMetaType::Void, QMetaType::Int, 17, 0 // eod }; @@ -105,8 +109,9 @@ void RecognizeSystem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int case 2: _t->sigNeedUpdate((*reinterpret_cast< bool(*)>(_a[1])),(*reinterpret_cast< qint64(*)>(_a[2])),(*reinterpret_cast< quint64(*)>(_a[3]))); break; case 3: _t->sigSendDebugLog((*reinterpret_cast< QString(*)>(_a[1]))); break; case 4: _t->sigSocketDisabled(); break; - case 5: _t->sigSaveLoginData((*reinterpret_cast< ServerAuthorization*(*)>(_a[1]))); break; - case 6: _t->sigSocketWaitForReadyRead((*reinterpret_cast< int(*)>(_a[1]))); break; + case 5: _t->sigServerBlocked(); break; + case 6: _t->sigSaveLoginData((*reinterpret_cast< ServerAuthorization*(*)>(_a[1]))); break; + case 7: _t->sigSocketWaitForReadyRead((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } } else if (_c == QMetaObject::IndexOfMethod) { @@ -146,17 +151,24 @@ void RecognizeSystem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int return; } } + { + using _t = void (RecognizeSystem::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&RecognizeSystem::sigServerBlocked)) { + *result = 5; + return; + } + } { using _t = void (RecognizeSystem::*)(ServerAuthorization * ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&RecognizeSystem::sigSaveLoginData)) { - *result = 5; + *result = 6; return; } } { using _t = void (RecognizeSystem::*)(int ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&RecognizeSystem::sigSocketWaitForReadyRead)) { - *result = 6; + *result = 7; return; } } @@ -192,13 +204,13 @@ int RecognizeSystem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 7) + if (_id < 8) qt_static_metacall(this, _c, _id, _a); - _id -= 7; + _id -= 8; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 7) + if (_id < 8) *reinterpret_cast(_a[0]) = -1; - _id -= 7; + _id -= 8; } return _id; } @@ -237,17 +249,23 @@ void RecognizeSystem::sigSocketDisabled() } // SIGNAL 5 -void RecognizeSystem::sigSaveLoginData(ServerAuthorization * _t1) +void RecognizeSystem::sigServerBlocked() { - void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; - QMetaObject::activate(this, &staticMetaObject, 5, _a); + QMetaObject::activate(this, &staticMetaObject, 5, nullptr); } // SIGNAL 6 -void RecognizeSystem::sigSocketWaitForReadyRead(int _t1) +void RecognizeSystem::sigSaveLoginData(ServerAuthorization * _t1) { void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; QMetaObject::activate(this, &staticMetaObject, 6, _a); } + +// SIGNAL 7 +void RecognizeSystem::sigSocketWaitForReadyRead(int _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; + QMetaObject::activate(this, &staticMetaObject, 7, _a); +} QT_WARNING_POP QT_END_MOC_NAMESPACE diff --git a/debug/moc_recognizesystem.o b/debug/moc_recognizesystem.o index f7ed826..8a561a7 100644 Binary files a/debug/moc_recognizesystem.o and b/debug/moc_recognizesystem.o differ diff --git a/debug/moc_tcpclient.o b/debug/moc_tcpclient.o index b3216f5..188b9fa 100644 Binary files a/debug/moc_tcpclient.o and b/debug/moc_tcpclient.o differ diff --git a/debug/recognizesystem.o b/debug/recognizesystem.o index eb6277b..fb39021 100644 Binary files a/debug/recognizesystem.o and b/debug/recognizesystem.o differ diff --git a/debug/tcpclient.o b/debug/tcpclient.o index 81bff9b..dcf9c2b 100644 Binary files a/debug/tcpclient.o and b/debug/tcpclient.o differ diff --git a/mainwindow.cpp b/mainwindow.cpp index 07368f4..1e71eaa 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -52,6 +52,7 @@ void MainWindow::initialize() connect(recognizeSystem,&RecognizeSystem::sigSocketDisabled,this,&MainWindow::lostConnection); connect(recognizeSystem,&RecognizeSystem::sigSaveLoginData,this,&MainWindow::checkLoginResult); connect(recognizeSystem,&RecognizeSystem::sigSocketWaitForReadyRead,client,&TCPClient::waitRead,Qt::AutoConnection); + connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&MainWindow::serverBlocked); connect(client,&TCPClient::sigGetXmlAnswer,dataParser,&DataParser::slotGetXmlAnswer); @@ -140,6 +141,18 @@ void MainWindow::lostConnection() slotConnectionState(false); } +void MainWindow::serverBlocked() +{ + ui->notificationLabel->show(); + QPalette palette = ui->notificationLabel->palette(); + QColor orangeColor(255,165,0); + palette.setColor(ui->notificationLabel->foregroundRole(),orangeColor); + ui->notificationLabel->setText(tr("Сервер заблокирован")); + + ui->notificationLabel->setPalette(palette); + timer->start(3000); +} + void MainWindow::checkLoginResult(ServerAuthorization *serverAuth) { if (serverAuth->Result){ @@ -287,8 +300,8 @@ void MainWindow::on_updateButton_clicked() void MainWindow::on_startButton_clicked() { - client->sendUnityConnect(); externalExecuter->callApp(); + client->sendDisable(); } diff --git a/mainwindow.h b/mainwindow.h index bd279eb..9425d21 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -80,6 +80,7 @@ private: void loadComplete(); void setNeedUpdate(bool flag,quint64 size,quint64 fileCount); void lostConnection(); + void serverBlocked(); void checkLoginResult(ServerAuthorization * serverAuth); void checkAppAvailable(); void checkLanguage(QString language);