Commit b3db933a authored by Melledy's avatar Melledy Committed by GitHub
Browse files

Merge pull request #41 from w4123/npctalk_patch

Try to implement NpcTalk packets
parents 105efe1d 716b6df2
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.NpcTalkReqOuterClass.NpcTalkReq;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketNpcTalkRsp;
@Opcodes(PacketOpcodes.NpcTalkReq)
public class HandlerNpcTalkReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
NpcTalkReq req = NpcTalkReq.parseFrom(payload);
session.send(new PacketNpcTalkRsp(req.getNpcEntityId(), req.getTalkId(), req.getEntityId()));
}
}
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.NpcTalkRspOuterClass.NpcTalkRsp;
public class PacketNpcTalkRsp extends GenshinPacket {
public PacketNpcTalkRsp(int npcEntityId, int curTalkId, int entityId) {
super(PacketOpcodes.NpcTalkRsp);
NpcTalkRsp p = NpcTalkRsp.newBuilder()
.setNpcEntityId(npcEntityId)
.setCurTalkId(curTalkId)
.setEntityId(entityId)
.build();
this.setData(p);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment