MQWarp/MQZone/MQGate Detector (Code Name: The VZTZ Hammer!)
May god have mercy on my soul for trying to diff this. I apologize that a lot of it will be redundant checks, but we've had to tweak it quite a bit to get it to the point where it is now. We only have false alarms when we hit a massive lag spike (which happens on occasion), but the only way around that would be to allow massive distance updates all the time - which defeats the purpose.
I know this won't fit into one post, and probably won't even fit into 3 or 4, but I'll do my best to get it all in. Ok, *gulp* here goes. Anti-MQ /Warp, Anti-MQ /Gate, Anti-MQ /zone, Anti-MQ /ghost code from the Vallon Zek/Tallon Zek Server: In addition to myself, contributions to this code came from Rancar and Null. .\common\ruletypes.h After: Code:
RULE_BOOL ( Zone, EnableShadowrest, 0 ) // enables or disables the shadowrest zone feature for player corpses. Default is turned off. Code:
RULE_INT ( Zone, MQWarpExemptStatus, 50 ) //Lieka: Required status level to exempt the MQWarpDetector. Set to -1 to disable this feature. .\common\database.h After: Code:
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked); Code:
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone); After: Code:
bool Database::SetHackerFlag(const char* accountname, const char* charactername, const char* hacked) { Code:
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. After: Code:
typedef enum { Code:
typedef enum { Code:
void AI_Init(); Code:
void CheatDetected(CheatTypes Cheat); .\zone\client.cpp Change (Insert Red Lines): Code:
bool Client::CheckCheat(){ |
.\zone\client_packet.cpp
After: Code:
void Client::Handle_Connect_OP_UpdateAA(const EQApplicationPacket *app) { Code:
bool Client::WarpDetection(bool CTimer, float distance) Code:
dist = sqrt(dist); Change (Insert Red Lines): Code:
void Client::Handle_OP_GMSummon(const EQApplicationPacket *app) Code:
x_pos = m_pp.x; Code:
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. Code:
case SE_InvisVsUndead: Code:
this->cheat_timer.Start(2500,false); //Lieka: Prevent tripping the MQWarp detector when arriving in a new zone. |
.\zone\client_process.cpp
Change (Insert Red Lines): Code:
if (ra->action == 1) { Code:
void Client::OPGMSummon(const EQApplicationPacket *app) Change (Insert Red Lines): Code:
else if (t->IsClient()) Code:
if (sep->IsNumber(2) || sep->IsNumber(3) || sep->IsNumber(4)){ After: Code:
inline int16 GetRace() const { return race; } Code:
float GetLWDistance() { return last_warp_distance; } //Null: these are used to return the values to #showstats Code:
bool fix_pathing; .\zone\mob.cpp Change (Insert Red Lines): Code:
attack_timer(2000), Code:
logging_enabled = false; Code:
void Mob::ShowStats(Client* client) { Code:
if (target->IsClient()) { |
.\zone\spdat.h
After: Code:
int GetMinLevel(int16 spell_id); Code:
bool IsShadowStepSpell(int16 spell_id); After: Code:
bool IsRuneSpell(int16 spell_id) { Code:
bool IsShadowStepSpell(int16 spell_id) { .\zone\spell_effects.cpp Change (Insert Red Lines): Code:
case SE_SummonPC: Change (Insert Red Lines): Code:
if(bard_song_mode) Code:
else Code:
if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin: Checking effects within the spell, rather than hardcoding Spell IDs. Code:
if // Bind Sight line of spells Code:
//Lieka start Edit: Fixing Warp Detector triggered by spells cast on the player. Change: Code:
ZonePoint* GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance = 40000.0f); Code:
ZonePoint* GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance = 40000.0f, Client* client = NULL); .\zone\zone.cpp Change: Code:
ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance) { Code:
ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance, Client* client) { Code:
if(closest_dist>(200.0f*200.0f) && closest_dist<max_distance2) |
.\zone\zoning.cpp
After: Code:
case ZoneToSafeCoords: Code:
cheat_timer.Start(35000,false); //Lieka: Allow Zone/Evac to Safe Coords without triggering MQWarp detector. Code:
case GMSummon: Code:
cheat_timer.Start(35000,false); //Lieka: Allow Inter-Zone GM Summons without triggering MQZone detectors. After: Code:
case ZoneSolicited: //we told the client to zone somewhere, so we know where they are going. Code:
cheat_timer.Start(3500,false); //Lieka: Allow Server Forced Zoning without triggering MQZone detector. Code:
case ZoneUnsolicited: //client came up with this on its own. Code:
cheat_timer.Start(3500,false); //Lieka: Allow Zone normal zoning without triggering MQZone detector. Code:
} else { Code:
this->CheatDetected(MQZone); //Lieka: Bring down the hammer, they are trying to zone without meeting any of the above criteria. Code:
if(zone_mode == ZoneUnsolicited) { Code:
if ((this->cheat_timer.GetRemainingTime())<1 || (!this->cheat_timer.Enabled())){ //Lieka: Disable MQGate Detector if timer is active. Code:
[color=red] //for now, there are no other cases... Change (Insert Red Lines): Code:
//enforce min status and level Code:
void Client::SendZoneCancel(ZoneChange_Struct *zc) { Code:
cheat_timer.Start(3500,false); //Lieka: Disable MQ Warp & MQ Gate Detector when zoning fails. (not high enough level, etc) Code:
void Client::SendZoneError(ZoneChange_Struct *zc, sint8 err) { Code:
cheat_timer.Start(3500,false);//Lieka: Disable /Warp & /Gate Detector when zoning fails. (not high enough level, etc) Code:
switch(zm) { |
REQUIRED SQL:
Code:
ALTER TABLE `hackers` Code:
insert into rule_values values (0, Zone:EnableMQWarpDetector, False); Zone:EnableMQWarpDetector //Lieka: Enable the MQWarp Detector. Set to False to disable this feature. Zone:EnableMQZoneDetector //Lieka: Enable the MQZone Detector. Set to False to disable this feature. Zone:EnableMQGateDetector //Lieka: Enable the MQGate Detector. Set to False to disable this feature. Zone:EnableMQGhostDetector //Lieka: Enable the MQGhost Detector. Set to False to disable this feature. Zone:MQWarpExemptStatus //Lieka: Required account status to exempt the MQWarpDetector. Set to -1 to disable this feature. Zone:MQZoneExemptStatus //Lieka: Required account status to exempt the MQWarpDetector. Set to -1 to disable this feature. Zone:MQGateExemptStatus //Lieka: Required account status to exempt the MQWarpDetector. Set to -1 to disable this feature. Zone:MQGhostExemptStatus //Lieka: Required account status to exempt the MQWarpDetector. Set to -1 to disable this feature. Zone:MQWarpDetectorDistance //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. Zone:MQWarpLagThreshold //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. Zone:MQWarpThresholdTimer //Lieka: Amount of time before the warp_threshold resets to the Zone:MQWarpLagThreshold value. Default: 90000 (900 seconds Zone:MQWarpDetectionSpellID //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) Zone:MQZoneDetectionSpellID //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) Zone:MQGateDetectionSpellID //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) Zone:MQGhostDetectionSpellID //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 resistible spell. Default: 757 (Resurrection Effects) |
Updating your Zone_Points table for MQZoneDetector.
When an unsolicited zone request comes through (i.e. the client is requesting a zone change), the MQZoneDetector works with the source to determine if the player is within an acceptable distance of a zoneline. These zonelines must be set in your Zone_Points table in order for this feature to work correctly. The majority of the Zone_Points only specify the destination zone points, but have 0, 0, 0 for the source zone points. If it is a zone line (like literally a line), then you put 999999 for the appropriate value. Below is my list, list: I do not have a complete Zone_Points table, but I do have Old World, FearPlane, HatePlane, and AirPlane updated in my table. SQL Step 1: Wipe your old world zone lines (I'm assuming that we're all based off of PEQ originally (mine is based from Angelox, but originally still it was PEQ)). This is a list of zone_points IDs that I have written insert statements for. Code:
delete from zone_points where id = 1 || id = 3 || id = 7 || id = 10 || id = 11 || id = 14 || id = 17 || id = 18 || id = 19 || id = 20 || id = 21 || id = 23 || id = 24 || id = 25 || id = 27 || id = 31 || id = 38 || id = 40 || id = 41 || id = 45 || id = 47 || id = 49 || id = 51 || id = 52 || id = 53 || id = 67 || id = 68 || id = 69 || id = 71 || id = 75 || id = 77 || id = 94 || id = 97 || id = 99 || id = 101 || id = 108 || id = 121 || id = 126 || id = 148 || id = 181 || id = 182 || id = 186 || id = 187 || id = 197 || id = 214 || id = 336 || id = 337 || id = 338 || id = 339 || id = 340 || id = 341 || id = 342 || id = 343 || id = 345 || id = 370 || id = 371 || id = 372 || id = 373 || id = 374 || id = 375 || id = 376 || id = 377 || id = 378 || id = 379 || id = 380 || id = 381 || id = 382 || id = 383 || id = 384 || id = 385 || id = 386 || id = 387 || id = 388 || id = 389 || id = 390 || id = 391 || id = 392 || id = 393 || id = 394 || id = 395 || id = 396 || id = 397 || id = 398 || id = 399 || id = 400 || id = 401 || id = 402 || id = 413 || id = 414 || id = 415 || id = 416 || id = 417 || id = 418 || id = 419 || id = 420 || id = 440 || id = 472 || id = 473 || id = 474 || id = 475 || id = 476 || id = 477 || id = 478 || id = 479 || id = 480 || id = 481 || id = 482 || id = 483 || id = 484 || id = 485 || id = 486 || id = 487 || id = 488 || id = 489 || id = 490 || id = 491 || id = 492 || id = 493 || id = 537 || id = 538 || id = 549 || id = 550 || id = 551 || id = 552 || id = 557 || id = 558 || id = 559 || id = 575 || id = 590 || id = 591 || id = 592 || id = 594 || id = 640 || id = 641 || id = 642 || id = 643 || id = 644 || id = 647 || id = 648 || id = 649 || id = 657 || id = 658 || id = 659 || id = 660 || id = 663 || id = 664 || id = 665 || id = 666 || id = 675 || id = 676 || id = 677 || id = 685 || id = 686 || id = 687 || id = 688 || id = 689 || id = 690 || id = 691 || id = 692 || id = 693 || id = 700 || id = 701 || id = 703 || id = 704 || id = 725 || id = 726 || id = 738 || id = 739 || id = 740 || id = 741 || id = 742 || id = 743 || id = 752 || id = 769 || id = 770 || id = 771 || id = 772 || id = 773 || id = 774 || id = 775 || id = 799 || id = 800 || id = 801 || id = 802 || id = 803 || id = 804 || id = 806 || id = 807 || id = 808 || id = 851 || id = 852 || id = 853 || id = 854 || id = 855 || id = 857 || id = 858 || id = 860 || id = 861 || id = 862 || id = 888 || id = 889 || id = 905 || id = 910 || id = 911 || id = 912 || id = 914 || id = 915 || id = 916 || id = 917 || id = 918 || id = 920 || id = 921 || id = 970 || id = 971 || id = 977 || id = 978 || id = 1142 || id = 1145 || id = 1146 || id = 1147 || id = 1148 || id = 1149 || id = 1150 || id = 1151 || id = 1152 || id = 1153 || id = 1154 || id = 1155 || id = 1158 || id = 1159 || id = 1160 || id = 1161 || id = 1162 || id = 1174 || id = 1218 || id = 1268 || id = 1269 || id = 1270 || id = 1271 || id = 1272 || id = 1273 || id = 1274 || id = 1275 || id = 1276 || id = 1277 || id = 1278 || id = 1314 || id = 1315 || id = 1327 || id = 1328 || id = 1329 || id = 1333 || id = 1750 || id = 1751; Code:
insert into zone_points values (1, 'qeynos',1,464,-442,1.5,0,-151,-5,1.5,999,0,2); |
SQL Part 2: Continued
Code:
|
SQL Part 2: Concluded
Code:
insert into zone_points values (743, 'steamfont',77,0,0,0,0,-401,-76,-157,255,0,202); Thanks, Dax |
dammit, I missed AirPlane:
Code:
delete from zone_points where id = 1163 || id = 1164 || id = 1165 || id = 1166 || id = 1167 || id = 1168 || id = 1169 || id = 1170 || id = 1171 || id = 1172 || id = 1173; Code:
insert into zone_points values (1163, 'airplane', 1, 0, 0, 0, 0, -387, 415, 132, 0, 0, 37); |
Holy. Shit. Much appreciation Dax. I'll post results, may take me a few days :).
|
Quote:
Code:
|
I just have to say..
Thank you for sharing, this is big and will help the community. |
This is wonderful, and I can't wait to try it out! However...
Could you post a diff against working code? Linux isn't liking client_packet.cpp at all and I want to rule out copy/paste errors on my part. (Though, there are a couple of typos as well, for example): Code:
AddBuff(this,(RuleI(Zone, MQZoneDetectionSpell)),30); needs to be: Code:
AddBuff(this,(RuleI(Zone, MQZoneDetectionSpellID)),30); Thanks for sharing this, it certainly is brilliantly written besides the minor typos here and there. |
Sorry for the typos with the rules system (I put it together for the submission). I'll see if I can get you a diff, but we've deviated quite a bit from the standard build, so it will take me a bit. I'll see if I can get one together.
Dax |
All times are GMT -4. The time now is 01:25 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.