From 666b87636a5152417a8e7f585220f58f4374da7b Mon Sep 17 00:00:00 2001 From: hamusuke Date: Wed, 30 Aug 2023 01:18:07 +0900 Subject: [PATCH] just sync it! (#2318) --- .../recv/HandlerEvtAvatarEnterFocusNotify.java | 16 ++++++++++++++++ .../recv/HandlerEvtAvatarExitFocusNotify.java | 16 ++++++++++++++++ .../recv/HandlerEvtAvatarUpdateFocusNotify.java | 16 ++++++++++++++++ .../send/PacketEvtAvatarEnterFocusNotify.java | 13 +++++++++++++ .../send/PacketEvtAvatarExitFocusNotify.java | 13 +++++++++++++ .../send/PacketEvtAvatarUpdateFocusNotify.java | 13 +++++++++++++ 6 files changed, 87 insertions(+) create mode 100644 src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java create mode 100644 src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java create mode 100644 src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java create mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java create mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java create mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java new file mode 100644 index 000000000..8429e03d3 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java @@ -0,0 +1,16 @@ +package emu.grasscutter.server.packet.recv; + +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EvtAvatarEnterFocusNotifyOuterClass; +import emu.grasscutter.server.game.GameSession; +import emu.grasscutter.server.packet.send.PacketEvtAvatarEnterFocusNotify; + +@Opcodes(PacketOpcodes.EvtAvatarEnterFocusNotify) +public class HandlerEvtAvatarEnterFocusNotify extends PacketHandler { + @Override + public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { + session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtAvatarEnterFocusNotify(EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify.parseFrom(payload))); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java new file mode 100644 index 000000000..d5d6102be --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java @@ -0,0 +1,16 @@ +package emu.grasscutter.server.packet.recv; + +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EvtAvatarExitFocusNotifyOuterClass; +import emu.grasscutter.server.game.GameSession; +import emu.grasscutter.server.packet.send.PacketEvtAvatarExitFocusNotify; + +@Opcodes(PacketOpcodes.EvtAvatarExitFocusNotify) +public class HandlerEvtAvatarExitFocusNotify extends PacketHandler { + @Override + public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { + session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtAvatarExitFocusNotify(EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify.parseFrom(payload))); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java new file mode 100644 index 000000000..0bc55b5ed --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java @@ -0,0 +1,16 @@ +package emu.grasscutter.server.packet.recv; + +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EvtAvatarUpdateFocusNotifyOuterClass; +import emu.grasscutter.server.game.GameSession; +import emu.grasscutter.server.packet.send.PacketEvtAvatarUpdateFocusNotify; + +@Opcodes(PacketOpcodes.EvtAvatarUpdateFocusNotify) +public class HandlerEvtAvatarUpdateFocusNotify extends PacketHandler { + @Override + public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { + session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtAvatarUpdateFocusNotify(EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify.parseFrom(payload))); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java new file mode 100644 index 000000000..c348a9180 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java @@ -0,0 +1,13 @@ +package emu.grasscutter.server.packet.send; + +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EvtAvatarEnterFocusNotifyOuterClass; + +public class PacketEvtAvatarEnterFocusNotify extends BasePacket { + public PacketEvtAvatarEnterFocusNotify(EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify notify) { + super(PacketOpcodes.EvtAvatarEnterFocusNotify); + + this.setData(EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify.newBuilder(notify)); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java new file mode 100644 index 000000000..7b63b083e --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java @@ -0,0 +1,13 @@ +package emu.grasscutter.server.packet.send; + +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EvtAvatarExitFocusNotifyOuterClass; + +public class PacketEvtAvatarExitFocusNotify extends BasePacket { + public PacketEvtAvatarExitFocusNotify(EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify notify) { + super(PacketOpcodes.EvtAvatarExitFocusNotify); + + this.setData(EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify.newBuilder(notify)); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java new file mode 100644 index 000000000..667ab3d39 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java @@ -0,0 +1,13 @@ +package emu.grasscutter.server.packet.send; + +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EvtAvatarUpdateFocusNotifyOuterClass; + +public class PacketEvtAvatarUpdateFocusNotify extends BasePacket { + public PacketEvtAvatarUpdateFocusNotify(EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify notify) { + super(PacketOpcodes.EvtAvatarUpdateFocusNotify); + + this.setData(EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify.newBuilder(notify)); + } +}