|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
05-03-2008, 01:41 AM
|
Developer
|
|
Join Date: Oct 2004
Location: THE ATL (wut wut)
Posts: 325
|
|
I'll make that change, we've also been doing some more testing with it (I've been really bogged down at work for the past month-ish), and found a few other places to refine the warp detection. I'll post those changes as soon as we get them completely ironed out.
Dax
__________________
Daxum
Former ServerOp - Vallon Zek / Tallon Zek Emu Server - Legit / Guild PvP - (2007 - 2011 RIP)
|
|
|
|
05-03-2008, 03:29 PM
|
Dragon
|
|
Join Date: Feb 2002
Posts: 583
|
|
Other things MQ does that I'm not seeing on this:
1) Let's you use a banker anywhere in the game.
2) Activate a door from anywhere in the zone (so if you have a teleport clicky zonepoint you can use it from anywhere for instance).
3) Equip things you can't use.
4) Loot corpses from anywhere in zone.
5) Bogus appearance packets (not just spawn packets) to change anyone's race / appearance etc. Not as trivial as it sounds, change a guy in a dungeon to size 50 and he's stuck.
6) Fake all sorts of things in the CastSpell packet - cast spells they don't have memorized, cast spells they have memorized as clicky spells (to prevent mana usage), cast clicky spells with a different slot (to prevent charges being used) and so on.
If there's already sanity checks in place for these, nevermind me, just wanted to bring it up.
Also remember that no warp detection will ever be perfect and can always be replicated by lag, so we've found that it's a bad idea to auto punish someone for warping - needs a human eye to determine if its authentic warping or just lag. Moving the person back to where they came from and freezing them for a few seconds might be a better idea than deathtouch.
|
|
|
|
05-30-2008, 04:28 PM
|
Demi-God
|
|
Join Date: Jul 2006
Posts: 1,552
|
|
This is exactly the kind of stuff that makes me all stiff in the britches for EQEmu again. I love this code, this effort, and the team work to iron out the iffy's.
I do not see this in the changelog yet. Is this still being evaluated for the base code? Can't wait.
|
05-30-2008, 05:00 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Yeah, once I find a crash that I *somehow* introduced while testing this I'll submit it. It's being somewhat elusive and I dun wanna submit code that has a known crash.
|
05-31-2008, 05:06 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I have added his diff from the 1102 code 2 times, but into 1108 and can't seem to get it to fully function, even though some of it does. I can't wait for this to get added into the main source! That and a few other additions will be nice.
Also, if you are doing a new update soon, KLS, I see that you don't have my fixmob post stickied. And, I think you guys sticky everything that is planned to go in at some point. The fixmob command change isn't huge, but without the changes I made, the command is only about half useful. With the changes it is fully functional and works flawlessly. They are very simple changes. I can always add them in manually before compiling, but it seems like something useful to have in the release source.
|
|
|
|
06-01-2008, 05:09 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Quote:
Originally Posted by TheLieka
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
...Removed code for size of quote
|
So, from looking at the source, it looks like the new eqemu binary code 1110 added in the detection from TZ/VZ, but it wasn't the most recent version of the detection which is noted in this quote. I updated to the latest 1110 code and so far it seems to be working very well. It has already detected some cheaters that I have confirmed are in fact cheaters. So far it looks great. I haven't seen any of the broadcasts and haven't heard any reports of players being punished by the tool, which are both fine with me. As far as I can tell, the only thing this does right now is log the MQ usage in the hackers table. Again, that is perfectly fine with me.
The reason I wanted to post here was to see if the latest updates on this code were under consideration for being added to the source. The last diff from TheLieka shows more features and probably better ways to detect warping and also catch more false positives. I could never get that diff to work properly with 1108. If TZ/VZ ever updates to 1110, I would love to see a diff from that with their latest anti-MQ code. I think it should be considerably less to change from 1102, since it now includes the MQ detection.
Also, I wanted to note that if anyone updates to the 1110, they will also want to add the rules listed below (and NOT the latest ones posted by TheLieka):
Code:
insert into rule_values values (0, Zone:EnableMQWarpDetector, true);
insert into rule_values values (0, Zone:EnableMQZoneDetector, true);
insert into rule_values values (0, Zone:EnableMQGateDetector, true);
insert into rule_values values (0, Zone:EnableMQGhostDetector, true);
insert into rule_values values (0, Zone:MQWarpExemptStatus, 50);
insert into rule_values values (0, Zone:MQGateExemptStatus, 50);
insert into rule_values values (0, Zone:MQZoneExemptStatus, 50);
insert into rule_values values (0, Zone:MQGhostExemptStatus, 50);
insert into rule_values values (0, Zone:MQWarpDetectorDistance, 30);
insert into rule_values values (0, Zone:MQWarpLagThreshold, 140);
insert into rule_values values (0, Zone:MQWarpThresholdTimer, 90000);
I didn't read through any of the actual source to see what all was added and what wasn't, I just read through the ruletypes.h to see what had rules added. Here is the source:
Code:
RULE_CATEGORY( Zone )
RULE_INT ( Zone, NPCGlobalPositionUpdateInterval, 60000 ) //ms between intervals of sending a position update to the entire zone.
RULE_INT ( Zone, ClientLinkdeadMS, 180000) //the time a client remains link dead on the server after a sudden disconnection
RULE_INT ( Zone, GraveyardTimeMS, 1200000) //ms time until a player corpse is moved to a zone's graveyard, if one is specified for the zone
RULE_BOOL ( Zone, EnableShadowrest, 0 ) // enables or disables the shadowrest zone feature for player corpses. Default is turned off.
RULE_INT ( Zone, MQWarpExemptStatus, -1 ) //Lieka: Required status level to exempt the MQWarpDetector. Set to -1 to disable this feature.
RULE_INT ( Zone, MQZoneExemptStatus, -1 ) //Lieka: Required status level to exempt the MQZoneDetector. Set to -1 to disable this feature.
RULE_INT ( Zone, MQGateExemptStatus, -1 ) //Lieka: Required status level to exempt the MQGateDetector. Set to -1 to disable this feature.
RULE_INT ( Zone, MQGhostExemptStatus, -1 ) //Lieka: Required status level to exempt the MGhostDetector. Set to -1 to disable this feature.
RULE_BOOL ( Zone, EnableMQWarpDetector, true ) //Lieka: Enable the MQWarp Detector. Set to False to disable this feature.
RULE_BOOL ( Zone, EnableMQZoneDetector, true ) //Lieka: Enable the MQZone Detector. Set to False to disable this feature.
RULE_BOOL ( Zone, EnableMQGateDetector, true ) //Lieka: Enable the MQGate Detector. Set to False to disable this feature.
RULE_BOOL ( Zone, EnableMQGhostDetector, true ) //Lieka: Enable the MQGhost Detector. Set to False to disable this feature.
RULE_REAL ( Zone, MQWarpDetectorDistance, 4900 ) //Lieka: Distance a player must travel between client to server location updates before a warp is registered. 30 allows for beyond GM speed without lag.
RULE_REAL ( Zone, MQWarpLagThreshold, 140 ) //Lieka: Distance beyond the Zone:MQWarpDetectorDistance that a player must travel within the MQWarpThresholdTimer amount of time before tripping the MQWarp detector. Set to 0 to disable this feature.
RULE_REAL ( Zone, MQWarpThresholdTimer, 90000 ) //Lieka: Amount of time before the warp_threshold resets to the Zone:MQWarpLagThreshold value. Default: 90000 (900 seconds/15 minutes). Set to -1 to disable this feature.
RULE_CATEGORY_END()
Huge thanks for TheLieka and the TZ/VZ team for writing this code, and to KLS and anyone who helped get it added into the source. Like I said, so far it is great. I was just curious if the latest code from TheLieka has been tried and/or is under consideration for being added to the source.
Also, someone might want to stick the rules table updates into the log file along with the hacker table one that is already there.
|
|
|
|
06-01-2008, 05:26 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
I didn't add that since I didn't see it I can look at that stuff too.
|
|
|
|
06-01-2008, 06:05 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Quote:
Originally Posted by KLS
I didn't add that since I didn't see it I can look at that stuff too.
|
Ya, when I first started adding in the source, I added all of the original stuff he posted and it all went in very well and compiled perfectly. I think it was easier since it had the "Before" and "After" notes showing exactly where the modified code should be added into the source. It took me a couple of hours to get it in, and then I scrolled down and saw the latest update and realized I had to recheck everything I had already added in! I figured that was the case with the updates to the source in the 1110 as well.
I basically had to run diffs and modify a bunch of stuff to my already modified code and was able to get it to compile in 1108, but it didn't seem to function at all other than the zone loop issue with the zone_points problem stated previously.
Finally, I started from scratch again with unmodified 1108 source and I pulled up a diff from 1102 to 1108 showing line numbers. I then used textpad to pull up 1108 so I could modify it and turned on Line Numbers there as well. Then, for each line in the diff, I looked at the 1102 source for each line mentioned and then lined that up with the 1108 code in my diff. Then, I added all of the lines 1 by 1 to my 1108 that I had opened in textpad. It was a quite involved processes lol. But, I thought I had it all in where it should be. I tried to compile and got some errors which appeared to be related to where I was adding the code to. The first time I compiled it errored on one of the first few lines and I just moved it down 1 to where it looked like it should go, but NOT the same line number mentioned in the diff and it got past that part the next time I compiled. But, the second compile failed later and I fixed it again by moving the line down 1 in the source. So, maybe I just didn't understand how the diff posted was supposed to work. I read it as the line number mentioned is where the code change was supposed to be added to the source, but maybe it is the line after it? I don't know. Either way, once I got the compile to work, it still did nothing other than cause the zone loops from the zone_points issue.
So far, the 1110 source is functioning perfectly as far as I can tell. But, it seems like the latest update from TheLieka might make it even better, which would be quite amazing. Plus, the rules it includes in the latest update look really great. I am sure the additional options for this system would come in quite handy. I am sure you guys updating the source should have much better luck than me lol. I just follow directions, but you should be able to actually understand where things are supposed to go or not. This is some very important and useful code and I am very excited to finally free up my time watching for cheating (which I waste countless hours doing) to finally allow this feature to do it for me!
Thanks again for all of the hard work you guys do. I am more than willing to put any new code updates through a good stress test on my server. My server gets quite a good load of players on it, so they should be good for testing for issues with anything released.
|
|
|
|
|
|
|
06-03-2008, 01:23 PM
|
Developer
|
|
Join Date: Oct 2004
Location: THE ATL (wut wut)
Posts: 325
|
|
I only have a moment, so I apologize for not being able to address these things in great depth.
We had issues with zoning into certain zones setting off the warp detector with the last iteration of changes that I posted. Unfortunately, I had to fall into a possibly permenant hiatus status shortly after that, so I never had a chance to chase down the root of that problem.
Other than that, the code was working very well for us, but with limited dev resources (as every ServerOp has experienced) and conflicting goals - we had to stop working on it for the time being. We ended up reverting back to a previous version of the warp detector (the older version only judges warps based on movement distance, rather than the newer version which judges warps based on movement velocity).
The older versions are quite inadequate for accounting for lag - which the new version does very well. I do not think it would take much time for someone to go through and finalize the code for the new version, but unforunately, I simply do not have the time to do it right now.
I would love to see the few remaining glitches in this code resolved and committed to the official source - I think it would be a great asset to any ServerOp with the intention of running a legit server.
Dax
__________________
Daxum
Former ServerOp - Vallon Zek / Tallon Zek Emu Server - Legit / Guild PvP - (2007 - 2011 RIP)
|
|
|
|
|
|
|
06-03-2008, 05:56 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Ya, I am sure we all know very well how easy it is to get sidetracked and get pulled into working on other problems instead of just focusing on one project :P Seems like I am working on something different every day lol.
The current anti-MQ detection in the 1110 code works very well and seems to catch every case of actual warping. The only negative part to it atm is that it also catches some false positives. It seems like CotH and maybe some other legit character moving features are not accounted for in the current committed version. I know you put checks in for pretty much all of them in the newest anti-MQ detection release.
Maybe if we could just get all of the false positive checks that are in the latest one added to the current committed version, that would finalize the detection to be quite complete for now anyway. Of course, it would also be great to have it run the checks against velocity instead of distance to help remove even more false positives.
I will try to do a diff of your newest anti-MQ code against the one that is currently in the committed code and post it here. Then, maybe we can all work towards pulling out the important changes and see if we can get the new stuff working. I am no coder, but I am fairly good at adjusting things as long as I have examples to work with and can grasp what it is trying to do.
I think it would be great to have some of the other rules working as well, but that isn't quite as important.
I want to make it clear that I LOVE the current MQ detection that is in the 1110 release! This will save me countless hours of time from investigating cheating and already in just a couple of days has stopped almost every incident of MQ abuse on my server! So, THANKS! I currently have the MQZone rule turned off so that I don't have to worry about zone_points and I think that helps a lot at least until I can find time to add them all in.
Even if nothing is changed in the code from here on out, I think it is a vital tool for the community and probably the best thing we have gotten in quite a while. That isn't to say that all of the other changes recently aren't great, but just that the MQ detection is simply amazing!
|
|
|
|
|
|
|
06-04-2008, 01:35 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Here is the best diff I can get for changing from the old code to the new code. I think I have everything here, but there could definitely be a mistake or 2. I think it should at least be a place to start. I had to add in vague line numbers because I don't have the exact lines where they should be in the 1110 code.
Code:
Index: zone/client.h
@@ Somewhere near Line 155 @@
WarpDetected, // Lieka: Return client to pre-warp location
@@ Somewhere near Line 190 @@
< bool WarpDetection(bool CTimer, float Distance);
bool WarpDetection(bool CTimer, float Distance, int32 last_ppu_timer);
Index: zone/client_packet.cpp
@@ Somewhere near Line 771 @@
< bool Client::WarpDetection(bool CTimer, float distance)
< {
< float last_distance;
< if (threshold_timer.GetRemainingTime() < 1 && ((RuleR(Zone, MQWarpThresholdTimer)) != -1)) { //Null: If the timer is done, reset threshold, then reset timer //Lieka: Integrated into Rules System.
< warp_threshold = (RuleR(Zone, MQWarpLagThreshold)); //Lieka: Integrated warp_threshold value into Rules System. Original Value was 140.
< threshold_timer.Start((RuleR(Zone, MQWarpThresholdTimer)), false); //Lieka: Integrated timer duration value into the Rules System. Original Value was 90000 (90 seconds).
< }
< if ((CTimer))
< return false;
< else
< {
< //Null Edit: made warp detector fire only when the sum of all the warps in a period of time are greater than a threshold
< //this makes the warp detector more lax on small warps, but still drops the hammer on the big ones.
< if (distance>140.0f) {
< last_distance = (distance-140.0f);
< warp_threshold -= last_distance;
< last_warp_distance = last_distance;
< }
< return (warp_threshold < 0); //Null: If the threshold is met, hit them with 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)
< {
< Message(13, "Your account has been reported for hacking.");
< database.SetMQDetectionFlag(this->account_name,this->name, "/MQWarp", zone->GetShortName());
< 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).
< worldserver.SendEmoteMessage(0,0,0,13,"<MQWarp Detector>. %s was just caught warping in %s. Come get your free kill!",this->GetName(),zone->GetLongName());
< warp_threshold = 1; //Null: bringing the detector back up to one to avoid chain detections.
< }
< 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)
< {
< Message(13, "Your account has been reported for hacking.");
< database.SetMQDetectionFlag(this->account_name,this->name, "/MQZone", zone->GetShortName());
< 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).
< 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))) {
< 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.
< 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).
< 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))) {
< Message(13, "Your account has been reported for hacking.");
< database.SetMQDetectionFlag(this->account_name,this->name, "/MQGhost", zone->GetShortName());
< 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).
< 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;
< }
< }
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;
}
}
@@ Somewhere near Line 890 @@
//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);
@@ Somewhere near Line 910 @@
< if ((this->cheat_timer.GetRemainingTime())>1 && (this->cheat_timer.Enabled())) //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)) && ((admin <= RuleI(Zone, MQWarpExemptStatus)) || (RuleI(Zone, MQWarpExemptStatus) == -1))) //Exempt from warp detection if admin level is > Rule:Zone:MQWarpExemptStatus
< {
< printf("Warping Detected by %S Acct: %s Distance: %f.", GetName(), AccountName(), GetLWDistance());
< CheatDetected(MQWarp); //Lieka: Execute MQWarp function on offending player
< }
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;
}
Index: zone/mob.cpp
@@ Somewhere near Line 100 @@
< threshold_timer(0), //Lieka: Timer to allow exemptions MQWarp related to lag
@@ Somewhere near Line 105 @@
ppu_timer(0), //Lieka: Timer to track time between Player Update Packets (to detect lag) for MQWarp detection
@@ Somewhere near Line 125 @@
< warp_threshold = 140; //Null: set the threshold on creation of mob instance
< last_warp_distance = 0; //Null: set this one to zero also just because.
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
@@ Somewhere near Line 875 @@
< client->Message(0, " Last Warp Distance: %f Threshold Remaining: %f", GetLWDistance(), GetWarpThreshold()); //Null: added this to check players last warp distance for debuging.
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.
Index: zone/mob.h
@@ Somewhere near Line 455 @@
< float GetLWDistance() { return last_warp_distance; } //Null: these are used to return the values to #showstats
< float GetWarpThreshold() { return warp_threshold; } //this one too
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
@@ Somewhere near Line 785 @@
< Timer threshold_timer; //Null: threshold timer
< float warp_threshold; //Null: threshold for warp detector
< float last_warp_distance; //Null: last distance logged as a warp, used for logs and #showstats
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.
Index: zone/spell_effects.cpp
@@ Somewhere near Line 1680 @@
Message(15, "You have been summoned!");
Index: zone/zoning.cpp
@@ Somewhere near Line 430 @@
case WarpDetected:
Message(15, "Returning to pre-warp location.");
ZonePC(zoneID, x, y, z, heading, ignorerestrictions, zm);
break;
@@ Somewhere near Line 450 @@
case WarpDetected:
this->cheat_timer.Disable();
zonesummon_x = x_pos = x;
zonesummon_y = y_pos = y;
zonesummon_z = z_pos = z;
heading = heading;
break;
Index: common/ruletypes.h
@@ Somewhere near Line 75 @@
< RULE_REAL ( Zone, MQWarpDetectorDistance, 30 ) //Lieka: Distance a player must travel between client to server location updates before a warp is registered. 30 allows for beyond GM speed without lag.
< RULE_REAL ( Zone, MQWarpLagThreshold, 140 ) //Lieka: Distance beyond the Zone:MQWarpDetectorDistance that a player must travel within the MQWarpThresholdTimer amount of time before tripping the MQWarp detector. Set to 0 to disable this feature.
< RULE_REAL ( Zone, MQWarpThresholdTimer, 90000 ) //Lieka: Amount of time before the warp_threshold resets to the Zone:MQWarpLagThreshold value. Default: 90000 (900 seconds/15 minutes). Set to -1 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_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
Index: zone/client.cpp
@@ Somewhere near Line 2300 @@
< return result>(RuleR(Zone, MQWarpDetectorDistance)); //Lieka: Integrated into Rules System; default value is 30, this allows for beyond GM speed without lag.
|
|
|
|
06-28-2008, 02:04 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
Quote:
case MQGhost: //Lieka: Not currently implemented, but the framework is in place - just needs detection scenarios identified
|
is this working now or no and if not has anyone found a way around it? i have seen a problem with it on my server as of late and would be nice to get told about it when im not online.
even if its just a simple check is pc close to a npc and what is the npc faction if its hostile there cheating i would be happy with that most the custom zones i use i just set all the npcs to the default hostile faction that npc loot editor sets it to. faction is 14329
|
06-30-2008, 03:13 PM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
On behalf of Raid Addicts, I want to thank you for this fix. I am sure it will help a ton to stop cheaters on my server.. And I am sure it will also help my stress level.
Your a God send thanks, and keep up the good work !
King Mortenson
www.raidaddicts.org
|
07-10-2008, 08:28 PM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
Seems that I am having zone looping issues in certain zones. Any Ideas why?
|
07-10-2008, 09:50 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Your zone_points table isn't fully updated. Personally, I disabled the mqzone detection on my server so that I don't have to mess with it until either I or someone else gets all of the zone points added in and updated. The rest of it works fine. To disable mqzone detection, look at the rules posted for it.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:58 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|