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
363dae9f
Commit
363dae9f
authored
Apr 28, 2022
by
Yazawazi
Committed by
GitHub
Apr 28, 2022
Browse files
Next time I'll never use github.dev again
parent
9092c9b3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowAvatarListRsp.java
View file @
363dae9f
package
emu.grasscutter.server.packet.
recv
;
package
emu.grasscutter.server.packet.
send
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.UpdatePlayerShowAvatarListReqOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketUpdatePlayerShowAvatarListRsp
;
import
emu.grasscutter.net.proto.UpdatePlayerShowAvatarListRspOuterClass.UpdatePlayerShowAvatarListRsp
;
@Opcodes
(
PacketOpcodes
.
UpdatePlayerShowAvatarListReq
)
public
class
HandlerUpdatePlayerShowAvatarListReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
UpdatePlayerShowAvatarListReqOuterClass
.
UpdatePlayerShowAvatarListReq
req
=
UpdatePlayerShowAvatarListReqOuterClass
.
UpdatePlayerShowAvatarListReq
.
parseFrom
(
payload
);
import
java.util.List
;
session
.
getPlayer
().
setShowAvatars
(
req
.
getIsShowAvatar
());
session
.
getPlayer
().
setShowAvatarList
(
req
.
getShowAvatarIdListList
());
public
class
PacketUpdatePlayerShowAvatarListRsp
extends
BasePacket
{
session
.
send
(
new
PacketUpdatePlayerShowAvatarListRsp
(
req
.
getIsShowAvatar
(),
req
.
getShowAvatarIdListList
()));
public
PacketUpdatePlayerShowAvatarListRsp
(
boolean
isShowAvatar
,
List
<
Integer
>
avatarIds
)
{
super
(
PacketOpcodes
.
UpdatePlayerShowAvatarListRsp
);
UpdatePlayerShowAvatarListRsp
proto
=
UpdatePlayerShowAvatarListRsp
.
newBuilder
()
.
setIsShowAvatar
(
isShowAvatar
)
.
addAllShowAvatarIdList
(
avatarIds
)
.
setRetcode
(
0
)
.
build
();
this
.
setData
(
proto
);
}
}
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