mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 00:58:35 +00:00
feat(Misc): update to new API (#41)
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
CU_SET_PATH("CMAKE_MOD_ANTICHEAT_DIR" "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/PassiveAnticheat.cpp")
|
||||
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/AnticheatMgr.cpp")
|
||||
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/AnticheatScripts.cpp")
|
||||
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/AnticheatData.cpp")
|
||||
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/cs_anticheat.cpp")
|
||||
|
||||
AC_ADD_SCRIPT_LOADER("PassiveAnticheat" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h")
|
||||
|
||||
AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/Anticheat.conf.dist")
|
||||
@@ -37,9 +37,6 @@ void AnticheatData::SetLastOpcode(uint32 opcode)
|
||||
void AnticheatData::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
lastMovementInfo.pos = { x, y, z, o };
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 AnticheatData::GetLastOpcode() const
|
||||
|
||||
@@ -1,12 +1,31 @@
|
||||
#include "Configuration/Config.h"
|
||||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "AnticheatMgr.h"
|
||||
#include "Object.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Player.h"
|
||||
#include "Timer.h"
|
||||
|
||||
int64 resetTime = 0;
|
||||
int64 lastIterationPlayer = sWorld->GetUptime() + 30;//TODO: change 30 secs static to a configurable option
|
||||
|
||||
class AnticheatPlayerScript : public PlayerScript
|
||||
{
|
||||
public:
|
||||
@@ -43,7 +62,8 @@ public:
|
||||
UpdateReportResetTime();
|
||||
sLog->outString( "Anticheat: Next daily report reset: %ld", resetTime);
|
||||
}
|
||||
if (sWorld->GetUptime() > lastIterationPlayer)
|
||||
|
||||
if (sWorld->GetUptime() > lastIterationPlayer)
|
||||
{
|
||||
lastIterationPlayer = sWorld->GetUptime() + sConfigMgr->GetOption<uint32>("Anticheat.SaveReportsTime", 60);
|
||||
sLog->outString( "Saving reports for %u players.", sWorld->GetPlayerCount());
|
||||
@@ -53,13 +73,15 @@ public:
|
||||
sAnticheatMgr->SavePlayerData(plr);
|
||||
}
|
||||
}
|
||||
void OnAfterConfigLoad(bool /* reload */) override // unusued parameter
|
||||
|
||||
void OnAfterConfigLoad(bool /* reload */) override // unusued parameter
|
||||
{
|
||||
sLog->outString("AnticheatModule Loaded.");
|
||||
}
|
||||
void UpdateReportResetTime()
|
||||
|
||||
void UpdateReportResetTime()
|
||||
{
|
||||
resetTime = sWorld->GetNextTimeWithDayAndHour(-1, 6);
|
||||
resetTime = Acore::Time::GetNextTimeWithDayAndHour(-1, 6);
|
||||
}
|
||||
};
|
||||
class AnticheatMovementHandlerScript : public MovementHandlerScript
|
||||
|
||||
@@ -1,8 +1,25 @@
|
||||
#include "cs_anticheat.h"
|
||||
#include "AnticheatScripts.h"
|
||||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
void AddPassiveAnticheatScripts()
|
||||
void startAnticheatScripts();
|
||||
void AddSC_anticheat_commandscript();
|
||||
|
||||
void Addmod_anticheatScripts()
|
||||
{
|
||||
startAnticheatScripts();
|
||||
AddSC_anticheat_commandscript();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
void AddPassiveAnticheatScripts();
|
||||
Reference in New Issue
Block a user