Jump to content
  • Announcements

    • Xmat

      Pravidlo pro postování v TTT

      Do sekce Tipy, triky, tutoriály nepatří žádné dotazy.   Postujte sem vaše návody, tipy a různé další věci jež uznáte za vhodné sdělit zdejšímu osazenstvu, ale veškeré dotazy směřujte do sekce Všeobecná diskuse.
    • Replik

      Seznam návodů a důležitých témat v této sekci

      Pro lepší přehlednost jsem vytvořil tento seznam, který vás, méně zkušené, lépe provede touto sekcí. Věřím, že zde najdete, co hledáte. Vypsané jsou návody, které jsou oficiálně uznané jako návody. Běžné diskuze, které neposkytují postupy a rady zvěřejněny nejsou.   Instalace vlastního MaNGOS Serveru Díky těmto návodům budete (měli by jste být) schopni vytvořit a následně spustit váš vlastní server. Nastavení je pro verze s i bez datadisku.   Instalace MaNGOS Serveru (bez datadisku TBC) - Autor Benny Instalace MaNGOS Serveru (s datadiskem TBC) - Autor Malfik Instalace MaNGOS Serveru v prostředí Linux - Autor charlie Instalace MaNGOS Serveru v prostředí Linux - Autor kupkoid   Chyby a jejich řešení při přihlašování k serveru - Autor Cybe   Zálohování uživatelských dat   Dávkový soubor (BAT soubor) pro vytvoření SQL záloh - Autor Replik   Kompilování - tvoření vlastních release (revizí)   Tvorba kompilací pro Win32 (MangoScript) - Autor bLuma   Ostatní - těžko zařaditelné, ale neznamená to, že nejsou dobré   VIP Systém - Autor charlie Tvorba Webových stránek pro MaNGOS - Autor zahuba Tvorba teleportačních NPC (MangoScript) - Autor Replik Registrační web (původně předělaná SPORA) Funkční pro Antrix i MaNGOS - Autor Replik Nastavení a spuštění Minimanager pro MaNGOS - Autor BlackMartin Nastavení MaNGOS Website - Autor Artorius   Samozřejmě jsou zde i jiné návody, ale tyto jsou nejvíce používané, proto věřím, že vám budou nápomocné. Tuto sekci budeme upravovat podle potřeby. Pokud by jste něco nenašli nebo si nevěděli rady, hledejte na fóru a teprve potom založte vlastní topik. Pokud nějaký autor vytvoří kvalitní návod a chtěl by ho zveřejnit i v tomto seznamu, doporučuji, aby mi napsal zprávu skrze PM.   Díky a přeji hezký den na WoWResource   Replik
    • Aristo

      Příspěvky tam, kde nemají co dělat

      Dodržujte zákaz přispívání do topiků s repaky pokud si to zakladatelé nepřejí!! Opakované psaní příspěvků bude trestáno warnem.
    • Aristo

      Používání spoilerů

      Poslední dobou má většina uživatelů fora zvláštní nutkání postovat extrémně dlouhé texty nebo kódy, které zabírají v nejedenom případu i 80% obsahu celé stránky a hodně tak zvedají nepřehlednost v topiku. Chtěl bych všechny uživatele požádat, aby při postování citací, jakýchkoliv kódů, errorů, atp... delších než 30 řádků používali funkci spoileru.   Funkci vyvoláte příkazem [spoiler] text [/spoiler]   Ukázka:  
Sign in to follow this  
Nex

Antihack mangos

Recommended Posts

Nazdarte nevi nekdo nebo nema nekdo antihack pro mangos 3.3.2 pro revizi nejlepe 9690?Skoousel jsem hledat na google ale nic nechcu aby jste mi sem davali prosim revize v kterych to je ja mam svoji s upravama a chcu jen do nej to hodit

Share this post


Link to post
Share on other sites

prepísana verzia:

nepíšeš akú máš revku malo by ti to ísť len dúfam že si to budeš vedieť nahodiť

nechapem prečo neskočíš na mangos forum

 

 

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

+

+

+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

+/*!40101 SET NAMES utf8 */;

+

+--

+-- Database: `mangos__2_characters`

+--

+

+-- --------------------------------------------------------

+

+--

+-- Table structure for table `cheaters`

+--

+

+CREATE TABLE IF NOT EXISTS `cheaters` (

+ `entry` bigint(20) NOT NULL AUTO_INCREMENT,

+ `player` varchar(30) NOT NULL,

+ `acctid` int(11) NOT NULL,

+ `reason` varchar(255) NOT NULL DEFAULT 'unknown',

+ `speed` float NOT NULL DEFAULT '0',

+ `Val1` float NOT NULL DEFAULT '0',

+ `Val2` int(10) unsigned NOT NULL DEFAULT '0',

+ `count` int(11) NOT NULL DEFAULT '0',

+ `Map` smallint(5) NOT NULL DEFAULT '-1',

+ `Pos` varchar(255) NOT NULL DEFAULT '0',

+ `Level` mediumint(9) NOT NULL DEFAULT '0',

+ `first_date` datetime NOT NULL,

+ `last_date` datetime NOT NULL,

+ `Op` varchar(255) NOT NULL DEFAULT 'unknown',

+ PRIMARY KEY (`entry`),

+ KEY `idx_Count` (`count`),

+ KEY `idx_Player` (`player`)

+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;

+

+--

+-- Dumping data for table `cheaters`

+--

diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp

index 23bacd5..23332c3 100644

--- a/src/game/Level3.cpp

+++ b/src/game/Level3.cpp

@@ -5469,9 +5469,15 @@ bool ChatHandler::HandleGMFlyCommand(const char* args)

 

WorldPacket data(12);

if (strncmp(args, "on", 3) == 0)

+ {

data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);

+ ((Player*)(target))->SetCanFly(true);

+ }

else if (strncmp(args, "off", 4) == 0)

+ {

data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);

+ ((Player*)(target))->SetCanFly(false);

+ }

else

