From f97bc85400915ea8543e51371849af6586d5d48d Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Fri, 17 May 2024 07:36:55 -0700 Subject: [PATCH] Implement assist and display avatars Support list is not implemented yet --- .../DisplayAvatarDetailInfoOuterClass.java | 1076 +++++++++++++++++ .../proto/DisplayEquipmentInfoOuterClass.java | 579 +++++++++ .../proto/DisplayRelicInfoOuterClass.java | 695 +++++++++++ .../proto/PlayerDetailInfoOuterClass.java | 390 +++++- .../proto/SetAssistAvatarCsReqOuterClass.java | 382 ++++++ .../proto/SetAssistAvatarScRspOuterClass.java | 462 +++++++ .../SetDisplayAvatarCsReqOuterClass.java | 296 +++++ .../SetDisplayAvatarScRspOuterClass.java | 376 ++++++ .../lunarcore/database/DatabaseManager.java | 6 +- .../lunarcore/game/avatar/AvatarStorage.java | 112 +- .../emu/lunarcore/game/avatar/GameAvatar.java | 65 +- .../lunarcore/game/inventory/GameItem.java | 18 +- .../lunarcore/game/inventory/Inventory.java | 87 +- .../emu/lunarcore/game/player/Player.java | 114 ++ .../recv/HandlerSetAssistAvatarCsReq.java | 21 + .../recv/HandlerSetDisplayAvatarCsReq.java | 21 + .../send/PacketGetPlayerBoardDataScRsp.java | 27 +- .../send/PacketSetAssistAvatarScRsp.java | 24 + .../send/PacketSetDisplayAvatarScRsp.java | 32 + 19 files changed, 4671 insertions(+), 112 deletions(-) create mode 100644 src/generated/main/emu/lunarcore/proto/DisplayAvatarDetailInfoOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/DisplayEquipmentInfoOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/DisplayRelicInfoOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SetAssistAvatarCsReqOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SetAssistAvatarScRspOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SetDisplayAvatarCsReqOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SetDisplayAvatarScRspOuterClass.java create mode 100644 src/main/java/emu/lunarcore/server/packet/recv/HandlerSetAssistAvatarCsReq.java create mode 100644 src/main/java/emu/lunarcore/server/packet/recv/HandlerSetDisplayAvatarCsReq.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketSetAssistAvatarScRsp.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketSetDisplayAvatarScRsp.java diff --git a/src/generated/main/emu/lunarcore/proto/DisplayAvatarDetailInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/DisplayAvatarDetailInfoOuterClass.java new file mode 100644 index 0000000..0688a57 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DisplayAvatarDetailInfoOuterClass.java @@ -0,0 +1,1076 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedMessage; + +public final class DisplayAvatarDetailInfoOuterClass { + /** + * Protobuf type {@code DisplayAvatarDetailInfo} + */ + public static final class DisplayAvatarDetailInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 promotion = 4; + */ + private int promotion; + + /** + * optional uint32 rank = 5; + */ + private int rank; + + /** + * optional uint32 exp = 10; + */ + private int exp; + + /** + * optional uint32 avatar_id = 11; + */ + private int avatarId; + + /** + * optional uint32 level = 12; + */ + private int level; + + /** + * optional uint32 pos = 14; + */ + private int pos; + + /** + * optional uint32 dressed_skin_id = 15; + */ + private int dressedSkinId; + + /** + * optional .DisplayEquipmentInfo equipment = 2; + */ + private final DisplayEquipmentInfoOuterClass.DisplayEquipmentInfo equipment = DisplayEquipmentInfoOuterClass.DisplayEquipmentInfo.newInstance(); + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + */ + private final RepeatedMessage skilltreeList = RepeatedMessage.newEmptyInstance(AvatarSkillTreeOuterClass.AvatarSkillTree.getFactory()); + + /** + * repeated .DisplayRelicInfo relic_list = 8; + */ + private final RepeatedMessage relicList = RepeatedMessage.newEmptyInstance(DisplayRelicInfoOuterClass.DisplayRelicInfo.getFactory()); + + private DisplayAvatarDetailInfo() { + } + + /** + * @return a new empty instance of {@code DisplayAvatarDetailInfo} + */ + public static DisplayAvatarDetailInfo newInstance() { + return new DisplayAvatarDetailInfo(); + } + + /** + * optional uint32 promotion = 4; + * @return whether the promotion field is set + */ + public boolean hasPromotion() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 promotion = 4; + * @return this + */ + public DisplayAvatarDetailInfo clearPromotion() { + bitField0_ &= ~0x00000001; + promotion = 0; + return this; + } + + /** + * optional uint32 promotion = 4; + * @return the promotion + */ + public int getPromotion() { + return promotion; + } + + /** + * optional uint32 promotion = 4; + * @param value the promotion to set + * @return this + */ + public DisplayAvatarDetailInfo setPromotion(final int value) { + bitField0_ |= 0x00000001; + promotion = value; + return this; + } + + /** + * optional uint32 rank = 5; + * @return whether the rank field is set + */ + public boolean hasRank() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 rank = 5; + * @return this + */ + public DisplayAvatarDetailInfo clearRank() { + bitField0_ &= ~0x00000002; + rank = 0; + return this; + } + + /** + * optional uint32 rank = 5; + * @return the rank + */ + public int getRank() { + return rank; + } + + /** + * optional uint32 rank = 5; + * @param value the rank to set + * @return this + */ + public DisplayAvatarDetailInfo setRank(final int value) { + bitField0_ |= 0x00000002; + rank = value; + return this; + } + + /** + * optional uint32 exp = 10; + * @return whether the exp field is set + */ + public boolean hasExp() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 exp = 10; + * @return this + */ + public DisplayAvatarDetailInfo clearExp() { + bitField0_ &= ~0x00000004; + exp = 0; + return this; + } + + /** + * optional uint32 exp = 10; + * @return the exp + */ + public int getExp() { + return exp; + } + + /** + * optional uint32 exp = 10; + * @param value the exp to set + * @return this + */ + public DisplayAvatarDetailInfo setExp(final int value) { + bitField0_ |= 0x00000004; + exp = value; + return this; + } + + /** + * optional uint32 avatar_id = 11; + * @return whether the avatarId field is set + */ + public boolean hasAvatarId() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 avatar_id = 11; + * @return this + */ + public DisplayAvatarDetailInfo clearAvatarId() { + bitField0_ &= ~0x00000008; + avatarId = 0; + return this; + } + + /** + * optional uint32 avatar_id = 11; + * @return the avatarId + */ + public int getAvatarId() { + return avatarId; + } + + /** + * optional uint32 avatar_id = 11; + * @param value the avatarId to set + * @return this + */ + public DisplayAvatarDetailInfo setAvatarId(final int value) { + bitField0_ |= 0x00000008; + avatarId = value; + return this; + } + + /** + * optional uint32 level = 12; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 level = 12; + * @return this + */ + public DisplayAvatarDetailInfo clearLevel() { + bitField0_ &= ~0x00000010; + level = 0; + return this; + } + + /** + * optional uint32 level = 12; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 12; + * @param value the level to set + * @return this + */ + public DisplayAvatarDetailInfo setLevel(final int value) { + bitField0_ |= 0x00000010; + level = value; + return this; + } + + /** + * optional uint32 pos = 14; + * @return whether the pos field is set + */ + public boolean hasPos() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional uint32 pos = 14; + * @return this + */ + public DisplayAvatarDetailInfo clearPos() { + bitField0_ &= ~0x00000020; + pos = 0; + return this; + } + + /** + * optional uint32 pos = 14; + * @return the pos + */ + public int getPos() { + return pos; + } + + /** + * optional uint32 pos = 14; + * @param value the pos to set + * @return this + */ + public DisplayAvatarDetailInfo setPos(final int value) { + bitField0_ |= 0x00000020; + pos = value; + return this; + } + + /** + * optional uint32 dressed_skin_id = 15; + * @return whether the dressedSkinId field is set + */ + public boolean hasDressedSkinId() { + return (bitField0_ & 0x00000040) != 0; + } + + /** + * optional uint32 dressed_skin_id = 15; + * @return this + */ + public DisplayAvatarDetailInfo clearDressedSkinId() { + bitField0_ &= ~0x00000040; + dressedSkinId = 0; + return this; + } + + /** + * optional uint32 dressed_skin_id = 15; + * @return the dressedSkinId + */ + public int getDressedSkinId() { + return dressedSkinId; + } + + /** + * optional uint32 dressed_skin_id = 15; + * @param value the dressedSkinId to set + * @return this + */ + public DisplayAvatarDetailInfo setDressedSkinId(final int value) { + bitField0_ |= 0x00000040; + dressedSkinId = value; + return this; + } + + /** + * optional .DisplayEquipmentInfo equipment = 2; + * @return whether the equipment field is set + */ + public boolean hasEquipment() { + return (bitField0_ & 0x00000080) != 0; + } + + /** + * optional .DisplayEquipmentInfo equipment = 2; + * @return this + */ + public DisplayAvatarDetailInfo clearEquipment() { + bitField0_ &= ~0x00000080; + equipment.clear(); + return this; + } + + /** + * optional .DisplayEquipmentInfo equipment = 2; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableEquipment()} if you want to modify it. + * + * @return internal storage object for reading + */ + public DisplayEquipmentInfoOuterClass.DisplayEquipmentInfo getEquipment() { + return equipment; + } + + /** + * optional .DisplayEquipmentInfo equipment = 2; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public DisplayEquipmentInfoOuterClass.DisplayEquipmentInfo getMutableEquipment() { + bitField0_ |= 0x00000080; + return equipment; + } + + /** + * optional .DisplayEquipmentInfo equipment = 2; + * @param value the equipment to set + * @return this + */ + public DisplayAvatarDetailInfo setEquipment( + final DisplayEquipmentInfoOuterClass.DisplayEquipmentInfo value) { + bitField0_ |= 0x00000080; + equipment.copyFrom(value); + return this; + } + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + * @return whether the skilltreeList field is set + */ + public boolean hasSkilltreeList() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + * @return this + */ + public DisplayAvatarDetailInfo clearSkilltreeList() { + bitField0_ &= ~0x00000100; + skilltreeList.clear(); + return this; + } + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableSkilltreeList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getSkilltreeList() { + return skilltreeList; + } + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableSkilltreeList() { + bitField0_ |= 0x00000100; + return skilltreeList; + } + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + * @param value the skilltreeList to add + * @return this + */ + public DisplayAvatarDetailInfo addSkilltreeList( + final AvatarSkillTreeOuterClass.AvatarSkillTree value) { + bitField0_ |= 0x00000100; + skilltreeList.add(value); + return this; + } + + /** + * repeated .AvatarSkillTree skilltree_list = 6; + * @param values the skilltreeList to add + * @return this + */ + public DisplayAvatarDetailInfo addAllSkilltreeList( + final AvatarSkillTreeOuterClass.AvatarSkillTree... values) { + bitField0_ |= 0x00000100; + skilltreeList.addAll(values); + return this; + } + + /** + * repeated .DisplayRelicInfo relic_list = 8; + * @return whether the relicList field is set + */ + public boolean hasRelicList() { + return (bitField0_ & 0x00000200) != 0; + } + + /** + * repeated .DisplayRelicInfo relic_list = 8; + * @return this + */ + public DisplayAvatarDetailInfo clearRelicList() { + bitField0_ &= ~0x00000200; + relicList.clear(); + return this; + } + + /** + * repeated .DisplayRelicInfo relic_list = 8; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableRelicList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getRelicList() { + return relicList; + } + + /** + * repeated .DisplayRelicInfo relic_list = 8; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableRelicList() { + bitField0_ |= 0x00000200; + return relicList; + } + + /** + * repeated .DisplayRelicInfo relic_list = 8; + * @param value the relicList to add + * @return this + */ + public DisplayAvatarDetailInfo addRelicList( + final DisplayRelicInfoOuterClass.DisplayRelicInfo value) { + bitField0_ |= 0x00000200; + relicList.add(value); + return this; + } + + /** + * repeated .DisplayRelicInfo relic_list = 8; + * @param values the relicList to add + * @return this + */ + public DisplayAvatarDetailInfo addAllRelicList( + final DisplayRelicInfoOuterClass.DisplayRelicInfo... values) { + bitField0_ |= 0x00000200; + relicList.addAll(values); + return this; + } + + @Override + public DisplayAvatarDetailInfo copyFrom(final DisplayAvatarDetailInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + promotion = other.promotion; + rank = other.rank; + exp = other.exp; + avatarId = other.avatarId; + level = other.level; + pos = other.pos; + dressedSkinId = other.dressedSkinId; + equipment.copyFrom(other.equipment); + skilltreeList.copyFrom(other.skilltreeList); + relicList.copyFrom(other.relicList); + } + return this; + } + + @Override + public DisplayAvatarDetailInfo mergeFrom(final DisplayAvatarDetailInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasPromotion()) { + setPromotion(other.promotion); + } + if (other.hasRank()) { + setRank(other.rank); + } + if (other.hasExp()) { + setExp(other.exp); + } + if (other.hasAvatarId()) { + setAvatarId(other.avatarId); + } + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasPos()) { + setPos(other.pos); + } + if (other.hasDressedSkinId()) { + setDressedSkinId(other.dressedSkinId); + } + if (other.hasEquipment()) { + getMutableEquipment().mergeFrom(other.equipment); + } + if (other.hasSkilltreeList()) { + getMutableSkilltreeList().addAll(other.skilltreeList); + } + if (other.hasRelicList()) { + getMutableRelicList().addAll(other.relicList); + } + return this; + } + + @Override + public DisplayAvatarDetailInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + promotion = 0; + rank = 0; + exp = 0; + avatarId = 0; + level = 0; + pos = 0; + dressedSkinId = 0; + equipment.clear(); + skilltreeList.clear(); + relicList.clear(); + return this; + } + + @Override + public DisplayAvatarDetailInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + equipment.clearQuick(); + skilltreeList.clearQuick(); + relicList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof DisplayAvatarDetailInfo)) { + return false; + } + DisplayAvatarDetailInfo other = (DisplayAvatarDetailInfo) o; + return bitField0_ == other.bitField0_ + && (!hasPromotion() || promotion == other.promotion) + && (!hasRank() || rank == other.rank) + && (!hasExp() || exp == other.exp) + && (!hasAvatarId() || avatarId == other.avatarId) + && (!hasLevel() || level == other.level) + && (!hasPos() || pos == other.pos) + && (!hasDressedSkinId() || dressedSkinId == other.dressedSkinId) + && (!hasEquipment() || equipment.equals(other.equipment)) + && (!hasSkilltreeList() || skilltreeList.equals(other.skilltreeList)) + && (!hasRelicList() || relicList.equals(other.relicList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(promotion); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(rank); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(exp); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(avatarId); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(pos); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(dressedSkinId); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(equipment); + } + if ((bitField0_ & 0x00000100) != 0) { + for (int i = 0; i < skilltreeList.length(); i++) { + output.writeRawByte((byte) 50); + output.writeMessageNoTag(skilltreeList.get(i)); + } + } + if ((bitField0_ & 0x00000200) != 0) { + for (int i = 0; i < relicList.length(); i++) { + output.writeRawByte((byte) 66); + output.writeMessageNoTag(relicList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(promotion); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(rank); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(exp); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000020) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(pos); + } + if ((bitField0_ & 0x00000040) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dressedSkinId); + } + if ((bitField0_ & 0x00000080) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(equipment); + } + if ((bitField0_ & 0x00000100) != 0) { + size += (1 * skilltreeList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(skilltreeList); + } + if ((bitField0_ & 0x00000200) != 0) { + size += (1 * relicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(relicList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DisplayAvatarDetailInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 32: { + // promotion + promotion = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 40) { + break; + } + } + case 40: { + // rank + rank = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // exp + exp = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // avatarId + avatarId = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // pos + pos = input.readUInt32(); + bitField0_ |= 0x00000020; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // dressedSkinId + dressedSkinId = input.readUInt32(); + bitField0_ |= 0x00000040; + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // equipment + input.readMessage(equipment); + bitField0_ |= 0x00000080; + tag = input.readTag(); + if (tag != 50) { + break; + } + } + case 50: { + // skilltreeList + tag = input.readRepeatedMessage(skilltreeList, tag); + bitField0_ |= 0x00000100; + if (tag != 66) { + break; + } + } + case 66: { + // relicList + tag = input.readRepeatedMessage(relicList, tag); + bitField0_ |= 0x00000200; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.promotion, promotion); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.rank, rank); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.exp, exp); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.avatarId, avatarId); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeUInt32(FieldNames.pos, pos); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeUInt32(FieldNames.dressedSkinId, dressedSkinId); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeMessage(FieldNames.equipment, equipment); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRepeatedMessage(FieldNames.skilltreeList, skilltreeList); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeRepeatedMessage(FieldNames.relicList, relicList); + } + output.endObject(); + } + + @Override + public DisplayAvatarDetailInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -799212381: { + if (input.isAtField(FieldNames.promotion)) { + if (!input.trySkipNullValue()) { + promotion = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3492908: { + if (input.isAtField(FieldNames.rank)) { + if (!input.trySkipNullValue()) { + rank = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 100893: { + if (input.isAtField(FieldNames.exp)) { + if (!input.trySkipNullValue()) { + exp = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1787287636: + case -428636735: { + if (input.isAtField(FieldNames.avatarId)) { + if (!input.trySkipNullValue()) { + avatarId = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case 111188: { + if (input.isAtField(FieldNames.pos)) { + if (!input.trySkipNullValue()) { + pos = input.readUInt32(); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + case -407000018: + case 2012697844: { + if (input.isAtField(FieldNames.dressedSkinId)) { + if (!input.trySkipNullValue()) { + dressedSkinId = input.readUInt32(); + bitField0_ |= 0x00000040; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1076356494: { + if (input.isAtField(FieldNames.equipment)) { + if (!input.trySkipNullValue()) { + input.readMessage(equipment); + bitField0_ |= 0x00000080; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1549763245: + case 815647086: { + if (input.isAtField(FieldNames.skilltreeList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(skilltreeList); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } + case 204814001: + case 2071893482: { + if (input.isAtField(FieldNames.relicList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(relicList); + bitField0_ |= 0x00000200; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DisplayAvatarDetailInfo clone() { + return new DisplayAvatarDetailInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DisplayAvatarDetailInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DisplayAvatarDetailInfo(), data).checkInitialized(); + } + + public static DisplayAvatarDetailInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DisplayAvatarDetailInfo(), input).checkInitialized(); + } + + public static DisplayAvatarDetailInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DisplayAvatarDetailInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating DisplayAvatarDetailInfo messages + */ + public static MessageFactory getFactory() { + return DisplayAvatarDetailInfoFactory.INSTANCE; + } + + private enum DisplayAvatarDetailInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public DisplayAvatarDetailInfo create() { + return DisplayAvatarDetailInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName promotion = FieldName.forField("promotion"); + + static final FieldName rank = FieldName.forField("rank"); + + static final FieldName exp = FieldName.forField("exp"); + + static final FieldName avatarId = FieldName.forField("avatarId", "avatar_id"); + + static final FieldName level = FieldName.forField("level"); + + static final FieldName pos = FieldName.forField("pos"); + + static final FieldName dressedSkinId = FieldName.forField("dressedSkinId", "dressed_skin_id"); + + static final FieldName equipment = FieldName.forField("equipment"); + + static final FieldName skilltreeList = FieldName.forField("skilltreeList", "skilltree_list"); + + static final FieldName relicList = FieldName.forField("relicList", "relic_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DisplayEquipmentInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/DisplayEquipmentInfoOuterClass.java new file mode 100644 index 0000000..b9911ed --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DisplayEquipmentInfoOuterClass.java @@ -0,0 +1,579 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class DisplayEquipmentInfoOuterClass { + /** + * Protobuf type {@code DisplayEquipmentInfo} + */ + public static final class DisplayEquipmentInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 promotion = 1; + */ + private int promotion; + + /** + * optional uint32 rank = 2; + */ + private int rank; + + /** + * optional uint32 tid = 8; + */ + private int tid; + + /** + * optional uint32 level = 12; + */ + private int level; + + /** + * optional uint32 exp = 13; + */ + private int exp; + + private DisplayEquipmentInfo() { + } + + /** + * @return a new empty instance of {@code DisplayEquipmentInfo} + */ + public static DisplayEquipmentInfo newInstance() { + return new DisplayEquipmentInfo(); + } + + /** + * optional uint32 promotion = 1; + * @return whether the promotion field is set + */ + public boolean hasPromotion() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 promotion = 1; + * @return this + */ + public DisplayEquipmentInfo clearPromotion() { + bitField0_ &= ~0x00000001; + promotion = 0; + return this; + } + + /** + * optional uint32 promotion = 1; + * @return the promotion + */ + public int getPromotion() { + return promotion; + } + + /** + * optional uint32 promotion = 1; + * @param value the promotion to set + * @return this + */ + public DisplayEquipmentInfo setPromotion(final int value) { + bitField0_ |= 0x00000001; + promotion = value; + return this; + } + + /** + * optional uint32 rank = 2; + * @return whether the rank field is set + */ + public boolean hasRank() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 rank = 2; + * @return this + */ + public DisplayEquipmentInfo clearRank() { + bitField0_ &= ~0x00000002; + rank = 0; + return this; + } + + /** + * optional uint32 rank = 2; + * @return the rank + */ + public int getRank() { + return rank; + } + + /** + * optional uint32 rank = 2; + * @param value the rank to set + * @return this + */ + public DisplayEquipmentInfo setRank(final int value) { + bitField0_ |= 0x00000002; + rank = value; + return this; + } + + /** + * optional uint32 tid = 8; + * @return whether the tid field is set + */ + public boolean hasTid() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 tid = 8; + * @return this + */ + public DisplayEquipmentInfo clearTid() { + bitField0_ &= ~0x00000004; + tid = 0; + return this; + } + + /** + * optional uint32 tid = 8; + * @return the tid + */ + public int getTid() { + return tid; + } + + /** + * optional uint32 tid = 8; + * @param value the tid to set + * @return this + */ + public DisplayEquipmentInfo setTid(final int value) { + bitField0_ |= 0x00000004; + tid = value; + return this; + } + + /** + * optional uint32 level = 12; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 level = 12; + * @return this + */ + public DisplayEquipmentInfo clearLevel() { + bitField0_ &= ~0x00000008; + level = 0; + return this; + } + + /** + * optional uint32 level = 12; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 12; + * @param value the level to set + * @return this + */ + public DisplayEquipmentInfo setLevel(final int value) { + bitField0_ |= 0x00000008; + level = value; + return this; + } + + /** + * optional uint32 exp = 13; + * @return whether the exp field is set + */ + public boolean hasExp() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 exp = 13; + * @return this + */ + public DisplayEquipmentInfo clearExp() { + bitField0_ &= ~0x00000010; + exp = 0; + return this; + } + + /** + * optional uint32 exp = 13; + * @return the exp + */ + public int getExp() { + return exp; + } + + /** + * optional uint32 exp = 13; + * @param value the exp to set + * @return this + */ + public DisplayEquipmentInfo setExp(final int value) { + bitField0_ |= 0x00000010; + exp = value; + return this; + } + + @Override + public DisplayEquipmentInfo copyFrom(final DisplayEquipmentInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + promotion = other.promotion; + rank = other.rank; + tid = other.tid; + level = other.level; + exp = other.exp; + } + return this; + } + + @Override + public DisplayEquipmentInfo mergeFrom(final DisplayEquipmentInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasPromotion()) { + setPromotion(other.promotion); + } + if (other.hasRank()) { + setRank(other.rank); + } + if (other.hasTid()) { + setTid(other.tid); + } + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasExp()) { + setExp(other.exp); + } + return this; + } + + @Override + public DisplayEquipmentInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + promotion = 0; + rank = 0; + tid = 0; + level = 0; + exp = 0; + return this; + } + + @Override + public DisplayEquipmentInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof DisplayEquipmentInfo)) { + return false; + } + DisplayEquipmentInfo other = (DisplayEquipmentInfo) o; + return bitField0_ == other.bitField0_ + && (!hasPromotion() || promotion == other.promotion) + && (!hasRank() || rank == other.rank) + && (!hasTid() || tid == other.tid) + && (!hasLevel() || level == other.level) + && (!hasExp() || exp == other.exp); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(promotion); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(rank); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(tid); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(exp); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(promotion); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(rank); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(tid); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(exp); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DisplayEquipmentInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // promotion + promotion = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 16) { + break; + } + } + case 16: { + // rank + rank = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // tid + tid = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // exp + exp = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.promotion, promotion); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.rank, rank); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.tid, tid); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt32(FieldNames.exp, exp); + } + output.endObject(); + } + + @Override + public DisplayEquipmentInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -799212381: { + if (input.isAtField(FieldNames.promotion)) { + if (!input.trySkipNullValue()) { + promotion = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3492908: { + if (input.isAtField(FieldNames.rank)) { + if (!input.trySkipNullValue()) { + rank = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 114831: { + if (input.isAtField(FieldNames.tid)) { + if (!input.trySkipNullValue()) { + tid = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 100893: { + if (input.isAtField(FieldNames.exp)) { + if (!input.trySkipNullValue()) { + exp = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DisplayEquipmentInfo clone() { + return new DisplayEquipmentInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DisplayEquipmentInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DisplayEquipmentInfo(), data).checkInitialized(); + } + + public static DisplayEquipmentInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DisplayEquipmentInfo(), input).checkInitialized(); + } + + public static DisplayEquipmentInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DisplayEquipmentInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating DisplayEquipmentInfo messages + */ + public static MessageFactory getFactory() { + return DisplayEquipmentInfoFactory.INSTANCE; + } + + private enum DisplayEquipmentInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public DisplayEquipmentInfo create() { + return DisplayEquipmentInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName promotion = FieldName.forField("promotion"); + + static final FieldName rank = FieldName.forField("rank"); + + static final FieldName tid = FieldName.forField("tid"); + + static final FieldName level = FieldName.forField("level"); + + static final FieldName exp = FieldName.forField("exp"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DisplayRelicInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/DisplayRelicInfoOuterClass.java new file mode 100644 index 0000000..f14ab04 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DisplayRelicInfoOuterClass.java @@ -0,0 +1,695 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedMessage; + +public final class DisplayRelicInfoOuterClass { + /** + * Protobuf type {@code DisplayRelicInfo} + */ + public static final class DisplayRelicInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 exp = 1; + */ + private int exp; + + /** + * optional uint32 slot = 2; + */ + private int slot; + + /** + * optional uint32 main_affix_id = 6; + */ + private int mainAffixId; + + /** + * optional uint32 tid = 8; + */ + private int tid; + + /** + * optional uint32 level = 15; + */ + private int level; + + /** + * repeated .RelicAffix sub_affix_list = 14; + */ + private final RepeatedMessage subAffixList = RepeatedMessage.newEmptyInstance(RelicAffixOuterClass.RelicAffix.getFactory()); + + private DisplayRelicInfo() { + } + + /** + * @return a new empty instance of {@code DisplayRelicInfo} + */ + public static DisplayRelicInfo newInstance() { + return new DisplayRelicInfo(); + } + + /** + * optional uint32 exp = 1; + * @return whether the exp field is set + */ + public boolean hasExp() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 exp = 1; + * @return this + */ + public DisplayRelicInfo clearExp() { + bitField0_ &= ~0x00000001; + exp = 0; + return this; + } + + /** + * optional uint32 exp = 1; + * @return the exp + */ + public int getExp() { + return exp; + } + + /** + * optional uint32 exp = 1; + * @param value the exp to set + * @return this + */ + public DisplayRelicInfo setExp(final int value) { + bitField0_ |= 0x00000001; + exp = value; + return this; + } + + /** + * optional uint32 slot = 2; + * @return whether the slot field is set + */ + public boolean hasSlot() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 slot = 2; + * @return this + */ + public DisplayRelicInfo clearSlot() { + bitField0_ &= ~0x00000002; + slot = 0; + return this; + } + + /** + * optional uint32 slot = 2; + * @return the slot + */ + public int getSlot() { + return slot; + } + + /** + * optional uint32 slot = 2; + * @param value the slot to set + * @return this + */ + public DisplayRelicInfo setSlot(final int value) { + bitField0_ |= 0x00000002; + slot = value; + return this; + } + + /** + * optional uint32 main_affix_id = 6; + * @return whether the mainAffixId field is set + */ + public boolean hasMainAffixId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 main_affix_id = 6; + * @return this + */ + public DisplayRelicInfo clearMainAffixId() { + bitField0_ &= ~0x00000004; + mainAffixId = 0; + return this; + } + + /** + * optional uint32 main_affix_id = 6; + * @return the mainAffixId + */ + public int getMainAffixId() { + return mainAffixId; + } + + /** + * optional uint32 main_affix_id = 6; + * @param value the mainAffixId to set + * @return this + */ + public DisplayRelicInfo setMainAffixId(final int value) { + bitField0_ |= 0x00000004; + mainAffixId = value; + return this; + } + + /** + * optional uint32 tid = 8; + * @return whether the tid field is set + */ + public boolean hasTid() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 tid = 8; + * @return this + */ + public DisplayRelicInfo clearTid() { + bitField0_ &= ~0x00000008; + tid = 0; + return this; + } + + /** + * optional uint32 tid = 8; + * @return the tid + */ + public int getTid() { + return tid; + } + + /** + * optional uint32 tid = 8; + * @param value the tid to set + * @return this + */ + public DisplayRelicInfo setTid(final int value) { + bitField0_ |= 0x00000008; + tid = value; + return this; + } + + /** + * optional uint32 level = 15; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 level = 15; + * @return this + */ + public DisplayRelicInfo clearLevel() { + bitField0_ &= ~0x00000010; + level = 0; + return this; + } + + /** + * optional uint32 level = 15; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 15; + * @param value the level to set + * @return this + */ + public DisplayRelicInfo setLevel(final int value) { + bitField0_ |= 0x00000010; + level = value; + return this; + } + + /** + * repeated .RelicAffix sub_affix_list = 14; + * @return whether the subAffixList field is set + */ + public boolean hasSubAffixList() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * repeated .RelicAffix sub_affix_list = 14; + * @return this + */ + public DisplayRelicInfo clearSubAffixList() { + bitField0_ &= ~0x00000020; + subAffixList.clear(); + return this; + } + + /** + * repeated .RelicAffix sub_affix_list = 14; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableSubAffixList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getSubAffixList() { + return subAffixList; + } + + /** + * repeated .RelicAffix sub_affix_list = 14; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableSubAffixList() { + bitField0_ |= 0x00000020; + return subAffixList; + } + + /** + * repeated .RelicAffix sub_affix_list = 14; + * @param value the subAffixList to add + * @return this + */ + public DisplayRelicInfo addSubAffixList(final RelicAffixOuterClass.RelicAffix value) { + bitField0_ |= 0x00000020; + subAffixList.add(value); + return this; + } + + /** + * repeated .RelicAffix sub_affix_list = 14; + * @param values the subAffixList to add + * @return this + */ + public DisplayRelicInfo addAllSubAffixList(final RelicAffixOuterClass.RelicAffix... values) { + bitField0_ |= 0x00000020; + subAffixList.addAll(values); + return this; + } + + @Override + public DisplayRelicInfo copyFrom(final DisplayRelicInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + exp = other.exp; + slot = other.slot; + mainAffixId = other.mainAffixId; + tid = other.tid; + level = other.level; + subAffixList.copyFrom(other.subAffixList); + } + return this; + } + + @Override + public DisplayRelicInfo mergeFrom(final DisplayRelicInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasExp()) { + setExp(other.exp); + } + if (other.hasSlot()) { + setSlot(other.slot); + } + if (other.hasMainAffixId()) { + setMainAffixId(other.mainAffixId); + } + if (other.hasTid()) { + setTid(other.tid); + } + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasSubAffixList()) { + getMutableSubAffixList().addAll(other.subAffixList); + } + return this; + } + + @Override + public DisplayRelicInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + exp = 0; + slot = 0; + mainAffixId = 0; + tid = 0; + level = 0; + subAffixList.clear(); + return this; + } + + @Override + public DisplayRelicInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + subAffixList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof DisplayRelicInfo)) { + return false; + } + DisplayRelicInfo other = (DisplayRelicInfo) o; + return bitField0_ == other.bitField0_ + && (!hasExp() || exp == other.exp) + && (!hasSlot() || slot == other.slot) + && (!hasMainAffixId() || mainAffixId == other.mainAffixId) + && (!hasTid() || tid == other.tid) + && (!hasLevel() || level == other.level) + && (!hasSubAffixList() || subAffixList.equals(other.subAffixList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(exp); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(slot); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(mainAffixId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(tid); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000020) != 0) { + for (int i = 0; i < subAffixList.length(); i++) { + output.writeRawByte((byte) 114); + output.writeMessageNoTag(subAffixList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(exp); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(slot); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(mainAffixId); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(tid); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000020) != 0) { + size += (1 * subAffixList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(subAffixList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DisplayRelicInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // exp + exp = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 16) { + break; + } + } + case 16: { + // slot + slot = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 48) { + break; + } + } + case 48: { + // mainAffixId + mainAffixId = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // tid + tid = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 114) { + break; + } + } + case 114: { + // subAffixList + tag = input.readRepeatedMessage(subAffixList, tag); + bitField0_ |= 0x00000020; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.exp, exp); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.slot, slot); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.mainAffixId, mainAffixId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.tid, tid); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRepeatedMessage(FieldNames.subAffixList, subAffixList); + } + output.endObject(); + } + + @Override + public DisplayRelicInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 100893: { + if (input.isAtField(FieldNames.exp)) { + if (!input.trySkipNullValue()) { + exp = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3533310: { + if (input.isAtField(FieldNames.slot)) { + if (!input.trySkipNullValue()) { + slot = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1973876974: + case -1426712144: { + if (input.isAtField(FieldNames.mainAffixId)) { + if (!input.trySkipNullValue()) { + mainAffixId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 114831: { + if (input.isAtField(FieldNames.tid)) { + if (!input.trySkipNullValue()) { + tid = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case -600836050: + case 919890188: { + if (input.isAtField(FieldNames.subAffixList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(subAffixList); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DisplayRelicInfo clone() { + return new DisplayRelicInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DisplayRelicInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DisplayRelicInfo(), data).checkInitialized(); + } + + public static DisplayRelicInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DisplayRelicInfo(), input).checkInitialized(); + } + + public static DisplayRelicInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DisplayRelicInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating DisplayRelicInfo messages + */ + public static MessageFactory getFactory() { + return DisplayRelicInfoFactory.INSTANCE; + } + + private enum DisplayRelicInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public DisplayRelicInfo create() { + return DisplayRelicInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName exp = FieldName.forField("exp"); + + static final FieldName slot = FieldName.forField("slot"); + + static final FieldName mainAffixId = FieldName.forField("mainAffixId", "main_affix_id"); + + static final FieldName tid = FieldName.forField("tid"); + + static final FieldName level = FieldName.forField("level"); + + static final FieldName subAffixList = FieldName.forField("subAffixList", "sub_affix_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java index 7695c7c..db8b9ca 100644 --- a/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java @@ -10,6 +10,7 @@ import us.hebi.quickbuf.MessageFactory; import us.hebi.quickbuf.ProtoMessage; import us.hebi.quickbuf.ProtoSink; import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedMessage; import us.hebi.quickbuf.Utf8String; public final class PlayerDetailInfoOuterClass { @@ -44,6 +45,11 @@ public final class PlayerDetailInfoOuterClass { */ private int platformType; + /** + * optional bool show_display_avatars = 14; + */ + private boolean showDisplayAvatars; + /** * optional .PlayerRecordInfo record_info = 7; */ @@ -64,6 +70,16 @@ public final class PlayerDetailInfoOuterClass { */ private final Utf8String nickname = Utf8String.newEmptyInstance(); + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + */ + private final RepeatedMessage displayAvatarList = RepeatedMessage.newEmptyInstance(DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo.getFactory()); + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + */ + private final RepeatedMessage assistAvatarList = RepeatedMessage.newEmptyInstance(DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo.getFactory()); + private PlayerDetailInfo() { } @@ -284,12 +300,49 @@ public final class PlayerDetailInfoOuterClass { return this; } + /** + * optional bool show_display_avatars = 14; + * @return whether the showDisplayAvatars field is set + */ + public boolean hasShowDisplayAvatars() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional bool show_display_avatars = 14; + * @return this + */ + public PlayerDetailInfo clearShowDisplayAvatars() { + bitField0_ &= ~0x00000020; + showDisplayAvatars = false; + return this; + } + + /** + * optional bool show_display_avatars = 14; + * @return the showDisplayAvatars + */ + public boolean getShowDisplayAvatars() { + return showDisplayAvatars; + } + + /** + * optional bool show_display_avatars = 14; + * @param value the showDisplayAvatars to set + * @return this + */ + public PlayerDetailInfo setShowDisplayAvatars(final boolean value) { + bitField0_ |= 0x00000020; + showDisplayAvatars = value; + return this; + } + /** * optional .PlayerRecordInfo record_info = 7; * @return whether the recordInfo field is set */ public boolean hasRecordInfo() { - return (bitField0_ & 0x00000020) != 0; + return (bitField0_ & 0x00000040) != 0; } /** @@ -297,7 +350,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo clearRecordInfo() { - bitField0_ &= ~0x00000020; + bitField0_ &= ~0x00000040; recordInfo.clear(); return this; } @@ -326,7 +379,7 @@ public final class PlayerDetailInfoOuterClass { * @return internal storage object for modifications */ public PlayerRecordInfoOuterClass.PlayerRecordInfo getMutableRecordInfo() { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; return recordInfo; } @@ -336,7 +389,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo setRecordInfo(final PlayerRecordInfoOuterClass.PlayerRecordInfo value) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; recordInfo.copyFrom(value); return this; } @@ -346,7 +399,7 @@ public final class PlayerDetailInfoOuterClass { * @return whether the displaySettings field is set */ public boolean hasDisplaySettings() { - return (bitField0_ & 0x00000040) != 0; + return (bitField0_ & 0x00000080) != 0; } /** @@ -354,7 +407,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo clearDisplaySettings() { - bitField0_ &= ~0x00000040; + bitField0_ &= ~0x00000080; displaySettings.clear(); return this; } @@ -383,7 +436,7 @@ public final class PlayerDetailInfoOuterClass { * @return internal storage object for modifications */ public PlayerDisplaySettingsOuterClass.PlayerDisplaySettings getMutableDisplaySettings() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; return displaySettings; } @@ -394,7 +447,7 @@ public final class PlayerDetailInfoOuterClass { */ public PlayerDetailInfo setDisplaySettings( final PlayerDisplaySettingsOuterClass.PlayerDisplaySettings value) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; displaySettings.copyFrom(value); return this; } @@ -404,7 +457,7 @@ public final class PlayerDetailInfoOuterClass { * @return whether the signature field is set */ public boolean hasSignature() { - return (bitField0_ & 0x00000080) != 0; + return (bitField0_ & 0x00000100) != 0; } /** @@ -412,7 +465,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo clearSignature() { - bitField0_ &= ~0x00000080; + bitField0_ &= ~0x00000100; signature.clear(); return this; } @@ -438,7 +491,7 @@ public final class PlayerDetailInfoOuterClass { * @return internal {@code Utf8String} representation of signature for modifications */ public Utf8String getMutableSignatureBytes() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; return this.signature; } @@ -448,7 +501,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo setSignature(final CharSequence value) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; signature.copyFrom(value); return this; } @@ -459,7 +512,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo setSignature(final Utf8String value) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; signature.copyFrom(value); return this; } @@ -469,7 +522,7 @@ public final class PlayerDetailInfoOuterClass { * @return whether the nickname field is set */ public boolean hasNickname() { - return (bitField0_ & 0x00000100) != 0; + return (bitField0_ & 0x00000200) != 0; } /** @@ -477,7 +530,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo clearNickname() { - bitField0_ &= ~0x00000100; + bitField0_ &= ~0x00000200; nickname.clear(); return this; } @@ -503,7 +556,7 @@ public final class PlayerDetailInfoOuterClass { * @return internal {@code Utf8String} representation of nickname for modifications */ public Utf8String getMutableNicknameBytes() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; return this.nickname; } @@ -513,7 +566,7 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo setNickname(final CharSequence value) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; nickname.copyFrom(value); return this; } @@ -524,11 +577,155 @@ public final class PlayerDetailInfoOuterClass { * @return this */ public PlayerDetailInfo setNickname(final Utf8String value) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; nickname.copyFrom(value); return this; } + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + * @return whether the displayAvatarList field is set + */ + public boolean hasDisplayAvatarList() { + return (bitField0_ & 0x00000400) != 0; + } + + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + * @return this + */ + public PlayerDetailInfo clearDisplayAvatarList() { + bitField0_ &= ~0x00000400; + displayAvatarList.clear(); + return this; + } + + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableDisplayAvatarList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDisplayAvatarList( + ) { + return displayAvatarList; + } + + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableDisplayAvatarList( + ) { + bitField0_ |= 0x00000400; + return displayAvatarList; + } + + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + * @param value the displayAvatarList to add + * @return this + */ + public PlayerDetailInfo addDisplayAvatarList( + final DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo value) { + bitField0_ |= 0x00000400; + displayAvatarList.add(value); + return this; + } + + /** + * repeated .DisplayAvatarDetailInfo display_avatar_list = 13; + * @param values the displayAvatarList to add + * @return this + */ + public PlayerDetailInfo addAllDisplayAvatarList( + final DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo... values) { + bitField0_ |= 0x00000400; + displayAvatarList.addAll(values); + return this; + } + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + * @return whether the assistAvatarList field is set + */ + public boolean hasAssistAvatarList() { + return (bitField0_ & 0x00000800) != 0; + } + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + * @return this + */ + public PlayerDetailInfo clearAssistAvatarList() { + bitField0_ &= ~0x00000800; + assistAvatarList.clear(); + return this; + } + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableAssistAvatarList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getAssistAvatarList( + ) { + return assistAvatarList; + } + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableAssistAvatarList( + ) { + bitField0_ |= 0x00000800; + return assistAvatarList; + } + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + * @param value the assistAvatarList to add + * @return this + */ + public PlayerDetailInfo addAssistAvatarList( + final DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo value) { + bitField0_ |= 0x00000800; + assistAvatarList.add(value); + return this; + } + + /** + * repeated .DisplayAvatarDetailInfo assist_avatar_list = 425; + * @param values the assistAvatarList to add + * @return this + */ + public PlayerDetailInfo addAllAssistAvatarList( + final DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo... values) { + bitField0_ |= 0x00000800; + assistAvatarList.addAll(values); + return this; + } + @Override public PlayerDetailInfo copyFrom(final PlayerDetailInfo other) { cachedSize = other.cachedSize; @@ -539,10 +736,13 @@ public final class PlayerDetailInfoOuterClass { worldLevel = other.worldLevel; level = other.level; platformType = other.platformType; + showDisplayAvatars = other.showDisplayAvatars; recordInfo.copyFrom(other.recordInfo); displaySettings.copyFrom(other.displaySettings); signature.copyFrom(other.signature); nickname.copyFrom(other.nickname); + displayAvatarList.copyFrom(other.displayAvatarList); + assistAvatarList.copyFrom(other.assistAvatarList); } return this; } @@ -568,6 +768,9 @@ public final class PlayerDetailInfoOuterClass { if (other.hasPlatformType()) { setPlatformTypeValue(other.platformType); } + if (other.hasShowDisplayAvatars()) { + setShowDisplayAvatars(other.showDisplayAvatars); + } if (other.hasRecordInfo()) { getMutableRecordInfo().mergeFrom(other.recordInfo); } @@ -580,6 +783,12 @@ public final class PlayerDetailInfoOuterClass { if (other.hasNickname()) { getMutableNicknameBytes().copyFrom(other.nickname); } + if (other.hasDisplayAvatarList()) { + getMutableDisplayAvatarList().addAll(other.displayAvatarList); + } + if (other.hasAssistAvatarList()) { + getMutableAssistAvatarList().addAll(other.assistAvatarList); + } return this; } @@ -595,10 +804,13 @@ public final class PlayerDetailInfoOuterClass { worldLevel = 0; level = 0; platformType = 0; + showDisplayAvatars = false; recordInfo.clear(); displaySettings.clear(); signature.clear(); nickname.clear(); + displayAvatarList.clear(); + assistAvatarList.clear(); return this; } @@ -613,6 +825,8 @@ public final class PlayerDetailInfoOuterClass { displaySettings.clearQuick(); signature.clear(); nickname.clear(); + displayAvatarList.clearQuick(); + assistAvatarList.clearQuick(); return this; } @@ -631,10 +845,13 @@ public final class PlayerDetailInfoOuterClass { && (!hasWorldLevel() || worldLevel == other.worldLevel) && (!hasLevel() || level == other.level) && (!hasPlatformType() || platformType == other.platformType) + && (!hasShowDisplayAvatars() || showDisplayAvatars == other.showDisplayAvatars) && (!hasRecordInfo() || recordInfo.equals(other.recordInfo)) && (!hasDisplaySettings() || displaySettings.equals(other.displaySettings)) && (!hasSignature() || signature.equals(other.signature)) - && (!hasNickname() || nickname.equals(other.nickname)); + && (!hasNickname() || nickname.equals(other.nickname)) + && (!hasDisplayAvatarList() || displayAvatarList.equals(other.displayAvatarList)) + && (!hasAssistAvatarList() || assistAvatarList.equals(other.assistAvatarList)); } @Override @@ -660,21 +877,37 @@ public final class PlayerDetailInfoOuterClass { output.writeEnumNoTag(platformType); } if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 112); + output.writeBoolNoTag(showDisplayAvatars); + } + if ((bitField0_ & 0x00000040) != 0) { output.writeRawByte((byte) 58); output.writeMessageNoTag(recordInfo); } - if ((bitField0_ & 0x00000040) != 0) { + if ((bitField0_ & 0x00000080) != 0) { output.writeRawLittleEndian16((short) 12202); output.writeMessageNoTag(displaySettings); } - if ((bitField0_ & 0x00000080) != 0) { + if ((bitField0_ & 0x00000100) != 0) { output.writeRawByte((byte) 26); output.writeStringNoTag(signature); } - if ((bitField0_ & 0x00000100) != 0) { + if ((bitField0_ & 0x00000200) != 0) { output.writeRawByte((byte) 34); output.writeStringNoTag(nickname); } + if ((bitField0_ & 0x00000400) != 0) { + for (int i = 0; i < displayAvatarList.length(); i++) { + output.writeRawByte((byte) 106); + output.writeMessageNoTag(displayAvatarList.get(i)); + } + } + if ((bitField0_ & 0x00000800) != 0) { + for (int i = 0; i < assistAvatarList.length(); i++) { + output.writeRawLittleEndian16((short) 6858); + output.writeMessageNoTag(assistAvatarList.get(i)); + } + } } @Override @@ -696,17 +929,26 @@ public final class PlayerDetailInfoOuterClass { size += 1 + ProtoSink.computeEnumSizeNoTag(platformType); } if ((bitField0_ & 0x00000020) != 0) { - size += 1 + ProtoSink.computeMessageSizeNoTag(recordInfo); + size += 2; } if ((bitField0_ & 0x00000040) != 0) { - size += 2 + ProtoSink.computeMessageSizeNoTag(displaySettings); + size += 1 + ProtoSink.computeMessageSizeNoTag(recordInfo); } if ((bitField0_ & 0x00000080) != 0) { - size += 1 + ProtoSink.computeStringSizeNoTag(signature); + size += 2 + ProtoSink.computeMessageSizeNoTag(displaySettings); } if ((bitField0_ & 0x00000100) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(signature); + } + if ((bitField0_ & 0x00000200) != 0) { size += 1 + ProtoSink.computeStringSizeNoTag(nickname); } + if ((bitField0_ & 0x00000400) != 0) { + size += (1 * displayAvatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(displayAvatarList); + } + if ((bitField0_ & 0x00000800) != 0) { + size += (2 * assistAvatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(assistAvatarList); + } return size; } @@ -761,6 +1003,15 @@ public final class PlayerDetailInfoOuterClass { bitField0_ |= 0x00000010; } tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // showDisplayAvatars + showDisplayAvatars = input.readBool(); + bitField0_ |= 0x00000020; + tag = input.readTag(); if (tag != 58) { break; } @@ -768,7 +1019,7 @@ public final class PlayerDetailInfoOuterClass { case 58: { // recordInfo input.readMessage(recordInfo); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; tag = input.readTag(); if (tag != 6058) { break; @@ -777,7 +1028,7 @@ public final class PlayerDetailInfoOuterClass { case 6058: { // displaySettings input.readMessage(displaySettings); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; tag = input.readTag(); if (tag != 26) { break; @@ -786,7 +1037,7 @@ public final class PlayerDetailInfoOuterClass { case 26: { // signature input.readString(signature); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; tag = input.readTag(); if (tag != 34) { break; @@ -795,8 +1046,24 @@ public final class PlayerDetailInfoOuterClass { case 34: { // nickname input.readString(nickname); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; tag = input.readTag(); + if (tag != 106) { + break; + } + } + case 106: { + // displayAvatarList + tag = input.readRepeatedMessage(displayAvatarList, tag); + bitField0_ |= 0x00000400; + if (tag != 3402) { + break; + } + } + case 3402: { + // assistAvatarList + tag = input.readRepeatedMessage(assistAvatarList, tag); + bitField0_ |= 0x00000800; if (tag != 0) { break; } @@ -834,17 +1101,26 @@ public final class PlayerDetailInfoOuterClass { output.writeEnum(FieldNames.platformType, platformType, PlatformTypeOuterClass.PlatformType.converter()); } if ((bitField0_ & 0x00000020) != 0) { - output.writeMessage(FieldNames.recordInfo, recordInfo); + output.writeBool(FieldNames.showDisplayAvatars, showDisplayAvatars); } if ((bitField0_ & 0x00000040) != 0) { - output.writeMessage(FieldNames.displaySettings, displaySettings); + output.writeMessage(FieldNames.recordInfo, recordInfo); } if ((bitField0_ & 0x00000080) != 0) { - output.writeString(FieldNames.signature, signature); + output.writeMessage(FieldNames.displaySettings, displaySettings); } if ((bitField0_ & 0x00000100) != 0) { + output.writeString(FieldNames.signature, signature); + } + if ((bitField0_ & 0x00000200) != 0) { output.writeString(FieldNames.nickname, nickname); } + if ((bitField0_ & 0x00000400) != 0) { + output.writeRepeatedMessage(FieldNames.displayAvatarList, displayAvatarList); + } + if ((bitField0_ & 0x00000800) != 0) { + output.writeRepeatedMessage(FieldNames.assistAvatarList, assistAvatarList); + } output.endObject(); } @@ -918,12 +1194,24 @@ public final class PlayerDetailInfoOuterClass { } break; } + case -1526656139: + case 635559547: { + if (input.isAtField(FieldNames.showDisplayAvatars)) { + if (!input.trySkipNullValue()) { + showDisplayAvatars = input.readBool(); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } case 734573727: case 1317125084: { if (input.isAtField(FieldNames.recordInfo)) { if (!input.trySkipNullValue()) { input.readMessage(recordInfo); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; } } else { input.skipUnknownField(); @@ -935,7 +1223,7 @@ public final class PlayerDetailInfoOuterClass { if (input.isAtField(FieldNames.displaySettings)) { if (!input.trySkipNullValue()) { input.readMessage(displaySettings); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; } } else { input.skipUnknownField(); @@ -946,7 +1234,7 @@ public final class PlayerDetailInfoOuterClass { if (input.isAtField(FieldNames.signature)) { if (!input.trySkipNullValue()) { input.readString(signature); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; } } else { input.skipUnknownField(); @@ -957,7 +1245,31 @@ public final class PlayerDetailInfoOuterClass { if (input.isAtField(FieldNames.nickname)) { if (!input.trySkipNullValue()) { input.readString(nickname); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; + } + } else { + input.skipUnknownField(); + } + break; + } + case 2117925881: + case 245562311: { + if (input.isAtField(FieldNames.displayAvatarList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(displayAvatarList); + bitField0_ |= 0x00000400; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1802092768: + case 1672618734: { + if (input.isAtField(FieldNames.assistAvatarList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(assistAvatarList); + bitField0_ |= 0x00000800; } } else { input.skipUnknownField(); @@ -1027,6 +1339,8 @@ public final class PlayerDetailInfoOuterClass { static final FieldName platformType = FieldName.forField("platformType", "platform_type"); + static final FieldName showDisplayAvatars = FieldName.forField("showDisplayAvatars", "show_display_avatars"); + static final FieldName recordInfo = FieldName.forField("recordInfo", "record_info"); static final FieldName displaySettings = FieldName.forField("displaySettings", "display_settings"); @@ -1034,6 +1348,10 @@ public final class PlayerDetailInfoOuterClass { static final FieldName signature = FieldName.forField("signature"); static final FieldName nickname = FieldName.forField("nickname"); + + static final FieldName displayAvatarList = FieldName.forField("displayAvatarList", "display_avatar_list"); + + static final FieldName assistAvatarList = FieldName.forField("assistAvatarList", "assist_avatar_list"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/SetAssistAvatarCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SetAssistAvatarCsReqOuterClass.java new file mode 100644 index 0000000..01981e5 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SetAssistAvatarCsReqOuterClass.java @@ -0,0 +1,382 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedInt; + +public final class SetAssistAvatarCsReqOuterClass { + /** + * Protobuf type {@code SetAssistAvatarCsReq} + */ + public static final class SetAssistAvatarCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 avatar_id = 1; + */ + private int avatarId; + + /** + * repeated uint32 avatar_id_list = 13; + */ + private final RepeatedInt avatarIdList = RepeatedInt.newEmptyInstance(); + + private SetAssistAvatarCsReq() { + } + + /** + * @return a new empty instance of {@code SetAssistAvatarCsReq} + */ + public static SetAssistAvatarCsReq newInstance() { + return new SetAssistAvatarCsReq(); + } + + /** + * optional uint32 avatar_id = 1; + * @return whether the avatarId field is set + */ + public boolean hasAvatarId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 avatar_id = 1; + * @return this + */ + public SetAssistAvatarCsReq clearAvatarId() { + bitField0_ &= ~0x00000001; + avatarId = 0; + return this; + } + + /** + * optional uint32 avatar_id = 1; + * @return the avatarId + */ + public int getAvatarId() { + return avatarId; + } + + /** + * optional uint32 avatar_id = 1; + * @param value the avatarId to set + * @return this + */ + public SetAssistAvatarCsReq setAvatarId(final int value) { + bitField0_ |= 0x00000001; + avatarId = value; + return this; + } + + /** + * repeated uint32 avatar_id_list = 13; + * @return whether the avatarIdList field is set + */ + public boolean hasAvatarIdList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 avatar_id_list = 13; + * @return this + */ + public SetAssistAvatarCsReq clearAvatarIdList() { + bitField0_ &= ~0x00000002; + avatarIdList.clear(); + return this; + } + + /** + * repeated uint32 avatar_id_list = 13; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableAvatarIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getAvatarIdList() { + return avatarIdList; + } + + /** + * repeated uint32 avatar_id_list = 13; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableAvatarIdList() { + bitField0_ |= 0x00000002; + return avatarIdList; + } + + /** + * repeated uint32 avatar_id_list = 13; + * @param value the avatarIdList to add + * @return this + */ + public SetAssistAvatarCsReq addAvatarIdList(final int value) { + bitField0_ |= 0x00000002; + avatarIdList.add(value); + return this; + } + + /** + * repeated uint32 avatar_id_list = 13; + * @param values the avatarIdList to add + * @return this + */ + public SetAssistAvatarCsReq addAllAvatarIdList(final int... values) { + bitField0_ |= 0x00000002; + avatarIdList.addAll(values); + return this; + } + + @Override + public SetAssistAvatarCsReq copyFrom(final SetAssistAvatarCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + avatarId = other.avatarId; + avatarIdList.copyFrom(other.avatarIdList); + } + return this; + } + + @Override + public SetAssistAvatarCsReq mergeFrom(final SetAssistAvatarCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasAvatarId()) { + setAvatarId(other.avatarId); + } + if (other.hasAvatarIdList()) { + getMutableAvatarIdList().addAll(other.avatarIdList); + } + return this; + } + + @Override + public SetAssistAvatarCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + avatarId = 0; + avatarIdList.clear(); + return this; + } + + @Override + public SetAssistAvatarCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + avatarIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SetAssistAvatarCsReq)) { + return false; + } + SetAssistAvatarCsReq other = (SetAssistAvatarCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasAvatarId() || avatarId == other.avatarId) + && (!hasAvatarIdList() || avatarIdList.equals(other.avatarIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < avatarIdList.length(); i++) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(avatarIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * avatarIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(avatarIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SetAssistAvatarCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // avatarId + avatarId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 106) { + break; + } + } + case 106: { + // avatarIdList [packed=true] + input.readPackedUInt32(avatarIdList, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 104: { + // avatarIdList [packed=false] + tag = input.readRepeatedUInt32(avatarIdList, tag); + bitField0_ |= 0x00000002; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.avatarId, avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedUInt32(FieldNames.avatarIdList, avatarIdList); + } + output.endObject(); + } + + @Override + public SetAssistAvatarCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1787287636: + case -428636735: { + if (input.isAtField(FieldNames.avatarId)) { + if (!input.trySkipNullValue()) { + avatarId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1214270702: + case 1824281692: { + if (input.isAtField(FieldNames.avatarIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(avatarIdList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SetAssistAvatarCsReq clone() { + return new SetAssistAvatarCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SetAssistAvatarCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SetAssistAvatarCsReq(), data).checkInitialized(); + } + + public static SetAssistAvatarCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetAssistAvatarCsReq(), input).checkInitialized(); + } + + public static SetAssistAvatarCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetAssistAvatarCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SetAssistAvatarCsReq messages + */ + public static MessageFactory getFactory() { + return SetAssistAvatarCsReqFactory.INSTANCE; + } + + private enum SetAssistAvatarCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SetAssistAvatarCsReq create() { + return SetAssistAvatarCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName avatarId = FieldName.forField("avatarId", "avatar_id"); + + static final FieldName avatarIdList = FieldName.forField("avatarIdList", "avatar_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SetAssistAvatarScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SetAssistAvatarScRspOuterClass.java new file mode 100644 index 0000000..3f2752b --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SetAssistAvatarScRspOuterClass.java @@ -0,0 +1,462 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedInt; + +public final class SetAssistAvatarScRspOuterClass { + /** + * Protobuf type {@code SetAssistAvatarScRsp} + */ + public static final class SetAssistAvatarScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 avatar_id = 4; + */ + private int avatarId; + + /** + * optional uint32 retcode = 10; + */ + private int retcode; + + /** + * repeated uint32 avatar_id_list = 5; + */ + private final RepeatedInt avatarIdList = RepeatedInt.newEmptyInstance(); + + private SetAssistAvatarScRsp() { + } + + /** + * @return a new empty instance of {@code SetAssistAvatarScRsp} + */ + public static SetAssistAvatarScRsp newInstance() { + return new SetAssistAvatarScRsp(); + } + + /** + * optional uint32 avatar_id = 4; + * @return whether the avatarId field is set + */ + public boolean hasAvatarId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 avatar_id = 4; + * @return this + */ + public SetAssistAvatarScRsp clearAvatarId() { + bitField0_ &= ~0x00000001; + avatarId = 0; + return this; + } + + /** + * optional uint32 avatar_id = 4; + * @return the avatarId + */ + public int getAvatarId() { + return avatarId; + } + + /** + * optional uint32 avatar_id = 4; + * @param value the avatarId to set + * @return this + */ + public SetAssistAvatarScRsp setAvatarId(final int value) { + bitField0_ |= 0x00000001; + avatarId = value; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 10; + * @return this + */ + public SetAssistAvatarScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 10; + * @param value the retcode to set + * @return this + */ + public SetAssistAvatarScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * repeated uint32 avatar_id_list = 5; + * @return whether the avatarIdList field is set + */ + public boolean hasAvatarIdList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated uint32 avatar_id_list = 5; + * @return this + */ + public SetAssistAvatarScRsp clearAvatarIdList() { + bitField0_ &= ~0x00000004; + avatarIdList.clear(); + return this; + } + + /** + * repeated uint32 avatar_id_list = 5; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableAvatarIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getAvatarIdList() { + return avatarIdList; + } + + /** + * repeated uint32 avatar_id_list = 5; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableAvatarIdList() { + bitField0_ |= 0x00000004; + return avatarIdList; + } + + /** + * repeated uint32 avatar_id_list = 5; + * @param value the avatarIdList to add + * @return this + */ + public SetAssistAvatarScRsp addAvatarIdList(final int value) { + bitField0_ |= 0x00000004; + avatarIdList.add(value); + return this; + } + + /** + * repeated uint32 avatar_id_list = 5; + * @param values the avatarIdList to add + * @return this + */ + public SetAssistAvatarScRsp addAllAvatarIdList(final int... values) { + bitField0_ |= 0x00000004; + avatarIdList.addAll(values); + return this; + } + + @Override + public SetAssistAvatarScRsp copyFrom(final SetAssistAvatarScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + avatarId = other.avatarId; + retcode = other.retcode; + avatarIdList.copyFrom(other.avatarIdList); + } + return this; + } + + @Override + public SetAssistAvatarScRsp mergeFrom(final SetAssistAvatarScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasAvatarId()) { + setAvatarId(other.avatarId); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasAvatarIdList()) { + getMutableAvatarIdList().addAll(other.avatarIdList); + } + return this; + } + + @Override + public SetAssistAvatarScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + avatarId = 0; + retcode = 0; + avatarIdList.clear(); + return this; + } + + @Override + public SetAssistAvatarScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + avatarIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SetAssistAvatarScRsp)) { + return false; + } + SetAssistAvatarScRsp other = (SetAssistAvatarScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasAvatarId() || avatarId == other.avatarId) + && (!hasRetcode() || retcode == other.retcode) + && (!hasAvatarIdList() || avatarIdList.equals(other.avatarIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < avatarIdList.length(); i++) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(avatarIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * avatarIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(avatarIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SetAssistAvatarScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 32: { + // avatarId + avatarId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // avatarIdList [packed=true] + input.readPackedUInt32(avatarIdList, tag); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 40: { + // avatarIdList [packed=false] + tag = input.readRepeatedUInt32(avatarIdList, tag); + bitField0_ |= 0x00000004; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.avatarId, avatarId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedUInt32(FieldNames.avatarIdList, avatarIdList); + } + output.endObject(); + } + + @Override + public SetAssistAvatarScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1787287636: + case -428636735: { + if (input.isAtField(FieldNames.avatarId)) { + if (!input.trySkipNullValue()) { + avatarId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1214270702: + case 1824281692: { + if (input.isAtField(FieldNames.avatarIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(avatarIdList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SetAssistAvatarScRsp clone() { + return new SetAssistAvatarScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SetAssistAvatarScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SetAssistAvatarScRsp(), data).checkInitialized(); + } + + public static SetAssistAvatarScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetAssistAvatarScRsp(), input).checkInitialized(); + } + + public static SetAssistAvatarScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetAssistAvatarScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SetAssistAvatarScRsp messages + */ + public static MessageFactory getFactory() { + return SetAssistAvatarScRspFactory.INSTANCE; + } + + private enum SetAssistAvatarScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SetAssistAvatarScRsp create() { + return SetAssistAvatarScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName avatarId = FieldName.forField("avatarId", "avatar_id"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName avatarIdList = FieldName.forField("avatarIdList", "avatar_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SetDisplayAvatarCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SetDisplayAvatarCsReqOuterClass.java new file mode 100644 index 0000000..6c7e50a --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SetDisplayAvatarCsReqOuterClass.java @@ -0,0 +1,296 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedMessage; + +public final class SetDisplayAvatarCsReqOuterClass { + /** + * Protobuf type {@code SetDisplayAvatarCsReq} + */ + public static final class SetDisplayAvatarCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + */ + private final RepeatedMessage displayAvatarList = RepeatedMessage.newEmptyInstance(DisplayAvatarOuterClass.DisplayAvatar.getFactory()); + + private SetDisplayAvatarCsReq() { + } + + /** + * @return a new empty instance of {@code SetDisplayAvatarCsReq} + */ + public static SetDisplayAvatarCsReq newInstance() { + return new SetDisplayAvatarCsReq(); + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @return whether the displayAvatarList field is set + */ + public boolean hasDisplayAvatarList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @return this + */ + public SetDisplayAvatarCsReq clearDisplayAvatarList() { + bitField0_ &= ~0x00000001; + displayAvatarList.clear(); + return this; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableDisplayAvatarList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDisplayAvatarList() { + return displayAvatarList; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableDisplayAvatarList() { + bitField0_ |= 0x00000001; + return displayAvatarList; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @param value the displayAvatarList to add + * @return this + */ + public SetDisplayAvatarCsReq addDisplayAvatarList( + final DisplayAvatarOuterClass.DisplayAvatar value) { + bitField0_ |= 0x00000001; + displayAvatarList.add(value); + return this; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @param values the displayAvatarList to add + * @return this + */ + public SetDisplayAvatarCsReq addAllDisplayAvatarList( + final DisplayAvatarOuterClass.DisplayAvatar... values) { + bitField0_ |= 0x00000001; + displayAvatarList.addAll(values); + return this; + } + + @Override + public SetDisplayAvatarCsReq copyFrom(final SetDisplayAvatarCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + displayAvatarList.copyFrom(other.displayAvatarList); + } + return this; + } + + @Override + public SetDisplayAvatarCsReq mergeFrom(final SetDisplayAvatarCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasDisplayAvatarList()) { + getMutableDisplayAvatarList().addAll(other.displayAvatarList); + } + return this; + } + + @Override + public SetDisplayAvatarCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + displayAvatarList.clear(); + return this; + } + + @Override + public SetDisplayAvatarCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + displayAvatarList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SetDisplayAvatarCsReq)) { + return false; + } + SetDisplayAvatarCsReq other = (SetDisplayAvatarCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasDisplayAvatarList() || displayAvatarList.equals(other.displayAvatarList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < displayAvatarList.length(); i++) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(displayAvatarList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * displayAvatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(displayAvatarList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SetDisplayAvatarCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 42: { + // displayAvatarList + tag = input.readRepeatedMessage(displayAvatarList, tag); + bitField0_ |= 0x00000001; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedMessage(FieldNames.displayAvatarList, displayAvatarList); + } + output.endObject(); + } + + @Override + public SetDisplayAvatarCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 2117925881: + case 245562311: { + if (input.isAtField(FieldNames.displayAvatarList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(displayAvatarList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SetDisplayAvatarCsReq clone() { + return new SetDisplayAvatarCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SetDisplayAvatarCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SetDisplayAvatarCsReq(), data).checkInitialized(); + } + + public static SetDisplayAvatarCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetDisplayAvatarCsReq(), input).checkInitialized(); + } + + public static SetDisplayAvatarCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetDisplayAvatarCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SetDisplayAvatarCsReq messages + */ + public static MessageFactory getFactory() { + return SetDisplayAvatarCsReqFactory.INSTANCE; + } + + private enum SetDisplayAvatarCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SetDisplayAvatarCsReq create() { + return SetDisplayAvatarCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName displayAvatarList = FieldName.forField("displayAvatarList", "display_avatar_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SetDisplayAvatarScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SetDisplayAvatarScRspOuterClass.java new file mode 100644 index 0000000..d101da7 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SetDisplayAvatarScRspOuterClass.java @@ -0,0 +1,376 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedMessage; + +public final class SetDisplayAvatarScRspOuterClass { + /** + * Protobuf type {@code SetDisplayAvatarScRsp} + */ + public static final class SetDisplayAvatarScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 1; + */ + private int retcode; + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + */ + private final RepeatedMessage displayAvatarList = RepeatedMessage.newEmptyInstance(DisplayAvatarOuterClass.DisplayAvatar.getFactory()); + + private SetDisplayAvatarScRsp() { + } + + /** + * @return a new empty instance of {@code SetDisplayAvatarScRsp} + */ + public static SetDisplayAvatarScRsp newInstance() { + return new SetDisplayAvatarScRsp(); + } + + /** + * optional uint32 retcode = 1; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 1; + * @return this + */ + public SetDisplayAvatarScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 1; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 1; + * @param value the retcode to set + * @return this + */ + public SetDisplayAvatarScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @return whether the displayAvatarList field is set + */ + public boolean hasDisplayAvatarList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @return this + */ + public SetDisplayAvatarScRsp clearDisplayAvatarList() { + bitField0_ &= ~0x00000002; + displayAvatarList.clear(); + return this; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableDisplayAvatarList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDisplayAvatarList() { + return displayAvatarList; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableDisplayAvatarList() { + bitField0_ |= 0x00000002; + return displayAvatarList; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @param value the displayAvatarList to add + * @return this + */ + public SetDisplayAvatarScRsp addDisplayAvatarList( + final DisplayAvatarOuterClass.DisplayAvatar value) { + bitField0_ |= 0x00000002; + displayAvatarList.add(value); + return this; + } + + /** + * repeated .DisplayAvatar display_avatar_list = 5; + * @param values the displayAvatarList to add + * @return this + */ + public SetDisplayAvatarScRsp addAllDisplayAvatarList( + final DisplayAvatarOuterClass.DisplayAvatar... values) { + bitField0_ |= 0x00000002; + displayAvatarList.addAll(values); + return this; + } + + @Override + public SetDisplayAvatarScRsp copyFrom(final SetDisplayAvatarScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + displayAvatarList.copyFrom(other.displayAvatarList); + } + return this; + } + + @Override + public SetDisplayAvatarScRsp mergeFrom(final SetDisplayAvatarScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasDisplayAvatarList()) { + getMutableDisplayAvatarList().addAll(other.displayAvatarList); + } + return this; + } + + @Override + public SetDisplayAvatarScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + displayAvatarList.clear(); + return this; + } + + @Override + public SetDisplayAvatarScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + displayAvatarList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SetDisplayAvatarScRsp)) { + return false; + } + SetDisplayAvatarScRsp other = (SetDisplayAvatarScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasDisplayAvatarList() || displayAvatarList.equals(other.displayAvatarList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < displayAvatarList.length(); i++) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(displayAvatarList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * displayAvatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(displayAvatarList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SetDisplayAvatarScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // displayAvatarList + tag = input.readRepeatedMessage(displayAvatarList, tag); + bitField0_ |= 0x00000002; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedMessage(FieldNames.displayAvatarList, displayAvatarList); + } + output.endObject(); + } + + @Override + public SetDisplayAvatarScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 2117925881: + case 245562311: { + if (input.isAtField(FieldNames.displayAvatarList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(displayAvatarList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SetDisplayAvatarScRsp clone() { + return new SetDisplayAvatarScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SetDisplayAvatarScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SetDisplayAvatarScRsp(), data).checkInitialized(); + } + + public static SetDisplayAvatarScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetDisplayAvatarScRsp(), input).checkInitialized(); + } + + public static SetDisplayAvatarScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SetDisplayAvatarScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SetDisplayAvatarScRsp messages + */ + public static MessageFactory getFactory() { + return SetDisplayAvatarScRspFactory.INSTANCE; + } + + private enum SetDisplayAvatarScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SetDisplayAvatarScRsp create() { + return SetDisplayAvatarScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName displayAvatarList = FieldName.forField("displayAvatarList", "display_avatar_list"); + } + } +} diff --git a/src/main/java/emu/lunarcore/database/DatabaseManager.java b/src/main/java/emu/lunarcore/database/DatabaseManager.java index 0d1d72d..e8f2cb7 100644 --- a/src/main/java/emu/lunarcore/database/DatabaseManager.java +++ b/src/main/java/emu/lunarcore/database/DatabaseManager.java @@ -135,13 +135,17 @@ public final class DatabaseManager { return getDatastore().find(cls).filter(Filters.eq("_id", uid)).first(); } - public T getObjectByField(Class cls, String filter, String value) { + public T getObjectByField(Class cls, String filter, Object value) { return getDatastore().find(cls).filter(Filters.eq(filter, value)).first(); } public T getObjectByField(Class cls, String filter, long value) { return getDatastore().find(cls).filter(Filters.eq(filter, value)).first(); } + + public Stream getObjects(Class cls, String filter, Object value) { + return getDatastore().find(cls).filter(Filters.eq(filter, value)).stream(); + } public Stream getObjects(Class cls, String filter, long value) { return getDatastore().find(cls).filter(Filters.eq(filter, value)).stream(); diff --git a/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java b/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java index 873ed24..ff6a6c3 100644 --- a/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java +++ b/src/main/java/emu/lunarcore/game/avatar/AvatarStorage.java @@ -3,27 +3,35 @@ package emu.lunarcore.game.avatar; import java.util.Iterator; import java.util.stream.Stream; +import org.bson.types.ObjectId; + import emu.lunarcore.GameConstants; import emu.lunarcore.LunarCore; import emu.lunarcore.data.GameData; import emu.lunarcore.data.excel.AvatarExcel; import emu.lunarcore.data.excel.HeroExcel; +import emu.lunarcore.game.inventory.GameItem; import emu.lunarcore.game.player.BasePlayerManager; import emu.lunarcore.game.player.Player; import emu.lunarcore.server.packet.send.PacketPlayerSyncScNotify; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import lombok.Getter; @Getter public class AvatarStorage extends BasePlayerManager implements Iterable { private final Int2ObjectMap avatars; + private final Object2ObjectMap avatarObjectIdMap; + private final Int2ObjectMap heroPaths; public AvatarStorage(Player player) { super(player); this.avatars = new Int2ObjectOpenHashMap<>(); + this.avatarObjectIdMap = new Object2ObjectOpenHashMap<>(); this.heroPaths = new Int2ObjectOpenHashMap<>(); } @@ -32,11 +40,15 @@ public class AvatarStorage extends BasePlayerManager implements Iterable stream = LunarCore.getGameDatabase().getObjects(GameAvatar.class, "ownerUid", this.getPlayer().getUid()); + stream.forEach(this::loadAvatar); + } + + private void loadHeroPathsFromDatabase() { + // Get stream from database Stream heroStream = LunarCore.getGameDatabase().getObjects(AvatarHeroPath.class, "ownerUid", this.getPlayer().getUid()); heroStream.forEach(heroPath -> { @@ -116,35 +140,59 @@ public class AvatarStorage extends BasePlayerManager implements Iterable stream = LunarCore.getGameDatabase().getObjects(GameAvatar.class, "ownerUid", this.getPlayer().getUid()); - - stream.forEach(avatar -> { - // Should never happen - if (avatar.getId() == null) { - return; + // Check avatar owner + if (avatar.getOwnerUid() != this.getPlayer().getUid()) { + return false; + } + + // Set hero path + if (avatar.isHero()) { + avatar.setHeroPath(getPlayer().getCurHeroPath()); + } else { + // Load avatar excel data + AvatarExcel excel = GameData.getAvatarExcelMap().get(avatar.getAvatarId()); + if (excel == null) { + return false; } - // Set hero path - if (avatar.isHero()) { - avatar.setHeroPath(getPlayer().getCurHeroPath()); - } else { - // Load avatar excel data - AvatarExcel excel = GameData.getAvatarExcelMap().get(avatar.getAvatarId()); - if (excel == null) { - return; - } - - // Set ownerships - avatar.setExcel(excel); - } - - // Set ownership - avatar.setOwner(getPlayer()); + // Set ownerships + avatar.setExcel(excel); + } + + // Set ownership + avatar.setOwner(getPlayer()); - // Add to avatar storage - this.avatars.put(avatar.getAvatarId(), avatar); - }); + // Add to avatar storage + this.avatars.put(avatar.getAvatarId(), avatar); + this.avatarObjectIdMap.put(avatar.getId(), avatar); + + // Done + return true; + } + + public GameAvatar loadAvatarByObjectId(ObjectId id) { + // Load hero paths first + if (this.getHeroPaths().size() == 0) { + this.loadHeroPathsFromDatabase(); + } + + // Load avatar + GameAvatar avatar = LunarCore.getGameDatabase().getObjectByField(GameAvatar.class, "_id", id); + + if (this.loadAvatar(avatar)) { + // Load items + var stream = LunarCore.getGameDatabase().getObjects(GameItem.class, "equipAvatarId", id); + stream.forEach(this.getPlayer().getInventory()::loadItem); + } + + return avatar; } } diff --git a/src/main/java/emu/lunarcore/game/avatar/GameAvatar.java b/src/main/java/emu/lunarcore/game/avatar/GameAvatar.java index 64de9b6..c1f46b5 100644 --- a/src/main/java/emu/lunarcore/game/avatar/GameAvatar.java +++ b/src/main/java/emu/lunarcore/game/avatar/GameAvatar.java @@ -16,12 +16,16 @@ import emu.lunarcore.game.player.Player; import emu.lunarcore.game.player.lineup.PlayerLineup; import emu.lunarcore.game.scene.Scene; import emu.lunarcore.game.scene.entity.GameEntity; +import emu.lunarcore.proto.AssistSimpleInfoOuterClass.AssistSimpleInfo; import emu.lunarcore.proto.AvatarOuterClass.Avatar; import emu.lunarcore.proto.AvatarSkillTreeOuterClass.AvatarSkillTree; import emu.lunarcore.proto.AvatarTypeOuterClass.AvatarType; import emu.lunarcore.proto.BattleAvatarOuterClass.BattleAvatar; import emu.lunarcore.proto.BattleEquipmentOuterClass.BattleEquipment; import emu.lunarcore.proto.BattleRelicOuterClass.BattleRelic; +import emu.lunarcore.proto.DisplayAvatarDetailInfoOuterClass.DisplayAvatarDetailInfo; +import emu.lunarcore.proto.DisplayEquipmentInfoOuterClass.DisplayEquipmentInfo; +import emu.lunarcore.proto.DisplayRelicInfoOuterClass.DisplayRelicInfo; import emu.lunarcore.proto.EquipRelicOuterClass.EquipRelic; import emu.lunarcore.proto.LineupAvatarOuterClass.LineupAvatar; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; @@ -237,7 +241,7 @@ public class GameAvatar implements GameEntity { if (slot == 0) return false; // Check if other avatars have this item equipped - GameAvatar otherAvatar = getOwner().getAvatarById(item.getEquipAvatar()); + GameAvatar otherAvatar = getOwner().getAvatarById(item.getEquipAvatarId()); if (otherAvatar != null) { // Unequip this item from the other avatar if (otherAvatar.unequipItem(slot) != null) { @@ -260,7 +264,7 @@ public class GameAvatar implements GameEntity { getEquips().put(slot, item); // Save equip if equipped avatar was changed - if (item.setEquipAvatar(this.getAvatarId())) { + if (item.setEquipAvatar(this)) { item.save(); } @@ -274,7 +278,7 @@ public class GameAvatar implements GameEntity { GameItem item = getEquips().remove(slot); if (item != null) { - item.setEquipAvatar(0); + item.setEquipAvatar(null); item.save(); return item; } @@ -385,6 +389,61 @@ public class GameAvatar implements GameEntity { return proto; } + public DisplayAvatarDetailInfo toDisplayAvatarProto() { + var proto = DisplayAvatarDetailInfo.newInstance() + .setAvatarId(this.getExcel().getAvatarID()) + .setLevel(this.getLevel()) + .setExp(this.getExp()) + .setPromotion(this.getPromotion()) + .setRank(this.getRank()); + + // Skills + for (var skill : getSkills().entrySet()) { + proto.addSkilltreeList(AvatarSkillTree.newInstance().setPointId(skill.getKey()).setLevel(skill.getValue())); + } + + // Build equips + for (var equip : this.getEquips().values()) { + if (equip.getItemMainType() == ItemMainType.Relic) { + // Build display relic proto + var relic = DisplayRelicInfo.newInstance() + .setTid(equip.getItemId()) + .setLevel(equip.getLevel()) + .setExp(equip.getExp()) + .setSlot(equip.getEquipSlot()) + .setMainAffixId(equip.getMainAffix()); + + if (equip.getSubAffixes() != null) { + for (var subAffix : equip.getSubAffixes()) { + relic.addSubAffixList(subAffix.toProto()); + } + } + + proto.addRelicList(relic); + } else if (equip.getItemMainType() == ItemMainType.Equipment) { + // Build display equipment proto + var equipment = DisplayEquipmentInfo.newInstance() + .setTid(equip.getItemId()) + .setLevel(equip.getLevel()) + .setExp(equip.getExp()) + .setPromotion(equip.getPromotion()) + .setRank(equip.getRank()); + + proto.setEquipment(equipment); + } + } + + return proto; + } + + public AssistSimpleInfo toAssistSimpleProto() { + var proto = AssistSimpleInfo.newInstance() + .setAvatarId(this.getAvatarId()) + .setLevel(this.getLevel()); + + return proto; + } + // Database public void save() { diff --git a/src/main/java/emu/lunarcore/game/inventory/GameItem.java b/src/main/java/emu/lunarcore/game/inventory/GameItem.java index 254e0b0..55dde24 100644 --- a/src/main/java/emu/lunarcore/game/inventory/GameItem.java +++ b/src/main/java/emu/lunarcore/game/inventory/GameItem.java @@ -15,6 +15,7 @@ import emu.lunarcore.data.GameDepot; import emu.lunarcore.data.excel.ItemExcel; import emu.lunarcore.data.excel.RelicMainAffixExcel; import emu.lunarcore.data.excel.RelicSubAffixExcel; +import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.enums.AvatarPropertyType; import emu.lunarcore.game.enums.ItemMainType; import emu.lunarcore.game.player.Player; @@ -54,6 +55,7 @@ public class GameItem { private List subAffixes; private int equipAvatar; + @Indexed private ObjectId equipAvatarId; @Deprecated public GameItem() { @@ -132,7 +134,7 @@ public class GameItem { } public boolean isEquipped() { - return this.getEquipAvatar() > 0; + return this.getEquipAvatarId() != null; } public boolean isDestroyable() { @@ -148,14 +150,20 @@ public class GameItem { return false; } - public boolean setEquipAvatar(int newEquipAvatar) { - if (this.equipAvatar != newEquipAvatar) { - this.equipAvatar = newEquipAvatar; + public boolean setEquipAvatar(GameAvatar avatar) { + if (avatar == null && this.isEquipped()) { + this.equipAvatarId = null; + this.equipAvatar = 0; + return true; + } else if (this.equipAvatarId != avatar.getId()) { + this.equipAvatarId = avatar.getId(); + this.equipAvatar = 0; return true; } + return false; } - + // Sub affixes public void resetSubAffixes() { diff --git a/src/main/java/emu/lunarcore/game/inventory/Inventory.java b/src/main/java/emu/lunarcore/game/inventory/Inventory.java index c04c098..f24ffa9 100644 --- a/src/main/java/emu/lunarcore/game/inventory/Inventory.java +++ b/src/main/java/emu/lunarcore/game/inventory/Inventory.java @@ -560,44 +560,63 @@ public class Inventory extends BasePlayerManager { public void loadFromDatabase() { Stream stream = LunarCore.getGameDatabase().getObjects(GameItem.class, "ownerUid", this.getPlayer().getUid()); + stream.forEach(this::loadItem); + } + + public boolean loadItem(GameItem item) { + // Should never happen + if (item.getId() == null) { + return false; + } + + // Check item owner + if (item.getOwnerUid() != this.getPlayer().getUid()) { + return false; + } - stream.forEach(item -> { - // Should never happen - if (item.getId() == null) { - return; - } + // Load item excel data + ItemExcel excel = GameData.getItemExcelMap().get(item.getItemId()); + if (excel == null) { + // Delete item if it has no excel data + item.setCount(0); + item.save(); + return false; + } - // Load item excel data - ItemExcel excel = GameData.getItemExcelMap().get(item.getItemId()); - if (excel == null) { - // Delete item if it has no excel data - item.setCount(0); + // Set ownerships + item.setExcel(excel); + + // Put in inventory + InventoryTab tab = getTabByItemType(item.getExcel().getItemMainType()); + putItem(item, tab); + + // Equip to a character if possible + if (item.isEquipped() || item.getEquipAvatar() > 0) { + GameAvatar avatar = null; + boolean hasEquipped = false; + + if (item.getEquipAvatar() > 0) { + // Legacy equip handler + avatar = getPlayer().getAvatars().getAvatarById(item.getEquipAvatar()); + item.setEquipAvatar(avatar); item.save(); - return; + } else { + avatar = getPlayer().getAvatars().getAvatarById(item.getEquipAvatarId()); } - - // Set ownerships - item.setExcel(excel); - - // Put in inventory - InventoryTab tab = getTabByItemType(item.getExcel().getItemMainType()); - putItem(item, tab); - - // Equip to a character if possible - if (item.isEquipped()) { - GameAvatar avatar = getPlayer().getAvatarById(item.getEquipAvatar()); - boolean hasEquipped = false; - - if (avatar != null) { - hasEquipped = avatar.equipItem(item); - } - - if (!hasEquipped) { - // Unset equipped flag on item since we couldnt find an avatar to equip it to - item.setEquipAvatar(0); - item.save(); - } + + // Make sure the avatar that we equipped this item to actually exists + if (avatar != null) { + hasEquipped = avatar.equipItem(item); } - }); + + // Unset equipped flag on item since we couldnt find an avatar to equip it to + if (!hasEquipped) { + item.setEquipAvatar(null); + item.save(); + } + } + + // Done + return true; } } diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index eb6354f..ae105d7 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -1,5 +1,10 @@ package emu.lunarcore.game.player; +import java.util.ArrayList; +import java.util.List; + +import org.bson.types.ObjectId; + import com.mongodb.client.model.Filters; import dev.morphia.annotations.Entity; @@ -48,6 +53,7 @@ import emu.lunarcore.game.scene.SceneBuff; import emu.lunarcore.game.scene.entity.EntityProp; import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.BoardDataSyncOuterClass.BoardDataSync; +import emu.lunarcore.proto.DisplayAvatarOuterClass.DisplayAvatar; import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus; import emu.lunarcore.proto.HeadIconOuterClass.HeadIcon; import emu.lunarcore.proto.PlatformTypeOuterClass.PlatformType; @@ -67,6 +73,8 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import lombok.Getter; import lombok.Setter; +import us.hebi.quickbuf.RepeatedInt; +import us.hebi.quickbuf.RepeatedMessage; @Entity(value = "players", useDiscriminator = false) @Getter @@ -118,6 +126,8 @@ public class Player implements Tickable { // Database persistent data private LineupManager lineupManager; private PlayerGachaInfo gachaInfo; + private List assistAvatars; + private List displayAvatars; // Instances @Setter private ChallengeInstance challengeInstance; @@ -138,6 +148,8 @@ public class Player implements Tickable { this.curBasicType = GameConstants.TRAILBLAZER_AVATAR_ID; this.gender = PlayerGender.GENDER_MAN; this.foodBuffs = new Int2ObjectOpenHashMap<>(); + this.assistAvatars = new ArrayList<>(); + this.displayAvatars = new ArrayList<>(); this.avatars = new AvatarStorage(this); this.inventory = new Inventory(this); @@ -324,6 +336,10 @@ public class Player implements Tickable { return getAvatars().getAvatarById(avatarId); } + public GameAvatar getAvatarById(ObjectId id) { + return getAvatars().getAvatarById(id); + } + public boolean setHeadIcon(int id) { if (this.getUnlocks().getHeadIcons().contains(id)) { this.headIcon = id; @@ -777,6 +793,54 @@ public class Player implements Tickable { // Done, return success return true; } + + public void setAssistAvatars(RepeatedInt avatars) { + // Check size + if (avatars.length() > 3) { + return; + } + + // Clear + this.getAssistAvatars().clear(); + + // Parse list from proto + for (int id : avatars) { + GameAvatar avatar = this.getAvatarById(id); + if (avatar == null) continue; + + this.getAssistAvatars().add(avatar.getId()); + } + + // Save player + this.save(); + } + + public void setDisplayAvatars(RepeatedMessage avatars) { + // Check size + if (avatars.length() > 5) { + return; + } + + // Clear + this.getDisplayAvatars().clear(); + + // Parse list from proto + for (int i = 0; i < avatars.length(); i++) { + var info = avatars.get(i); + + if (info.getAvatarId() > 0) { + GameAvatar avatar = this.getAvatarById(info.getAvatarId()); + if (avatar == null) continue; + + this.getDisplayAvatars().add(avatar.getId()); + } else { + this.getDisplayAvatars().add(null); + } + } + + // Save player + this.save(); + } public void sendMessage(String message) { var msg = new ChatMessage(GameConstants.SERVER_CONSOLE_UID, this.getUid(), message); @@ -933,11 +997,45 @@ public class Player implements Tickable { .setLevel(this.getLevel()) .setWorldLevel(this.getWorldLevel()) .setPlatformType(PlatformType.PC) + .setShowDisplayAvatars(true) .setHeadIcon(this.getHeadIcon()); proto.getMutableRecordInfo().getMutableCollectionInfo(); proto.getMutableDisplaySettings(); + for (int i = 0; i < this.getAssistAvatars().size(); i++) { + ObjectId objectId = this.getAssistAvatars().get(i); + + GameAvatar avatar = this.getAvatarById(objectId); + if (avatar == null && this.getSession() == null) { + avatar = this.getAvatars().loadAvatarByObjectId(objectId); + } + + if (avatar == null) continue; + + var info = avatar.toDisplayAvatarProto(); + info.setPos(i); + + proto.addAssistAvatarList(info); + } + + for (int i = 0; i < this.getDisplayAvatars().size(); i++) { + ObjectId objectId = this.getDisplayAvatars().get(i); + if (objectId == null) continue; + + GameAvatar avatar = this.getAvatarById(objectId); + if (avatar == null && this.getSession() == null) { + avatar = this.getAvatars().loadAvatarByObjectId(objectId); + } + + if (avatar == null) continue; + + var info = avatar.toDisplayAvatarProto(); + info.setPos(i); + + proto.addDisplayAvatarList(info); + } + return proto; } @@ -953,6 +1051,22 @@ public class Player implements Tickable { .setLastActiveTime(this.getLastActiveTime()) .setHeadIcon(this.getHeadIcon()); + for (int i = 0; i < this.getAssistAvatars().size(); i++) { + ObjectId objectId = this.getAssistAvatars().get(i); + + GameAvatar avatar = this.getAvatarById(objectId); + if (avatar == null && this.getSession() == null) { + avatar = this.getAvatars().loadAvatarByObjectId(objectId); + } + + if (avatar == null) continue; + + var info = avatar.toAssistSimpleProto(); + info.setPos(i); + + proto.addAssistSimpleInfo(info); + } + return proto; } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetAssistAvatarCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetAssistAvatarCsReq.java new file mode 100644 index 0000000..68a973f --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetAssistAvatarCsReq.java @@ -0,0 +1,21 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.SetAssistAvatarCsReqOuterClass.SetAssistAvatarCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketSetAssistAvatarScRsp; + +@Opcodes(CmdId.SetAssistAvatarCsReq) +public class HandlerSetAssistAvatarCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = SetAssistAvatarCsReq.parseFrom(data); + + session.getPlayer().setAssistAvatars(req.getAvatarIdList()); + session.send(new PacketSetAssistAvatarScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetDisplayAvatarCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetDisplayAvatarCsReq.java new file mode 100644 index 0000000..0f94a68 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSetDisplayAvatarCsReq.java @@ -0,0 +1,21 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.SetDisplayAvatarCsReqOuterClass.SetDisplayAvatarCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketSetDisplayAvatarScRsp; + +@Opcodes(CmdId.SetDisplayAvatarCsReq) +public class HandlerSetDisplayAvatarCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = SetDisplayAvatarCsReq.parseFrom(data); + + session.getPlayer().setDisplayAvatars(req.getDisplayAvatarList()); + session.send(new PacketSetDisplayAvatarScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerBoardDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerBoardDataScRsp.java index 80dccaa..b68fc66 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerBoardDataScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerBoardDataScRsp.java @@ -1,6 +1,7 @@ package emu.lunarcore.server.packet.send; import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.DisplayAvatarOuterClass.DisplayAvatar; import emu.lunarcore.proto.GetPlayerBoardDataScRspOuterClass.GetPlayerBoardDataScRsp; import emu.lunarcore.proto.HeadIconOuterClass.HeadIcon; import emu.lunarcore.server.packet.BasePacket; @@ -15,13 +16,37 @@ public class PacketGetPlayerBoardDataScRsp extends BasePacket { .setCurrentHeadIconId(player.getHeadIcon()) .setSignature(player.getSignature()); - // Set empty display avatars + // Create display avatar object data.getMutableDisplayAvatarVec(); + // Head icons, aka profile pictures for (int id : player.getUnlocks().getHeadIcons()) { data.addUnlockedHeadIconList(HeadIcon.newInstance().setId(id)); } + // Assist avatars + for (var objectId : player.getAssistAvatars()) { + var avatar = player.getAvatarById(objectId); + if (avatar == null) continue; + + data.addDisplaySupportAvatarVec(avatar.getAvatarId()); + } + + // Display avatars + for (int i = 0; i < player.getDisplayAvatars().size(); i++) { + var objectId = player.getDisplayAvatars().get(i); + if (objectId == null) continue; + + var avatar = player.getAvatarById(objectId); + if (avatar == null) continue; + + var info = DisplayAvatar.newInstance() + .setAvatarId(avatar.getAvatarId()) + .setPos(i); + + data.getMutableDisplayAvatarVec().addDisplayAvatarList(info); + } + this.setData(data); } } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSetAssistAvatarScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSetAssistAvatarScRsp.java new file mode 100644 index 0000000..daea12a --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSetAssistAvatarScRsp.java @@ -0,0 +1,24 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.SetAssistAvatarScRspOuterClass.SetAssistAvatarScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSetAssistAvatarScRsp extends BasePacket { + + public PacketSetAssistAvatarScRsp(Player player) { + super(CmdId.SetAssistAvatarScRsp); + + var data = SetAssistAvatarScRsp.newInstance(); + + for (var objectId : player.getAssistAvatars()) { + var avatar = player.getAvatarById(objectId); + if (avatar == null) continue; + + data.addAvatarIdList(avatar.getAvatarId()); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSetDisplayAvatarScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSetDisplayAvatarScRsp.java new file mode 100644 index 0000000..c769855 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSetDisplayAvatarScRsp.java @@ -0,0 +1,32 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.DisplayAvatarOuterClass.DisplayAvatar; +import emu.lunarcore.proto.SetDisplayAvatarScRspOuterClass.SetDisplayAvatarScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSetDisplayAvatarScRsp extends BasePacket { + + public PacketSetDisplayAvatarScRsp(Player player) { + super(CmdId.SetDisplayAvatarScRsp); + + var data = SetDisplayAvatarScRsp.newInstance(); + + for (int i = 0; i < player.getDisplayAvatars().size(); i++) { + var objectId = player.getDisplayAvatars().get(i); + if (objectId == null) continue; + + var avatar = player.getAvatarById(objectId); + if (avatar == null) continue; + + var info = DisplayAvatar.newInstance() + .setAvatarId(avatar.getAvatarId()) + .setPos(i); + + data.addDisplayAvatarList(info); + } + + this.setData(data); + } +}