azerothcore / mod-anticheat

Port of PassiveAnticheat to Azerothcore
http://azerothcore.org/
MIT License
33 stars 50 forks source link

Feature: Forbid summon players if they are in prison #65

Open Tony931023 opened 2 years ago

Tony931023 commented 2 years ago

Describe your feature request or suggestion in detail

Testing various antihack-module jailbreaks, we found that if a GM gives .summon to a player he is jailbroken and to avoid this, he asked if something could be added to the source code in the command. summon to prohibit this bug More information in this Issues https://github.com/azerothcore/mod-anticheat/issues/59

@acidmanifesto

Describe a possible solution to your feature or suggestion in detail

Additional context

I don't know if I've explained myself well, it's just a suggestion to be valued, and sorry for my bad English, it's not my main language.

AC rev. hash/commit

AzerothCore rev. 4ac565699fcb 2022-04-13 11:57:04 +0000 (master branch) (Unix, RelWithDebInfo, Static)

acidmanifesto commented 2 years ago

this will be more of a issue or suggestion for the anticheat module git, as implementing select things fo this case will not be a core subject. currently there is some research for the jailing feature's improvements. so far we got the bg\arena\lfg\lfr jailbreak queues fixed. but as for gm summons. the issue will is that GM's are suppose to play the role as the disciplinary committee and therefor should be handling the punishment and the release.

Nyeriah commented 2 years ago

Sounds like roleplay to me, and in that case, yes, maybe it should go to a module? Or GMs need to check where people are at before summoning...

acidmanifesto commented 2 years ago

Sounds like roleplay to me, and in that case, yes, maybe it should go to a module? Or GMs need to check where people are at before summoning...

pretty much what i suggested in my comment that this is more of a issue or suggestions for the anticheat module git.

acidmanifesto commented 2 years ago

Issued transfered to Anticheat Module GIt, that way we dont have to bother with the whole close and reopen the issue on another git.

acidmanifesto commented 2 years ago

@Tony931023 a quick solution for your local would be to place the code at https://github.com/azerothcore/azerothcore-wotlk/blob/03a6413080752294bd47b9e4e9ef0287dc1d4833/src/server/scripts/Commands/cs_misc.cpp#L853

Code:

           Player* player;
            if (player->GetSession()->GetSecurity() == SEC_PLAYER && player->GetAreaId() == 876)
            {
                handler->PSendSysMessage("User is Jailed!");
                handler->SetSentErrorMessage(true);
                return false;
            }

That will prevent a level 0 normal player account from not being summoned if they are in the area 876 gm island. the gm jail is actually inside the tall mountain behind the gm cabin. however i am not certain if the parole command will override it which can only be done by a level 3 gm account. But try it out and let me know how it goes. I can not see how to add this is in the module as that summon gm cmd is apart of the core itself. so i am not entirely certain if they will allow such a edit or change to the core it self for the auto jailing.

acidmanifesto commented 2 years ago

@Tony931023 i updated the above code slightly to include a message on error, obviosuly feel free to adjust it to your locale and liking.