diff --git a/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java b/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java new file mode 100644 index 0000000..8a02a2d --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ArchiveDataOuterClass.java @@ -0,0 +1,541 @@ +// 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 ArchiveDataOuterClass { + /** + * Protobuf type {@code ArchiveData} + */ + public static final class ArchiveData extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated uint32 archive_equipment_id_list = 2; + */ + private final RepeatedInt archiveEquipmentIdList = RepeatedInt.newEmptyInstance(); + + /** + * repeated uint32 archive_avatar_id_list = 3; + */ + private final RepeatedInt archiveAvatarIdList = RepeatedInt.newEmptyInstance(); + + /** + * repeated uint32 BDPEEIFDDFK = 11; + */ + private final RepeatedInt bDPEEIFDDFK = RepeatedInt.newEmptyInstance(); + + private ArchiveData() { + } + + /** + * @return a new empty instance of {@code ArchiveData} + */ + public static ArchiveData newInstance() { + return new ArchiveData(); + } + + /** + * repeated uint32 archive_equipment_id_list = 2; + * @return whether the archiveEquipmentIdList field is set + */ + public boolean hasArchiveEquipmentIdList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated uint32 archive_equipment_id_list = 2; + * @return this + */ + public ArchiveData clearArchiveEquipmentIdList() { + bitField0_ &= ~0x00000001; + archiveEquipmentIdList.clear(); + return this; + } + + /** + * repeated uint32 archive_equipment_id_list = 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 #getMutableArchiveEquipmentIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getArchiveEquipmentIdList() { + return archiveEquipmentIdList; + } + + /** + * repeated uint32 archive_equipment_id_list = 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 RepeatedInt getMutableArchiveEquipmentIdList() { + bitField0_ |= 0x00000001; + return archiveEquipmentIdList; + } + + /** + * repeated uint32 archive_equipment_id_list = 2; + * @param value the archiveEquipmentIdList to add + * @return this + */ + public ArchiveData addArchiveEquipmentIdList(final int value) { + bitField0_ |= 0x00000001; + archiveEquipmentIdList.add(value); + return this; + } + + /** + * repeated uint32 archive_equipment_id_list = 2; + * @param values the archiveEquipmentIdList to add + * @return this + */ + public ArchiveData addAllArchiveEquipmentIdList(final int... values) { + bitField0_ |= 0x00000001; + archiveEquipmentIdList.addAll(values); + return this; + } + + /** + * repeated uint32 archive_avatar_id_list = 3; + * @return whether the archiveAvatarIdList field is set + */ + public boolean hasArchiveAvatarIdList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 archive_avatar_id_list = 3; + * @return this + */ + public ArchiveData clearArchiveAvatarIdList() { + bitField0_ &= ~0x00000002; + archiveAvatarIdList.clear(); + return this; + } + + /** + * repeated uint32 archive_avatar_id_list = 3; + * + * 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 #getMutableArchiveAvatarIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getArchiveAvatarIdList() { + return archiveAvatarIdList; + } + + /** + * repeated uint32 archive_avatar_id_list = 3; + * + * 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 getMutableArchiveAvatarIdList() { + bitField0_ |= 0x00000002; + return archiveAvatarIdList; + } + + /** + * repeated uint32 archive_avatar_id_list = 3; + * @param value the archiveAvatarIdList to add + * @return this + */ + public ArchiveData addArchiveAvatarIdList(final int value) { + bitField0_ |= 0x00000002; + archiveAvatarIdList.add(value); + return this; + } + + /** + * repeated uint32 archive_avatar_id_list = 3; + * @param values the archiveAvatarIdList to add + * @return this + */ + public ArchiveData addAllArchiveAvatarIdList(final int... values) { + bitField0_ |= 0x00000002; + archiveAvatarIdList.addAll(values); + return this; + } + + /** + * repeated uint32 BDPEEIFDDFK = 11; + * @return whether the bDPEEIFDDFK field is set + */ + public boolean hasBDPEEIFDDFK() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated uint32 BDPEEIFDDFK = 11; + * @return this + */ + public ArchiveData clearBDPEEIFDDFK() { + bitField0_ &= ~0x00000004; + bDPEEIFDDFK.clear(); + return this; + } + + /** + * repeated uint32 BDPEEIFDDFK = 11; + * + * 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 #getMutableBDPEEIFDDFK()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getBDPEEIFDDFK() { + return bDPEEIFDDFK; + } + + /** + * repeated uint32 BDPEEIFDDFK = 11; + * + * 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 getMutableBDPEEIFDDFK() { + bitField0_ |= 0x00000004; + return bDPEEIFDDFK; + } + + /** + * repeated uint32 BDPEEIFDDFK = 11; + * @param value the bDPEEIFDDFK to add + * @return this + */ + public ArchiveData addBDPEEIFDDFK(final int value) { + bitField0_ |= 0x00000004; + bDPEEIFDDFK.add(value); + return this; + } + + /** + * repeated uint32 BDPEEIFDDFK = 11; + * @param values the bDPEEIFDDFK to add + * @return this + */ + public ArchiveData addAllBDPEEIFDDFK(final int... values) { + bitField0_ |= 0x00000004; + bDPEEIFDDFK.addAll(values); + return this; + } + + @Override + public ArchiveData copyFrom(final ArchiveData other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + archiveEquipmentIdList.copyFrom(other.archiveEquipmentIdList); + archiveAvatarIdList.copyFrom(other.archiveAvatarIdList); + bDPEEIFDDFK.copyFrom(other.bDPEEIFDDFK); + } + return this; + } + + @Override + public ArchiveData mergeFrom(final ArchiveData other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasArchiveEquipmentIdList()) { + getMutableArchiveEquipmentIdList().addAll(other.archiveEquipmentIdList); + } + if (other.hasArchiveAvatarIdList()) { + getMutableArchiveAvatarIdList().addAll(other.archiveAvatarIdList); + } + if (other.hasBDPEEIFDDFK()) { + getMutableBDPEEIFDDFK().addAll(other.bDPEEIFDDFK); + } + return this; + } + + @Override + public ArchiveData clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + archiveEquipmentIdList.clear(); + archiveAvatarIdList.clear(); + bDPEEIFDDFK.clear(); + return this; + } + + @Override + public ArchiveData clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + archiveEquipmentIdList.clear(); + archiveAvatarIdList.clear(); + bDPEEIFDDFK.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ArchiveData)) { + return false; + } + ArchiveData other = (ArchiveData) o; + return bitField0_ == other.bitField0_ + && (!hasArchiveEquipmentIdList() || archiveEquipmentIdList.equals(other.archiveEquipmentIdList)) + && (!hasArchiveAvatarIdList() || archiveAvatarIdList.equals(other.archiveAvatarIdList)) + && (!hasBDPEEIFDDFK() || bDPEEIFDDFK.equals(other.bDPEEIFDDFK)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < archiveEquipmentIdList.length(); i++) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(archiveEquipmentIdList.array()[i]); + } + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < archiveAvatarIdList.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(archiveAvatarIdList.array()[i]); + } + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < bDPEEIFDDFK.length(); i++) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(bDPEEIFDDFK.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * archiveEquipmentIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(archiveEquipmentIdList); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * archiveAvatarIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(archiveAvatarIdList); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * bDPEEIFDDFK.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(bDPEEIFDDFK); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ArchiveData mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 18: { + // archiveEquipmentIdList [packed=true] + input.readPackedUInt32(archiveEquipmentIdList, tag); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // archiveAvatarIdList [packed=true] + input.readPackedUInt32(archiveAvatarIdList, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 90) { + break; + } + } + case 90: { + // bDPEEIFDDFK [packed=true] + input.readPackedUInt32(bDPEEIFDDFK, 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 16: { + // archiveEquipmentIdList [packed=false] + tag = input.readRepeatedUInt32(archiveEquipmentIdList, tag); + bitField0_ |= 0x00000001; + break; + } + case 24: { + // archiveAvatarIdList [packed=false] + tag = input.readRepeatedUInt32(archiveAvatarIdList, tag); + bitField0_ |= 0x00000002; + break; + } + case 88: { + // bDPEEIFDDFK [packed=false] + tag = input.readRepeatedUInt32(bDPEEIFDDFK, tag); + bitField0_ |= 0x00000004; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedUInt32(FieldNames.archiveEquipmentIdList, archiveEquipmentIdList); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedUInt32(FieldNames.archiveAvatarIdList, archiveAvatarIdList); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedUInt32(FieldNames.bDPEEIFDDFK, bDPEEIFDDFK); + } + output.endObject(); + } + + @Override + public ArchiveData mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1521227365: + case 967463252: { + if (input.isAtField(FieldNames.archiveEquipmentIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(archiveEquipmentIdList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 500094196: + case 1198392697: { + if (input.isAtField(FieldNames.archiveAvatarIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(archiveAvatarIdList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1579550416: { + if (input.isAtField(FieldNames.bDPEEIFDDFK)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(bDPEEIFDDFK); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ArchiveData clone() { + return new ArchiveData().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ArchiveData parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ArchiveData(), data).checkInitialized(); + } + + public static ArchiveData parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ArchiveData(), input).checkInitialized(); + } + + public static ArchiveData parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ArchiveData(), input).checkInitialized(); + } + + /** + * @return factory for creating ArchiveData messages + */ + public static MessageFactory getFactory() { + return ArchiveDataFactory.INSTANCE; + } + + private enum ArchiveDataFactory implements MessageFactory { + INSTANCE; + + @Override + public ArchiveData create() { + return ArchiveData.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName archiveEquipmentIdList = FieldName.forField("archiveEquipmentIdList", "archive_equipment_id_list"); + + static final FieldName archiveAvatarIdList = FieldName.forField("archiveAvatarIdList", "archive_avatar_id_list"); + + static final FieldName bDPEEIFDDFK = FieldName.forField("BDPEEIFDDFK"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetArchiveDataScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetArchiveDataScRspOuterClass.java new file mode 100644 index 0000000..e424f7e --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetArchiveDataScRspOuterClass.java @@ -0,0 +1,361 @@ +// 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 GetArchiveDataScRspOuterClass { + /** + * Protobuf type {@code GetArchiveDataScRsp} + */ + public static final class GetArchiveDataScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 3; + */ + private int retcode; + + /** + * optional .ArchiveData archive_data = 9; + */ + private final ArchiveDataOuterClass.ArchiveData archiveData = ArchiveDataOuterClass.ArchiveData.newInstance(); + + private GetArchiveDataScRsp() { + } + + /** + * @return a new empty instance of {@code GetArchiveDataScRsp} + */ + public static GetArchiveDataScRsp newInstance() { + return new GetArchiveDataScRsp(); + } + + /** + * optional uint32 retcode = 3; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 3; + * @return this + */ + public GetArchiveDataScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 3; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 3; + * @param value the retcode to set + * @return this + */ + public GetArchiveDataScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * optional .ArchiveData archive_data = 9; + * @return whether the archiveData field is set + */ + public boolean hasArchiveData() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .ArchiveData archive_data = 9; + * @return this + */ + public GetArchiveDataScRsp clearArchiveData() { + bitField0_ &= ~0x00000002; + archiveData.clear(); + return this; + } + + /** + * optional .ArchiveData archive_data = 9; + * + * 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 #getMutableArchiveData()} if you want to modify it. + * + * @return internal storage object for reading + */ + public ArchiveDataOuterClass.ArchiveData getArchiveData() { + return archiveData; + } + + /** + * optional .ArchiveData archive_data = 9; + * + * 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 ArchiveDataOuterClass.ArchiveData getMutableArchiveData() { + bitField0_ |= 0x00000002; + return archiveData; + } + + /** + * optional .ArchiveData archive_data = 9; + * @param value the archiveData to set + * @return this + */ + public GetArchiveDataScRsp setArchiveData(final ArchiveDataOuterClass.ArchiveData value) { + bitField0_ |= 0x00000002; + archiveData.copyFrom(value); + return this; + } + + @Override + public GetArchiveDataScRsp copyFrom(final GetArchiveDataScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + archiveData.copyFrom(other.archiveData); + } + return this; + } + + @Override + public GetArchiveDataScRsp mergeFrom(final GetArchiveDataScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasArchiveData()) { + getMutableArchiveData().mergeFrom(other.archiveData); + } + return this; + } + + @Override + public GetArchiveDataScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + archiveData.clear(); + return this; + } + + @Override + public GetArchiveDataScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + archiveData.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetArchiveDataScRsp)) { + return false; + } + GetArchiveDataScRsp other = (GetArchiveDataScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasArchiveData() || archiveData.equals(other.archiveData)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 74); + output.writeMessageNoTag(archiveData); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(archiveData); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetArchiveDataScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 24: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 74) { + break; + } + } + case 74: { + // archiveData + input.readMessage(archiveData); + bitField0_ |= 0x00000002; + 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.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.archiveData, archiveData); + } + output.endObject(); + } + + @Override + public GetArchiveDataScRsp 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 1053234060: + case -1684475641: { + if (input.isAtField(FieldNames.archiveData)) { + if (!input.trySkipNullValue()) { + input.readMessage(archiveData); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetArchiveDataScRsp clone() { + return new GetArchiveDataScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetArchiveDataScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetArchiveDataScRsp(), data).checkInitialized(); + } + + public static GetArchiveDataScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetArchiveDataScRsp(), input).checkInitialized(); + } + + public static GetArchiveDataScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetArchiveDataScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetArchiveDataScRsp messages + */ + public static MessageFactory getFactory() { + return GetArchiveDataScRspFactory.INSTANCE; + } + + private enum GetArchiveDataScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetArchiveDataScRsp create() { + return GetArchiveDataScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName archiveData = FieldName.forField("archiveData", "archive_data"); + } + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java new file mode 100644 index 0000000..accf250 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetArchiveDataCsReq.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.recv; + +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.PacketGetArchiveDataScRsp; + +@Opcodes(CmdId.GetArchiveDataCsReq) +public class HandlerGetArchiveDataCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] header, byte[] data) throws Exception { + // TODO The client does not send this packet right now to the server so we send it in HandlerPlayerLoginFinishCsReq instead + session.send(new PacketGetArchiveDataScRsp()); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java index 2348805..6c7ef32 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java @@ -5,13 +5,15 @@ import emu.lunarcore.server.packet.BasePacket; import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.Opcodes; import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetArchiveDataScRsp; @Opcodes(CmdId.PlayerLoginFinishCsReq) public class HandlerPlayerLoginFinishCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] data) throws Exception { - session.send(new BasePacket(CmdId.PlayerLoginFinishScRsp)); + session.send(CmdId.PlayerLoginFinishScRsp); + session.send(new PacketGetArchiveDataScRsp()); } } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java new file mode 100644 index 0000000..c924d0f --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetArchiveDataScRsp.java @@ -0,0 +1,24 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.data.GameData; +import emu.lunarcore.proto.ArchiveDataOuterClass.ArchiveData; +import emu.lunarcore.proto.GetArchiveDataScRspOuterClass.GetArchiveDataScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetArchiveDataScRsp extends BasePacket { + + public PacketGetArchiveDataScRsp() { + super(CmdId.GetArchiveDataScRsp); + + var archive = ArchiveData.newInstance(); + + for (var avatarExcel : GameData.getAvatarExcelMap().values()) { + archive.addArchiveAvatarIdList(avatarExcel.getAvatarID()); + } + + var data = GetArchiveDataScRsp.newInstance().setArchiveData(archive); + + this.setData(data); + } +}