2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class CBanSystem
|
|
|
|
{
|
|
|
|
public:
|
2022-02-19 02:31:16 +01:00
|
|
|
void Load(void);
|
|
|
|
void Save(void) const;
|
|
|
|
|
2022-08-29 15:59:12 +02:00
|
|
|
bool AddEntry(const string& svIpAddress, const uint64_t nNucleusID);
|
|
|
|
bool DeleteEntry(const string& svIpAddress, const uint64_t nNucleusID);
|
2022-06-14 20:56:55 +02:00
|
|
|
|
2022-08-30 12:07:09 +02:00
|
|
|
bool AddConnectionRefuse(const string& svError, const uint64_t nNucleusID);
|
|
|
|
bool DeleteConnectionRefuse(const uint64_t nNucleusID);
|
2022-02-19 02:31:16 +01:00
|
|
|
|
2022-06-14 20:56:55 +02:00
|
|
|
void BanListCheck(void);
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-08-29 15:59:12 +02:00
|
|
|
bool IsBanned(const string& svIpAddress, const uint64_t nNucleusID) const;
|
2022-02-19 02:31:16 +01:00
|
|
|
bool IsRefuseListValid(void) const;
|
|
|
|
bool IsBanListValid(void) const;
|
|
|
|
|
2022-09-15 23:13:37 +02:00
|
|
|
void KickPlayerByName(const string& svPlayerName);
|
|
|
|
void KickPlayerById(const string& svHandle);
|
|
|
|
|
|
|
|
void BanPlayerByName(const string& svPlayerName);
|
|
|
|
void BanPlayerById(const string& svHandle);
|
|
|
|
|
2022-09-16 00:51:35 +02:00
|
|
|
void UnbanPlayer(const string& svCriteria);
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
private:
|
2022-06-14 20:56:55 +02:00
|
|
|
vector<std::pair<string, uint64_t>> m_vRefuseList = {};
|
|
|
|
vector<std::pair<string, uint64_t>> m_vBanList = {};
|
2021-12-25 22:36:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern CBanSystem* g_pBanSystem;
|