Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
0144e55d
Commit
0144e55d
authored
Jun 26, 2022
by
zhaodice
Committed by
GitHub
Jun 25, 2022
Browse files
Lunch Support (#1373)
* PacketSetUpLunchBoxWidgetRsp * HandlerSetUpLunchBoxWidgetReq
parent
40dcde66
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerSetUpLunchBoxWidgetReq.java
0 → 100644
View file @
0144e55d
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
()));
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketSetUpLunchBoxWidgetRsp.java
0 → 100644
View file @
0144e55d
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
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment