Files
RRJClient/Core/tools.h
2025-07-23 12:29:34 +03:00

69 lines
2.0 KiB
C++

#ifndef GLOBAL_H
#define GLOBAL_H
#include <QString>
#include <QTime>
#include <QDebug>
#include <QDir>
#include <Data/streamingversiondata.h>
#define TCP_READ_TIMEOUT 2000
static QString applicationEXEName = "RRJ.exe";
static QString applicationFolderName = "/Application";
static QString staticDataFolderName = "/StaticData";
static QString fullStaticDataFolderName = QDir::currentPath() + staticDataFolderName;
static QString streamingAssetsPath = "/Application/RRJLoader/RRJ_Data/StreamingAssets";
static QString hashFilename = "/clientHash.xml";
static QString settingsName = fullStaticDataFolderName + "/settings.xml";
static QString tempName = fullStaticDataFolderName + "/temp.xml";
static QString authTempName = fullStaticDataFolderName + "/authData.xml";
static QString displayTemp = fullStaticDataFolderName + "/displayData.xml";
static QString streamingHashFilename = fullStaticDataFolderName + "/streamingHash.xml";
static QString serverHash = fullStaticDataFolderName + "/serverHash.xml";
static QString cmd_CheckVersionList = "CHECKVERSIONLIST";
static QString cmd_GetServerHash = "GETSERVERDATALIST";
static QString cmd_Disable = "DISABLE";
static QString baseNamePackage = "base";
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_UPDATE = 12,
TYPE_CHECK_VERSION = 13,
HASH_READY = 150,
CHANGE_DATA_VERSION = 151,
COPY_VERSION = 152,
DELETE_DATA_VERSION = 153,
BUSY = 154,
FREE = 155,
HASH_CALCULATE_START = 156
};
class Tools {
public:
static void printTime();
static QString getTime();
static QString createLocalPath(QString path);
static QString createSendFullPath(QString path);
static QString createReceiveFullPath(QString path,StreamingVersionData *version);
static QString convertFileSize(quint64 fileSize);
};
#endif // GLOBAL_H