mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-30 11:49:24 +00:00
Lunch Support (#1373)
* PacketSetUpLunchBoxWidgetRsp * HandlerSetUpLunchBoxWidgetReq
This commit is contained in:
parent
7d709c3b18
commit
e32fcefcd9
@ -0,0 +1,19 @@
|
|||||||
|
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.SetUpLunchBoxWidgetReqOuterClass;
|
||||||
|
import emu.grasscutter.server.game.GameSession;
|
||||||
|
import emu.grasscutter.server.packet.send.PacketSetUpLunchBoxWidgetRsp;
|
||||||
|
|
||||||
|
@Opcodes(PacketOpcodes.SetUpLunchBoxWidgetReq)
|
||||||
|
public class HandlerSetUpLunchBoxWidgetReq extends PacketHandler {
|
||||||
|
@Override
|
||||||
|
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
|
var req
|
||||||
|
= SetUpLunchBoxWidgetReqOuterClass.SetUpLunchBoxWidgetReq.parseFrom(payload);
|
||||||
|
|
||||||
|
session.send(new PacketSetUpLunchBoxWidgetRsp(req.getLunchBoxData()));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package emu.grasscutter.server.packet.send;
|
||||||
|
|
||||||
|
import emu.grasscutter.net.packet.BasePacket;
|
||||||
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
|
import emu.grasscutter.net.proto.LunchBoxDataOuterClass;
|
||||||
|
import emu.grasscutter.net.proto.SetUpLunchBoxWidgetRspOuterClass;
|
||||||
|
|
||||||
|
public class PacketSetUpLunchBoxWidgetRsp extends BasePacket {
|
||||||
|
|
||||||
|
public PacketSetUpLunchBoxWidgetRsp(LunchBoxDataOuterClass.LunchBoxData lunchBoxData) {
|
||||||
|
super(PacketOpcodes.SetUpLunchBoxWidgetRsp);
|
||||||
|
var rsp
|
||||||
|
= SetUpLunchBoxWidgetRspOuterClass.SetUpLunchBoxWidgetRsp.newBuilder();
|
||||||
|
rsp.setLunchBoxData(lunchBoxData);
|
||||||
|
|
||||||
|
setData(rsp.build());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user