吾爱尚玩资源基地

标题: T端335怀旧魔兽自动封锁(查封)使用外挂的玩家的代码-最新 [打印本页]

作者: admin    时间: 2016-4-20 22:44
标题: T端335怀旧魔兽自动封锁(查封)使用外挂的玩家的代码-最新
---
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






回复下载完整代码





作者: samirwang    时间: 2020-2-5 19:12
这套代码有效吗
作者: fang139842    时间: 2020-2-12 18:42
这个是使用到核心里面用的么??
作者: 神级丶    时间: 2020-2-20 18:47
RE: T端335怀旧魔兽自动封锁(查封)使用外挂的玩家的代码
作者: taga001    时间: 2020-12-2 19:00
楼主好棒,终于找到需要的了!有需求就来吾爱尚玩!
作者: sdwowtest    时间: 2021-7-22 21:49
有效果吗

作者: letver    时间: 2021-11-3 14:35
找了好久终于找到了!吾爱尚玩真棒!
作者: ljh1987    时间: 2021-12-6 09:57
小白一个 顶一下,吾爱尚玩免费服务端下载!
作者: 78953353    时间: 2022-1-31 22:19
必须要看看了  
作者: 冯宝宝    时间: 2022-7-20 06:15
楼主好棒,终于找到需要的了
作者: cj8184    时间: 2023-7-13 23:12
桃园修复版手工架设服务端+外网教程+修复补丁




欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/) Powered by Discuz! X3.4