add socketio, http post & get

This commit is contained in:
Lion Kortlepel
2021-02-16 12:37:55 +01:00
committed by Anonymous275
parent 4cda6e8bc3
commit ef5db013b3
12 changed files with 487 additions and 19 deletions

26
src/TResourceManager.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include "TResourceManager.h"
#include <algorithm>
#include <filesystem>
namespace fs = std::filesystem;
TResourceManager::TResourceManager() {
std::string Path = Application::Settings.Resource + "/Client";
if (!fs::exists(Path))
fs::create_directory(Path);
for (const auto& entry : fs::directory_iterator(Path)) {
auto pos = entry.path().string().find(".zip");
if (pos != std::string::npos) {
if (entry.path().string().length() - pos == 4) {
mFileList += entry.path().string() + ";";
mFileSizes += std::to_string(uint64_t(fs::file_size(entry.path()))) + ";";
mMaxModSize += uint64_t(fs::file_size(entry.path()));
mModsLoaded++;
}
}
}
std::replace(mFileList.begin(), mFileList.end(), '\\', '/');
if (mModsLoaded)
info("Loaded " + std::to_string(mModsLoaded) + " Mods");
}