mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
До трансляции message на ГУИ от Клиента
This commit is contained in:
@@ -72,6 +72,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
connect(this,&ServerLMSWidget::sigLog,logger,&Logger::addTextToLogger);
|
||||
|
||||
connect(processingSystem,&ProcessingSystem::sigAuthChanged,this, &ServerLMSWidget::slot_AuthChanged);
|
||||
connect(processingSystem,&ProcessingSystem::signal_msgToClientReady,this, &ServerLMSWidget::slot_msgToClientFromGUI);
|
||||
|
||||
on_btnStartServer_clicked();
|
||||
|
||||
@@ -227,7 +228,7 @@ void ServerLMSWidget::slot_LanguageChanged(QString language)
|
||||
}
|
||||
|
||||
|
||||
void ServerLMSWidget::slot_msgToClientReady(QString login, QString text)
|
||||
void ServerLMSWidget::slot_msgToClientFromGUI(QString login, QString text)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
@@ -253,6 +254,32 @@ void ServerLMSWidget::slot_msgToClientReady(QString login, QString text)
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_msgToGUIfromClient(QString login, QString text)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
QByteArray byteArrayMsg = dataParser->xmlAnswer_message(textMsg);
|
||||
|
||||
//Проходим все открытые сокеты, ищем нужный
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
ClientHandler *handler = clientsMap[idSocket];
|
||||
if(handler->getClient()->getTypeClient() == TypeClientAutorization::TYPE_GUI)
|
||||
{//Отправляем GUI-клиенту для отображения в Мессенджере
|
||||
|
||||
handler->sendXmlAnswer(byteArrayMsg);
|
||||
|
||||
QString peerAddress = clientsMap[idSocket]->getSocket()->peerAddress().toString();
|
||||
QString peerPort = QString::number(clientsMap[idSocket]->getSocket()->peerPort());
|
||||
|
||||
QString str = "Msg From Client [" + peerAddress + ":" + peerPort + "] : " + textMsg;
|
||||
|
||||
logger->addTextToLogger(str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slotAddToLog(QString msg)
|
||||
{
|
||||
ui->listWidgetLogger->addItem(msg);
|
||||
|
||||
Reference in New Issue
Block a user