mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-04-12 18:06:01 +00:00
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
///
|
|
/// Created by Anonymous275 on 7/28/2020
|
|
///
|
|
#include "Security/Enc.h"
|
|
#include <filesystem>
|
|
#include "Settings.h"
|
|
#include <algorithm>
|
|
#include "Logger.h"
|
|
namespace fs = std::experimental::filesystem;
|
|
uint64_t MaxModSize = 0;
|
|
std::string FileSizes;
|
|
std::string FileList;
|
|
int ModsLoaded = 0;
|
|
|
|
void InitRes(){
|
|
std::string Path = Resource + Sec("/Client");
|
|
if(!fs::exists(Path))fs::create_directory(Path);
|
|
for (const auto & entry : fs::directory_iterator(Path)){
|
|
auto pos = entry.path().string().find(Sec(".zip"));
|
|
if(pos != std::string::npos){
|
|
if(entry.path().string().length() - pos == 4){
|
|
FileList += entry.path().string() + ";";
|
|
FileSizes += std::to_string(fs::file_size(entry.path()))+";";
|
|
MaxModSize += fs::file_size(entry.path());
|
|
ModsLoaded++;
|
|
}
|
|
}
|
|
}
|
|
std::replace(FileList.begin(),FileList.end(),'\\','/');
|
|
if(ModsLoaded){
|
|
info(Sec("Loaded ")+std::to_string(ModsLoaded)+Sec(" Mods"));
|
|
}
|
|
} |