Grasscutter/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarUpgradeRsp.java

28 lines
813 B
Java
Raw Normal View History

2022-04-17 12:43:07 +00:00
package emu.grasscutter.server.packet.send;
import java.util.Map;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
2022-04-17 12:43:07 +00:00
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarUpgradeRspOuterClass.AvatarUpgradeRsp;
public class PacketAvatarUpgradeRsp extends BasePacket {
2022-04-17 12:43:07 +00:00
public PacketAvatarUpgradeRsp(Avatar avatar, int oldLevel, Map<Integer, Float> oldFightPropMap) {
2022-04-17 12:43:07 +00:00
super(PacketOpcodes.AvatarUpgradeRsp);
this.buildHeader(0);
AvatarUpgradeRsp proto = AvatarUpgradeRsp.newBuilder()
.setAvatarGuid(avatar.getGuid())
.setOldLevel(oldLevel)
.setCurLevel(avatar.getLevel())
.putAllOldFightPropMap(oldFightPropMap)
.putAllCurFightPropMap(avatar.getFightProperties())
.build();
this.setData(proto);
}
}