{

SendSysMessage(LANG_USE_BOL);

diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp

index 2c2ca30..83318db 100644

--- a/src/game/MovementHandler.cpp

+++ b/src/game/MovementHandler.cpp

@@ -31,6 +31,187 @@

#include "WaypointMovementGenerator.h"

#include "InstanceSaveMgr.h"

#include "ObjectMgr.h"

+#include "World.h"

+

+//#define __ANTI_DEBUG__

+

+#ifdef __ANTI_DEBUG__

+#include "Chat.h"

+std::string FlagsToStr(const uint32 Flags)

+{

+ std::string Ret="";

+ if(Flags==0)

+ {

+ Ret="None";

+ return Ret;

+ }

+

+ if(Flags & MOVEFLAG_FORWARD)

+ { Ret+="FW "; }

+ if(Flags & MOVEFLAG_BACKWARD)

+ { Ret+="BW "; }

+ if(Flags & MOVEFLAG_STRAFE_LEFT)

+ { Ret+="STL "; }

+ if(Flags & MOVEFLAG_STRAFE_RIGHT)

+ { Ret+="STR "; }

+ if(Flags & MOVEFLAG_LEFT)

+ { Ret+="LF "; }

+ if(Flags & MOVEFLAG_RIGHT)

+ { Ret+="RI "; }

+ if(Flags & MOVEFLAG_PITCH_UP)

+ { Ret+="PTUP "; }

+ if(Flags & MOVEFLAG_PITCH_DOWN)

+ { Ret+="PTDW "; }

+ if(Flags & MOVEFLAG_WALK_MODE)

+ { Ret+="WALK "; }

+ if(Flags & MOVEFLAG_ONTRANSPORT)

+ { Ret+="TRANS "; }

+ if(Flags & MOVEFLAG_LEVITATING)

+ { Ret+="LEVI "; }

+ if(Flags & MOVEFLAG_FLY_UNK1)

+ { Ret+="FLYUNK1 "; }

+ if(Flags & MOVEFLAG_JUMPING)

+ { Ret+="JUMP "; }

+ if(Flags & MOVEFLAG_UNK4)

+ { Ret+="UNK4 "; }

+ if(Flags & MOVEFLAG_FALLING)

+ { Ret+="FALL "; }

+ if(Flags & MOVEFLAG_SWIMMING)

+ { Ret+="SWIM "; }

+ if(Flags & MOVEFLAG_FLY_UP)

+ { Ret+="FLYUP "; }

+ if(Flags & MOVEFLAG_CAN_FLY)

+ { Ret+="CFLY "; }

+ if(Flags & MOVEFLAG_FLYING)

+ { Ret+="FLY "; }

+ if(Flags & MOVEFLAG_FLYING2)

+ { Ret+="FLY2 "; }

+ if(Flags & MOVEFLAG_WATERWALKING)

+ { Ret+="WTWALK "; }

+ if(Flags & MOVEFLAG_SAFE_FALL)

+ { Ret+="SAFE "; }

+ if(Flags & MOVEFLAG_UNK3)

+ { Ret+="UNK3 "; }

+ if(Flags & MOVEFLAG_SPLINE)

+ { Ret+="SPLINE "; }

+ if(Flags & MOVEFLAG_SPLINE2)

+ { Ret+="SPLINE2 "; }

+

+ return Ret;

+}

+#endif // __ANTI_DEBUG__

+

+bool WorldSession::Anti__ReportCheat(const char* Reason,float Speed,const char* Op,float Val1,uint32 Val2 /*,MovementInfo* MvInfo*/)

+{

+ if(!Reason)

+ {

+ sLog.outError("Anti__ReportCheat: Missing Reason parameter!");

+ return false;

+ }

+ const char* Player=GetPlayer()->GetName();

+ uint32 Acc=GetPlayer()->GetSession()->GetAccountId();

+ uint32 Map=GetPlayer()->GetMapId();

+ if(!Player)

+ {

+ sLog.outError("Anti__ReportCheat: Player with no name?!?");

+ return false;

+ }

+

+ QueryResult *Res=CharacterDatabase.PQuery("SELECT speed,Val1 FROM cheaters WHERE player='%s' AND reason LIKE '%s' AND Map='%u' AND last_date >= NOW()-300",Player,Reason,Map);

+ if(Res)

+ {

+ Field* Fields = Res->Fetch();

+

+ std::stringstream Query;

+ Query << "UPDATE cheaters SET count=count+1,last_date=NOW()";

+ Query.precision(5);

+ if(Speed>0.0f && Speed > Fields[0].GetFloat())

+ {

+ Query << ",speed='";

+ Query << std::fixed << Speed;

+ Query << "'";

+ }

+

+ if(Val1>0.0f && Val1 > Fields[1].GetFloat())

+ {

+ Query << ",Val1='";

+ Query << std::fixed << Val1;

+ Query << "'";

+ }

+

+ Query << " WHERE player='" << Player << "' AND reason='" << Reason << "' AND Map='" << Map << "' AND last_date >= NOW()-300 ORDER BY entry DESC LIMIT 1";

+

+ CharacterDatabase.Execute(Query.str().c_str());

+ delete Res;

+ }

+ else

+ {

+ if(!Op)

+ { Op=""; }

+ std::stringstream Pos;

+ Pos << "OldPos: " << GetPlayer()->GetPositionX() << " " << GetPlayer()->GetPositionY() << " "

+ << GetPlayer()->GetPositionZ();

+ /*if(MvInfo)

+ {

+ Pos << "\nNew: " << MvInfo->x << " " << MvInfo->y << " " << MvInfo->z << "\n"

+ << "Flags: " << MvInfo->flags << "\n"

+ << "t_guid: " << MvInfo->t_guid << " falltime: " << MvInfo->fallTime;

+ }*/

+ CharacterDatabase.PExecute("INSERT INTO cheaters (player,acctid,reason,speed,count,first_date,last_date,`Op`,Val1,Val2,Map,Pos,Level) "

+ "VALUES ('%s','%u','%s','%f','1',NOW(),NOW(),'%s','%f','%u','%u','%s','%u')",

+ Player,Acc,Reason,Speed,Op,Val1,Val2,Map,

+ Pos.str().c_str(),GetPlayer()->getLevel());

+ }

+

+ if(sWorld.GetMvAnticheatKill() && GetPlayer()->isAlive())

+ {

+ GetPlayer()->DealDamage(GetPlayer(), GetPlayer()->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);

+ }

+ if(sWorld.GetMvAnticheatKick())

+ {

+ GetPlayer()->GetSession()->KickPlayer();

+ }

+ if(sWorld.GetMvAnticheatBan() & 1)

+ {

+ sWorld.BanAccount(BAN_CHARACTER,Player,sWorld.GetMvAnticheatBanTime(),"Cheat","Anticheat");

+ }

+ if(sWorld.GetMvAnticheatBan() & 2)

+ {

+ QueryResult *result = loginDatabase.PQuery("SELECT last_ip FROM account WHERE id=%u", Acc);

+ if(result)

+ {

+

+ Field *fields = result->Fetch();

+ std::string LastIP = fields[0].GetCppString();

+ if(!LastIP.empty())

+ {

+ sWorld.BanAccount(BAN_IP,LastIP,sWorld.GetMvAnticheatBanTime(),"Cheat","Anticheat");

+ }

+ delete result;

+ }

+ }

+ return true;

+}

+

+bool WorldSession::Anti__CheatOccurred(uint32 CurTime,const char* Reason,float Speed,const char* Op,

+ float Val1,uint32 Val2/*,MovementInfo* MvInfo*/)

+{

+ if(!Reason)

+ {

+ sLog.outError("Anti__CheatOccurred: Missing Reason parameter!");

+ return false;

+ }

+

+ GetPlayer()->m_anti_lastalarmtime = CurTime;

+ GetPlayer()->m_anti_alarmcount = GetPlayer()->m_anti_alarmcount + 1;

+

+ if (GetPlayer()->m_anti_alarmcount > sWorld.GetMvAnticheatAlarmCount())

+ {

+ Anti__ReportCheat(Reason,Speed,Op,Val1,Val2/*,MvInfo*/);

+ return true;

+ }

+ return false;

+}

 

void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )

{

@@ -72,6 +253,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()

// relocate the player to the teleport destination

GetPlayer()->SetMap(sMapMgr.CreateMap(loc.mapid, GetPlayer()));

GetPlayer()->Relocate(loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation);

+ GetPlayer()->m_anti_TeleTime=time(NULL);

 

GetPlayer()->SendInitialPacketsBeforeAddToMap();

// the CanEnter checks are done in TeleporTo but conditions may change

@@ -163,6 +345,8 @@ void WorldSession::HandleMoveWorldportAckOpcode()

 

// resummon pet

GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();

+ GetPlayer()->Anti__SetLastTeleTime(::time(NULL));

+ GetPlayer()->m_anti_BeginFallZ=INVALID_HEIGHT;

 

//lets process all delayed operations on successful teleport

GetPlayer()->ProcessDelayedOperations();

@@ -212,6 +396,11 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)

 

// resummon pet

GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();

+ if(plMover)

+ {

+ plMover->Anti__SetLastTeleTime(::time(NULL));

+ plMover->m_anti_BeginFallZ=INVALID_HEIGHT;

+ }

 

//lets process all delayed operations on successful teleport

GetPlayer()->ProcessDelayedOperations();

@@ -268,6 +457,11 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )

// if we boarded a transport, add us to it

if (plMover && !plMover->m_transport)

{

+ float trans_rad = movementInfo.GetTransportPos()->x*movementInfo.GetTransportPos()->x + movementInfo.GetTransportPos()->y*movementInfo.GetTransportPos()->y + movementInfo.GetTransportPos()->z*movementInfo.GetTransportPos()->z;

+ if (trans_rad > 3600.0f) // transport radius = 60 yards //cheater with on_transport_flag

+ {

+ return;

+ }

// elevators also cause the client to send MOVEFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list

for (MapManager::TransportSet::const_iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter)

{

@@ -295,9 +489,141 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )

{

// now client not include swimming flag in case jumping under water

plMover->SetInWater( !plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z) );

+ if(plMover->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z-7.0f))

+ {

+ plMover->m_anti_BeginFallZ=INVALID_HEIGHT;

+ }

}

 

- /*----------------------*/

+ // ---- anti-cheat features -->>>

+ uint32 Anti_TeleTimeDiff=plMover ? time(NULL) - plMover->Anti__GetLastTeleTime() : time(NULL);

+ static const uint32 Anti_TeleTimeIgnoreDiff=sWorld.GetMvAnticheatIgnoreAfterTeleport();

+ if (plMover && (plMover->m_transport == 0) && sWorld.GetMvAnticheatEnable() &&

+ GetPlayer()->GetSession()->GetSecurity() <= sWorld.GetMvAnticheatGmLevel() &&

+ GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()!=FLIGHT_MOTION_TYPE &&

+ Anti_TeleTimeDiff>Anti_TeleTimeIgnoreDiff)

