mcrpc.h 906 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef MCRPC_H
  2. #define MCRPC_H
  3. #include <QDir>
  4. #include <QJsonObject>
  5. #include <QNetworkAccessManager>
  6. #include <QString>
  7. class mcrpc : public QObject
  8. {
  9. Q_OBJECT
  10. const QString platform = QSysInfo::kernelType();
  11. const QDir dirHome = QDir::home();
  12. QDir dirDotMC;
  13. QDir dirCache;
  14. QDir dirJars;
  15. QDir dirRP;
  16. const QString linkVM =
  17. "https://launchermeta.mojang.com/mc/game/version_manifest_v2.json";
  18. QTextStream qout;
  19. QTextStream qin;
  20. QNetworkAccessManager qnam;
  21. QFileInfo rp;
  22. QJsonObject mcv1;
  23. QJsonObject mcv2;
  24. QFile clientPath;
  25. QFileInfo chooseRP();
  26. QJsonObject chooseMCV();
  27. void compare(const QFileInfo &rp, const QJsonObject &mcv1, const QJsonObject &mcv2);
  28. void getClient(const QJsonObject &mcv);
  29. public:
  30. explicit mcrpc(QObject *parent = nullptr);
  31. signals:
  32. public slots:
  33. void run();
  34. };
  35. #endif // MCRPC_H