Next time I'll never use github.dev again

This commit is contained in:
Yazawazi 2022-04-28 03:37:09 +08:00 committed by GitHub
parent 80aaa0d856
commit 6e73d4221d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,22 +1,22 @@
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.send;
import emu.grasscutter.Grasscutter; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.UpdatePlayerShowAvatarListReqOuterClass; import emu.grasscutter.net.proto.UpdatePlayerShowAvatarListRspOuterClass.UpdatePlayerShowAvatarListRsp;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketUpdatePlayerShowAvatarListRsp;
@Opcodes(PacketOpcodes.UpdatePlayerShowAvatarListReq) import java.util.List;
public class HandlerUpdatePlayerShowAvatarListReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
UpdatePlayerShowAvatarListReqOuterClass.UpdatePlayerShowAvatarListReq req = UpdatePlayerShowAvatarListReqOuterClass.UpdatePlayerShowAvatarListReq.parseFrom(payload);
session.getPlayer().setShowAvatars(req.getIsShowAvatar()); public class PacketUpdatePlayerShowAvatarListRsp extends BasePacket {
session.getPlayer().setShowAvatarList(req.getShowAvatarIdListList());
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);
} }
} }