Skip to content

Commit

Permalink
Antispam (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb authored Aug 27, 2022
1 parent 373fde4 commit a38a389
Show file tree
Hide file tree
Showing 7 changed files with 753 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/game/Anticheat/Anticheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ AnticheatManager* GetAnticheatLib()
#include "World.h"
#include "WorldSession.h"

#include "Antispam/Antispam.h"
#include "MovementAnticheat/MovementAnticheat.h"
#include "WardenAnticheat/Warden.hpp"
#include "WardenAnticheat/WardenScanMgr.hpp"
Expand All @@ -41,6 +42,10 @@ AnticheatManager* GetAnticheatLib()

void AnticheatManager::LoadAnticheatData()
{
sLog.outString();
sLog.outString("Loading antispam system ...");
sAntispam->loadConfig();

sLog.outString();
sLog.outString("Loading warden checks...");
sWardenScanMgr.loadFromDB();
Expand Down Expand Up @@ -74,4 +79,9 @@ Warden* AnticheatManager::CreateWardenFor(WorldSession* client, BigNumber* K)
return nullptr;
}

AntispamInterface* AnticheatManager::GetAntispam() const
{
return sAntispam;
}

#endif
5 changes: 3 additions & 2 deletions src/game/Anticheat/Anticheat.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ class AnticheatManager
#ifdef USE_ANTICHEAT
void LoadAnticheatData();

Warden * CreateWardenFor(WorldSession* client, BigNumber* K);
Warden* CreateWardenFor(WorldSession* client, BigNumber* K);
MovementAnticheat* CreateAnticheatFor(Player* player);
AntispamInterface* GetAntispam() const;
#else
void LoadAnticheatData() {}

Expand All @@ -141,10 +142,10 @@ class AnticheatManager
{
return new MovementAnticheat();
}
AntispamInterface* GetAntispam() const { return nullptr; }
#endif

// Antispam wrappers
AntispamInterface* GetAntispam() const { return nullptr; }
bool CanWhisper(AccountPersistentData const& data, MasterPlayer* player) { return true; }

static AnticheatManager* instance();
Expand Down
Loading

0 comments on commit a38a389

Please sign in to comment.