Package fr.neatmonster.nocheatplus.checks

Examples of fr.neatmonster.nocheatplus.checks.ViolationData


            // Remember how much further than allowed he tried to reach for logging, if necessary.
            data.reachDistance = distance;

            // Execute whatever actions are associated with this check and the violation level and find out if we should
            // cancel the event.
            final ViolationData vd = new ViolationData(this, player, data.reachVL, distance, cc.reachActions);
            vd.setParameter(ParameterName.REACH_DISTANCE, String.valueOf(Math.round(data.reachDistance)));
            cancel = executeActions(vd);
        } else
            // Player passed the check, reward them.
            data.reachVL *= 0.9D;

View Full Code Here


          violation = true;
        }
        // Handle violation and return.
    if (violation) {
      data.againstVL += 1.0;
      final ViolationData vd = new ViolationData(this, player, data.againstVL, 1, cc.againstActions);
      vd.setParameter(ParameterName.BLOCK_TYPE, placedMat.toString());
      vd.setParameter(ParameterName.BLOCK_ID, Integer.toString(BlockProperties.getId(placedMat)));
      return executeActions(vd);
    } else {
      data.againstVL *=  0.99; // Assume one false positive every 100 blocks.
      return false;
    }
View Full Code Here

    // TODO: set data.set-back ? or something: still some aji here.
   
    // Return the reset position.
    data.passableVL += 1d;
    final ViolationData vd = new ViolationData(this, player, data.passableVL, 1, cc.passableActions);
    if (cc.debug || vd.needsParameters()) {
      vd.setParameter(ParameterName.BLOCK_ID, "" + to.getTypeId());
      if (!tags.isEmpty()) {
        vd.setParameter(ParameterName.TAGS, tags);
      }
    }
    if (executeActions(vd)) {
      // TODO: Consider another set back position for this, also keeping track of players moving around in blocks.
      final Location newTo;
View Full Code Here

            // Increment violation level.
            data.morePacketsVehicleVL = -data.morePacketsVehicleBuffer;

            // Execute whatever actions are associated with this check and the violation level and find out if we should
            // cancel the event.
            final ViolationData vd = new ViolationData(this, player, data.morePacketsVehicleVL, -data.morePacketsVehicleBuffer, cc.morePacketsVehicleActions);
            if (cc.debug || vd.needsParameters()) {
              vd.setParameter(ParameterName.PACKETS, Integer.toString(-data.morePacketsVehicleBuffer));
            }
            if (executeActions(vd)){
              newTo = data.getMorePacketsVehicleSetBack();
            }
        }
View Full Code Here

            // Only raise a violation, if the total penalty score exceeds the contention duration (for lag, delay).
            if (data.fastBreakPenalties.score(cc.fastBreakBucketFactor) > cc.fastBreakGrace) {
              // TODO: maybe add one absolute penalty time for big amounts to stop breaking until then
                final double vlAdded = (double) missingTime / 1000.0;
              data.fastBreakVL += vlAdded;
              final ViolationData vd = new ViolationData(this, player, data.fastBreakVL, vlAdded, cc.fastBreakActions);
              if (vd.needsParameters()) {
                vd.setParameter(ParameterName.BLOCK_TYPE, blockType.toString());
                vd.setParameter(ParameterName.BLOCK_ID, Integer.toString(BlockProperties.getId(blockType)));
              }
              cancel = executeActions(vd);
            }
            // else: still within contention limits.
        }
View Full Code Here

                      delta = 0;
                    }
                   
                    // Execute whatever actions are associated with this check and the violation level and find out if we
                    // should cancel the event.
                    final ViolationData vd = new ViolationData(this, player, data.criticalVL, delta, cc.criticalActions);
                    if (vd.needsParameters()){
                      if (dataM.sfLowJump){
                        tags.add("sf_lowjump");
                      }
                      vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
                    }
                    cancel = executeActions(vd)
              }
            }
        }
View Full Code Here

       
        boolean cancel = false;
       
        if (violation > 0){
          data.fastClickVL += violation;
          final ViolationData vd = new ViolationData(this, player, data.fastClickVL + violation, violation, cc.fastClickActions);
          cancel = executeActions(vd);
        }
       
        if (cc.debug && player.hasPermission(Permissions.ADMINISTRATION_DEBUG)){
          player.sendMessage("FastClick: " + data.fastClickFreq.bucketScore(0) + " | " + data.fastClickFreq.score(1f) + " | cursor=" + cursor + " | clicked=" + clicked);
View Full Code Here

    }
    boolean cancel = false;
    if (violated){
      // Execute actions
      data.improbableVL += violation / 10.0;
      final ViolationData vd = new ViolationData(this, player, data.improbableVL, violation, cc.improbableActions);
      if (tags != null && !tags.isEmpty()) vd.setParameter(ParameterName.TAGS, tags);
      cancel = executeActions(vd);
    }
    else
      data.improbableVL *= 0.95;
    return cancel;
View Full Code Here

    private final Location handleViolation(final long now, final double result, final Player player, final PlayerLocation from, final PlayerLocation to, final MovingData data, final MovingConfig cc)
    {
        // Increment violation level.
        data.survivalFlyVL += result;
        data.sfVLTime = now;
        final ViolationData vd = new ViolationData(this, player, data.survivalFlyVL, result, cc.survivalFlyActions);
        if (vd.needsParameters()) {
            vd.setParameter(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", from.getX(), from.getY(), from.getZ()));
            vd.setParameter(ParameterName.LOCATION_TO, String.format(Locale.US, "%.2f, %.2f, %.2f", to.getX(), to.getY(), to.getZ()));
            vd.setParameter(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", TrigUtil.distance(from, to)));
            vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
        }
        // Some resetting is done in MovingListener.
        if (executeActions(vd)) {
            // Set-back + view direction of to (more smooth).
            return data.getSetBack(to);
View Full Code Here

    protected final void handleHoverViolation(final Player player, final Location loc, final MovingConfig cc, final MovingData data) {
        data.survivalFlyVL += cc.sfHoverViolation;

        // TODO: Extra options for set-back / kick, like vl?
        data.sfVLTime = System.currentTimeMillis();
        final ViolationData vd = new ViolationData(this, player, data.survivalFlyVL, cc.sfHoverViolation, cc.survivalFlyActions);
        if (vd.needsParameters()) {
            vd.setParameter(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", loc.getX(), loc.getY(), loc.getZ()));
            vd.setParameter(ParameterName.LOCATION_TO, "(HOVER)");
            vd.setParameter(ParameterName.DISTANCE, "0.0(HOVER)");
            vd.setParameter(ParameterName.TAGS, "hover");
        }
        if (executeActions(vd)) {
            // Set-back or kick.
            if (data.hasSetBack()) {
                final Location newTo = data.getSetBack(loc);
View Full Code Here

TOP

Related Classes of fr.neatmonster.nocheatplus.checks.ViolationData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.