mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
add socketio, http post & get
This commit is contained in:
committed by
Anonymous275
parent
4cda6e8bc3
commit
ef5db013b3
26
src/TResourceManager.cpp
Normal file
26
src/TResourceManager.cpp
Normal 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");
|
||||
}
|
||||
Reference in New Issue
Block a user