-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreaction.cpp
More file actions
51 lines (40 loc) · 1.21 KB
/
reaction.cpp
File metadata and controls
51 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "reaction.h"
#include "games.h"
#include "utils.h"
#include "settings.h"
#include "logging.h"
#include "serverlink.h"
#include "authentification.h"
#include <QJsonDocument>
#include <QJsonObject>
#include <QObject>
namespace Pico{
namespace Reaction{
Funcs::Funcs(QObject *parent) :
QObject(parent)
{}
Pico::Logging::Funcs logging;
Pico::Games::Funcs games;
Pico::Settings::FD_CONFIG FDC;
////
/// \brief Funcs::MakeResponse
/// \param inputData
/// \param gamesMap
/// \return
///
QString Funcs::MakeResponse(
QString inputData,
std::map<int, QJsonObject> &gamesMap,
Pico::Server::Funcs &server
){
QString response = "";
QJsonDocument jsonDocument = QJsonDocument::fromJson(inputData.toLocal8Bit());
QJsonObject jsonObject = jsonDocument.object();
QString command = jsonObject.value("command").toString();
if (response.length() > 0){
logging.Write(QString::fromStdString("MAKE_RESPONSE => ") + response);
}
return response;
}
}
}