NoCheatPlus / Issues

Issues managment for the NoCheatPlus project.
13 stars 9 forks source link

NoCactus isn't blocked [DBO 768] #35

Open MyPictures opened 8 years ago

MyPictures commented 8 years ago

==What is the problem? What do you expect to see instead?== Players (in survival gamemode, without god mode) are able to touch cacti without dying.

==Can it be reproduced systematically and if so: How?== With a client.

==How easy is it to reproduce? Does it always happen? Does it happen to all players? Does it happen with vanilla clients?== Easy to do with a client.

==Versions of NCP+MCAccess and server: Post the full output of the "ncp version" command!== Server: git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3042jnks (MC: 1.7.5) NCP: 3.10.12-RC-sMD5NET-b700 MCAccess: 1.7.5 / CB3026 Hooks: TestNCPHook 1.0

==Details about the configuration file of NCP.== //(Examples: What version of NCP was the config generated with? Did you change anything - if so: add a quick description.)//\ Default

==Do you run any other special plugin next to NC+ (adding skills, machines, adding/changing blocks)?== //(Examples: SpoutPlugin, mcMMO, Heroes, MachinaCraft and others.)//\ Nope

==Please provide any additional information below!== //(Examples: Logs, screenshots, plugin list, player amount, NCP configuration files ... use http://dev.bukkit.org/paste/ or http://pastebin.com/ and add the link here if linked resources are longer than a few lines.)//\

Video: https://www.youtube.com/watch?v=Y0x5huVWqBQ

MyPictures commented 8 years ago

asofold: "Are you sure they actually touch the cactus? They might just move such that they don't touch them.

For the case of standing on a cactus without taking damage we would have to do something, though one would need to find out, if ...

For the case of just jumping into a cactus, we are not likely to detect it with conventional means, because it seems to be a case of "just smart moving". What we might be able to detect, is "sudden" stopping without touching blocks. In that case we might detect it more easily, also by counting up how often the player stops near cactus.

MyPictures commented 8 years ago

MyPictures: "Its interesting how they can stand on top of it without CraftBukkit complaining. If you would jump and stay on top of a cactus for more then 45 seconds would this trigger the MC fly check?"

MyPictures commented 8 years ago

ProdigyOG: "asofold:

When the client stands on the cactus, they treat the block to be full and not have a decreased height.

Normally cactus is .9375 blocks high. Players standing on the cactus should have a y coordinate with .9375 as the decimal.

With NoCactus, however, the client treats the block to be 1 instead of .9375 and doesn't sink-in.

MyPictures:

The client can stand/jump on the cactus of an indefinite amount of time and they will not be flagged by NoCheatPlus and CraftBukkit/MC won't "complain.""

MyPictures commented 8 years ago

asofold: "ProdigyOG:

The missing bit is exactly the distance above which moves must differ from last moving events start position, to have CraftBukkit trigger a moving event (i.e. sqrt(1/256) = 0.0625).

We check on ground with that distance as margine, due to CB ahndling move events like that.

If the "lost-ground" checks are good enough one might set it lower. Right now i am not sure if Player.getLocation would return the actual location, so one might use a lower margine again.

You can in fact reduce that distance with a hidden config entry, by setting checks.moving.yonground to just slightly below 0.0625, e.g. 0.06 (should suffice, if cactus starts damaging you when just within the full block). This should catch them with the hover check, though that's not too efficient either. Don't mix it up with the nofall.yonground setting."

MyPictures commented 8 years ago

asofold: "Could be the same with soulsand - needs checking."

MyPictures commented 8 years ago

asofold: "In theory we should be able to remove the margin in favour of determining the distance to ground instead, so we don't need any margin at all.

The problem is that there certainly are untracked moves hidden by CraftBukkit thresholds, which are revealed by Player.getLocation() being different than PlayerMoveEvent.getFrom(). If a player manages to be just slightly above ground and moves back onto ground with such a "micro move", there will not be a moving event for it. In that case the player would be on ground for the hover check, which checks in a repeating task, and they would receive damage.

Switching to the "distance to ground" calculation instead of "is there ground within XYZ distance", could enable us to keep checking if players are avoiding ground, because their location should be on ground even with PlayerMoveEvent not covering it.

Edit: We might also want to return all the type of blocks (e.g. as flags) for the on-ground judgment, to be able to tell friction/cactus etc., so the onGround check needs to be transformed into returning (or working on) a class, containing the distance to ground, if found any, type of ground, possibly some of the input paramters (ignore flags, when/how to return)."

MyPictures commented 8 years ago

MyPictures: "The latest NC+ build (867) will not prevent players from standing on cactus without taking damage (constantly setback from survivalfly)."