mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
now every player has their own list of allowed client mods, this can be modified by lua upon joining and is later used as a whitelist to ensure only those files can be sent to each client
22 lines
719 B
C++
22 lines
719 B
C++
#pragma once
|
|
|
|
#include "Common.h"
|
|
#include <optional>
|
|
|
|
using ModMap = HashMap<std::string, size_t>;
|
|
|
|
class TResourceManager {
|
|
public:
|
|
TResourceManager();
|
|
|
|
[[nodiscard]] size_t TotalModsSize() const { return mTotalModSize; }
|
|
[[nodiscard]] ModMap FileMap() const { return mMods; }
|
|
[[nodiscard]] static std::string FormatForBackend(const ModMap& mods);
|
|
[[nodiscard]] static std::string FormatForClient(const ModMap& mods);
|
|
[[nodiscard]] static std::optional<std::string> IsModValid(std::string& pathString, const ModMap& mods);
|
|
[[nodiscard]] int LoadedModCount() const { return mMods.size(); }
|
|
|
|
private:
|
|
size_t mTotalModSize = 0; // size of all mods
|
|
ModMap mMods; // map of mod names
|
|
}; |