mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Мессенджер полностью работает
This commit is contained in:
@@ -357,6 +357,26 @@ void RecognizeSystem::xmlParser(QByteArray array)
|
||||
emit sigAuth(serverAuth);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ServerMessage"){
|
||||
|
||||
ClientMessage *clientMessage = new ClientMessage;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Login"){
|
||||
clientMessage->Login = value;
|
||||
}
|
||||
if (name == "Text"){
|
||||
clientMessage->Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
emit signal_MessageForGUI(clientMessage->Login, clientMessage->Text);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "ServerDeAuthorization"){
|
||||
|
||||
ServerDeAuthorization *serverDeAuth = new ServerDeAuthorization;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "Datas.h"
|
||||
|
||||
|
||||
class RecognizeSystem : public QObject
|
||||
@@ -38,6 +39,8 @@ signals:
|
||||
void sigSocketWaitForReadyRead(int waitTime);
|
||||
void sigStartCompare();
|
||||
|
||||
void signal_MessageForGUI(QString login, QString text);
|
||||
|
||||
void sigAnswerQueryToDB_ListInstructors(QList<Instructor> listInstructors);
|
||||
void sigAnswerQueryToDB_ListGroups(QList<Group> listGroups);
|
||||
void sigAnswerQueryToDB_ListTrainees(QList<Trainee> listTrainees);
|
||||
|
||||
@@ -32,6 +32,8 @@ enum PacketType{
|
||||
TYPE_QT = 9,
|
||||
TYPE_DISABLE = 11,
|
||||
|
||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||
|
||||
//xml-ответы на запросы к БД
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS = 100,
|
||||
TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS = 101,
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
class ClientMessage
|
||||
{
|
||||
public:
|
||||
QString Login;
|
||||
QString Text;
|
||||
};
|
||||
|
||||
|
||||
@@ -281,8 +281,6 @@ void ConnectorToServer::slot_msgToClientReady(QString login, QString text)
|
||||
sendMessageForClient(id, login, text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ConnectorToServer::initialize()
|
||||
{
|
||||
createObjects();
|
||||
@@ -302,6 +300,7 @@ void ConnectorToServer::bindConnection()
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::sigLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_MessageForGUI,this,&ConnectorToServer::signal_msgFromClientReady);
|
||||
//connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB,this,&ConnectorToServer::slot_AnswerQueryToDB);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListInstructors,this,&ConnectorToServer::slot_AnswerQueryToDB_ListInstructors);
|
||||
|
||||
@@ -80,6 +80,8 @@ signals:
|
||||
|
||||
void signal_InitMessanger(QList<Trainee> listTrainees);
|
||||
|
||||
void signal_msgFromClientReady(QString login, QString text);
|
||||
|
||||
|
||||
private:
|
||||
void initialize();
|
||||
|
||||
Reference in New Issue
Block a user