mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* Run 'CHostState::Think()' in the main thread. * Construct 'NetGameServer_t' objects in main thread before dispatching (TODO: browser). * Dispatch the call to 'CBanSystem::AddConnectionRefuse' from 'SV_IsClientBanned' to the main thread if we aren't main. * Return bool for CBanSystem::AddEntry and CBanSystem::DeleteEntry for future optimizations (next commit).
30 lines
775 B
C++
30 lines
775 B
C++
#pragma once
|
|
|
|
class CBanSystem
|
|
{
|
|
public:
|
|
CBanSystem(void);
|
|
void operator[](std::pair<const string&, const uint64_t> pair);
|
|
|
|
void Load(void);
|
|
void Save(void) const;
|
|
|
|
bool AddEntry(const string& svIpAddress, const uint64_t nOriginID);
|
|
bool DeleteEntry(const string& svIpAddress, const uint64_t nOriginID);
|
|
|
|
void AddConnectionRefuse(const string& svError, const uint64_t nOriginID);
|
|
void DeleteConnectionRefuse(const uint64_t nOriginID);
|
|
|
|
void BanListCheck(void);
|
|
|
|
bool IsBanned(const string& svIpAddress, const uint64_t nOriginID) const;
|
|
bool IsRefuseListValid(void) const;
|
|
bool IsBanListValid(void) const;
|
|
|
|
private:
|
|
vector<std::pair<string, uint64_t>> m_vRefuseList = {};
|
|
vector<std::pair<string, uint64_t>> m_vBanList = {};
|
|
};
|
|
|
|
extern CBanSystem* g_pBanSystem;
|