Class BoarPlayerManager<T>

java.lang.Object
java.util.AbstractMap<T,BoarPlayer>
java.util.HashMap<T,BoarPlayer>
ac.boar.anticheat.player.BoarPlayerManager<T>
All Implemented Interfaces:
Serializable, Cloneable, Map<T,BoarPlayer>

public abstract class BoarPlayerManager<T> extends HashMap<T,BoarPlayer>
See Also:
  • Constructor Details

    • BoarPlayerManager

      public BoarPlayerManager()
  • Method Details

    • add

      public BoarPlayer add(T session)
    • installHandlers

      protected void installHandlers(BoarPlayer player, io.netty.channel.Channel channel)
      Installs the handlers that feed packets into Boar. The default inserts the bidirectional packet capture and the batch-tail acknowledgment injector directly into the bedrock channel pipeline, just after the BedrockPacketCodec.

      A platform that already exposes its own packet-event stream can override this to bridge that stream into PacketEvents instead, so it doesn't run a second netty codec on the same channel.

    • shouldDisableMitigations

      protected boolean shouldDisableMitigations(T session)
      Decides whether the player being added starts with mitigations suppressed — checks still run and violations are still reported, but Boar won't cancel packets, correct blocks, rewind movement or kick. The default reads the global disable-mitigations config value, so every player gets the same arm.

      A platform that wants to split players (A/B testing corrections, per-rank exemptions, a staged rollout) can override this to decide per session. The value is only a starting point —

      invalid reference
      BoarPlayer#setDisableMitigations(boolean)
      can move a player between arms afterwards.
    • createNetworkSession

      protected abstract ac.boar.api.anticheat.model.NetworkSession createNetworkSession(T session)
    • getConnection

      protected abstract BoarConnection getConnection(T session)
    • getPlayerEntity

      protected abstract Entity getPlayerEntity(T session)
    • getMappingInfo

      protected abstract BlockMappingInfo getMappingInfo(T session)
    • createWorldAccessor

      protected abstract WorldAccessor createWorldAccessor(T session)
    • createEntityAccessor

      protected abstract EntityAccessor createEntityAccessor(T session)
    • createInventoryAccessor

      protected abstract InventoryAccessor createInventoryAccessor(T session)
    • createDefaultAttributes

      protected abstract Map<String,AttributeInstance> createDefaultAttributes()
    • createAckTransport

      protected abstract BoarAcknowledgmentTransport createAckTransport(BoarPlayer player)
    • beginTicking

      protected abstract ScheduledFuture<?> beginTicking(T session, Runnable ticker)