1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

PVP hack

Discussion in 'Development' started by CreeperFace, Mar 1, 2017.

  1. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    Hi i would like to block hack that expands other players bounding box so you can touch anywhere on screen and you will hit the player. This is quite good advantage but i absolutely do not have any idea how to prevent this.
     
    gistrec likes this.
  2. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    but its impossible right?
     
  3. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    I will release some combat Huristics that can find this soon, they´ll be in my AntiCheat Plugin SAC.
    Thoose detections aren´t released, yet. you´ll have to wait for the 3.2.1 release.
     
  4. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    So you think you can detect them?
     
  5. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    yes, i think i can. but im not 100% sure yet.
     
    jasonwynn10 likes this.
  6. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    because you can not check the touch direction, so if victim is within player interact range, there's nothing to check (or idk about anything)
     
  7. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    i can check both angle (very complicated maths and physics :D) and distance with my heuristics. So it shouldn´t be too hard.
     
  8. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    hmm :D i think you or me don't understand :D
     
  9. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    there is a way to get the direction of a player :
    PHP:
    $damaged_entity             $event->getEntity();
    $damaged_entity_position    = new Vector3($damaged_entity->getX(), $damaged_entity->getY(), $damaged_entity->getZ());
    $damaged_xz_entity_position = new Vector3($damaged_entity->getX(), 0                      $damaged_entity->getZ());
    $damager                    $event->getDamager(); 
    $damager_position           = new Vector3($damager->getX()       , $damager->getY()       , $damager->getZ()       );
    $damager_xz_position        = new Vector3($damager->getX()       , 0                      $damager->getZ()       );
    $damager_direction          $damager->getDirectionVector();
    $damager_direction          $damager_direction->normalize();
    $damager_xz_direction       $damager->getDirectionVector();
    $damager_xz_direction->y    0;
    $damager_xz_direction       $damager_xz_direction->normalize();
    $entity_xz_direction        $damaged_xz_entity_position->subtract($damager_xz_position)->normalize();
    $entity_direction           $damaged_entity_position->subtract($damager_position)->normalize();
    $distance_xz                $damager_xz_position->distance($damaged_xz_entity_position);
    $distance                   $damager_position->distance($damaged_entity_position);

    $dot_product_xz $damager_xz_direction->dot($entity_xz_direction);
    $angle_xz       rad2deg(acos($dot_product_xz));
     
    $dot_product    $damager_direction->dot($entity_direction);
    $angle          rad2deg(acos($dot_product));

    $angle is the difference betwenn the hitted entity and the players direction.
    $angle_xz is the difference betwenn the hitted entity and the players direction WITHOUT the Y angle included. (the more safer method).
    This has to be put into the onDamage() event handler.
    BTW, i already kick players if they have high angles and a dist or 3.5 blocks or more
     
    Muqsit and Skullex like this.
  10. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    so you check if victim is in his field of view and within interact range
     
  11. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
  12. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    but its not what i mean
     
  13. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    so what do you mean exactly?
     
  14. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    if you use this hack, you can theoretically click anywhere on screen to hit the player that is in you field of view and within your interact range, so both checks will pass
     
  15. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    i also kick ppl that are in interact range, but hit fast and with high distances (that prevents a significant advantage, and detects your hack, probably.)
     
  16. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    no, how? this hack doesn't hit entities by itself, it just expands their bounding box (probably)
     
  17. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    an entity has an exact position on server side, which cant be modyfied by the client.
    if someone doesnt look at the entity (This is handled server-side, cant be modyfied by the client, althogh the client can hit the entity.) hes hitting, i can always detect this.
    However , i need to go for today, ill be back tomorrow.
    bye
     
    kaliiks likes this.
  18. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    but problem is player is looking at this entity :D ok bye
     
  19. Darku

    Darku Spider Jockey

    Messages:
    49
    GitHub:
    DarkWav
    hes just looking at it for the client, the server is showing that hes looking next to ti.
    and even if hes looking at it, i still have a triggerbot detection :).
    bye and until tomorrow.
     
  20. CreeperFace

    CreeperFace Witch

    Messages:
    58
    GitHub:
    creeperface01
    ok so i keep my fingers crossed :D im thinking about realeasing my anticheat for nukkit
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.