[Patch] AC2

AC2 anticheat patch (with Ishigure mods) for TrinityCore

To apply use git:
-to check if it runs without errors:

git apply --check ac2_for_tc_e39634246e.diff-to apply it:

git apply --whitespace=fix ac2_for_tc_e39634246e.diff[/CODE]This patch causes this crash

https://github.com/TrinityCore/TrinityCore/issues/14878

AC2 anticheat patch for TrinityCore

To apply use git:
-to check if it runs without errors:

git apply --check ac2_for_tc_a7d8a65bd0a95f21f1e350cefbef94ace20f69ec.diff

-to apply it:

git apply --whitespace=fix ac2_for_tc_a7d8a65bd0a95f21f1e350cefbef94ace20f69ec.diff[/code]

ac2_for_tc_a7d8a65bd0a95f21f1e350cefbef94ace20f69ec.diff

Ok, spent some time updating the diff. Here it is. It does work and compiles without errors on TC as of 7-24-2013. I messed with the code a little. I am trying to get it to output to the “cheat” log. If I get it working I’ll re-post. Oh, and I noticed that it creates a new MovementHandler.cpp2. I have no idea (yet) why it does this as I dont even include this in my compile and it works. I tested it with the most current hitchhiker hack I could find. Copy it to the root of your source and run git apply --check --ignore-space-change --ignore-whitespace ac2_for_tc_7-23-2013.diff to make sure it runs without errors. then apply with git apply --ignore-space-change --ignore-whitespace ac2_for_tc_7-23-2013.diff

I did come up with a few whitespace errors, but those can be ignored.

As I stated, this is a WIP, I just need to stop for a few days, and wanted to contrib before I forget.

Ok, took a few minutes and get the Cheat.log file running. There are a few options that are in the config file that are not implemented yet. I do plan on expanding it to allow selective log/kick/ban.

Another change, The Debug did not have the correct parms either, I corrected it.

ac2_for_tc_7-24-2013 2nd.diff

As a note: After I compile this into my source along with AHBot I start getting crashes. I am changing the to Alpha as it does not seem to be quite functional yet. I will need to go through the code and see where it is crashing. Unfortunately this will take me a while since I do have a life. /emoticons/default_smile.png If anyone else wants to tackle this have at please!

Someone else will need to work on the patch for Linux. While I am a linux admin I just dont have time to track down the issues. Here is the current version I have. It is updated through 10-14-2013.

If you are wondering why there is a 5- on the beginning it is because I apply my patches in a certain order. Makes it easier for when I get a new build that has issues (like the 10-14-2013 that made some core changes that broke NPCBots.)

I will go ahead and post 1-4 in case you are more of a cut-and-paste compiler rather than being able to find and correct errors with patches.

Also, when you apply you need to increase your core timeout. I have mine set at 30 and it seems to be working better. I had it on 20 seconds and I was still getting a time-out crash once in a while.

the files are as follows:

1-ahbot.2013-07-15.53e5075.patch1: Auction House Bot.

2-RBAC_SkipRaceCheck.diff2: My custom Skip Race Check flag using RBAC. (I am not sure if this is currently working. The patch is tiny.)

3-VAS AutoBalance.diff3: Autobalance dungeons based on how many are in them… I think… I am going off memory here. Google it if your really curious.

4-NPCBots.patch4: NPCBots (I have added this to my core but have not verified that it is working. Compiles without errors as of 10-14-2013. Earlier version of TC core wont work as changes were made in the last week that broke the old version).

5-ac2_for_tc_7-24-2013 2nd.diff5: Anti-Cheat-2 What your looking for! I dont remember making any fundamental changes since 7-25-2013 but there may have been a few.

Check them with git apply --check --ignore-space-change --ignore-whitespace

Apply them with git apply --ignore-space-change --ignore-whitespace

As has been noted earlier these may not compile under Linux versions. I have no intention of fixing these myself as I only have a limited amount of time and just keeping up what I have takes all the free time I am willing to spend on it.

This patch generates some compile errors with gcc. I’ve updated it to the latest rev: [COLOR=rgb(68,68,68)]b1bef5b0c6e72ef7ae0470bb7009305280bf4845

Have fun /emoticons/default_smile.png

AC2_fix_by_FrickX.patch

Ok, I think I fixed it. The patched code was trying to exit a vehicle when the first user enters the game. I dont know the whole thread of code here, but it looks like they just forgot to take out the original exit a vehicle code when they added the Anti-cheat. Anyways, I am recompiling now and will test it in a few. The debug version I am currently running does not crash any more but some more testing will need to be done to make sure I didnt break the taxi, enter/exit vehicle code. I think I accounted for everything but like I said I am not 100% sure. YMMV.

I will post it in a few. I also changed it to use Frickx’s patch. I dont have a Linux machine to test on so I trust he knows what he is doing. /emoticons/default_smile.png Thanks Frickx!

Ok, Here it is. Think I got the crashes out. For those that are curious here is a snippit from the original AC2 code:

  • else if (plrMover && plrMover->GetTransport()) // if we were on a transport, leave
  • else if (plrMover && (plrMover->m_transport || plrMover->m_temp_transport)) // if we were on a transport, leave
    {
    plrMover->m_transport->RemovePassenger(plrMover); <— this is the line causing the crash. Should not be needed as the block below does the correct check before exiting the vehicle
    plrMover->m_transport = NULL; <— not needed, this is duplicated after the if block below
    movementInfo.transport.Reset(); ← same here.
  •    if (plrMover->m_transport)
    
  •    {
    
  •        plrMover->m_transport->RemovePassenger(plrMover);
    
  •        plrMover->m_transport = NULL;
    
  •    }
    
  •    plrMover->m_temp_transport = NULL;
    
  •    movementInfo.transport.Reset();
    
    }

As usual, I add them in order so you still need files 1-4 posted earlier if you dont want to have to modify the patch for your build. I have not tested this against the newest available code, I think the code I am using is from 11/7/13 so if you use a newer revision it may not patch cleanly. Flame ON!

5-AC2_fix_by_Ragman_linux_by_FrickX.patch

Very Nice

Test And Work it!

Ok, Here it is. Everything seems to be online and working. At least it is not crashing any more! /emoticons/default_smile.png

Ok, this has been updated today for the new log file format. So, you will need to pull the newest Trinity core to get it to compile as the TC_LOG_ routines have all changed.

Apply them in order…

1-ahbot.2013-07-15.53e5075.patch

2-RBAC_SkipRaceCheck.diff

3-VAS AutoBalance.diff

4-NPCBots.patch

5-AC2_fix_by_Ragman_linux_by_FrickX.patch

Let me know if I forgot anything. As always… FLAME ON!

Can anyone help me with this patch? when i try to apply the patch i get this error

“C:Program Files (x86)Gitbingit.exe” apply --ignore-whitespace “D:/Trinity/TrinityCore/AntiCheat2.patch”
D:/Trinity/TrinityCore/AntiCheat2.patch:316: tab in indent.
movementInfo.flags, LookupOpcodeName(opcode), movementInfo.transport.pos.m_positionX, movementInfo.transport.pos.m_positionY, movementInfo.transport.pos.m_positionZ, movementInfo.transport.pos.m_orientation);
D:/Trinity/TrinityCore/AntiCheat2.patch:469: tab in indent.
plrMover->GetName().c_str(), JumpHeight, plrMover->m_anti_Last_VSpeed);
D:/Trinity/TrinityCore/AntiCheat2.patch:537: tab in indent.
D:/Trinity/TrinityCore/AntiCheat2.patch:539: tab in indent.
D:/Trinity/TrinityCore/AntiCheat2.patch:552: tab in indent.
error: patch failed: src/server/game/Handlers/MovementHandler.cpp:376
error: src/server/game/Handlers/MovementHandler.cpp: patch does not apply
Done

that’s because trinity has changed something in MovementHandler.cpp

diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index 08dc860…0c2eae8 100644
— a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -381,6 +381,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)

 if (plrMover)                                            // nothing is charmed, or player charmed
 {
  •    if (plrMover->IsSitState() && (movementInfo.flags & (MOVEMENTFLAG_MASK_MOVING | MOVEMENTFLAG_MASK_TURNING)))
    
  •        plrMover->SetStandState(UNIT_STAND_STATE_STAND);
    
  •    plrMover->UpdateFallInformationIfNeed(movementInfo, opcode);
    
       if (movementInfo.pos.GetPositionZ() < -500.0f)
    

but i don’t know how to fix the problem, any help would be awesome

http://www.trinitycore.org/f/index.php?app=core&module=attach&section=attach&attach_id=863

my source version is TDB 335.52 - 2013/07/17 , when players online to server Crash Worldserver.exe

pls help me .

Sorry I have not checked on this thread in a while. I have had several deaths in the family so I had to take a break. I was updating my code yesterday and I noticed that EVERYTHING broke. I have reset back to the “standard” TC as of 5-3-2014. I am working on the auction bot now and will work up to the others. I think I am going to drop the RBAC changes I was making. I never got it to work and I just dont think I will have the time to fix it right. I might add it back in later. I should have something working in the next few days. Surprised that no one else took it up and fixed it. I dont expect it broke too badly, but then again I have been out of the loop for a few months.

The new files will be updated to TDB 335.53 (the newest as of now.)

Ok, first off there looks to be a very simular thread and I would recomend you take a look at it: http://www.trinitycore.org/f/topic/10-patch-telenpc2-pvpranks-ahbot-passive-anticheat-for-trinitycore-2014-03-09-d4416c0/

Second off, I have updated my selection of patches before going and trying out the other threads patches. So here they are. I pulled the newest source today and wen through the process so, while it comes up with some whitespace errors and such, it does complete, compile and I tested it.

Apply in order and everything should work. I am compiling under MS VC13

1-05_05_2014-ahbot.patch

2-05_05_2014-apply-updated-VAS-autobalancer-for-latest-3.3.5a.patch

3-05_05_2014-NPCBots_5-5-14.patch

4-05_05_2014-AC2_fix_by_Ragman_linux_by_FrickX.patch

Please note, it looks like a file was removed from the core that is probably not used any more. It has to do with un-named maps, so I had to add a section in dealing with a now unknown definition. I did add the section so if core puts it back in then my additions will detect it (hopefully) and disable my defs. Anyway… just a heads up. I am going to reset back to factory and try out the links above.

thx, but can you fix warning AC2 ? http://pastebin.com/3466igeC

Are you compiling under linux? Once again I dont have a linux box to compile against. Those lines look to be just logging lines. If you remove them does it compile?

The thread that I mentioned before, I do kinda like it. Very professional and compiles without my whitespace errors. The only thing I dont like is the passive cheat log. I do get a notification if someone is cheating but there does not appear to be any actual part of the server to curb cheating. I was flying all around and all I got was a “ might be cheating!” message. Great it you have admins on the server at all times and they have the time to look into it. It also smacks of not being done right since it is actively saying that they might be cheating. Ummm is there some place in the game that I can fly at 8 times normal speed? Anyways, if you looking for a more polished and what appears to be kept up version I would recommend his thread. If you have the skills to keep up with the patches without waiting on someone within this thread to update it then I think the AC2 that is on this thread is much better as it will reset users that try and multi-jump or fly. Those that dont know how to troubleshoot compiler errors and want the AC2 will just have to wait I guess. Please be aware, this is not my full time job and is just a hobby. I try and update my wow server once a week but I dont feel bad if I dont do it for three months.

Try this:

replace &Warden::Penalty with Warden::Penalty.c_str()

Will it work? Dont know, I dont have a linux box.

not work

Ok. Here is the latest. I made a few changes. The site that I quoted above has a few patches here now. I took the ahbot, pvpranks and the telenpc and added in VAS and the version of AC2 I like. I dont expect this to compile under Linux as I didnt make any of those changes that are needed. I did however go through and remove those pesky whitespace errors.

Good luck.

1-05_12_2014-patch.2013-11-08.114cae2.patch

2-05_12_2014-ahbot.2014-03-09.d4416c0.patch

3-05_12_2014-pvpranks.2013-11-08.114cae2.patch

4-05_12_2014-AC2_fix_by_Ragman_linux_by_FrickX.patch

5-05_12_2014-telenpc2.2013-12-23.a2c3736.patch

6-05_12_2014-apply-updated-VAS-autobalancer-for-latest-3.3.5a.patch

7-05_12_2014-NPCBots_5-5-14.patch

As always… Flame on!

Little bit of a change for today. Just a little broken autopatch.

7-05_27_2014-NPCBots_5-5-14.patch

Just a quick update, the patch fails on compile. I need to dig into it and fix it. Dont download yet, it wont compile. Looks like some of the structs have changed.

ok, got around to fixing it. There were a few changes made to source and they removed some includes that are needed for these patches, but no longer required for the master source. Anyways, I updated to today (6-4-14) and fixed the few additional errors that popped up with today’s source. Have fun!

1-05_12_2014-patch.2013-11-08.114cae2.patch

2-05_27_2014-ahbot.2014-03-09.d4416c0.patch

3-05_12_2014-pvpranks.2013-11-08.114cae2.patch

4-05_12_2014-AC2_fix_by_Ragman_linux_by_FrickX.patch

5-06_04_2014-telenpc2.2013-12-23.a2c3736.patch

6-05_12_2014-apply-updated-VAS-autobalancer-for-latest-3.3.5a.patch

7-06_04_2014-NPCBots_5-5-14.patch

Ok, patched for today’s release. Just a minor change.

Just going to post the one changed file. The others are the same.

7-06_09_2014-NPCBots_5-5-14.patch