From a74d5099c65b869119a9e5027d0076e15348b9e5 Mon Sep 17 00:00:00 2001 From: ItsNature Date: Mon, 21 Aug 2023 17:19:10 +0200 Subject: [PATCH] feat: new attack message field --- .../apollo/event/anticheat/ApolloPlayerAttackEvent.java | 2 ++ .../lunarclient/apollo/module/anticheat/AntiCheatImpl.java | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/lunarclient/apollo/event/anticheat/ApolloPlayerAttackEvent.java b/api/src/main/java/com/lunarclient/apollo/event/anticheat/ApolloPlayerAttackEvent.java index 34e485ba..4c4694c4 100644 --- a/api/src/main/java/com/lunarclient/apollo/event/anticheat/ApolloPlayerAttackEvent.java +++ b/api/src/main/java/com/lunarclient/apollo/event/anticheat/ApolloPlayerAttackEvent.java @@ -35,10 +35,12 @@ @Value public class ApolloPlayerAttackEvent implements Event { + // TODO: docs long instantiationTimeMs; PlayerInfo playerInfo; PlayerInfo attackerInfo; + double distance; } diff --git a/common/src/main/java/com/lunarclient/apollo/module/anticheat/AntiCheatImpl.java b/common/src/main/java/com/lunarclient/apollo/module/anticheat/AntiCheatImpl.java index a56de10b..82257fea 100644 --- a/common/src/main/java/com/lunarclient/apollo/module/anticheat/AntiCheatImpl.java +++ b/common/src/main/java/com/lunarclient/apollo/module/anticheat/AntiCheatImpl.java @@ -51,8 +51,9 @@ private void onReceivePacket(ApolloReceivePacketEvent event) { event.unpack(PlayerAttackMessage.class).ifPresent(packet -> { ApolloPlayerAttackEvent playerAttackEvent = new ApolloPlayerAttackEvent( NetworkTypes.fromProtobuf(packet.getPacketInfo().getInstantiationTime()), - NetworkTypes.fromProtobuf(packet.getPlayerInfo()), - NetworkTypes.fromProtobuf(packet.getAttackerInfo()) + NetworkTypes.fromProtobuf(packet.getTargetInfo()), + NetworkTypes.fromProtobuf(packet.getAttackerInfo()), + packet.getDistance() ); EventBus.EventResult result = EventBus.getBus().post(playerAttackEvent);