mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* Refactored code; kick & ban now share the same function. * Kick & ban will now log a confirmation to the console. * Players in refused list will no longer get banned, this was initially performed to keep load off the master server, but this turned out to be excessive. It also caused the side effect of having players banned even if their bans have been removed from the master server.
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
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;
|
|
|
|
void KickPlayerByName(const string& svPlayerName);
|
|
void KickPlayerById(const string& svHandle);
|
|
|
|
void BanPlayerByName(const string& svPlayerName);
|
|
void BanPlayerById(const string& svHandle);
|
|
|
|
void UnbanPlayer(const string& svCriteria);
|
|
|
|
private:
|
|
void AuthorPlayerByName(const string& svPlayerName, const bool bBan);
|
|
void AuthorPlayerById(const string& svHandle, const bool bBan);
|
|
|
|
vector<std::pair<string, uint64_t>> m_vRefuseList = {};
|
|
vector<std::pair<string, uint64_t>> m_vBanList = {};
|
|
};
|
|
|
|
extern CBanSystem* g_pBanSystem;
|