From 16a7c9dd67078a80f90206c37b1dbf27b73e94aa Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Sat, 23 Apr 2022 04:36:34 -0700 Subject: [PATCH] Revert "Drowning packets handled" --- Grasscutter-Protos | 2 +- .../recv/HandlerSceneEntityDrownReq.java | 41 ------------------- .../send/PacketSceneEntityDrownRsp.java | 20 --------- 3 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneEntityDrownReq.java delete mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDrownRsp.java diff --git a/Grasscutter-Protos b/Grasscutter-Protos index dd17415b7..0537e9cc4 160000 --- a/Grasscutter-Protos +++ b/Grasscutter-Protos @@ -1 +1 @@ -Subproject commit dd17415b71dfcff049e72dbe8a76173611f4b0ae +Subproject commit 0537e9cc4c7856a7c6f88bbbaa908a80c4ee677e diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneEntityDrownReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneEntityDrownReq.java deleted file mode 100644 index 005141958..000000000 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneEntityDrownReq.java +++ /dev/null @@ -1,41 +0,0 @@ -package emu.grasscutter.server.packet.recv; - -import emu.grasscutter.game.entity.GenshinEntity; -import emu.grasscutter.game.props.LifeState; -import emu.grasscutter.net.packet.Opcodes; -import emu.grasscutter.net.packet.PacketHandler; -import emu.grasscutter.net.packet.PacketOpcodes; -import emu.grasscutter.net.proto.SceneEntityDrownReqOuterClass.SceneEntityDrownReq; -import emu.grasscutter.net.proto.VisionTypeOuterClass; -import emu.grasscutter.server.game.GameSession; -import emu.grasscutter.server.packet.send.PacketLifeStateChangeNotify; -import emu.grasscutter.server.packet.send.PacketSceneEntityDrownRsp; - -@Opcodes(PacketOpcodes.SceneEntityDrownReq) -public class HandlerSceneEntityDrownReq extends PacketHandler { - - @Override - public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - SceneEntityDrownReq req = SceneEntityDrownReq.parseFrom(payload); - - - GenshinEntity entity = session.getPlayer().getScene().getEntityById(req.getEntityId()); - - - PacketLifeStateChangeNotify lifeStateChangeNotify = new PacketLifeStateChangeNotify(entity, entity, LifeState.LIFE_DEAD); - PacketSceneEntityDrownRsp drownRsp = new PacketSceneEntityDrownRsp(req.getEntityId()); - - - - //kill entity + broadcast it - - session.getPlayer().getScene().broadcastPacket(lifeStateChangeNotify); - session.getPlayer().getScene().broadcastPacket(drownRsp); - - //TODO: make a list somewhere of all entities to remove per tick rather than one by one - - session.getPlayer().getScene().removeEntity(entity, VisionTypeOuterClass.VisionType.VisionDie); - - } - -} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDrownRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDrownRsp.java deleted file mode 100644 index 4d3a2b232..000000000 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDrownRsp.java +++ /dev/null @@ -1,20 +0,0 @@ -package emu.grasscutter.server.packet.send; - -import emu.grasscutter.game.entity.GenshinEntity; -import emu.grasscutter.net.packet.GenshinPacket; -import emu.grasscutter.net.packet.PacketOpcodes; -import emu.grasscutter.net.proto.SceneEntityDrownRspOuterClass.SceneEntityDrownRsp; -import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType; - -public class PacketSceneEntityDrownRsp extends GenshinPacket { - - public PacketSceneEntityDrownRsp(int entityId) { - super(PacketOpcodes.SceneEntityDrownRsp); - - SceneEntityDrownRsp proto = new SceneEntityDrownRsp().toBuilder().setEntityId(entityId).build(); - - this.setData(proto); - } -} - -