mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-23 10:44:36 +01:00
Fix talking to npcs soft locking the client
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.proto.GetFirstTalkByPerformanceNpcCsReqOuterClass.GetFirstTalkByPerformanceNpcCsReq;
|
||||
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.PacketGetFirstTalkByPerformanceNpcScRsp;
|
||||
|
||||
@Opcodes(CmdId.GetFirstTalkByPerformanceNpcCsReq)
|
||||
public class HandlerGetFirstTalkByPerformanceNpcCsReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] data) throws Exception {
|
||||
session.send(CmdId.GetFirstTalkByPerformanceNpcScRsp);
|
||||
var req = GetFirstTalkByPerformanceNpcCsReq.parseFrom(data);
|
||||
|
||||
session.send(new PacketGetFirstTalkByPerformanceNpcScRsp(req));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.GetFirstTalkByPerformanceNpcCsReqOuterClass.GetFirstTalkByPerformanceNpcCsReq;
|
||||
import emu.lunarcore.proto.GetFirstTalkByPerformanceNpcScRspOuterClass.GetFirstTalkByPerformanceNpcScRsp;
|
||||
import emu.lunarcore.proto.NpcTalkInfoOuterClass.NpcTalkInfo;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketGetFirstTalkByPerformanceNpcScRsp extends BasePacket {
|
||||
|
||||
public PacketGetFirstTalkByPerformanceNpcScRsp(GetFirstTalkByPerformanceNpcCsReq req) {
|
||||
super(CmdId.GetFirstTalkByPerformanceNpcScRsp);
|
||||
|
||||
var data = GetFirstTalkByPerformanceNpcScRsp.newInstance();
|
||||
|
||||
for (int id: req.getNpcTalkList()) {
|
||||
var info = NpcTalkInfo.newInstance()
|
||||
.setNpcTalkId(id);
|
||||
|
||||
data.addNpcTalkInfoList(info);
|
||||
}
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user