diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 00ef8ff..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -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") diff --git a/src/AnticheatData.cpp b/src/AnticheatData.cpp index b0584e5..56edd63 100644 --- a/src/AnticheatData.cpp +++ b/src/AnticheatData.cpp @@ -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 diff --git a/src/AnticheatScripts.cpp b/src/AnticheatScripts.cpp index d5c2848..f66c58e 100644 --- a/src/AnticheatScripts.cpp +++ b/src/AnticheatScripts.cpp @@ -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 . + */ + +#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("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 diff --git a/src/PassiveAnticheat.cpp b/src/PassiveAnticheat.cpp index f467ae6..11fa76c 100644 --- a/src/PassiveAnticheat.cpp +++ b/src/PassiveAnticheat.cpp @@ -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 . + */ -void AddPassiveAnticheatScripts() +void startAnticheatScripts(); +void AddSC_anticheat_commandscript(); + +void Addmod_anticheatScripts() { startAnticheatScripts(); AddSC_anticheat_commandscript(); -} \ No newline at end of file +} diff --git a/src/loader.h b/src/loader.h deleted file mode 100644 index 634c701..0000000 --- a/src/loader.h +++ /dev/null @@ -1 +0,0 @@ -void AddPassiveAnticheatScripts();