---
Changelog.txt | 1 +
sql/gary_world.sql | 4 ++++
src/server/game/Anticheat/AnticheatMgr.cpp | 12 ++++++++++++
src/server/game/Miscellaneous/Language.h | 1 +
src/server/game/World/World.cpp | 1 +
src/server/game/World/World.h | 1 +
src/server/worldserver/worldserver.conf.dist | 6 ++++++
7 files changed, 26 insertions(+)
diff --git a/Changelog.txt b/Changelog.txt
index 10ec421..d1e97d9 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -11,6 +11,7 @@
# #
############################################################################################
+[39] --> Add AutoBanned Passive Anticheat System!
[38] --> [Censor] Update vulgar slang.
[37] --> Reset Duel Cooldowns, Hp, Mana, Rage and Runic Power in Astranaar.
[36] --> [Censor] Update vulgar slang.
diff --git a/sql/gary_world.sql b/sql/gary_world.sql
index e66fdf3..ea652b4 100644
--- a/sql/gary_world.sql
+++ b/sql/gary_world.sql
@@ -147,3 +147,7 @@ REPLACE INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `cont
REPLACE INTO `command` (`name`, `security`, `help`) VALUES
('msg', 2, 'Syntax: .msg $announcement. Send an announcement to all online players, displaying the name of the sender.'),
('adm', 4, 'Syntax: .adm $announcement. Send an announcement to all online players, displaying the name of the sender.');
+
+-- Add AutoBanned Passive Anticheat System!
+REPLACE INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(11002, '|cFFFFFC00[ANTICHEAT]|cFF00FFFF[|cFF60FF00%s|cFF00FFFF] Banned for cheating!|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
diff --git a/src/server/game/Anticheat/AnticheatMgr.cpp b/src/server/game/Anticheat/AnticheatMgr.cpp
index a359017..e5f46b7 100644
--- a/src/server/game/Anticheat/AnticheatMgr.cpp
+++ b/src/server/game/Anticheat/AnticheatMgr.cpp
@@ -332,10 +332,22 @@ void AnticheatMgr::BuildReport(Player* player,uint8 reportType)
{
// display warning at the center of the screen, hacky way?
std::string str = "";
+ if (sWorld->getBoolConfig(CONFIG_BAN_PLAYER)) //Make anticheat active.
+ {
+ if (m_Players[key].GetAverage() > 0.5f)
+ {
+ str = "Possible cheater found: " + std::string(player->GetName());
+ sWorld->BanCharacter(player->GetName(), "1h", str, "Anticheat");
+ sWorld->SendWorldText(LANG_BAN_CHEATER, player->GetName());
+ }
+ }
+ else
+ {
str = "|cFFFFFC00[AC]|cFF00FFFF[|cFF60FF00" + std::string(player->GetName()) + "|cFF00FFFF] Possible cheater!";
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
data << str;
sWorld->SendGlobalGMMessage(&data);
+ }
}
}
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 8f32f7c..b85ea1f 100755
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1077,6 +1077,7 @@ enum TrinityStrings
// Use for custom patches 11000-11999
LANG_AUTO_BROADCAST = 11000,
LANG_INVALID_REALMID = 11001,
+ LANG_BAN_CHEATER = 11002,
LANG_ANNOUNCE_ADMIN_COLOR = 11666,
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index b6898e6..f31de28 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1231,6 +1231,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_ANTICHEAT_REPORTS_INGAME_NOTIFICATION] = ConfigMgr::GetIntDefault("Anticheat.ReportsForIngameWarnings", 70);
m_int_configs[CONFIG_ANTICHEAT_DETECTIONS_ENABLED] = ConfigMgr::GetIntDefault("Anticheat.DetectionsEnabled",31);
m_int_configs[CONFIG_ANTICHEAT_MAX_REPORTS_FOR_DAILY_REPORT] = ConfigMgr::GetIntDefault("Anticheat.MaxReportsForDailyReport",70);
+ m_bool_configs[CONFIG_BAN_PLAYER] = ConfigMgr::GetBoolDefault("Anticheat.Ban", true);
/** World of Warcraft Armory **/
m_bool_configs[CONFIG_ARMORY_ENABLE] = ConfigMgr::GetBoolDefault("Armory.Enable", true);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 3a1db02..20c50d7 100755
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -166,6 +166,7 @@ enum WorldBoolConfigs
CONFIG_QUEST_IGNORE_AUTO_COMPLETE,
CONFIG_WARDEN_ENABLED,
CONFIG_ANTICHEAT_ENABLE,
+ CONFIG_BAN_PLAYER,
CONFIG_EXTERNAL_MAIL,
CONFIG_ARMORY_ENABLE,
CONFIG_WINTERGRASP_ENABLE,
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index af4743c..0f21449 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2882,12 +2882,18 @@ PvPRank.HKPerRank = "10,50,100,200,450,1000,2000,3000,4500,7500,10500,15000,3000
# Description: How many reports must the player have to make a report that it is in DB for a day (not only during the player's session).
# Default: 70
#
+# Anticheat.Ban
+# Description: Make anticheat active (Ban cheaters character for 1 hour.)
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+#
###################################################################################################################
Anticheat.Enable = 1
Anticheat.ReportsForIngameWarnings = 70
Anticheat.DetectionsEnabled = 31
Anticheat.MaxReportsForDailyReport = 70
+Anticheat.Ban = 1
###################################################################################################
# Transmogrification config #
--
1.7.10
回复下载完整代码
|