关灯
开启左侧

T端仿官方魔兽世界私服服务端的设置能进入GM岛的传送设置

  [复制链接]
admin实名认证 发表于 2016-4-20 23:07:06 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
T端仿官方魔兽世界私服服务端的一个设置能进入GM岛的传送设置。。可以参考使用。。未测试过的


From 84706599d75f60b187f3c03e6c5218663db0346b Mon Sep 17 00:00:00 2001From: Kingswow <hossein.abavi@gmail.com>
Date: Sun, 2 Dec 2012 17:58:32 +0330
Subject: [PATCH] Add GM Island Players No Access

---
src/server/game/Entities/Player/Player.cpp   |   48 ++++++++++++++++++++++++++
src/server/game/Spells/SpellEffects.cpp      |    7 ++++
src/server/game/World/World.cpp              |    4 +++
src/server/game/World/World.h                |    2 ++
src/server/worldserver/worldserver.conf.dist |   23 ++++++++++++
5 files changed, 84 insertions(+)

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 3c5bd68..c30526f 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -34,6 +34,7 @@
#include "Chat.h"
#include <cmath>
#include "Common.h"
+#include "Config.h"
#include "ConditionMgr.h"
#include "CreatureAI.h"
#include "DatabaseEnv.h"
@@ -7514,6 +7515,53 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
         if (Guild* guild = GetGuild())
             guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone);
     }
+ // Prevent players from accessing GM Island
+ if (sWorld->getBoolConfig(CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE) == true)
+ {
+ if (newZone == 876 && AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
+ {
+ uint32 map = 13;
+ double coords[4] = { 1.118799, 0.477914, -144.708650, 3.133046 }; // Jail Box
+
+ std::string config = ConfigMgr::GetStringDefault("GMIsland.TeleportTo", "");
+ if (config != "")
+ {
+ std::istringstream ss(config);
+
+ for (int i = 0; i < 5; ++i)
+ {
+ if (!ss)
+ break;
+
+ if (i == 0)
+ ss >> map;
+ else
+ ss >> coords[i - 1];
+ }
+ }
+
+ if (map == 876)
+ {
+ sLog->outError("Error: Cannot set tele to GM Island (map: 876). Sending possible hacker to default location. (Jail Box)");
+ map = 13;
+ coords[0] = 1.118799; // x
+ coords[1] = 0.477914; // y
+ coords[2] = -144.708650; // z
+ coords[3] = 3.133046; // orientation
+ }
+
+ sLog->outError("Player (GUID: %u) tried to access GM Island.", GetGUIDLow());
+ TeleportTo(map, coords[0], coords[1], coords[2], coords[3]); // Tele to Jail Box
+ if (map == 13)
+ CastSpell(this, 9454, true); // Cast GM Freeze on player
+
+ if (sWorld->getBoolConfig(CONFIG_GMISLAND_BAN_ENABLE) == true)
+ {
+ sLog->outError("Player (GUID: %u) tried to access GM Island. Banning Player Account.", GetGUIDLow());
+ sWorld->BanAccount(BAN_ACCOUNT, this->GetName(), secsToTimeString(TimeStringToSecs("-1"), true).c_str(), "Being on GM Island", "Anticheat protection");
+ }
+ }
+ }

     // group update
     if (Group* group = GetGroup())
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c049605..0b15995 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4549,6 +4549,13 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)

     Player* target = (Player*)m_caster;

+ // Prevent players from trying to unstuck themselves in the Jail box.
+ if (target->GetMapId() == 13 && AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()))
+ {
+ sLog->outError("Player %s (guid %u) tried to use unstuck in Jail box.", target->GetName(), target->GetGUIDLow());
+ return;
+ }
+
     sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck");
     sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName().c_str(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ());

diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 0ef8611..5aa53cc 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1227,6 +1227,10 @@ void World::LoadConfigSettings(bool reload)
     m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true);
     m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true);

+        // Prevent players from accessing GM Island
+        m_bool_configs[CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE] = ConfigMgr::GetBoolDefault("GMIsland.PlayersNoAccess.Enable", true);
+        m_bool_configs[CONFIG_GMISLAND_BAN_ENABLE] = ConfigMgr::GetBoolDefault("GMIsland.Ban.Enable", false);
+
     // call ScriptMgr if we're reloading the configuration
     m_bool_configs[CONFIG_WINTERGRASP_ENABLE] = ConfigMgr::GetBoolDefault("Wintergrasp.Enable", false);
     m_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = ConfigMgr::GetIntDefault("Wintergrasp.PlayerMax", 100);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index d901c98..a443811 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -164,6 +164,8 @@ enum WorldBoolConfigs
     CONFIG_QUEST_IGNORE_AUTO_ACCEPT,
     CONFIG_QUEST_IGNORE_AUTO_COMPLETE,
     CONFIG_WARDEN_ENABLED,
+    CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE,
+         CONFIG_GMISLAND_BAN_ENABLE,
     CONFIG_WINTERGRASP_ENABLE,
     BOOL_CONFIG_VALUE_COUNT
};
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 4c019e5..0e352e0 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2926,6 +2926,29 @@ PlayerDump.DisallowPaths = 1
PlayerDump.DisallowOverwrite = 1

#
+# GMIsland.PlayersNoAccess.Enable
+# Prevent access for players to gm island
+# Default: 1 - Enable
+# 0 - Disable
+
+GMIsland.PlayersNoAccess.Enable = 1
+
+#
+# GMIsland.TeleportTo
+# Teleport player to this coordinates (map, x, y, z, orientation)
+# Default: "13 1.118799 0.477914 -144.708650 3.133046" (Jailbox)
+
+GMIsland.TeleportTo = "13 1.118799 0.477914 -144.708650 3.133046"
+
+#
+# GMIsland.Ban.Enable
+# Enable to ban players that tries to access GM Island without proper Access
+# Default: 0 - Disable
+# 1 - Enable
+
+GMIsland.Ban.Enable = 0
+
+#
###################################################################################################

###################################################################################################
--
1.7.10


回复下载完整代码



游客,如果您要查看本帖隐藏内容请回复


 

精彩评论2

倒序浏览
candyil 发表于 2020-4-6 15:41:43 | 显示全部楼层
 
非常感谢。6666
 
1314 发表于 2016-10-29 12:07:57 | 显示全部楼层
 
找了好久终于找到了!吾爱尚玩免费服务端下载!
 
VIP介绍
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

5粉丝

3421帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523Play.Com

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523play.comPowered by©523Pplay.Com技术支持:吾爱尚玩资源基地