+ {

+ const uint32 CurTime=getMSTime();

+ if(getMSTimeDiff(GetPlayer()->m_anti_lastalarmtime,CurTime) > sWorld.GetMvAnticheatAlarmPeriod())

+ {

+ GetPlayer()->m_anti_alarmcount = 0;

+ }

+ /* I really don't care about movement-type yet (todo)

+ UnitMoveType move_type;

+

+ if (movementInfo.flags & MOVEMENTFLAG_FLYING) move_type = MOVE_FLY;

+ else if (movementInfo.flags & MOVEMENTFLAG_SWIMMING) move_type = MOVE_SWIM;

+ else if (movementInfo.flags & MOVEMENTFLAG_WALK_MODE) move_type = MOVE_WALK;

+ else move_type = MOVE_RUN;*/

+

+ float delta_x = GetPlayer()->GetPositionX() - movementInfo.GetPos()->x;

+ float delta_y = GetPlayer()->GetPositionY() - movementInfo.GetPos()->y;

+ float delta_z = GetPlayer()->GetPositionZ() - movementInfo.GetPos()->z;

+ float delta = sqrt(delta_x * delta_x + delta_y * delta_y); // Len of movement-vector via Pythagoras (a^2+b^2=Len^2)

+ float tg_z = 0.0f; //tangens

+ float delta_t = getMSTimeDiff(GetPlayer()->m_anti_lastmovetime,CurTime);

+

+ GetPlayer()->m_anti_lastmovetime = CurTime;

+ GetPlayer()->m_anti_MovedLen += delta;

+

+ if(delta_t > 15000.0f)

+ { delta_t = 15000.0f; }

+

+ // Tangens of walking angel

+ if (!(movementInfo.GetMovementFlags() & (MOVEFLAG_FLYING | MOVEFLAG_SWIMMING)))

+ {

+ //Mount hack detection currently disabled

+ tg_z = ((delta !=0.0f) && (delta_z > 0.0f)) ? (atan((delta_z*delta_z) / delta) * 180.0f / M_PI) : 0.0f;

+ }

+

+ //antiOFF fall-damage, MOVEMENTFLAG_UNK4 seted by client if player try movement when falling and unset in this case the MOVEMENTFLAG_FALLING flag.

+

+ if((GetPlayer()->m_anti_BeginFallZ == INVALID_HEIGHT) &&

+ (movementInfo.GetMovementFlags() & (MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR)) != 0)

+ {

+ GetPlayer()->m_anti_BeginFallZ=(float)(movementInfo.GetPos()->z);

+ }

+

+ if(GetPlayer()->m_anti_NextLenCheck <= CurTime)

+ {

+ // Check every 500ms is a lot more advisable then 1000ms, because normal movment packet arrives every 500ms

+ uint32 OldNextLenCheck=GetPlayer()->m_anti_NextLenCheck;

+ float delta_xyt=GetPlayer()->m_anti_MovedLen/(float)(getMSTimeDiff(OldNextLenCheck-500,CurTime));

+ GetPlayer()->m_anti_NextLenCheck = CurTime+500;

+ GetPlayer()->m_anti_MovedLen = 0.0f;

+ static const float MaxDeltaXYT = sWorld.GetMvAnticheatMaxXYT();

+

+#ifdef __ANTI_DEBUG__

+ SendAreaTriggerMessage("XYT: %f ; Flags: %s",delta_xyt,FlagsToStr(movementInfo.GetMovementFlags()).c_str());

+#endif //__ANTI_DEBUG__

+

+ if(delta_xyt > MaxDeltaXYT && delta<=100.0f && GetPlayer()->GetZoneId() != 2257)

+ {

+ Anti__CheatOccurred(CurTime,"Speed hack",delta_xyt,LookupOpcodeName(opcode),

+ (float)(GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()),

+ (float)(getMSTimeDiff(OldNextLenCheck-500,CurTime))/*,&movementInfo*/);

+ }

+ }

+

+ if(delta > 100.0f && GetPlayer()->GetZoneId() != 2257)

+ {

+ Anti__ReportCheat("Tele hack",delta,LookupOpcodeName(opcode));

+ }

+

+ // Check for waterwalking . Fix new way of checking for waterwalking by Darky88

+ if (movementInfo.HasMovementFlag(MOVEFLAG_WATERWALKING) &&

+ !(GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK) || GetPlayer()->HasAuraType(SPELL_AURA_GHOST)))

+ {

+ Anti__CheatOccurred(CurTime,"Water walking",0.0f,NULL,0.0f,(uint32)(movementInfo.GetMovementFlags()));

+ }

+

+ // Check for walking upwards a mountain while not beeing able to do that

+ if ((tg_z > 85.0f))

+ {

+ Anti__CheatOccurred(CurTime,"Mount hack",tg_z,NULL,delta,delta_z);

+ }

+

+

+ static const float DIFF_OVERGROUND = 10.0f;

+ float Anti__GroundZ = GetPlayer()->GetMap()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),MAX_HEIGHT);

+ float Anti__FloorZ = GetPlayer()->GetMap()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),GetPlayer()->GetPositionZ());

+ float Anti__MapZ = ((Anti__FloorZ <= (INVALID_HEIGHT+5.0f)) ? Anti__GroundZ : Anti__FloorZ) + DIFF_OVERGROUND;

+

+ if(!GetPlayer()->CanFly() && /*!plMover->isGameMaster() &&*/

+ !GetPlayer()->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z-7.0f) &&

+ Anti__MapZ < GetPlayer()->GetPositionZ() && Anti__MapZ > (INVALID_HEIGHT+DIFF_OVERGROUND + 5.0f))

+ {

+ static const float DIFF_AIRJUMP=25.0f; // 25 is realy high, but to many false positives...

+

+ // Air-Jump-Detection definitively needs a better way to be detected...

+ if((movementInfo.GetMovementFlags() & (MOVEFLAG_CAN_FLY | MOVEFLAG_FLYING | MOVEFLAG_ROOT)) != 0) // Fly Hack

+ {

+ Anti__CheatOccurred(CurTime,"Fly hack",

+ ((uint8)(GetPlayer()->HasAuraType(SPELL_AURA_FLY))) +

+ ((uint8)(GetPlayer()->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))*2),

+ NULL,GetPlayer()->GetPositionZ()-Anti__MapZ);

+ }

+

+ /* Need a better way to do that - currently a lot of fake alarms

+ else if((Anti__MapZ+DIFF_AIRJUMP < GetPlayer()->GetPositionZ() &&

+ (movementInfo.flags & (MOVEMENTFLAG_FALLING | MOVEMENTFLAG_UNK4))==0) ||

+ (Anti__MapZ < GetPlayer()->GetPositionZ() &&

+ opcode==MSG_MOVE_JUMP))

+ {

+ Anti__CheatOccurred(CurTime,"Possible Air Jump Hack",

+ 0.0f,LookupOpcodeName(opcode),0.0f,movementInfo.flags,&movementInfo);

+ }*/

+ }

+

+

+ /*if(Anti__FloorZ < -199900.0f && Anti__GroundZ >= -199900.0f &&

+ GetPlayer()->GetPositionZ()+5.0f < Anti__GroundZ)

+ {

+ Anti__CheatOccurred(CurTime,"Teleport2Plane hack",

+ GetPlayer()->GetPositionZ(),NULL,Anti__GroundZ);

+ }*/

+ }

+ // <<---- anti-cheat features

 

/* process position-change */

movementInfo.UpdateTime(getMSTime());

diff --git a/src/game/Player.cpp b/src/game/Player.cpp

index 3f7c773..4ced6f3 100644

--- a/src/game/Player.cpp

+++ b/src/game/Player.cpp

@@ -437,6 +437,17 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa

rest_type=REST_TYPE_NO;

////////////////////Rest System/////////////////////

 

+ //movement anticheat

+ m_anti_lastmovetime = 0; //last movement time

+ m_anti_NextLenCheck = 0;

+ m_anti_MovedLen = 0.0f;

+ m_anti_BeginFallZ = INVALID_HEIGHT;

+ m_anti_lastalarmtime = 0; //last time when alarm generated

+ m_anti_alarmcount = 0; //alarm counter

+ m_anti_TeleTime = 0;

+ m_CanFly=false;

+ /////////////////////////////////

+

m_mailsUpdated = false;

unReadMails = 0;

m_nextMailDelivereTime = 0;

@@ -21038,7 +21049,11 @@ uint8 Player::CanEquipUniqueItem( ItemPrototype const* itemProto, uint8 except_s

void Player::HandleFall(MovementInfo const& movementInfo)

{

// calculate total z distance of the fall

- float z_diff = m_lastFallZ - movementInfo.GetPos()->z;

+ //float z_diff = m_lastFallZ - movementInfo.z;

+ float z_diff = (m_lastFallZ >= m_anti_BeginFallZ ? m_lastFallZ : m_anti_BeginFallZ) - movementInfo.GetPos()->z;

+

+ m_anti_BeginFallZ=INVALID_HEIGHT;

+ //float z_diff = m_lastFallZ - movementInfo.GetPos()->z;

sLog.outDebug("zDiff = %f", z_diff);

 

//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored

diff --git a/src/game/Player.h b/src/game/Player.h

index b6e6f30..98bb83c 100644

--- a/src/game/Player.h

+++ b/src/game/Player.h

@@ -2144,7 +2144,11 @@ class MANGOS_DLL_SPEC Player : public Unit

bool isMoving() const { return m_movementInfo.HasMovementFlag(movementFlagsMask); }

bool isMovingOrTurning() const { return m_movementInfo.HasMovementFlag(movementOrTurningFlagsMask); }

 

- bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_CAN_FLY); }

