mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* Fixed bug where multiple of the same entries get added to the global ban/refuse list. * Fixed bug where we still use the client instance after deleting it in 'CBanSystem::BanListCheck()'. * Load banlist at a later state (not at construction of class), this is needed for a future change of adapting the 'business' code to feature the game's FileSystem. * CServer cleanup. * More detailed ban messages (banned, added to refused list, removed from slot, etc..). * Use localization key for banned message ("#Valve_Reject_Banned"). * Add const qualifiers to all CPylon methods. Note: * This commit requires changes on the master server, these changes are already performed, however the new master server isn't live yet until we publish the new release.
27 lines
695 B
C++
27 lines
695 B
C++
#pragma once
|
|
|
|
class CBanSystem
|
|
{
|
|
public:
|
|
void Load(void);
|
|
void Save(void) const;
|
|
|
|
bool AddEntry(const string& svIpAddress, const uint64_t nNucleusID);
|
|
bool DeleteEntry(const string& svIpAddress, const uint64_t nNucleusID);
|
|
|
|
bool AddConnectionRefuse(const string& svError, const uint64_t nNucleusID);
|
|
bool DeleteConnectionRefuse(const uint64_t nNucleusID);
|
|
|
|
void BanListCheck(void);
|
|
|
|
bool IsBanned(const string& svIpAddress, const uint64_t nNucleusID) 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;
|