Files
RRJServer/InstructorsAndTrainees/connectorToServer/Core/tools.h
2025-11-26 17:28:22 +03:00

87 lines
2.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef GLOBAL_H
#define GLOBAL_H
#include <QString>
#include <QTime>
#include <QDebug>
#define TCP_READ_TIMEOUT 2000
static QString applicationEXEName = "RRJ.exe";
static QString applicationFolderName = "/Application";
static QString staticDataFolderName = "StaticData";
static QString additionalFilesFolderName = "RRJ-95NEW-100";
static QString streamingAssetsPath = "/Application/RRJLoader/RRJ_Data/StreamingAssets";
static QString hashFilename = staticDataFolderName + "/clientHash.xml";
static QString configFolderName = "config";
static QString settingsName = configFolderName + "/settings.xml";
static QString tempName = staticDataFolderName + "/temp.xml";
static QString authTempName = staticDataFolderName + "/authData.xml";
static QString displayTemp = staticDataFolderName + "/displayData.xml";
static QString streamingHashFilename = staticDataFolderName + "/streamingHash.xml";
static QString serverHash = staticDataFolderName + "/serverHash.xml";
static QString cmd_CheckVersionList = "CHECKVERSIONLIST";
static QString cmd_GetOfflineMessages = "GETOFFLINEMESSAGE";
enum PacketType{
TYPE_NONE = 0,
TYPE_UNITY = 1,
TYPE_FILE = 2,
TYPE_COMMAND = 3,
TYPE_FOLDER = 4,
TYPE_DELETE = 5,
TYPE_FINISH = 6,
TYPE_NEEDUPDATE = 7,
TYPE_XMLANSWER = 8,
TYPE_QT = 9,
TYPE_DISABLE = 11,
TYPE_CHECKVERSION = 13,
TYPE_GET_OLD_MESSAGES = 22,
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
//xml-ответы на запросы к БД
TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS = 100,
TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS = 101,
TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES = 102,
TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS = 103,
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
TYPE_XMLANSWER_QUERY_TASKS_AMM_FOR_TRAINEE = 106,
TYPE_XMLANSWER_QUERY_TASKS_FIM_FOR_TRAINEE = 107,
//xml-ответы на запросы AdditionalFiles
TYPE_XMLANSWER_QUERY_TASKS_XML_FIM = 130,
TYPE_XMLANSWER_QUERY_TASKS_XML_AMM = 131,
//оповещение об изменении docs.xml
TYPE_XMLANSWER_DOCS_CHANGED = 132,
TYPE_XMLANSWER_QUERY_LIST_SUB_PROC_AMM = 133,
GET_VERSION = 149,
HASH_READY = 150,
CHANGE_DATA_VERSION = 151,
COPY_VERSION = 152,
DELETE_DATA_VERSION = 153,
BUSY = 154,
FREE = 155
};
//Q_DECLARE_METATYPE(PacketType)
class Tools {
public:
static void printTime();
static QString getTime();
static QString createLocalPath(QString path);
static QString createFullPath(QString path);
static QString convertFileSize(quint64 fileSize);
};
#endif // GLOBAL_H