+ uint32 Anti__GetLastTeleTime() const { return m_anti_TeleTime; }

+ void Anti__SetLastTeleTime(uint32 TeleTime) { m_anti_TeleTime=TeleTime; }

+ //bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_CAN_FLY); }

+ bool CanFly() const { return m_CanFly; }

+ void SetCanFly(bool CanFly) { m_CanFly=CanFly; }

bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_FLYING); }

bool IsKnowHowFlyIn(uint32 mapid, uint32 zone) const;

 

@@ -2494,6 +2498,16 @@ class MANGOS_DLL_SPEC Player : public Unit

RestType rest_type;

////////////////////Rest System/////////////////////

 

+ //movement anticheat

+ uint32 m_anti_lastmovetime; //last movement time

+ float m_anti_MovedLen; //Length of traveled way

+ uint32 m_anti_NextLenCheck;

+ float m_anti_BeginFallZ; //alternative falling begin

+ uint32 m_anti_lastalarmtime; //last time when alarm generated

+ uint32 m_anti_alarmcount; //alarm counter

+ uint32 m_anti_TeleTime;

+ bool m_CanFly;

+

// Transports

Transport * m_transport;

 

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp

index 35362de..63d7664 100644

--- a/src/game/SpellAuras.cpp

+++ b/src/game/SpellAuras.cpp

@@ -4383,9 +4383,16 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)

{

WorldPacket data;

if(apply)

+ {

+ ((Player*)m_target)->SetCanFly(true);

data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);

+ }

else

+ {

data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);

+ ((Player*)m_target)->SetCanFly(false);

+ }

+ //data.append(m_target->GetPackGUID());

data << m_target->GetPackGUID();

data << uint32(0); // unknown

m_target->SendMessageToSet(&data, true);

@@ -6661,9 +6668,15 @@ void Aura::HandleAuraAllowFlight(bool apply, bool Real)

// allow fly

WorldPacket data;

if(apply)

+ {

+ ((Player*)m_target)->SetCanFly(true);

data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);

+ }

else

+ {

data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);

+ ((Player*)m_target)->SetCanFly(false);

+ }

data << m_target->GetPackGUID();

data << uint32(0); // unk

m_target->SendMessageToSet(&data, true);

diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp

index 5461756..4e1a6f7 100644

--- a/src/game/WaypointMovementGenerator.cpp

+++ b/src/game/WaypointMovementGenerator.cpp

@@ -313,6 +313,7 @@ void FlightPathMovementGenerator::Finalize(Player & player)

 

float x, y, z;

i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);

+ player.Anti__SetLastTeleTime(time(NULL));

player.SetPosition(x, y, z, player.GetOrientation());

 

player.Unmount();

diff --git a/src/game/World.cpp b/src/game/World.cpp

index 2d7b352..56d803e 100644

--- a/src/game/World.cpp

+++ b/src/game/World.cpp

@@ -514,6 +514,19 @@ void World::LoadConfigSettings(bool reload)

setConfigPos(CONFIG_FLOAT_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, "CreatureFamilyFleeAssistanceRadius", 30.0f);

 

///- Read other configuration items from the config file

+

+ // movement anticheat

+ m_MvAnticheatEnable = sConfig.GetBoolDefault("Anticheat.Movement.Enable",false);

+ m_MvAnticheatKick = sConfig.GetBoolDefault("Anticheat.Movement.Kick",false);

+ m_MvAnticheatAlarmCount = (uint32)sConfig.GetIntDefault("Anticheat.Movement.AlarmCount", 5);

+ m_MvAnticheatAlarmPeriod = (uint32)sConfig.GetIntDefault("Anticheat.Movement.AlarmTime", 5000);

+ m_MvAntiCheatBan = (unsigned char)sConfig.GetIntDefault("Anticheat.Movement.BanType",0);

+ m_MvAnticheatBanTime = sConfig.GetStringDefault("Anticheat.Movement.BanTime","1m");

+ m_MvAnticheatGmLevel = (unsigned char)sConfig.GetIntDefault("Anticheat.Movement.GmLevel",0);

+ m_MvAnticheatKill = sConfig.GetBoolDefault("Anticheat.Movement.Kill",false);

+ m_MvAnticheatMaxXYT = sConfig.GetFloatDefault("Anticheat.Movement.MaxXYT",0.04f);

+ m_MvAnticheatIgnoreAfterTeleport = (uint16)sConfig.GetIntDefault("Anticheat.Movement.IgnoreSecAfterTeleport",10);

+

setConfigMinMax(CONFIG_UINT32_COMPRESSION, "Compression", 1, 1, 9);

setConfig(CONFIG_BOOL_ADDON_CHANNEL, "AddonChannel", true);

setConfig(CONFIG_BOOL_GRID_UNLOAD, "GridUnload", true);

diff --git a/src/game/World.h b/src/game/World.h

index a4e4f6f..e079b7c 100644

--- a/src/game/World.h

+++ b/src/game/World.h

@@ -565,6 +565,18 @@ class World

static float GetVisibleUnitGreyDistance() { return m_VisibleUnitGreyDistance; }

static float GetVisibleObjectGreyDistance() { return m_VisibleObjectGreyDistance; }

 

+ //movement anticheat enable flag

+ inline bool GetMvAnticheatEnable() {return m_MvAnticheatEnable;}

+ inline bool GetMvAnticheatKick() {return m_MvAnticheatKick;}

+ inline uint32 GetMvAnticheatAlarmCount() {return m_MvAnticheatAlarmCount;}

+ inline uint32 GetMvAnticheatAlarmPeriod() {return m_MvAnticheatAlarmPeriod;}

+ inline unsigned char GetMvAnticheatBan() {return m_MvAntiCheatBan;}

+ inline std::string GetMvAnticheatBanTime() {return m_MvAnticheatBanTime;}

+ inline unsigned char GetMvAnticheatGmLevel() {return m_MvAnticheatGmLevel;}

+ inline bool GetMvAnticheatKill() {return m_MvAnticheatKill;}

+ inline float GetMvAnticheatMaxXYT() {return m_MvAnticheatMaxXYT;}

+ inline uint16 GetMvAnticheatIgnoreAfterTeleport() {return m_MvAnticheatIgnoreAfterTeleport;}

+

void ProcessCliCommands();

void QueueCliCommand(CliCommandHolder* commandHolder) { cliCmdQueue.add(commandHolder); }

 

@@ -656,6 +668,18 @@ class World

static float m_VisibleUnitGreyDistance;

static float m_VisibleObjectGreyDistance;

 

+ //movement anticheat enable flag

+ bool m_MvAnticheatEnable;

+ bool m_MvAnticheatKick;

+ uint32 m_MvAnticheatAlarmCount;

+ uint32 m_MvAnticheatAlarmPeriod;

+ unsigned char m_MvAntiCheatBan;

+ std::string m_MvAnticheatBanTime;

+ unsigned char m_MvAnticheatGmLevel;

+ bool m_MvAnticheatKill;

+ float m_MvAnticheatMaxXYT;

+ uint16 m_MvAnticheatIgnoreAfterTeleport;

+

// CLI command holder to be thread safe

ACE_Based::LockedQueue<CliCommandHolder*,ACE_Thread_Mutex> cliCmdQueue;

SqlResultQueue *m_resultQueue;

diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h

index 5551eed..17cd1c1 100644

--- a/src/game/WorldSession.h

+++ b/src/game/WorldSession.h

@@ -143,6 +143,10 @@ class MANGOS_DLL_SPEC WorldSession

bool PlayerLogout() const { return m_playerLogout; }

bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }

 

+ inline bool Anti__CheatOccurred(uint32 CurTime,const char* Reason,float Speed,const char* Op=NULL,

+ float Val1=0.0f,uint32 Val2=0/*,MovementInfo* MvInfo=NULL*/);

+ bool Anti__ReportCheat(const char* Reason,float Speed,const char* Op=NULL,float Val1=0.0f,uint32 Val2=0/*,MovementInfo* MvInfo=NULL*/);

+

void SizeError(WorldPacket const& packet, uint32 size) const;

 

void ReadAddonsInfo(WorldPacket &data);

diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in

index 5d4053f..8d1f55f 100644

--- a/src/mangosd/mangosd.conf.dist.in

+++ b/src/mangosd/mangosd.conf.dist.in

@@ -1451,3 +1451,62 @@ SOAP.Enabled = 0

SOAP.IP = 127.0.0.1

SOAP.Port = 7878

 

+###################################################################################################################

+# MOVEMENT ANTICHEAT

+#

+# Anticheat.Movement.Enable

+# Enable Movement Anticheat

+# Default: 0 - off

+# 1 - on

+#

+# Anticheat.Movement.AlarmCount

+# Count alarms. After AlarmCount is exceeded, actions are taken against the player. (default 5)

+#

+# Anticheat.Movement.AlarmTime

+# Reset alarm-count after this milliseconds. (default 5000)

+#

+# Anticheat.Movement.Kill

+# Enable Kill cheater

+# Default: 0 - off

+# 1 - on

+#

+# Anticheat.Movement.Kick

+# Enable Kick cheater

+# Default: 0 - off

+# 1 - on

+#

+# Anticheat.Movement.BanType

+# Enable Ban cheater

+# Default: 0 - off

+# 1 - Ban Account

+# 2 - Ban IP

+# 3 - Ban Account + IP

+#

+# Anticheat.Movement.BanTime

+# How long the ban should last.

+# Default: 1 Minute - 1m

+#

+# Anticheat.Movement.MaxXYT

+# Max units a player is allowed to travel per millisecond.

+# Default: 0.04 (This is ~400% Speed, 0.007 is walk-speed, 310% is 0.0287)

+#

+# Anticheat.Movement.IgnoreSecAfterTeleport

+# After being teleported this number of seconds no cheat is reported.

+# Default: 10 seconds - 10

+#

+# Anticheat.Movement.GmLevel

+# Only accounts that are below this gm-level or exact at the same, are reported for cheating.

+# Default: Only normal Players - 0

+#

+###################################################################################################################

+

+Anticheat.Movement.Enable = 1

+Anticheat.Movement.AlarmCount = 5

+Anticheat.Movement.AlarmTime = 5000

+Anticheat.Movement.Kill = 0

+Anticheat.Movement.Kick = 0

+Anticheat.Movement.BanType = 0

+Anticheat.Movement.BanTime = "1m"

+Anticheat.Movement.MaxXYT = 0.04

+Anticheat.Movement.IgnoreSecAfterTeleport = 10

+Anticheat.Movement.GmLevel = 0

 

  • Upvote 2

Share this post


Link to post
Share on other sites

Psal jsem revizi 9690 pokud si nevidel ale dik

 

 

Share this post


Link to post
Share on other sites

Sorry že to tady oživuju po nějaký době, ale nedalo mi to. Když do spoileru dáš code a do něj teprve ten kód, líp se to čte i kopíruje.

Takže znova to, co postnul Absolution:

 

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `mangos__2_characters`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `cheaters`
+--
+
+CREATE TABLE IF NOT EXISTS `cheaters` (
+  `entry` bigint(20) NOT NULL AUTO_INCREMENT,
+  `player` varchar(30) NOT NULL,
+  `acctid` int(11) NOT NULL,
+  `reason` varchar(255) NOT NULL DEFAULT 'unknown',
+  `speed` float NOT NULL DEFAULT '0',
+  `Val1` float NOT NULL DEFAULT '0',
+  `Val2` int(10) unsigned NOT NULL DEFAULT '0',
+  `count` int(11) NOT NULL DEFAULT '0',
+  `Map` smallint(5) NOT NULL DEFAULT '-1',
+  `Pos` varchar(255) NOT NULL DEFAULT '0',
+  `Level` mediumint(9) NOT NULL DEFAULT '0',
+  `first_date` datetime NOT NULL,
+  `last_date` datetime NOT NULL,
+  `Op` varchar(255) NOT NULL DEFAULT 'unknown',
+  PRIMARY KEY (`entry`),
+  KEY `idx_Count` (`count`),
+  KEY `idx_Player` (`player`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;
+
+--
+-- Dumping data for table `cheaters`
+--
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 23bacd5..23332c3 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -5469,9 +5469,15 @@ bool ChatHandler::HandleGMFlyCommand(const char* args)

    WorldPacket data(12);
    if (strncmp(args, "on", 3) == 0)
+    {
        data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+        ((Player*)(target))->SetCanFly(true);
+    } 
    else if (strncmp(args, "off", 4) == 0)
+    {
        data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+        ((Player*)(target))->SetCanFly(false);
+    }
    else
    {
        SendSysMessage(LANG_USE_BOL);
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index 2c2ca30..83318db 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -31,6 +31,187 @@
#include "WaypointMovementGenerator.h"
#include "InstanceSaveMgr.h"
#include "ObjectMgr.h"
+#include "World.h"
+
+//#define __ANTI_DEBUG__
+
+#ifdef __ANTI_DEBUG__
+#include "Chat.h"
+std::string FlagsToStr(const uint32 Flags)
+{
+    std::string Ret="";
+    if(Flags==0)
+    {
+        Ret="None";
+        return Ret;
+    }
+    
+    if(Flags & MOVEFLAG_FORWARD)
+    {   Ret+="FW "; }
+    if(Flags & MOVEFLAG_BACKWARD)
+    {   Ret+="BW "; }
+    if(Flags & MOVEFLAG_STRAFE_LEFT)
+    {   Ret+="STL ";    }
+    if(Flags & MOVEFLAG_STRAFE_RIGHT)
+    {   Ret+="STR ";    }
+    if(Flags & MOVEFLAG_LEFT)
+    {   Ret+="LF "; }
+    if(Flags & MOVEFLAG_RIGHT)
+    {   Ret+="RI "; }
+    if(Flags & MOVEFLAG_PITCH_UP)
+    {   Ret+="PTUP ";   }
+    if(Flags & MOVEFLAG_PITCH_DOWN)
+    {   Ret+="PTDW ";   }
+    if(Flags & MOVEFLAG_WALK_MODE)
+    {   Ret+="WALK ";   }
+    if(Flags & MOVEFLAG_ONTRANSPORT)
+    {   Ret+="TRANS ";  }
+    if(Flags & MOVEFLAG_LEVITATING)
+    {   Ret+="LEVI ";   }
+    if(Flags & MOVEFLAG_FLY_UNK1)
+    {   Ret+="FLYUNK1 ";    }
+    if(Flags & MOVEFLAG_JUMPING)
+    {   Ret+="JUMP ";   }
+    if(Flags & MOVEFLAG_UNK4)
+    {   Ret+="UNK4 ";   }
+    if(Flags & MOVEFLAG_FALLING)
+    {   Ret+="FALL ";   }
+    if(Flags & MOVEFLAG_SWIMMING)
+    {   Ret+="SWIM ";   }
+    if(Flags & MOVEFLAG_FLY_UP)
+    {   Ret+="FLYUP ";  }
+    if(Flags & MOVEFLAG_CAN_FLY)
+    {   Ret+="CFLY ";   }
+    if(Flags & MOVEFLAG_FLYING)
+    {   Ret+="FLY ";    }
+    if(Flags & MOVEFLAG_FLYING2)
+    {   Ret+="FLY2 ";   }
+    if(Flags & MOVEFLAG_WATERWALKING)
+    {   Ret+="WTWALK "; }
+    if(Flags & MOVEFLAG_SAFE_FALL)
+    {   Ret+="SAFE ";   }
+    if(Flags & MOVEFLAG_UNK3)
+    {   Ret+="UNK3 ";   }
+    if(Flags & MOVEFLAG_SPLINE)
+    {   Ret+="SPLINE ";     }
+    if(Flags & MOVEFLAG_SPLINE2)
+    {   Ret+="SPLINE2 ";    }
+    
+    return Ret;
+}
+#endif // __ANTI_DEBUG__
+
+bool WorldSession::Anti__ReportCheat(const char* Reason,float Speed,const char* Op,float Val1,uint32 Val2 /*,MovementInfo* MvInfo*/)
+{
+    if(!Reason)
+    {
+        sLog.outError("Anti__ReportCheat: Missing Reason parameter!");
+        return false;
+    }
+    const char* Player=GetPlayer()->GetName();
+    uint32 Acc=GetPlayer()->GetSession()->GetAccountId();
+    uint32 Map=GetPlayer()->GetMapId();
+    if(!Player)
+    {
+        sLog.outError("Anti__ReportCheat: Player with no name?!?");
+        return false;
+    }
+
+    QueryResult *Res=CharacterDatabase.PQuery("SELECT speed,Val1 FROM cheaters WHERE player='%s' AND reason LIKE '%s' AND Map='%u' AND last_date >= NOW()-300",Player,Reason,Map);
+    if(Res)
+    {
+        Field* Fields = Res->Fetch();
+        
+        std::stringstream Query;
+        Query << "UPDATE cheaters SET count=count+1,last_date=NOW()";
+        Query.precision(5);
+        if(Speed>0.0f && Speed > Fields[0].GetFloat())
+        {
+            Query << ",speed='";
+            Query << std::fixed << Speed;
+            Query << "'";
+        }
+
+        if(Val1>0.0f && Val1 > Fields[1].GetFloat())
+        {
+            Query << ",Val1='";
+            Query << std::fixed << Val1;
+            Query << "'";
+        }
+        
+        Query << " WHERE player='" << Player << "' AND reason='" << Reason << "' AND Map='" << Map << "' AND last_date >= NOW()-300 ORDER BY entry DESC LIMIT 1";
+        
+        CharacterDatabase.Execute(Query.str().c_str());
+        delete Res;
+    }
+    else
+    {
+        if(!Op)
+        {   Op="";  }
+        std::stringstream Pos;
+        Pos << "OldPos: " << GetPlayer()->GetPositionX() << " " << GetPlayer()->GetPositionY() << " "
+            << GetPlayer()->GetPositionZ();
+        /*if(MvInfo)
+        {
+            Pos << "\nNew: " << MvInfo->x << " " << MvInfo->y << " " << MvInfo->z << "\n"
+                << "Flags: " << MvInfo->flags << "\n"
+                << "t_guid: " << MvInfo->t_guid << " falltime: " << MvInfo->fallTime;
+        }*/
+        CharacterDatabase.PExecute("INSERT INTO cheaters (player,acctid,reason,speed,count,first_date,last_date,`Op`,Val1,Val2,Map,Pos,Level) "
+                                   "VALUES ('%s','%u','%s','%f','1',NOW(),NOW(),'%s','%f','%u','%u','%s','%u')",
+                                   Player,Acc,Reason,Speed,Op,Val1,Val2,Map,
+                                   Pos.str().c_str(),GetPlayer()->getLevel());
+    }
+
+    if(sWorld.GetMvAnticheatKill() && GetPlayer()->isAlive())
+    {
+        GetPlayer()->DealDamage(GetPlayer(), GetPlayer()->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+    }
+    if(sWorld.GetMvAnticheatKick())
+    {
+        GetPlayer()->GetSession()->KickPlayer();
+    }
+    if(sWorld.GetMvAnticheatBan() & 1)
+    {
+        sWorld.BanAccount(BAN_CHARACTER,Player,sWorld.GetMvAnticheatBanTime(),"Cheat","Anticheat");
+    }
+    if(sWorld.GetMvAnticheatBan() & 2)
+    {
+        QueryResult *result = loginDatabase.PQuery("SELECT last_ip FROM account WHERE id=%u", Acc);
+        if(result)
+        {
+
+            Field *fields = result->Fetch();
+            std::string LastIP = fields[0].GetCppString();
+            if(!LastIP.empty())
+            {
+                sWorld.BanAccount(BAN_IP,LastIP,sWorld.GetMvAnticheatBanTime(),"Cheat","Anticheat");
+            }
+            delete result;
+        }
+    }
+    return true;
+}
+
+bool WorldSession::Anti__CheatOccurred(uint32 CurTime,const char* Reason,float Speed,const char* Op,
+                                float Val1,uint32 Val2/*,MovementInfo* MvInfo*/)
+{
+    if(!Reason)
+    {
+        sLog.outError("Anti__CheatOccurred: Missing Reason parameter!");
+        return false;
+    }
+    
+    GetPlayer()->m_anti_lastalarmtime = CurTime;
+    GetPlayer()->m_anti_alarmcount = GetPlayer()->m_anti_alarmcount + 1;
+
+    if (GetPlayer()->m_anti_alarmcount > sWorld.GetMvAnticheatAlarmCount())
+    {
+        Anti__ReportCheat(Reason,Speed,Op,Val1,Val2/*,MvInfo*/);
+        return true;
+    }
+    return false;
+}

void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )
{
@@ -72,6 +253,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
    // relocate the player to the teleport destination
    GetPlayer()->SetMap(sMapMgr.CreateMap(loc.mapid, GetPlayer()));
    GetPlayer()->Relocate(loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation);
+    GetPlayer()->m_anti_TeleTime=time(NULL);

    GetPlayer()->SendInitialPacketsBeforeAddToMap();
    // the CanEnter checks are done in TeleporTo but conditions may change
@@ -163,6 +345,8 @@ void WorldSession::HandleMoveWorldportAckOpcode()

    // resummon pet
    GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
+    GetPlayer()->Anti__SetLastTeleTime(::time(NULL));
+    GetPlayer()->m_anti_BeginFallZ=INVALID_HEIGHT;

    //lets process all delayed operations on successful teleport
    GetPlayer()->ProcessDelayedOperations();
@@ -212,6 +396,11 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)

    // resummon pet
    GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
+    if(plMover)
+    {
+        plMover->Anti__SetLastTeleTime(::time(NULL));
+        plMover->m_anti_BeginFallZ=INVALID_HEIGHT;
+    }

    //lets process all delayed operations on successful teleport
    GetPlayer()->ProcessDelayedOperations();
@@ -268,6 +457,11 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
        // if we boarded a transport, add us to it
        if (plMover && !plMover->m_transport)
        {
+            float trans_rad = movementInfo.GetTransportPos()->x*movementInfo.GetTransportPos()->x + movementInfo.GetTransportPos()->y*movementInfo.GetTransportPos()->y + movementInfo.GetTransportPos()->z*movementInfo.GetTransportPos()->z;
+            if (trans_rad > 3600.0f) // transport radius = 60 yards //cheater with on_transport_flag
+            {
+ 	            return;
+            }
            // elevators also cause the client to send MOVEFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list
            for (MapManager::TransportSet::const_iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter)
            {
@@ -295,9 +489,141 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
    {
        // now client not include swimming flag in case jumping under water
        plMover->SetInWater( !plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z) );
+        if(plMover->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z-7.0f))
+        {
+            plMover->m_anti_BeginFallZ=INVALID_HEIGHT;
+        }
    }

-    /*----------------------*/
+    // ---- anti-cheat features -->>>
+    uint32 Anti_TeleTimeDiff=plMover ? time(NULL) - plMover->Anti__GetLastTeleTime() : time(NULL);
+    static const uint32 Anti_TeleTimeIgnoreDiff=sWorld.GetMvAnticheatIgnoreAfterTeleport();
+    if (plMover && (plMover->m_transport == 0) && sWorld.GetMvAnticheatEnable() &&
+        GetPlayer()->GetSession()->GetSecurity() <= sWorld.GetMvAnticheatGmLevel() &&
+        GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()!=FLIGHT_MOTION_TYPE &&
+        Anti_TeleTimeDiff>Anti_TeleTimeIgnoreDiff)
+    {
+        const uint32 CurTime=getMSTime();
+        if(getMSTimeDiff(GetPlayer()->m_anti_lastalarmtime,CurTime) > sWorld.GetMvAnticheatAlarmPeriod())
+        {
+            GetPlayer()->m_anti_alarmcount = 0;
+        }
+        /* I really don't care about movement-type yet (todo)
+        UnitMoveType move_type;
+ 
+        if (movementInfo.flags & MOVEMENTFLAG_FLYING) move_type = MOVE_FLY;
+        else if (movementInfo.flags & MOVEMENTFLAG_SWIMMING) move_type = MOVE_SWIM;
+        else if (movementInfo.flags & MOVEMENTFLAG_WALK_MODE) move_type = MOVE_WALK;
+        else move_type = MOVE_RUN;*/
+ 
+        float delta_x = GetPlayer()->GetPositionX() - movementInfo.GetPos()->x;
+        float delta_y = GetPlayer()->GetPositionY() - movementInfo.GetPos()->y;
+        float delta_z = GetPlayer()->GetPositionZ() - movementInfo.GetPos()->z;
+        float delta = sqrt(delta_x * delta_x + delta_y * delta_y); // Len of movement-vector via Pythagoras (a^2+b^2=Len^2)
+        float tg_z = 0.0f; //tangens
+        float delta_t = getMSTimeDiff(GetPlayer()->m_anti_lastmovetime,CurTime);
+         
+        GetPlayer()->m_anti_lastmovetime = CurTime;
+        GetPlayer()->m_anti_MovedLen += delta;
+ 
+        if(delta_t > 15000.0f)
+        {   delta_t = 15000.0f;   }
+ 
+        // Tangens of walking angel
+        if (!(movementInfo.GetMovementFlags() & (MOVEFLAG_FLYING | MOVEFLAG_SWIMMING)))
+        {
+            //Mount hack detection currently disabled
+            tg_z = ((delta !=0.0f) && (delta_z > 0.0f)) ? (atan((delta_z*delta_z) / delta) * 180.0f / M_PI) : 0.0f;
+        }
+
+        //antiOFF fall-damage, MOVEMENTFLAG_UNK4 seted by client if player try movement when falling and unset in this case the MOVEMENTFLAG_FALLING flag.
+         
+        if((GetPlayer()->m_anti_BeginFallZ == INVALID_HEIGHT) &&
+           (movementInfo.GetMovementFlags() & (MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR)) != 0)
+        {
+            GetPlayer()->m_anti_BeginFallZ=(float)(movementInfo.GetPos()->z);
+        }
+ 
+        if(GetPlayer()->m_anti_NextLenCheck <= CurTime)
+        {
+            // Check every 500ms is a lot more advisable then 1000ms, because normal movment packet arrives every 500ms
+            uint32 OldNextLenCheck=GetPlayer()->m_anti_NextLenCheck;
+            float delta_xyt=GetPlayer()->m_anti_MovedLen/(float)(getMSTimeDiff(OldNextLenCheck-500,CurTime));
+            GetPlayer()->m_anti_NextLenCheck = CurTime+500;
+            GetPlayer()->m_anti_MovedLen = 0.0f;
+            static const float MaxDeltaXYT = sWorld.GetMvAnticheatMaxXYT();
+
+#ifdef __ANTI_DEBUG__
+            SendAreaTriggerMessage("XYT: %f ; Flags: %s",delta_xyt,FlagsToStr(movementInfo.GetMovementFlags()).c_str());
+#endif //__ANTI_DEBUG__
+             
+            if(delta_xyt > MaxDeltaXYT && delta<=100.0f && GetPlayer()->GetZoneId() != 2257)
+            {
+                Anti__CheatOccurred(CurTime,"Speed hack",delta_xyt,LookupOpcodeName(opcode),
+                                    (float)(GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()),
+                                    (float)(getMSTimeDiff(OldNextLenCheck-500,CurTime))/*,&movementInfo*/);
+            }
+        }
+ 
+        if(delta > 100.0f && GetPlayer()->GetZoneId() != 2257)
+        {
+            Anti__ReportCheat("Tele hack",delta,LookupOpcodeName(opcode));
+        }
+
+        // Check for waterwalking . Fix new way of checking for waterwalking by Darky88
+        if (movementInfo.HasMovementFlag(MOVEFLAG_WATERWALKING) &&
+           !(GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK) || GetPlayer()->HasAuraType(SPELL_AURA_GHOST)))
+        {
+            Anti__CheatOccurred(CurTime,"Water walking",0.0f,NULL,0.0f,(uint32)(movementInfo.GetMovementFlags()));
+        }
+         
+        // Check for walking upwards a mountain while not beeing able to do that
+        if ((tg_z > 85.0f))
+        {
+            Anti__CheatOccurred(CurTime,"Mount hack",tg_z,NULL,delta,delta_z);
+        }
+        
+        
+        static const float DIFF_OVERGROUND = 10.0f;
+        float Anti__GroundZ = GetPlayer()->GetMap()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),MAX_HEIGHT);
+        float Anti__FloorZ  = GetPlayer()->GetMap()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),GetPlayer()->GetPositionZ());
+        float Anti__MapZ = ((Anti__FloorZ <= (INVALID_HEIGHT+5.0f)) ? Anti__GroundZ : Anti__FloorZ) + DIFF_OVERGROUND;
+         
+        if(!GetPlayer()->CanFly() && /*!plMover->isGameMaster() &&*/
+           !GetPlayer()->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z-7.0f) &&
+           Anti__MapZ < GetPlayer()->GetPositionZ() && Anti__MapZ > (INVALID_HEIGHT+DIFF_OVERGROUND + 5.0f))
+        {
+            static const float DIFF_AIRJUMP=25.0f; // 25 is realy high, but to many false positives...
+             
+            // Air-Jump-Detection definitively needs a better way to be detected...
+            if((movementInfo.GetMovementFlags() & (MOVEFLAG_CAN_FLY | MOVEFLAG_FLYING | MOVEFLAG_ROOT)) != 0) // Fly Hack
+            {
+                Anti__CheatOccurred(CurTime,"Fly hack",
+                                    ((uint8)(GetPlayer()->HasAuraType(SPELL_AURA_FLY))) +
+                                    ((uint8)(GetPlayer()->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))*2),
+                                    NULL,GetPlayer()->GetPositionZ()-Anti__MapZ);
+            }
+             
+            /* Need a better way to do that - currently a lot of fake alarms
+            else if((Anti__MapZ+DIFF_AIRJUMP < GetPlayer()->GetPositionZ() &&
+                    (movementInfo.flags & (MOVEMENTFLAG_FALLING | MOVEMENTFLAG_UNK4))==0) ||
+                    (Anti__MapZ < GetPlayer()->GetPositionZ() && 
+                     opcode==MSG_MOVE_JUMP))
+            {
+                 Anti__CheatOccurred(CurTime,"Possible Air Jump Hack",
+                                    0.0f,LookupOpcodeName(opcode),0.0f,movementInfo.flags,&movementInfo);
+            }*/
+        }
+ 
+        
+        /*if(Anti__FloorZ < -199900.0f && Anti__GroundZ >= -199900.0f &&
+           GetPlayer()->GetPositionZ()+5.0f < Anti__GroundZ)
+        {
+            Anti__CheatOccurred(CurTime,"Teleport2Plane hack",
+                                GetPlayer()->GetPositionZ(),NULL,Anti__GroundZ);
+        }*/
+    } 
+    // <<---- anti-cheat features

    /* process position-change */
    movementInfo.UpdateTime(getMSTime());
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 3f7c773..4ced6f3 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -437,6 +437,17 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
    rest_type=REST_TYPE_NO;
    ////////////////////Rest System/////////////////////

+    //movement anticheat
+    m_anti_lastmovetime = 0;   //last movement time
+    m_anti_NextLenCheck = 0;
+    m_anti_MovedLen = 0.0f;
+    m_anti_BeginFallZ = INVALID_HEIGHT;
+    m_anti_lastalarmtime = 0;    //last time when alarm generated
+    m_anti_alarmcount = 0;       //alarm counter
+    m_anti_TeleTime = 0;
+    m_CanFly=false;
+    /////////////////////////////////
+ 
    m_mailsUpdated = false;
    unReadMails = 0;
    m_nextMailDelivereTime = 0;
@@ -21038,7 +21049,11 @@ uint8 Player::CanEquipUniqueItem( ItemPrototype const* itemProto, uint8 except_s
void Player::HandleFall(MovementInfo const& movementInfo)
{
    // calculate total z distance of the fall
-    float z_diff = m_lastFallZ - movementInfo.GetPos()->z;
+    //float z_diff = m_lastFallZ - movementInfo.z;
+    float z_diff = (m_lastFallZ >= m_anti_BeginFallZ ? m_lastFallZ : m_anti_BeginFallZ) - movementInfo.GetPos()->z;
+     
+    m_anti_BeginFallZ=INVALID_HEIGHT;
+    //float z_diff = m_lastFallZ - movementInfo.GetPos()->z;
    sLog.outDebug("zDiff = %f", z_diff);

    //Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
diff --git a/src/game/Player.h b/src/game/Player.h
index b6e6f30..98bb83c 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2144,7 +2144,11 @@ class MANGOS_DLL_SPEC Player : public Unit
        bool isMoving() const { return m_movementInfo.HasMovementFlag(movementFlagsMask); }
        bool isMovingOrTurning() const { return m_movementInfo.HasMovementFlag(movementOrTurningFlagsMask); }

-        bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_CAN_FLY); }
+        uint32 Anti__GetLastTeleTime() const { return m_anti_TeleTime; }
+        void Anti__SetLastTeleTime(uint32 TeleTime) { m_anti_TeleTime=TeleTime; }
+        //bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_CAN_FLY); }
+        bool CanFly() const { return m_CanFly;  }
+        void SetCanFly(bool CanFly) { m_CanFly=CanFly; }
        bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_FLYING); }
        bool IsKnowHowFlyIn(uint32 mapid, uint32 zone) const;

@@ -2494,6 +2498,16 @@ class MANGOS_DLL_SPEC Player : public Unit
        RestType rest_type;
        ////////////////////Rest System/////////////////////

+        //movement anticheat
+        uint32 m_anti_lastmovetime;     //last movement time
+        float  m_anti_MovedLen;         //Length of traveled way
+        uint32 m_anti_NextLenCheck;
+        float  m_anti_BeginFallZ;    //alternative falling begin
+        uint32 m_anti_lastalarmtime;    //last time when alarm generated
+        uint32 m_anti_alarmcount;       //alarm counter
+        uint32 m_anti_TeleTime;
+        bool m_CanFly;
+
        // Transports
        Transport * m_transport;

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 35362de..63d7664 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -4383,9 +4383,16 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
    {
        WorldPacket data;
        if(apply)
+        {
+            ((Player*)m_target)->SetCanFly(true);
            data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
+        }
        else
+        {
            data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
+            ((Player*)m_target)->SetCanFly(false);
+        }
+        //data.append(m_target->GetPackGUID());
        data << m_target->GetPackGUID();
        data << uint32(0);                                      // unknown
        m_target->SendMessageToSet(&data, true);
@@ -6661,9 +6668,15 @@ void Aura::HandleAuraAllowFlight(bool apply, bool Real)
    // allow fly
    WorldPacket data;
    if(apply)
+    {
+        ((Player*)m_target)->SetCanFly(true);
        data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
+    }
    else
+    {
        data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
+        ((Player*)m_target)->SetCanFly(false);
+    }
    data << m_target->GetPackGUID();
    data << uint32(0);                                      // unk
    m_target->SendMessageToSet(&data, true);
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 5461756..4e1a6f7 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -313,6 +313,7 @@ void FlightPathMovementGenerator::Finalize(Player & player)

    float x, y, z;
    i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
+    player.Anti__SetLastTeleTime(time(NULL));
    player.SetPosition(x, y, z, player.GetOrientation());

    player.Unmount();
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 2d7b352..56d803e 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -514,6 +514,19 @@ void World::LoadConfigSettings(bool reload)
    setConfigPos(CONFIG_FLOAT_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, "CreatureFamilyFleeAssistanceRadius", 30.0f);

    ///- Read other configuration items from the config file
+
+    // movement anticheat
+    m_MvAnticheatEnable                     = sConfig.GetBoolDefault("Anticheat.Movement.Enable",false);
+    m_MvAnticheatKick                       = sConfig.GetBoolDefault("Anticheat.Movement.Kick",false);
+    m_MvAnticheatAlarmCount                 = (uint32)sConfig.GetIntDefault("Anticheat.Movement.AlarmCount", 5);
+    m_MvAnticheatAlarmPeriod                = (uint32)sConfig.GetIntDefault("Anticheat.Movement.AlarmTime", 5000);
+    m_MvAntiCheatBan                        = (unsigned char)sConfig.GetIntDefault("Anticheat.Movement.BanType",0);
+    m_MvAnticheatBanTime                    = sConfig.GetStringDefault("Anticheat.Movement.BanTime","1m");
+    m_MvAnticheatGmLevel                    = (unsigned char)sConfig.GetIntDefault("Anticheat.Movement.GmLevel",0);
+    m_MvAnticheatKill                       = sConfig.GetBoolDefault("Anticheat.Movement.Kill",false);
+    m_MvAnticheatMaxXYT                     = sConfig.GetFloatDefault("Anticheat.Movement.MaxXYT",0.04f);
+    m_MvAnticheatIgnoreAfterTeleport        = (uint16)sConfig.GetIntDefault("Anticheat.Movement.IgnoreSecAfterTeleport",10);
+
    setConfigMinMax(CONFIG_UINT32_COMPRESSION, "Compression", 1, 1, 9);
    setConfig(CONFIG_BOOL_ADDON_CHANNEL, "AddonChannel", true);
    setConfig(CONFIG_BOOL_GRID_UNLOAD, "GridUnload", true);
diff --git a/src/game/World.h b/src/game/World.h
index a4e4f6f..e079b7c 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -565,6 +565,18 @@ class World
        static float GetVisibleUnitGreyDistance()           { return m_VisibleUnitGreyDistance;       }
        static float GetVisibleObjectGreyDistance()         { return m_VisibleObjectGreyDistance;     }

+        //movement anticheat enable flag
+        inline bool GetMvAnticheatEnable()             {return m_MvAnticheatEnable;}
+        inline bool GetMvAnticheatKick()               {return m_MvAnticheatKick;}
+        inline uint32 GetMvAnticheatAlarmCount()       {return m_MvAnticheatAlarmCount;}
+        inline uint32 GetMvAnticheatAlarmPeriod()      {return m_MvAnticheatAlarmPeriod;}
+        inline unsigned char GetMvAnticheatBan()       {return m_MvAntiCheatBan;}
+        inline std::string GetMvAnticheatBanTime()     {return m_MvAnticheatBanTime;}
+        inline unsigned char GetMvAnticheatGmLevel()   {return m_MvAnticheatGmLevel;}
+        inline bool GetMvAnticheatKill()               {return m_MvAnticheatKill;}
+        inline float GetMvAnticheatMaxXYT()            {return m_MvAnticheatMaxXYT;}
+        inline uint16 GetMvAnticheatIgnoreAfterTeleport()   {return m_MvAnticheatIgnoreAfterTeleport;}
+
        void ProcessCliCommands();
        void QueueCliCommand(CliCommandHolder* commandHolder) { cliCmdQueue.add(commandHolder); }

@@ -656,6 +668,18 @@ class World
        static float m_VisibleUnitGreyDistance;
        static float m_VisibleObjectGreyDistance;

+        //movement anticheat enable flag
+        bool m_MvAnticheatEnable;
+        bool m_MvAnticheatKick;
+        uint32 m_MvAnticheatAlarmCount;
+        uint32 m_MvAnticheatAlarmPeriod;
+        unsigned char m_MvAntiCheatBan;
+        std::string m_MvAnticheatBanTime;
+        unsigned char m_MvAnticheatGmLevel;
+        bool m_MvAnticheatKill;
+        float m_MvAnticheatMaxXYT;
+        uint16 m_MvAnticheatIgnoreAfterTeleport;
+
        // CLI command holder to be thread safe
        ACE_Based::LockedQueue<CliCommandHolder*,ACE_Thread_Mutex> cliCmdQueue;
        SqlResultQueue *m_resultQueue;
diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h
index 5551eed..17cd1c1 100644
--- a/src/game/WorldSession.h
+++ b/src/game/WorldSession.h
@@ -143,6 +143,10 @@ class MANGOS_DLL_SPEC WorldSession
        bool PlayerLogout() const { return m_playerLogout; }
        bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }

+        inline bool Anti__CheatOccurred(uint32 CurTime,const char* Reason,float Speed,const char* Op=NULL,
+                                float Val1=0.0f,uint32 Val2=0/*,MovementInfo* MvInfo=NULL*/);
+        bool Anti__ReportCheat(const char* Reason,float Speed,const char* Op=NULL,float Val1=0.0f,uint32 Val2=0/*,MovementInfo* MvInfo=NULL*/);
+
        void SizeError(WorldPacket const& packet, uint32 size) const;

        void ReadAddonsInfo(WorldPacket &data);
diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
index 5d4053f..8d1f55f 100644
--- a/src/mangosd/mangosd.conf.dist.in
+++ b/src/mangosd/mangosd.conf.dist.in
@@ -1451,3 +1451,62 @@ SOAP.Enabled = 0
SOAP.IP = 127.0.0.1
SOAP.Port = 7878

+###################################################################################################################
+# MOVEMENT ANTICHEAT
+#
+#    Anticheat.Movement.Enable
+#        Enable Movement Anticheat
+#        Default: 0 - off
+#                 1 - on
+#
+#    Anticheat.Movement.AlarmCount
+#        Count alarms. After AlarmCount is exceeded, actions are taken against the player. (default 5)
+#
+#    Anticheat.Movement.AlarmTime
+#        Reset alarm-count after this milliseconds. (default 5000)
+#
+#    Anticheat.Movement.Kill
+#        Enable Kill cheater
+#        Default: 0 - off
+#                 1 - on
+#
+#    Anticheat.Movement.Kick
+#        Enable Kick cheater
+#        Default: 0 - off
+#                 1 - on
+#
+#    Anticheat.Movement.BanType
+#        Enable Ban cheater
+#        Default: 0 - off
+#                 1 - Ban Account
+#                 2 - Ban IP
+#                 3 - Ban Account + IP
+#
+#    Anticheat.Movement.BanTime
+#        How long the ban should last.
+#        Default: 1 Minute - 1m
+#
+#    Anticheat.Movement.MaxXYT
+#        Max units a player is allowed to travel per millisecond.
+#        Default: 0.04 (This is ~400% Speed, 0.007 is walk-speed, 310% is 0.0287)
+#
+#    Anticheat.Movement.IgnoreSecAfterTeleport
+#        After being teleported this number of seconds no cheat is reported.
+#        Default: 10 seconds - 10
+#
+#    Anticheat.Movement.GmLevel
+#        Only accounts that are below this gm-level or exact at the same, are reported for cheating.
+#        Default: Only normal Players - 0
+#
+###################################################################################################################
+
+Anticheat.Movement.Enable = 1
+Anticheat.Movement.AlarmCount = 5
+Anticheat.Movement.AlarmTime = 5000
+Anticheat.Movement.Kill = 0
+Anticheat.Movement.Kick = 0
+Anticheat.Movement.BanType = 0
+Anticheat.Movement.BanTime = "1m"
+Anticheat.Movement.MaxXYT = 0.04
+Anticheat.Movement.IgnoreSecAfterTeleport = 10
+Anticheat.Movement.GmLevel = 0

 

;) Zdár..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×