Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
- index 01903e8..8ebcf33 100755
- --- a/src/server/game/Entities/Player/Player.cpp
- +++ b/src/server/game/Entities/Player/Player.cpp
- @@ -7399,6 +7399,48 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
- SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
- }
- + // Prevent players from accessing GM Island
- + if (sWorld->getBoolConfig(CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE) == true)
- + {
- + if (newZone == 876 && AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
- + {
- + QueryResult result = CharacterDatabase.Query("SELECT * FROM `gmisland_teleport` LIMIT 1");
- +
- + if (result)
- + {
- + Field* fields = result->Fetch();
- +
- + uint32 map = fields[0].GetUInt32();
- + double x = fields[1].GetDouble();
- + double y = fields[2].GetDouble();
- + double z = fields[3].GetDouble();
- + double orientation = fields[4].GetDouble();
- +
- + if (map == 876)
- + {
- + sLog->outError("Error: Cannot set tele to GM Island (map: 876). Sending possible hacker to default location. (Jail Box)");
- + map = 13;
- + x = 1.118799;
- + y = 0.477914;
- + z = -144.708650;
- + orientation = 3.133046;
- + }
- +
- + sLog->outError("Player (GUID: %u) tried to access GM Island.", GetGUIDLow());
- + TeleportTo(map,x,y,z,orientation); // Tele to Jail Box
- + if (map == 13)
- + CastSpell(this, 9454, true); // Cast GM Freeze on player
- + }
- + else
- + {
- + sLog->outError("Player (GUID: %u) tried to access GM Island. Sending possible hacker to %u,%u,%u,%u,%u", GetGUIDLow(), map, x, y, z, orientation);
- + sLog->outError("Error: Cannot set tele to custom place (couldn't find the table). Sending possible hacker to default location. (Jail Box)");
- + TeleportTo(13,1.118799,0.477914,-144.708650,3.133046);
- + 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");
- + }
- + }
- + }
- +
- m_zoneUpdateId = newZone;
- m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
- diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
- index 2642ed6..83e62bc 100755
- --- a/src/server/game/Spells/SpellEffects.cpp
- +++ b/src/server/game/Spells/SpellEffects.cpp
- @@ -5466,6 +5466,13 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
- Player* pTarget = (Player*)unitTarget;
- + // Prevent players from trying to unstuck themselves in the Jail box.
- + if (pTarget->GetMapId() == 13 && AccountMgr::IsPlayerAccount(pTarget->GetSession()->GetSecurity()))
- + {
- + sLog->outError("Player %s (guid %u) tried to use unstuck in Jail box.", pTarget->GetName(), pTarget->GetGUIDLow());
- + return;
- + }
- +
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck");
- sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
- diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
- index d16e49b..7c6da9b 100755
- --- a/src/server/game/World/World.cpp
- +++ b/src/server/game/World/World.cpp
- @@ -1183,6 +1183,10 @@ void World::LoadConfigSettings(bool reload)
- // MySQL ping time interval
- m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfig->GetIntDefault("MaxPingTime", 30);
- + // Prevent players from accessing GM Island
- + m_bool_configs[CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE] = sConfig->GetBoolDefault("GMIsland.PlayersNoAccess.Enable", true);
- + m_bool_configs[CONFIG_GMISLAND_BAN_ENABLE] = sConfig->GetBoolDefault("GMIsland.Ban.Enable", false);
- +
- sScriptMgr->OnConfigLoad(reload);
- }
- diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
- index b045ce6..07fc1fc 100755
- --- a/src/server/game/World/World.h
- +++ b/src/server/game/World/World.h
- @@ -158,6 +158,8 @@ enum WorldBoolConfigs
- CONFIG_ALLOW_TICKETS,
- CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES,
- CONFIG_PRESERVE_CUSTOM_CHANNELS,
- + CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE,
- + CONFIG_GMISLAND_BAN_ENABLE,
- BOOL_CONFIG_VALUE_COUNT
- };
- diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
- index d9ce9ee..7a8433c 100644
- --- a/src/server/worldserver/worldserver.conf.dist
- +++ b/src/server/worldserver/worldserver.conf.dist
- @@ -2768,4 +2768,20 @@ LevelReq.Auction = 1
- LevelReq.Mail = 1
- #
- +# GMIsland.PlayersNoAccess.Enable
- +# Prevent access for players to gm island
- +# Default: 1 - Enable
- +# 0 - Disable
- +
- +GMIsland.PlayersNoAccess.Enable = 1
- +
- +#
- +# 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
- +
- +#
- ###################################################################################################
- diff -r 8d9a2eb7c952 sql/tools/gmisland.teleport.sql
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/sql/tools/gmisland.teleport.sql Wed Dec 01 11:54:07 2010 +0000
- @@ -0,0 +1,16 @@
- +-- Put this SQL in character database.
- +DROP TABLE IF EXISTS `gmisland_teleport`;
- +CREATE TABLE `gmisland_teleport` (
- +`map` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
- +`x` DOUBLE NOT NULL DEFAULT '0',
- +`y` DOUBLE NOT NULL DEFAULT '0',
- +`z` DOUBLE NOT NULL DEFAULT '0',
- +`orientation` DOUBLE NOT NULL DEFAULT '0',
- +`comment` VARCHAR(255),
- +PRIMARY KEY (`map`)
- +) ENGINE = MYISAM DEFAULT CHARSET=utf8;
- +
- +INSERT INTO `gmisland_teleport` (
- +`map`,`x`,`y`,`z`,`orientation`,`comment`)
- +VALUES (
- +'13','1.118799','0.477914','-144.708650','3.133046','Jail Box');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement