View Single Post
  #12  
Old 04-16-2008, 03:51 AM
TheLieka
Developer
 
Join Date: Oct 2004
Location: THE ATL (wut wut)
Posts: 325
Default

Ax - the submission thread for this is locked, could you move this code over for me?

I don't have a ton of time to document this, but it's well documented in the code. Long story short -
  • Warp detection is now done by velocity rather than just distance. The time measurement is taken between Player Position Update packets being received.
  • The velocity is taken by taking the distance / time since last PPU.
  • If the detector trips, it moves the player back to his previous PPU location.
  • Added the following rules:
    For Disabling MQDetector Penalties (Punishment for the player)
    For Disabling SQL Logging (haven't replaced it with text logging, but if it's a performance concern you can now disable it in the rules)
    For Disabling MQDetector Broadcast
    For Setting the Speed Limit (speed measured by units / second - this rule specifies the number of units a player is allowed to travel per second. From testing: 3-4 is level 50 SoW, 7 - 10 is GM Speed
  • Added 4 new items to #showstats:
    Last PPU Time: Indicates how long it was since the last PPU for the player (in hundredths of a second)
    Longest PPU Time: Records the longest time between PPUs for the player (in hundredths of a second)
    Current Movement Speed: Indicates the current movement speed of the player
    Highest Movement Speed: Indicates the highest movement speed of the player

That's pretty much it - the rest is the same as my original submission, but I think these updates should be what the code needed.

Let me know what you think.

Thanks,
Dax

This Diff was taken against 0.7.0-1102
Code:
diff  c:/EQEmu_0.7.0_1102_source/zone/client.h c:/VZ-TZ-Diff/zone/client.h
151a152
> 	WarpDetected,			// Lieka:  Return client to pre-warp location
154a156,162
> typedef enum {
> 	MQWarp,
> 	MQZone,
> 	MQGate,
> 	MQGhost
> } CheatTypes;
> 
177a186,187
> 	void	CheatDetected(CheatTypes Cheat);
> 	bool	WarpDetection(bool CTimer, float Distance, int32 last_ppu_timer);
diff  c:/EQEmu_0.7.0_1102_source/zone/client_packet.cpp c:/VZ-TZ-Diff/zone/client_packet.cpp
773a774,860
> bool Client::WarpDetection(bool CTimer, float distance, int32 last_ppu_timer) //Lieka:  Completely reworked this function.  Rather than basing warp detection on large movement diffs, we now base it on the player's speed (update distance / update time)
> {	
> 	if (CTimer)
> 		return false;
> 	else
> 	{
> 	movement_speed = distance / (last_ppu_timer/100);
> 	if (movement_speed > highest_movement_speed) {
> 		highest_movement_speed = movement_speed;
> 	}
> 	return (movement_speed > RuleR(Zone, MQWarpSpeedLimit)); //Lieka:  If the player breaks the speed limit, bring down the hammer.
> 	}
> }
> 
> void Client::CheatDetected(CheatTypes CheatType)
> { //[Paddy] ToDo: Break warp down for special zones. Some zones have special teleportation pads or bad .map files which can trigger the detector without a legit zone request.
> 	switch (CheatType)
> 	{
> 		case MQWarp://Some zones have serious issues, turning off warp flags for these zones.
> 			if(!((zone->GetZoneID()==2)/*qeynos2*/ || (zone->GetZoneID()==9)/*freportw*/|| (zone->GetZoneID()==10)/*freporte*/ || (zone->GetZoneID()==34)/*nro*/ || (zone->GetZoneID()==24)/*erudin*/ || (zone->GetZoneID()==75)/*Paineel*/ || (zone->GetZoneID()==62)/*Felwitheb*/) && (RuleB(Zone, EnableMQWarpDetector) && ((this->Admin() < RuleI(Zone, MQWarpExemptStatus) || (RuleI(Zone, MQWarpExemptStatus)) == -1)))) //Lieka:  Exempt these zones from the MQWarp detector (This may be depricated now, but these zones were problems in the past)
> 			{
> 				if (!RuleB(Zone, MQDetectorDisableSQLLogging)){
> 				Message(13, "Your account has been reported for hacking.");
> 				database.SetMQDetectionFlag(this->account_name, this->name, "/MQWarp", zone->GetShortName());
> 				}
> 				if(!RuleB(Zone, MQDetectorDisablePenalties)){ //Lieka:  Toggle Negative effects based on rule value
> 				SetMana(0);  //Lieka:  Remove all mana from player.
> 				SetHP(5);  //Lieka:  Set player's hitpoints to 5.
> 				BuffFadeAll();  //Lieka:  Wipe all of player's buffs.
> 				SpellFinished((RuleI(Zone, MQWarpDetectionSpellID)), this);  //Lieka:  Integrated into Rules System.  Spell to cast on players Default:  757 (Resurrection Effects).
> 				}
> 				if(!RuleB(Zone, MQDetectorDisableBroadcast)) //Lieka:  Toggle broadcast based on rule value
> 					worldserver.SendEmoteMessage(0,0,0,13,"<MQWarp Detector>.  %s was just caught warping in %s.  Come get your free kill!",this->GetName(),zone->GetLongName());
> 			}
> 			break;
> 		case MQZone:
> 			if(!( (zone->GetZoneID()==31)/*sola*/ || (zone->GetZoneID()==32)/*solb*/ || (zone->GetZoneID()==25)/*nek*/ || (zone->GetZoneID()==27)/*lava*/ ) && (RuleB(Zone, EnableMQZoneDetector))&& ((this->Admin() < RuleI(Zone, MQZoneExemptStatus) || (RuleI(Zone, MQZoneExemptStatus)) == -1))) //Lieka:  Exempt these zones from the MQZone detector (This may be depricated now, but were problems in the past)
> 			{
> 				if (!RuleB(Zone, MQDetectorDisableSQLLogging)){
> 				Message(13, "Your account has been reported for hacking.");
> 				database.SetMQDetectionFlag(this->account_name, this->name, "/MQZone", zone->GetShortName());
> 				}
> 				if(!RuleB(Zone, MQDetectorDisablePenalties)){ //Lieka:  Toggle Negative effects based on rule value
> 				SetMana(0);  //Lieka:  Remove all mana from player.
> 				SetHP(5);  //Lieka:  Set player's hitpoints to 5.
> 				BuffFadeAll();  //Lieka:  Wipe all of player's buffs.
> 				AddBuff(this,(RuleI(Zone, MQZoneDetectionSpellID)),30);   //Lieka:  Integrated into Rules System.  Add (de)buff on player for 30 ticks.  Default:  757 (Resurrection Effects).
> 				}
> 				if(!RuleB(Zone, MQDetectorDisableBroadcast)) //Lieka:  Toggle broadcast based on rule value
> 					worldserver.SendEmoteMessage(0,0,0,13,"<MQZone Detector>.  %s as just caught using Macroquest to /Zone to %s.  Come get your free kill!",this->GetName(),zone->GetLongName()); //Lieka:  Broadcast to the server that the MQZone detector has caught a cheater.
> 			}
> 			break;
> 		case MQGate:
> 			if (RuleB(Zone, EnableMQGateDetector)&& ((this->Admin() < RuleI(Zone, MQGateExemptStatus) || (RuleI(Zone, MQGateExemptStatus)) == -1))) {
> 				if (!RuleB(Zone, MQDetectorDisableSQLLogging)){
> 				Message(13, "Your account has been reported for hacking.");
> 				database.SetMQDetectionFlag(this->account_name, this->name, "/MQGate", zone->GetShortName());
> 				}
> 				this->SetZone(this->GetZoneID()); //Lieka:  Prevent the player from zoning, place him back in the zone where he tried to originally /gate.
> 				if(!RuleB(Zone, MQDetectorDisablePenalties)){ //Lieka:  Toggle Negative effects based on rule value
> 				SetMana(0);  //Lieka:  Remove all mana from player.
> 				SetHP(5);  //Lieka:  Set player's hitpoints to 5.
> 				BuffFadeAll();  //Lieka:  Wipe all of player's buffs.
> 				AddBuff(this,(RuleI(Zone, MQGateDetectionSpellID)),30);   //Lieka:  Integrated into Rules System.  Add (de)buff on player for 30 ticks.  Default:  757 (Resurrection Effects).
> 				}
> 				if(!RuleB(Zone, MQDetectorDisableBroadcast)) //Lieka:  Toggle broadcast based on rule value
> 					worldserver.SendEmoteMessage(0,0,0,13,"<MQGate Detector>.  %s was just caught using Macroquest to /Gate to %s.  Come get your free kill!",this->GetName(),zone->GetLongName()); //Lieka:  Broadcast to the server that the MQGate Detector has caught a cheater.
> 			}
> 			break;
> 		case MQGhost: //Lieka:  Not currently implemented, but the framework is in place - just needs detection scenarios identified
> 			if (RuleB(Zone, EnableMQGhostDetector) && ((this->Admin() < RuleI(Zone, MQGhostExemptStatus) || (RuleI(Zone, MQGhostExemptStatus)) == -1))) {
> 				if (!RuleB(Zone, MQDetectorDisableSQLLogging)){
> 				Message(13, "Your account has been reported for hacking.");
> 				database.SetMQDetectionFlag(this->account_name, this->name, "/MQGhost", zone->GetShortName());
> 				}
> 				if(!RuleB(Zone, MQDetectorDisablePenalties)){ //Lieka:  Toggle Negative effects based on rule value
> 				SetMana(0);  //Lieka:  Remove all mana from player.
> 				SetHP(5);  //Lieka:  Set player's hitpoints to 5.
> 				BuffFadeAll();  //Lieka:  Wipe all of player's buffs.
> 				SpellFinished((RuleI(Zone, MQGhostDetectionSpellID)), this);  //Lieka:  Integrated into Rules System.  Spell to cast on players Default:  757 (Resurrection Effects).
> 				}
> 				if(!RuleB(Zone, MQDetectorDisableBroadcast)) //Lieka:  Toggle broadcast based on rule value
> 					worldserver.SendEmoteMessage(0,0,0,13,"<MQGhost Detector>.  %s was just caught using Macroquest to /Ghost to %s.  Come get your free kill!",this->GetName(),zone->GetLongName()); //Lieka:  Broadcast to the server that the MQGate Detector has caught a cheater.			
> 			}
> 			break;
> 	}
> }
791,792c878,888
< 	
< 	
---
> 	//Lieka:  Track duration between Player Position Updates to determine lag (for warp detection).
> 	if (ppu_timer.Enabled()) { 
> 		last_ppu_timer = 40000 - ppu_timer.GetRemainingTime(); 
> 		if(last_ppu_timer > longest_ppu_timer) {
> 			longest_ppu_timer = last_ppu_timer;
> 		}
> 	} else {
> 		last_ppu_timer = 1;
> 	}
> 	ppu_timer.Start(40000, true);
> 
799,801c895,918
< 	tmp = z_pos - ppu->z_pos;
< 	dist += tmp*tmp;
< 	if(dist > 50.0f*50.0f) {
---
> 	
> 	dist = sqrt(dist);
> 	/*[Paddy] Cutting out the Z-Axis check. Not necessary and prevents long falls from triggering */
> 	//tmp = z_pos - ppu->z_pos;
> 	//dist += tmp*tmp;
> 	
> 	/* Begin Cheat Detection*/
> 	if (((this->cheat_timer.GetRemainingTime())>1 && (this->cheat_timer.Enabled())) || longest_ppu_timer < 2) //Lieka:  Check to see if the cheat (exemption) timer is active - this is for debugging
> 	{
> 		//Spell timer is currently active
> 		//worldserver.SendEmoteMessage(0,0,0,13,"Timer is Active.  %d True: %s",this->cheat_timer.GetRemainingTime(), (this->cheat_timer.GetRemainingTime()>1)? "true" : "false"); //Leika Edit:  Enable this to get debug messages.
> 	}
> 	else //Timer has elapsed or hasn't started, let's do a Warp Check
> 	{
> 		if ((WarpDetection(false, dist, last_ppu_timer)) && ((RuleB(Zone,EnableMQGateDetector) && (admin <= RuleI(Zone, MQWarpExemptStatus)) || (RuleI(Zone, MQWarpExemptStatus) == -1)))) //Exempt from warp detection if admin level is >  Rule:Zone:MQWarpExemptStatus
> 		{
> 			printf("Warping Detected by %s Distance: %f.", GetName(), dist);
> 			this->CastToClient()->MovePC(zone->GetZoneID(), x_pos, y_pos, z_pos, heading, 2, WarpDetected); //Lieka Edit:  Move player back to pre-warp location
> 			CheatDetected(MQWarp); //Lieka:  Execute MQWarp function on offending player
> 			return;
> 			}
> 	}
> 	//Lieka End Edit
> 		if(dist > 50.0f*50.0f) {
816,822c933,939
< 	if(
< 		( (heading != ppu->heading) && !((int)heading % 3) ) ||	// turning
< 		( (x_pos != ppu->x_pos) && !((int)x_pos % 6) )					// moving
< 	)
< 	{
< 		CheckIncreaseSkill(SENSE_HEADING, -20);
< 	}
---
> 	if(
> 		( (heading != ppu->heading) && !((int)heading % 3) ) ||	// turning
> 		( (x_pos != ppu->x_pos) && !((int)x_pos % 6) )					// moving
> 	)
> 	{
> 		CheckIncreaseSkill(SENSE_HEADING, -20);
> 	}
3156a3274
> 	this->cheat_timer.Start(5000, false); //Lieka:  Exempt in-zone GM Summons from triggering MQWarp detector
6018a6137
> 	this->cheat_timer.Start(2500,false); //Lieka:  Prevent tripping the MQWarp detector when logging in after LD - basically gives a grace period for large position changes.
6650a6770,6771
> 
> 	this->cheat_timer.Start(2500,false); //Lieka:  Prevent tripping the MQWarp detector when arriving in a new zone.
diff  c:/EQEmu_0.7.0_1102_source/zone/client_process.cpp c:/VZ-TZ-Diff/zone/client_process.cpp
923a924
> 		this->cheat_timer.Start(3500, false); //[Paddy] Allow getting rezzed without triggering 
1483a1485
> 			this->cheat_timer.Start(3500, false);//[Paddy] Allow PC's to be summoned without triggering Warp Detection
1514a1517
> 				this->cheat_timer.Start(3500, false); //Lieka:  Don't want to trip the MQWarp detector here either.
diff  c:/EQEmu_0.7.0_1102_source/zone/command.cpp c:/VZ-TZ-Diff/zone/command.cpp
1366a1367
> 		t->CastToClient()->cheat_timer.Start(3500,false); //Lieka:  Prevent Zone-to-Zone GM Summons from triggering the MQZone and MQWarp detectors.
1412c1413
< 	if (sep->IsNumber(2) || sep->IsNumber(3) || sep->IsNumber(4))
---
> 	if (sep->IsNumber(2) || sep->IsNumber(3) || sep->IsNumber(4)) {
1413a1415
> 		c->CastToClient()->cheat_timer.Start(3500,false);  //Lieka:  Not sure why we put this here... should be an admin if you are zoning to special coordinates by this point.
1414a1417
> 	}
diff  c:/EQEmu_0.7.0_1102_source/zone/mob.cpp c:/VZ-TZ-Diff/zone/mob.cpp
102a103
> 		cheat_timer(0), //Lieka:  Timer for MQ Detector exemptions
104a106
> 		ppu_timer(0), //Lieka:  Timer to track time between Player Update Packets (to detect lag) for MQWarp detection
124c126,129
< 
---
> 	longest_ppu_timer = 0;			 //Lieka:  reset longest player packet update timer record on creation of mob instance
> 	last_ppu_timer = 0;				 //Lieka:  reset last player packet update timer record on creation of mob instance
> 	movement_speed = 0;				 //Lieka:  reset player movement speed record on creation of mob instance
> 	highest_movement_speed = 0;		 //Lieka:  reset highest recorded player movement speed on creation of mob instance
234c239
< 	
---
> 	cheat_timer.Disable();
876a882,883
> 	client->Message(0, "  Last Player Position Update Timer: %i  Longest Player Position Update Timer: %i", GetLastPPUTimer(), GetLongestPPUTimer()); //Lieka:  added this to monitor player lag for MQWarp detection.
> 	client->Message(0, "  Current Movement Speed: %i  Highest Movement Speed: %i", GetMovementSpeed(), GetHighestMovementSpeed()); //Lieka:  added this to monitor player's movement speed (based on last PPU update / PPU time.
1844a1852,1855
> 			if (target->IsClient()) {
> 			target->CastToClient()->cheat_timer.Start(3500,false); //Lieka:  Prevent Mob Summons from tripping hack detector.
> 			target->CastToClient()->MovePC(zone->GetZoneID(), x_pos, y_pos, z_pos, target->GetHeading(), 0, SummonPC);
> 		}
diff  c:/EQEmu_0.7.0_1102_source/zone/mob.h c:/VZ-TZ-Diff/zone/mob.h
458c458,461
< 	
---
> 	int32 GetLastPPUTimer()					{ return last_ppu_timer; }  //Lieka:  Used in #showstats mainly for debugging and monitoring players
> 	int32 GetLongestPPUTimer()				{ return longest_ppu_timer; }  //Lieka:  Used in #showstats mainly for debugging and monitoring players
> 	int32 GetMovementSpeed()				{ return movement_speed; }	//Lieka:  Used in #showstats mainly for debugging and monitoring players
> 	int32 GetHighestMovementSpeed()			{ return highest_movement_speed; } //Lieka: Used in #showstats mainly for debugging and monitorint players	
785a789,794
> 	Timer cheat_timer; //Lieka:  Timer used to check for movement exemptions/client-based, unsolicited zone exemptions
> 	Timer ppu_timer; //Lieka:  Timer used to track amount of time between Player Position Updates.
> 	int32 last_ppu_timer;  //Lieka:  Indicates last amount of time between the player's PPUs.
> 	int32 longest_ppu_timer; //Lieka:  indicates longest time that the player gone without a PPU (while in the current zone).
> 	float movement_speed;  //Lieka:  Calculated movement speed in units / second.
> 	float highest_movement_speed; //Lieka:  Highest movement speed reached.
diff  c:/EQEmu_0.7.0_1102_source/zone/spdat.cpp c:/VZ-TZ-Diff/zone/spdat.cpp
639a640,672
> bool IsShadowStepSpell(int16 spell_id) {
> 	if (IsEffectInSpell(spell_id, SE_ShadowStep)){
> 		return true;
> 	}
> 	else {
> 		return false;
> 	}
> }
> bool IsSuccorSpell(int16 spell_id) {
> 	if (IsEffectInSpell(spell_id, SE_Succor)){
> 		return true;
> 	}
> 	else {
> 		return false;
> 	}
> }
> bool IsTeleportSpell(int16 spell_id) {
> 	if (IsEffectInSpell(spell_id, SE_Teleport)){
> 		return true;
> 	}
> 	else {
> 		return false;
> 	}
> }
> bool IsGateSpell(int16 spell_id) {
> 	if (IsEffectInSpell(spell_id, SE_Gate)){
> 		return true;
> 	}
> 	else {
> 		return false;
> 	}
> }
> 
diff  c:/EQEmu_0.7.0_1102_source/zone/spdat.h c:/VZ-TZ-Diff/zone/spdat.h
533a534,537
> bool IsShadowStepSpell(int16 spell_id);
> bool IsSuccorSpell(int16 spell_id);
> bool IsTeleportSpell(int16 spell_id);
> bool IsGateSpell(int16 spell_id);
diff  c:/EQEmu_0.7.0_1102_source/zone/spell_effects.cpp c:/VZ-TZ-Diff/zone/spell_effects.cpp
1685,1689c1685,1690
< 				if(IsClient())
< 					CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
< 				else
< 					caster->Message(13, "This spell can only be cast on players.");
< 
---
> 			if(IsClient()){
> 					CastToClient()->cheat_timer.Start(3500, false);  //Lieka:  Exempt spells the "SummonPC" effect from triggering the MQWarp detector.
> 					CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
> 				} else {
> 					caster->Message(13, "This spell can only be cast on players.");
> 				}
diff  c:/EQEmu_0.7.0_1102_source/zone/spells.cpp c:/VZ-TZ-Diff/zone/spells.cpp
944a945,954
> 			//Lieka start Edit:  Fixing Warp Detector triggered for Bard Songs
> 			if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin:  Checking effects within the spell, rather than hardcoding Spell IDs.
> 				(IsTeleportSpell(spell_id)) ||
> 				(IsSuccorSpell(spell_id)) ||
> 				(IsShadowStepSpell(spell_id)) ||
> 				(IsGateSpell(spell_id)))
> 				{
> 						this->cheat_timer.Start(2000,false);  //Lieka:  Exempt above effects from setting off MQWarp detector due to intrazone movement generated from the bard song effects
> 				}
> 				//Lieka end edit.
975c985,992
< 			
---
> 			if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin:  Checking effects within the spell, rather than hardcoding Spell IDs.
> 				(IsTeleportSpell(spell_id)) ||
> 				(IsSuccorSpell(spell_id)) ||
> 				(IsShadowStepSpell(spell_id)) ||
> 				(IsGateSpell(spell_id)))
> 				{
> 				c->cheat_timer.Start(2000,false); //Lieka:  Exempt above effects from setting off MQWarp detector due to intrazone movement generated from the spell effects
> 				}		
2243a2261,2271
> 
> 		//Lieka start Edit:  Fixing Warp Detector triggered by spells cast on the player.
> 	if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin:  Checking effects within the spell, rather than hardcoding Spell IDs.
> 		(IsTeleportSpell(spell_id)) ||
> 		(IsSuccorSpell(spell_id)) ||
> 		(IsShadowStepSpell(spell_id)) ||
> 		(IsGateSpell(spell_id)))
> 		{
> 				spelltar->cheat_timer.Start(2000,false); //Lieka:  Exempt above effects from setting off MQWarp detector due to intrazone movement generated from the spell effects
> 		}
> 		//Lieka end edit.
diff  c:/EQEmu_0.7.0_1102_source/zone/zone.cpp c:/VZ-TZ-Diff/zone/zone.cpp
1188c1188
< ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance) {
---
> ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance, Client* client) {
1217,1218c1217,1224
< 		LogFile->write(EQEMuLog::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.",to,closest_dist);
< 	
---
> 		{
> 		client->CheatDetected(MQZone); //[Paddy] Someone is trying to use /zone
> 		LogFile->write(EQEMuLog::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.",to,closest_dist);
> 		LogFile->write(EQEMuLog::Status, "<Real Zone Points>.  %f x %f y %fz ",x,y,z);
> 		//worldserver.SendEmoteMessage(0,0,0,13,"<Real Zone Points>.  %f x %f y %fz ",x,y,z);
> 		closest_zp = NULL; //Lieka:  Prevent the zone request from happening.
> 	}
> 
diff  c:/EQEmu_0.7.0_1102_source/zone/zone.h c:/VZ-TZ-Diff/zone/zone.h
111c111
< 	ZonePoint* GetClosestZonePoint(float x, float y, float z, int32	to, float max_distance = 40000.0f);
---
> 	ZonePoint* GetClosestZonePoint(float x, float y, float z, int32	to, float max_distance = 40000.0f, Client* client = NULL);
diff  c:/EQEmu_0.7.0_1102_source/zone/zoning.cpp c:/VZ-TZ-Diff/zone/zoning.cpp
57a58
> 			cheat_timer.Start(35000,false); //Lieka:  Allow Zone/Evac to Safe Coords without triggering MQWarp detector.
76a78
> 				cheat_timer.Start(3500,false); //Lieka:  Allow Zone normal zoning without triggering MQZone detector.
80a83,84
> 
> 				this->CheatDetected(MQZone); //Lieka:  Bring down the hammer, they are trying to zone without meeting any of the above criteria.
107a112,116
> 
> 				if ((this->cheat_timer.GetRemainingTime())<1 || (!this->cheat_timer.Enabled())){ //Lieka:  Disable MQGate Detector if timer is active.
> 				this->CheatDetected(MQGate);
> 				}
> 
170a180
> 		cheat_timer.Start(3500,false); //Lieka:  Allow Server Forced Zoning without triggering MQZone detector.
206a217
> 		this->CheatDetected(MQZone);  //Lieka:  Bring down the hammer, we don't let hackers off that easily...
221c232,233
< 	if (!ignorerestrictions && (Admin() < minstatus || GetLevel() < minlevel))
---
> 	if (!ignorerestrictions && (Admin() < minstatus || GetLevel() < minlevel)) {
> 		this->cheat_timer.Start(3500,false); //Lieka:  Don't set off warp detector for when a player is moved to the safe-spot for trying to access a zone without the appropriate level or status requirements (i.e. zoning into FearPlane at level 30, etc)
222a235
> 	}
226a240
> 			this->cheat_timer.Start(3500,false); //Lieka:  Don't set off warp detector for when a player is moved to the safe-spot for trying to access a zone without the appropriate flag.
267a282
> 	cheat_timer.Start(3500,false); //Lieka:  Disable MQ Warp & MQ Gate Detector when zoning fails. (not high enough level, etc)
281a297
> 	cheat_timer.Start(3500,false);//Lieka:  Disable /Warp & /Gate Detector when zoning fails. (not high enough level, etc)
410a427,430
> 		case WarpDetected:
> 			Message(15, "Returning to pre-warp location.");
> 			ZonePC(zoneID, x, y, z, heading, ignorerestrictions, zm);
> 			break;
427,477c447,511
< 	switch(zm) {
< 		case EvacToSafeCoords:
< 		case ZoneToSafeCoords:
< 			x = zone->safe_x();
< 			y = zone->safe_y();
< 			z = zone->safe_z();
< 			heading = heading;
< 			break;
< 		case GMSummon:
< 			zonesummon_x = x_pos = x;
< 			zonesummon_y = y_pos = y;
< 			zonesummon_z = z_pos = z;
< 			heading = heading;
< 			
< 			zonesummon_id = zoneID;
< 			zonesummon_ignorerestrictions = 1;
< 			break;
< 		case ZoneSolicited:
< 			zonesummon_x = x;
< 			zonesummon_y = y;
< 			zonesummon_z = z;
< 			heading = heading;
< 			
< 			zonesummon_id = zoneID;
< 			zonesummon_ignorerestrictions = ignorerestrictions;
< 			break;
< 		case GateToBindPoint:
< 			x = x_pos = m_pp.binds[0].x;
< 			y = y_pos = m_pp.binds[0].y;
< 			z = z_pos = m_pp.binds[0].z;
< 			heading = m_pp.binds[0].heading;
< 			break;
< 		case ZoneToBindPoint:
< 			x = x_pos = m_pp.binds[0].x;
< 			y = y_pos = m_pp.binds[0].y;
< 			z = z_pos = m_pp.binds[0].z;
< 			heading = m_pp.binds[0].heading;
< 			
< 			zonesummon_ignorerestrictions = 1;
< 			LogFile->write(EQEMuLog::Debug, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading);
< 			break;
< 		case SummonPC:
< 			zonesummon_x = x_pos = x;
< 			zonesummon_y = y_pos = y;
< 			zonesummon_z = z_pos = z;
< 			heading = heading;
< 			break;
< 		default:
< 			LogFile->write(EQEMuLog::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation.");
< 			ReadyToZone = false;
< 			break;
---
> 	switch(zm) {
> 		case EvacToSafeCoords:
> 			this->cheat_timer.Start(2500,false);// Null: added a timers to this location because sometimes the ones in the other locations of code were not doing the job
> 		case ZoneToSafeCoords:
> 			this->cheat_timer.Start(2500,false);
> 			x = zone->safe_x();
> 			y = zone->safe_y();
> 			z = zone->safe_z();
> 			heading = heading;
> 			break;
> 		case GMSummon:
> 			this->cheat_timer.Start(2500,false);
> 			zonesummon_x = x_pos = x;
> 			zonesummon_y = y_pos = y;
> 			zonesummon_z = z_pos = z;
> 			heading = heading;
> 			
> 			zonesummon_id = zoneID;
> 			zonesummon_ignorerestrictions = 1;
> 			break;
> 		case ZoneSolicited:
> 			this->cheat_timer.Start(2500,false);
> 			zonesummon_x = x;
> 			zonesummon_y = y;
> 			zonesummon_z = z;
> 			heading = heading;
> 			
> 			zonesummon_id = zoneID;
> 			zonesummon_ignorerestrictions = ignorerestrictions;
> 			break;
> 		case GateToBindPoint:
> 			this->cheat_timer.Start(2500,false);
> 			x = x_pos = m_pp.binds[0].x;
> 			y = y_pos = m_pp.binds[0].y;
> 			z = z_pos = m_pp.binds[0].z;
> 			heading = m_pp.binds[0].heading;
> 			break;
> 		case ZoneToBindPoint:
> 			this->cheat_timer.Start(2500,false);
> 			x = x_pos = m_pp.binds[0].x;
> 			y = y_pos = m_pp.binds[0].y;
> 			z = z_pos = m_pp.binds[0].z;
> 			heading = m_pp.binds[0].heading;
> 			
> 			zonesummon_ignorerestrictions = 1;
> 			LogFile->write(EQEMuLog::Debug, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading);
> 			break;
> 		case SummonPC:
> 			this->cheat_timer.Start(2500,false);
> 			zonesummon_x = x_pos = x;
> 			zonesummon_y = y_pos = y;
> 			zonesummon_z = z_pos = z;
> 			heading = heading;
> 			break;
> 		case WarpDetected:
> 			this->cheat_timer.Disable();
> 			zonesummon_x = x_pos = x;
> 			zonesummon_y = y_pos = y;
> 			zonesummon_z = z_pos = z;
> 			heading = heading;
> 			break;
> 		default:
> 			LogFile->write(EQEMuLog::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation.");
> 			ReadyToZone = false;
> 			break;
diff  c:/EQEmu_0.7.0_1102_source/common/database.h c:/VZ-TZ-Diff/common/database.h
120a121
> 	bool	SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
diff  c:/EQEmu_0.7.0_1102_source/common/ruletypes.h c:/VZ-TZ-Diff/common/ruletypes.h
67a68,84
> RULE_INT ( Zone, MQWarpExemptStatus, 50 ) //Lieka:  Required status level to exempt the MQWarpDetector.  Set to -1 to disable this feature.
> RULE_INT ( Zone, MQZoneExemptStatus, 50 ) //Lieka:  Required status level to exempt the MQWarpDetector.  Set to -1 to disable this feature.
> RULE_INT ( Zone, MQGateExemptStatus, 50 ) //Lieka:  Required status level to exempt the MQWarpDetector.  Set to -1 to disable this feature.
> RULE_INT ( Zone, MQGhostExemptStatus, 50 ) //Lieka:  Required status level to exempt the MQWarpDetector.  Set to -1 to disable this feature.
> RULE_BOOL ( Zone, EnableMQWarpDetector, false ) //Lieka:  Enable the MQWarp Detector.  Set to False to disable this feature.
> RULE_BOOL ( Zone, EnableMQZoneDetector, false ) //Lieka:  Enable the MQZone Detector.  Set to False to disable this feature.
> RULE_BOOL ( Zone, EnableMQGateDetector, false ) //Lieka:  Enable the MQGate Detector.  Set to False to disable this feature.
> RULE_BOOL ( Zone, EnableMQGhostDetector, false ) //Lieka:  Enable the MQGhost Detector.  Set to False to disable this feature.
> RULE_REAL ( Zone, MQWarpSpeedLimit, 30 ) //Lieka:  Units / second that a player is allowed to travel before a warp is registered. At level 50 SoW = 4, GM Speed = 7 Default value: 10
> RULE_INT ( Zone, MQWarpDetectionSpellID, 757 ) //Lieka:  Which spell ID will be cast on players that incur the hammer of the MQ Detector.  This spell will be actually cast, don't pick a resistible spell.  Default: 757 (Resurrection Effects)
> RULE_INT ( Zone, MQGateDetectionSpellID, 757 ) //Lieka:  Which spell ID debuff will be cast on players that incur the hammer of the MQGateDetector.  This spell will be added as a debuff while zoning.  Default: 757 (Resurrection Effects)
> RULE_INT ( Zone, MQZoneDetectionSpellID, 757 ) //Lieka:  Which spell ID debuff will be cast on players that incur the hammer of the MQGateDetector.  This spell will be added as a debuff while zoning.  Default: 757 (Resurrection Effects)
> RULE_INT ( Zone, MQGhostDetectionSpellID, 757 ) //Lieka:  Which spell ID will be cast on players that incur the hammer of the MQGhostDetector.  This spell will be actually cast, don't pick a resistable spell.  Default: 757 (Resurrection Effects)
> RULE_BOOL ( Zone, MQDetectorDisablePenalties, false ) //Lieka:  Disable penalties (including spell IDs in other MQ rules above when a player triggers a detector.  Default value: false
> RULE_BOOL ( Zone, MQDetectorDisableBroadcast, false ) //Lieka:  Disable the broadcast message when the use of MQ is detected.  Default Value:  false
> RULE_BOOL ( Zone, MQDetectorDisableSQLLogging, false ) //Lieka:  Disable logging of MQDetector events into SQL.  Default Value:  false
> 
diff  c:/EQEmu_0.7.0_1102_source/common/database.cpp c:/VZ-TZ-Diff/common/database.cpp
1460a1461,1478
> bool Database::SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone) { //Lieka:  Utilize the "hacker" table, but also give zone information.
> 	char errbuf[MYSQL_ERRMSG_SIZE];
> 	char *query = 0;
> 	int32	affected_rows = 0;
> 	if (!RunQuery(query, MakeAnyLenString(&query, "INSERT INTO hackers(account,name,hacked,zone) values('%s','%s','%s','%s')", accountname, charactername, hacked, zone), errbuf, 0,&affected_rows)) {
> 		cerr << "Error in SetMQDetectionFlag query '" << query << "' " << errbuf << endl;
> 		return false;
> 	}
> 	safe_delete_array(query);
> 	
> 	if (affected_rows == 0)
> 	{
> 		return false;
> 	}
> 	
> 	return true;
> }
>
SQL Rules
Code:
insert into rule_values values (0, 'Zone:MQWarpExemptStatus', 50);
insert into rule_values values (0, 'Zone:MQZoneExemptStatus', 50);
insert into rule_values values (0, 'Zone:MQGateExemptStatus', 50);
insert into rule_values values (0, 'Zone:MQGhostExemptStatus', 50);
insert into rule_values values (0, 'Zone:EnableMQWarpDetector', 'false');
insert into rule_values values (0, 'Zone:EnableMQZoneDetector', 'false');
insert into rule_values values (0, 'Zone:EnableMQGateDetector', 'false');
insert into rule_values values (0, 'Zone:EnableMQGhostDetector', 'false');
insert into rule_values values (0, 'Zone:MQWarpSpeedLimit', 30);
insert into rule_values values (0, 'Zone:MQWarpDetectionSpellID', 757);
insert into rule_values values (0, 'Zone:MQGateDetectionSpellID', 757);
insert into rule_values values (0, 'Zone:MQZoneDetectionSpellID', 757);
insert into rule_values values (0, 'Zone:MQGhostDetectionSpellID', 757);
insert into rule_values values (0, 'Zone:MQDetectorDisablePenalties', 'false');
insert into rule_values values (0, 'Zone:MQDetectorDisableBroadcast', 'false');
insert into rule_values values (0, 'Zone:MQDetectorDisableSQLLogging', 'false');
__________________
Daxum



Former ServerOp - Vallon Zek / Tallon Zek Emu Server - Legit / Guild PvP - (2007 - 2011 RIP)

Last edited by TheLieka; 04-16-2008 at 11:54 AM..
Reply With Quote