Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2011
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.58 KB | None | 0 0
  1. diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
  2. index 01903e8..8ebcf33 100755
  3. --- a/src/server/game/Entities/Player/Player.cpp
  4. +++ b/src/server/game/Entities/Player/Player.cpp
  5. @@ -7399,6 +7399,48 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
  6.          SendInitWorldStates(newZone, newArea);              // only if really enters to new zone, not just area change, works strange...
  7.      }
  8.  
  9. +    // Prevent players from accessing GM Island
  10. +    if (sWorld->getBoolConfig(CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE) == true)
  11. +    {
  12. +        if (newZone == 876 && AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
  13. +        {
  14. +            QueryResult result = CharacterDatabase.Query("SELECT * FROM `gmisland_teleport` LIMIT 1");
  15. +
  16. +            if (result)
  17. +            {
  18. +                Field* fields = result->Fetch();
  19. +
  20. +                uint32   map           = fields[0].GetUInt32();
  21. +                double   x             = fields[1].GetDouble();
  22. +                double   y             = fields[2].GetDouble();
  23. +                double   z             = fields[3].GetDouble();
  24. +                double   orientation   = fields[4].GetDouble();
  25. +
  26. +                if (map == 876)
  27. +                {
  28. +                    sLog->outError("Error: Cannot set tele to GM Island (map: 876). Sending possible hacker to default location. (Jail Box)");
  29. +                    map = 13;
  30. +                    x = 1.118799;
  31. +                    y = 0.477914;
  32. +                    z = -144.708650;
  33. +                    orientation = 3.133046;
  34. +                }
  35. +
  36. +                sLog->outError("Player (GUID: %u) tried to access GM Island.", GetGUIDLow());
  37. +                TeleportTo(map,x,y,z,orientation); // Tele to Jail Box
  38. +                if (map == 13)
  39. +                    CastSpell(this, 9454, true); // Cast GM Freeze on player
  40. +            }
  41. +            else
  42. +            {
  43. +                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);
  44. +                sLog->outError("Error: Cannot set tele to custom place (couldn't find the table). Sending possible hacker to default location. (Jail Box)");
  45. +                TeleportTo(13,1.118799,0.477914,-144.708650,3.133046);
  46. +                CastSpell(this, 9454, true); // Cast GM Freeze on player
  47. +            }
  48. +
  49. +            if (sWorld->getBoolConfig(CONFIG_GMISLAND_BAN_ENABLE) == true)
  50. +            {
  51. +                sLog->outError("Player (GUID: %u) tried to access GM Island. Banning Player Account.", GetGUIDLow());
  52. +                sWorld->BanAccount(BAN_ACCOUNT, this->GetName(),secsToTimeString(TimeStringToSecs("-1"),true).c_str(),"Being on GM Island","Anticheat protection");
  53. +            }
  54. +        }
  55. +    }
  56. +
  57.      m_zoneUpdateId    = newZone;
  58.      m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
  59.  
  60. diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
  61. index 2642ed6..83e62bc 100755
  62. --- a/src/server/game/Spells/SpellEffects.cpp
  63. +++ b/src/server/game/Spells/SpellEffects.cpp
  64. @@ -5466,6 +5466,13 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
  65.  
  66.      Player* pTarget = (Player*)unitTarget;
  67.  
  68. +    // Prevent players from trying to unstuck themselves in the Jail box.
  69. +    if (pTarget->GetMapId() == 13 && AccountMgr::IsPlayerAccount(pTarget->GetSession()->GetSecurity()))
  70. +    {
  71. +        sLog->outError("Player %s (guid %u) tried to use unstuck in Jail box.", pTarget->GetName(), pTarget->GetGUIDLow());
  72. +        return;
  73. +    }
  74. +
  75.      sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck");
  76.      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());
  77.  
  78. diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
  79. index d16e49b..7c6da9b 100755
  80. --- a/src/server/game/World/World.cpp
  81. +++ b/src/server/game/World/World.cpp
  82. @@ -1183,6 +1183,10 @@ void World::LoadConfigSettings(bool reload)
  83.      // MySQL ping time interval
  84.      m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfig->GetIntDefault("MaxPingTime", 30);
  85.  
  86. +    // Prevent players from accessing GM Island
  87. +    m_bool_configs[CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE] = sConfig->GetBoolDefault("GMIsland.PlayersNoAccess.Enable", true);
  88. +    m_bool_configs[CONFIG_GMISLAND_BAN_ENABLE] = sConfig->GetBoolDefault("GMIsland.Ban.Enable", false);
  89. +
  90.      sScriptMgr->OnConfigLoad(reload);
  91.  }
  92.  
  93. diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
  94. index b045ce6..07fc1fc 100755
  95. --- a/src/server/game/World/World.h
  96. +++ b/src/server/game/World/World.h
  97. @@ -158,6 +158,8 @@ enum WorldBoolConfigs
  98.      CONFIG_ALLOW_TICKETS,
  99.      CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES,
  100.      CONFIG_PRESERVE_CUSTOM_CHANNELS,
  101. +    CONFIG_GMISLAND_PLAYERS_NOACCESS_ENABLE,
  102. +    CONFIG_GMISLAND_BAN_ENABLE,
  103.      BOOL_CONFIG_VALUE_COUNT
  104.  };
  105.  
  106. diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
  107. index d9ce9ee..7a8433c 100644
  108. --- a/src/server/worldserver/worldserver.conf.dist
  109. +++ b/src/server/worldserver/worldserver.conf.dist
  110. @@ -2768,4 +2768,20 @@ LevelReq.Auction = 1
  111.  LevelReq.Mail = 1
  112.  
  113.  #
  114. +#      GMIsland.PlayersNoAccess.Enable
  115. +#        Prevent access for players to gm island
  116. +#        Default: 1 - Enable
  117. +#                 0 - Disable
  118. +
  119. +GMIsland.PlayersNoAccess.Enable = 1
  120. +
  121. +#
  122. +#      GMIsland.Ban.Enable
  123. +#        Enable to ban players that tries to access GM Island without proper Access
  124. +#        Default: 0 - Disable
  125. +#                 1 - Enable
  126. +
  127. +GMIsland.Ban.Enable = 0
  128. +
  129. +#
  130.  ###################################################################################################
  131.  
  132. diff -r 8d9a2eb7c952 sql/tools/gmisland.teleport.sql
  133. --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
  134. +++ b/sql/tools/gmisland.teleport.sql   Wed Dec 01 11:54:07 2010 +0000
  135. @@ -0,0 +1,16 @@
  136. +-- Put this SQL in character database.
  137. +DROP TABLE IF EXISTS `gmisland_teleport`;
  138. +CREATE TABLE `gmisland_teleport` (
  139. +`map` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
  140. +`x` DOUBLE NOT NULL DEFAULT '0',
  141. +`y` DOUBLE NOT NULL DEFAULT '0',
  142. +`z` DOUBLE NOT NULL DEFAULT '0',
  143. +`orientation` DOUBLE NOT NULL DEFAULT '0',
  144. +`comment` VARCHAR(255),
  145. +PRIMARY KEY (`map`)
  146. +) ENGINE = MYISAM DEFAULT CHARSET=utf8;
  147. +
  148. +INSERT INTO `gmisland_teleport` (
  149. +`map`,`x`,`y`,`z`,`orientation`,`comment`)
  150. +VALUES (
  151. +'13','1.118799','0.477914','-144.708650','3.133046','Jail Box');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement