Fix soft lock when talking to shop npcs

This commit is contained in:
Melledy 2023-09-26 23:54:19 -07:00
parent 7886c5f2b5
commit ee6c7d0296
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package emu.lunarcore.server.packet.recv;
import emu.lunarcore.proto.GetNpcTakenRewardCsReqOuterClass.GetNpcTakenRewardCsReq;
import emu.lunarcore.server.game.GameSession;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketGetNpcTakenRewardScRsp;
@Opcodes(CmdId.GetNpcTakenRewardCsReq)
public class HandlerGetNpcTakenRewardCsReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] data) throws Exception {
var req = GetNpcTakenRewardCsReq.parseFrom(data);
session.send(new PacketGetNpcTakenRewardScRsp(req.getNpcId()));
}
}

View File

@ -0,0 +1,17 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.proto.GetNpcTakenRewardScRspOuterClass.GetNpcTakenRewardScRsp;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
public class PacketGetNpcTakenRewardScRsp extends BasePacket {
public PacketGetNpcTakenRewardScRsp(int npcId) {
super(CmdId.GetNpcTakenRewardScRsp);
var data = GetNpcTakenRewardScRsp.newInstance()
.setNpcId(npcId);
this.setData(data);
}
}