Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
@@ -0,0 +1,53 @@
|
||||
#include "message_factory.h"
|
||||
#include "messages.h"
|
||||
#include "json_keys.h"
|
||||
|
||||
#include <LtsWebSocket/client_message.h>
|
||||
#include <LtsWebSocket/json_keys.h>
|
||||
|
||||
#include <QUuid>
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *MessageFactory::createMessage(LtsWebSocket::ReplyHandler *client, const QString &message)
|
||||
{
|
||||
|
||||
|
||||
if (m_uuid.isEmpty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Got message without uuid: " << message << "'";
|
||||
WARNING_LOG(m_logger) << "Created UUID for error message!";
|
||||
return new ErrorMessage(QUuid::createUuid().toString(), QStringLiteral("Got message without uuid"));
|
||||
}
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *result = checkAttributes(client, message);
|
||||
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
if (m_type == JsonKeys::DEDICAED_DISCONNECT())
|
||||
result = new STC::DedicatedDisconnect(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGIN_REPLY())
|
||||
result = new STC::LoginRequestReply(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGOUT_REPLY())
|
||||
result = new STC::LoginRequestReply(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new CTS::LoginRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new CTS::LogoutRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::DISCONNECT_REQUEST())
|
||||
result = new CTS::DisconnectRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == LtsWebSocket::JsonKeys::ERROR_())
|
||||
return nullptr;
|
||||
|
||||
return checkResult(client, message, result);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user