add non-working GET for version

This commit is contained in:
Lion Kortlepel
2021-08-12 21:19:50 +02:00
committed by Lion
parent 3fb227e468
commit 12123582ad
5 changed files with 133 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
#include "TSentry.h"
#include "Common.h"
#include "CustomAssert.h"
#include "Http.h"
#include "TConfig.h"
#include "THeartbeatThread.h"
@@ -39,6 +40,8 @@ void UnixSignalHandler(int sig) {
// global, yes, this is ugly, no, it cant be done another way
TSentry Sentry { SECRET_SENTRY_URL };
#include <iostream>
int main(int argc, char** argv) try {
#ifdef __unix
#if DEBUG
@@ -55,9 +58,18 @@ int main(int argc, char** argv) try {
bool Shutdown = false;
Application::RegisterShutdownHandler([&Shutdown] { Shutdown = true; });
Assert(!Application::IsOutdated(std::array<int, 3> { 1, 0, 0 }, std::array<int, 3> { 1, 0, 0 }));
Assert(!Application::IsOutdated(std::array<int, 3> { 1, 0, 1 }, std::array<int, 3> { 1, 0, 0 }));
Assert(Application::IsOutdated(std::array<int, 3> { 1, 0, 0 }, std::array<int, 3> { 1, 0, 1 }));
Assert(Application::IsOutdated(std::array<int, 3> { 1, 0, 0 }, std::array<int, 3> { 1, 1, 0 }));
Assert(Application::IsOutdated(std::array<int, 3> { 1, 0, 0 }, std::array<int, 3> { 2, 0, 0 }));
Assert(!Application::IsOutdated(std::array<int, 3> { 2, 0, 0 }, std::array<int, 3> { 1, 0, 1 }));
TServer Server(argc, argv);
TConfig Config;
Application::CheckForUpdates();
if (Config.Failed()) {
info("Closing in 10 seconds");
std::this_thread::sleep_for(std::chrono::seconds(10));