diff --git a/src/generated/main/emu/lunarcore/proto/GetJukeboxDataCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataCsReqOuterClass.java new file mode 100644 index 0000000..15f7785 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +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 GetJukeboxDataCsReqOuterClass { + /** + * Protobuf type {@code GetJukeboxDataCsReq} + */ + public static final class GetJukeboxDataCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetJukeboxDataCsReq() { + } + + /** + * @return a new empty instance of {@code GetJukeboxDataCsReq} + */ + public static GetJukeboxDataCsReq newInstance() { + return new GetJukeboxDataCsReq(); + } + + @Override + public GetJukeboxDataCsReq copyFrom(final GetJukeboxDataCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetJukeboxDataCsReq mergeFrom(final GetJukeboxDataCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetJukeboxDataCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetJukeboxDataCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetJukeboxDataCsReq)) { + return false; + } + GetJukeboxDataCsReq other = (GetJukeboxDataCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetJukeboxDataCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + 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(); + output.endObject(); + } + + @Override + public GetJukeboxDataCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetJukeboxDataCsReq clone() { + return new GetJukeboxDataCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetJukeboxDataCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetJukeboxDataCsReq(), data).checkInitialized(); + } + + public static GetJukeboxDataCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataCsReq(), input).checkInitialized(); + } + + public static GetJukeboxDataCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetJukeboxDataCsReq messages + */ + public static MessageFactory getFactory() { + return GetJukeboxDataCsReqFactory.INSTANCE; + } + + private enum GetJukeboxDataCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetJukeboxDataCsReq create() { + return GetJukeboxDataCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetJukeboxDataScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataScRspOuterClass.java new file mode 100644 index 0000000..2c22642 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetJukeboxDataScRspOuterClass.java @@ -0,0 +1,861 @@ +// 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 GetJukeboxDataScRspOuterClass { + /** + * Protobuf type {@code GetJukeboxDataScRsp} + */ + public static final class GetJukeboxDataScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 playing_id = 3; + */ + private int playingId; + + /** + * optional uint32 retcode = 14; + */ + private int retcode; + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + */ + private final RepeatedMessage musicList = RepeatedMessage.newEmptyInstance(UnlockedMusic.getFactory()); + + private GetJukeboxDataScRsp() { + } + + /** + * @return a new empty instance of {@code GetJukeboxDataScRsp} + */ + public static GetJukeboxDataScRsp newInstance() { + return new GetJukeboxDataScRsp(); + } + + /** + * optional uint32 playing_id = 3; + * @return whether the playingId field is set + */ + public boolean hasPlayingId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 playing_id = 3; + * @return this + */ + public GetJukeboxDataScRsp clearPlayingId() { + bitField0_ &= ~0x00000001; + playingId = 0; + return this; + } + + /** + * optional uint32 playing_id = 3; + * @return the playingId + */ + public int getPlayingId() { + return playingId; + } + + /** + * optional uint32 playing_id = 3; + * @param value the playingId to set + * @return this + */ + public GetJukeboxDataScRsp setPlayingId(final int value) { + bitField0_ |= 0x00000001; + playingId = value; + return this; + } + + /** + * optional uint32 retcode = 14; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 14; + * @return this + */ + public GetJukeboxDataScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 14; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 14; + * @param value the retcode to set + * @return this + */ + public GetJukeboxDataScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @return whether the musicList field is set + */ + public boolean hasMusicList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @return this + */ + public GetJukeboxDataScRsp clearMusicList() { + bitField0_ &= ~0x00000004; + musicList.clear(); + return this; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * + * 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 #getMutableMusicList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMusicList() { + return musicList; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * + * 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 getMutableMusicList() { + bitField0_ |= 0x00000004; + return musicList; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @param value the musicList to add + * @return this + */ + public GetJukeboxDataScRsp addMusicList(final UnlockedMusic value) { + bitField0_ |= 0x00000004; + musicList.add(value); + return this; + } + + /** + * repeated .GetJukeboxDataScRsp.UnlockedMusic music_list = 7; + * @param values the musicList to add + * @return this + */ + public GetJukeboxDataScRsp addAllMusicList(final UnlockedMusic... values) { + bitField0_ |= 0x00000004; + musicList.addAll(values); + return this; + } + + @Override + public GetJukeboxDataScRsp copyFrom(final GetJukeboxDataScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + playingId = other.playingId; + retcode = other.retcode; + musicList.copyFrom(other.musicList); + } + return this; + } + + @Override + public GetJukeboxDataScRsp mergeFrom(final GetJukeboxDataScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasPlayingId()) { + setPlayingId(other.playingId); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasMusicList()) { + getMutableMusicList().addAll(other.musicList); + } + return this; + } + + @Override + public GetJukeboxDataScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + playingId = 0; + retcode = 0; + musicList.clear(); + return this; + } + + @Override + public GetJukeboxDataScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + musicList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetJukeboxDataScRsp)) { + return false; + } + GetJukeboxDataScRsp other = (GetJukeboxDataScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasPlayingId() || playingId == other.playingId) + && (!hasRetcode() || retcode == other.retcode) + && (!hasMusicList() || musicList.equals(other.musicList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(playingId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < musicList.length(); i++) { + output.writeRawByte((byte) 58); + output.writeMessageNoTag(musicList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playingId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * musicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(musicList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetJukeboxDataScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 24: { + // playingId + playingId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 58) { + break; + } + } + case 58: { + // musicList + tag = input.readRepeatedMessage(musicList, tag); + bitField0_ |= 0x00000004; + 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.playingId, playingId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.musicList, musicList); + } + output.endObject(); + } + + @Override + public GetJukeboxDataScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1868462615: + case -2087744820: { + if (input.isAtField(FieldNames.playingId)) { + if (!input.trySkipNullValue()) { + playingId = 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 389904483: + case -780236168: { + if (input.isAtField(FieldNames.musicList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(musicList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetJukeboxDataScRsp clone() { + return new GetJukeboxDataScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetJukeboxDataScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetJukeboxDataScRsp(), data).checkInitialized(); + } + + public static GetJukeboxDataScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataScRsp(), input).checkInitialized(); + } + + public static GetJukeboxDataScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetJukeboxDataScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetJukeboxDataScRsp messages + */ + public static MessageFactory getFactory() { + return GetJukeboxDataScRspFactory.INSTANCE; + } + + /** + * Protobuf type {@code UnlockedMusic} + */ + public static final class UnlockedMusic extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 group_id = 1; + */ + private int groupId; + + /** + * optional uint32 id = 8; + */ + private int id; + + /** + * optional bool unkbool = 7; + */ + private boolean unkbool; + + private UnlockedMusic() { + } + + /** + * @return a new empty instance of {@code UnlockedMusic} + */ + public static UnlockedMusic newInstance() { + return new UnlockedMusic(); + } + + /** + * optional uint32 group_id = 1; + * @return whether the groupId field is set + */ + public boolean hasGroupId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 group_id = 1; + * @return this + */ + public UnlockedMusic clearGroupId() { + bitField0_ &= ~0x00000001; + groupId = 0; + return this; + } + + /** + * optional uint32 group_id = 1; + * @return the groupId + */ + public int getGroupId() { + return groupId; + } + + /** + * optional uint32 group_id = 1; + * @param value the groupId to set + * @return this + */ + public UnlockedMusic setGroupId(final int value) { + bitField0_ |= 0x00000001; + groupId = value; + return this; + } + + /** + * optional uint32 id = 8; + * @return whether the id field is set + */ + public boolean hasId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 id = 8; + * @return this + */ + public UnlockedMusic clearId() { + bitField0_ &= ~0x00000002; + id = 0; + return this; + } + + /** + * optional uint32 id = 8; + * @return the id + */ + public int getId() { + return id; + } + + /** + * optional uint32 id = 8; + * @param value the id to set + * @return this + */ + public UnlockedMusic setId(final int value) { + bitField0_ |= 0x00000002; + id = value; + return this; + } + + /** + * optional bool unkbool = 7; + * @return whether the unkbool field is set + */ + public boolean hasUnkbool() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool unkbool = 7; + * @return this + */ + public UnlockedMusic clearUnkbool() { + bitField0_ &= ~0x00000004; + unkbool = false; + return this; + } + + /** + * optional bool unkbool = 7; + * @return the unkbool + */ + public boolean getUnkbool() { + return unkbool; + } + + /** + * optional bool unkbool = 7; + * @param value the unkbool to set + * @return this + */ + public UnlockedMusic setUnkbool(final boolean value) { + bitField0_ |= 0x00000004; + unkbool = value; + return this; + } + + @Override + public UnlockedMusic copyFrom(final UnlockedMusic other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + groupId = other.groupId; + id = other.id; + unkbool = other.unkbool; + } + return this; + } + + @Override + public UnlockedMusic mergeFrom(final UnlockedMusic other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGroupId()) { + setGroupId(other.groupId); + } + if (other.hasId()) { + setId(other.id); + } + if (other.hasUnkbool()) { + setUnkbool(other.unkbool); + } + return this; + } + + @Override + public UnlockedMusic clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + groupId = 0; + id = 0; + unkbool = false; + return this; + } + + @Override + public UnlockedMusic 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 UnlockedMusic)) { + return false; + } + UnlockedMusic other = (UnlockedMusic) o; + return bitField0_ == other.bitField0_ + && (!hasGroupId() || groupId == other.groupId) + && (!hasId() || id == other.id) + && (!hasUnkbool() || unkbool == other.unkbool); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 56); + output.writeBoolNoTag(unkbool); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockedMusic mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // groupId + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // id + id = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // unkbool + unkbool = input.readBool(); + bitField0_ |= 0x00000004; + 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.groupId, groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.id, id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.unkbool, unkbool); + } + output.endObject(); + } + + @Override + public UnlockedMusic mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 293428218: + case 506361563: { + if (input.isAtField(FieldNames.groupId)) { + if (!input.trySkipNullValue()) { + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3355: { + if (input.isAtField(FieldNames.id)) { + if (!input.trySkipNullValue()) { + id = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -285198628: { + if (input.isAtField(FieldNames.unkbool)) { + if (!input.trySkipNullValue()) { + unkbool = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockedMusic clone() { + return new UnlockedMusic().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockedMusic parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), data).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockedMusic messages + */ + public static MessageFactory getFactory() { + return UnlockedMusicFactory.INSTANCE; + } + + private enum UnlockedMusicFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockedMusic create() { + return UnlockedMusic.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName groupId = FieldName.forField("groupId", "group_id"); + + static final FieldName id = FieldName.forField("id"); + + static final FieldName unkbool = FieldName.forField("unkbool"); + } + } + + private enum GetJukeboxDataScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetJukeboxDataScRsp create() { + return GetJukeboxDataScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName playingId = FieldName.forField("playingId", "playing_id"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName musicList = FieldName.forField("musicList", "music_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicCsReqOuterClass.java new file mode 100644 index 0000000..86aee44 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicCsReqOuterClass.java @@ -0,0 +1,260 @@ +// 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 PlayBackGroundMusicCsReqOuterClass { + /** + * Protobuf type {@code PlayBackGroundMusicCsReq} + */ + public static final class PlayBackGroundMusicCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 play_music_id = 6; + */ + private int playMusicId; + + private PlayBackGroundMusicCsReq() { + } + + /** + * @return a new empty instance of {@code PlayBackGroundMusicCsReq} + */ + public static PlayBackGroundMusicCsReq newInstance() { + return new PlayBackGroundMusicCsReq(); + } + + /** + * optional uint32 play_music_id = 6; + * @return whether the playMusicId field is set + */ + public boolean hasPlayMusicId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 play_music_id = 6; + * @return this + */ + public PlayBackGroundMusicCsReq clearPlayMusicId() { + bitField0_ &= ~0x00000001; + playMusicId = 0; + return this; + } + + /** + * optional uint32 play_music_id = 6; + * @return the playMusicId + */ + public int getPlayMusicId() { + return playMusicId; + } + + /** + * optional uint32 play_music_id = 6; + * @param value the playMusicId to set + * @return this + */ + public PlayBackGroundMusicCsReq setPlayMusicId(final int value) { + bitField0_ |= 0x00000001; + playMusicId = value; + return this; + } + + @Override + public PlayBackGroundMusicCsReq copyFrom(final PlayBackGroundMusicCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + playMusicId = other.playMusicId; + } + return this; + } + + @Override + public PlayBackGroundMusicCsReq mergeFrom(final PlayBackGroundMusicCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasPlayMusicId()) { + setPlayMusicId(other.playMusicId); + } + return this; + } + + @Override + public PlayBackGroundMusicCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + playMusicId = 0; + return this; + } + + @Override + public PlayBackGroundMusicCsReq 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 PlayBackGroundMusicCsReq)) { + return false; + } + PlayBackGroundMusicCsReq other = (PlayBackGroundMusicCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasPlayMusicId() || playMusicId == other.playMusicId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(playMusicId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playMusicId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public PlayBackGroundMusicCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // playMusicId + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000001; + 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.playMusicId, playMusicId); + } + output.endObject(); + } + + @Override + public PlayBackGroundMusicCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 835898444: + case -1319856608: { + if (input.isAtField(FieldNames.playMusicId)) { + if (!input.trySkipNullValue()) { + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public PlayBackGroundMusicCsReq clone() { + return new PlayBackGroundMusicCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static PlayBackGroundMusicCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicCsReq(), data).checkInitialized(); + } + + public static PlayBackGroundMusicCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicCsReq(), input).checkInitialized(); + } + + public static PlayBackGroundMusicCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating PlayBackGroundMusicCsReq messages + */ + public static MessageFactory getFactory() { + return PlayBackGroundMusicCsReqFactory.INSTANCE; + } + + private enum PlayBackGroundMusicCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public PlayBackGroundMusicCsReq create() { + return PlayBackGroundMusicCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName playMusicId = FieldName.forField("playMusicId", "play_music_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicScRspOuterClass.java new file mode 100644 index 0000000..3f86cea --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PlayBackGroundMusicScRspOuterClass.java @@ -0,0 +1,421 @@ +// 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 PlayBackGroundMusicScRspOuterClass { + /** + * Protobuf type {@code PlayBackGroundMusicScRsp} + */ + public static final class PlayBackGroundMusicScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 6; + */ + private int retcode; + + /** + * optional uint32 playing_id = 7; + */ + private int playingId; + + /** + * optional uint32 play_music_id = 8; + */ + private int playMusicId; + + private PlayBackGroundMusicScRsp() { + } + + /** + * @return a new empty instance of {@code PlayBackGroundMusicScRsp} + */ + public static PlayBackGroundMusicScRsp newInstance() { + return new PlayBackGroundMusicScRsp(); + } + + /** + * optional uint32 retcode = 6; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 6; + * @return this + */ + public PlayBackGroundMusicScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 6; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 6; + * @param value the retcode to set + * @return this + */ + public PlayBackGroundMusicScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * optional uint32 playing_id = 7; + * @return whether the playingId field is set + */ + public boolean hasPlayingId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 playing_id = 7; + * @return this + */ + public PlayBackGroundMusicScRsp clearPlayingId() { + bitField0_ &= ~0x00000002; + playingId = 0; + return this; + } + + /** + * optional uint32 playing_id = 7; + * @return the playingId + */ + public int getPlayingId() { + return playingId; + } + + /** + * optional uint32 playing_id = 7; + * @param value the playingId to set + * @return this + */ + public PlayBackGroundMusicScRsp setPlayingId(final int value) { + bitField0_ |= 0x00000002; + playingId = value; + return this; + } + + /** + * optional uint32 play_music_id = 8; + * @return whether the playMusicId field is set + */ + public boolean hasPlayMusicId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 play_music_id = 8; + * @return this + */ + public PlayBackGroundMusicScRsp clearPlayMusicId() { + bitField0_ &= ~0x00000004; + playMusicId = 0; + return this; + } + + /** + * optional uint32 play_music_id = 8; + * @return the playMusicId + */ + public int getPlayMusicId() { + return playMusicId; + } + + /** + * optional uint32 play_music_id = 8; + * @param value the playMusicId to set + * @return this + */ + public PlayBackGroundMusicScRsp setPlayMusicId(final int value) { + bitField0_ |= 0x00000004; + playMusicId = value; + return this; + } + + @Override + public PlayBackGroundMusicScRsp copyFrom(final PlayBackGroundMusicScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + playingId = other.playingId; + playMusicId = other.playMusicId; + } + return this; + } + + @Override + public PlayBackGroundMusicScRsp mergeFrom(final PlayBackGroundMusicScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasPlayingId()) { + setPlayingId(other.playingId); + } + if (other.hasPlayMusicId()) { + setPlayMusicId(other.playMusicId); + } + return this; + } + + @Override + public PlayBackGroundMusicScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + playingId = 0; + playMusicId = 0; + return this; + } + + @Override + public PlayBackGroundMusicScRsp 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 PlayBackGroundMusicScRsp)) { + return false; + } + PlayBackGroundMusicScRsp other = (PlayBackGroundMusicScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasPlayingId() || playingId == other.playingId) + && (!hasPlayMusicId() || playMusicId == other.playMusicId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(playingId); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(playMusicId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playingId); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(playMusicId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public PlayBackGroundMusicScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // playingId + playingId = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // playMusicId + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000004; + 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.writeUInt32(FieldNames.playingId, playingId); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.playMusicId, playMusicId); + } + output.endObject(); + } + + @Override + public PlayBackGroundMusicScRsp 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 -1868462615: + case -2087744820: { + if (input.isAtField(FieldNames.playingId)) { + if (!input.trySkipNullValue()) { + playingId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 835898444: + case -1319856608: { + if (input.isAtField(FieldNames.playMusicId)) { + if (!input.trySkipNullValue()) { + playMusicId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public PlayBackGroundMusicScRsp clone() { + return new PlayBackGroundMusicScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static PlayBackGroundMusicScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicScRsp(), data).checkInitialized(); + } + + public static PlayBackGroundMusicScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicScRsp(), input).checkInitialized(); + } + + public static PlayBackGroundMusicScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayBackGroundMusicScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating PlayBackGroundMusicScRsp messages + */ + public static MessageFactory getFactory() { + return PlayBackGroundMusicScRspFactory.INSTANCE; + } + + private enum PlayBackGroundMusicScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public PlayBackGroundMusicScRsp create() { + return PlayBackGroundMusicScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName playingId = FieldName.forField("playingId", "playing_id"); + + static final FieldName playMusicId = FieldName.forField("playMusicId", "play_music_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicCsReqOuterClass.java new file mode 100644 index 0000000..8bc796a --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicCsReqOuterClass.java @@ -0,0 +1,301 @@ +// 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 UnlockBackGroundMusicCsReqOuterClass { + /** + * Protobuf type {@code UnlockBackGroundMusicCsReq} + */ + public static final class UnlockBackGroundMusicCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated uint32 unlock_ids = 11; + */ + private final RepeatedInt unlockIds = RepeatedInt.newEmptyInstance(); + + private UnlockBackGroundMusicCsReq() { + } + + /** + * @return a new empty instance of {@code UnlockBackGroundMusicCsReq} + */ + public static UnlockBackGroundMusicCsReq newInstance() { + return new UnlockBackGroundMusicCsReq(); + } + + /** + * repeated uint32 unlock_ids = 11; + * @return whether the unlockIds field is set + */ + public boolean hasUnlockIds() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated uint32 unlock_ids = 11; + * @return this + */ + public UnlockBackGroundMusicCsReq clearUnlockIds() { + bitField0_ &= ~0x00000001; + unlockIds.clear(); + return this; + } + + /** + * repeated uint32 unlock_ids = 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 #getMutableUnlockIds()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getUnlockIds() { + return unlockIds; + } + + /** + * repeated uint32 unlock_ids = 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 getMutableUnlockIds() { + bitField0_ |= 0x00000001; + return unlockIds; + } + + /** + * repeated uint32 unlock_ids = 11; + * @param value the unlockIds to add + * @return this + */ + public UnlockBackGroundMusicCsReq addUnlockIds(final int value) { + bitField0_ |= 0x00000001; + unlockIds.add(value); + return this; + } + + /** + * repeated uint32 unlock_ids = 11; + * @param values the unlockIds to add + * @return this + */ + public UnlockBackGroundMusicCsReq addAllUnlockIds(final int... values) { + bitField0_ |= 0x00000001; + unlockIds.addAll(values); + return this; + } + + @Override + public UnlockBackGroundMusicCsReq copyFrom(final UnlockBackGroundMusicCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + unlockIds.copyFrom(other.unlockIds); + } + return this; + } + + @Override + public UnlockBackGroundMusicCsReq mergeFrom(final UnlockBackGroundMusicCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUnlockIds()) { + getMutableUnlockIds().addAll(other.unlockIds); + } + return this; + } + + @Override + public UnlockBackGroundMusicCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockIds.clear(); + return this; + } + + @Override + public UnlockBackGroundMusicCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockIds.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UnlockBackGroundMusicCsReq)) { + return false; + } + UnlockBackGroundMusicCsReq other = (UnlockBackGroundMusicCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasUnlockIds() || unlockIds.equals(other.unlockIds)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < unlockIds.length(); i++) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(unlockIds.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * unlockIds.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(unlockIds); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockBackGroundMusicCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 90: { + // unlockIds [packed=true] + input.readPackedUInt32(unlockIds, tag); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 88: { + // unlockIds [packed=false] + tag = input.readRepeatedUInt32(unlockIds, tag); + bitField0_ |= 0x00000001; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedUInt32(FieldNames.unlockIds, unlockIds); + } + output.endObject(); + } + + @Override + public UnlockBackGroundMusicCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 2050476244: + case -859086019: { + if (input.isAtField(FieldNames.unlockIds)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(unlockIds); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockBackGroundMusicCsReq clone() { + return new UnlockBackGroundMusicCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockBackGroundMusicCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicCsReq(), data).checkInitialized(); + } + + public static UnlockBackGroundMusicCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicCsReq(), input).checkInitialized(); + } + + public static UnlockBackGroundMusicCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockBackGroundMusicCsReq messages + */ + public static MessageFactory getFactory() { + return UnlockBackGroundMusicCsReqFactory.INSTANCE; + } + + private enum UnlockBackGroundMusicCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockBackGroundMusicCsReq create() { + return UnlockBackGroundMusicCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName unlockIds = FieldName.forField("unlockIds", "unlock_ids"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicScRspOuterClass.java new file mode 100644 index 0000000..7e5a902 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/UnlockBackGroundMusicScRspOuterClass.java @@ -0,0 +1,902 @@ +// 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; +import us.hebi.quickbuf.RepeatedMessage; + +public final class UnlockBackGroundMusicScRspOuterClass { + /** + * Protobuf type {@code UnlockBackGroundMusicScRsp} + */ + public static final class UnlockBackGroundMusicScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 12; + */ + private int retcode; + + /** + * repeated uint32 unlocked_ids = 3; + */ + private final RepeatedInt unlockedIds = RepeatedInt.newEmptyInstance(); + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + */ + private final RepeatedMessage musicList = RepeatedMessage.newEmptyInstance(UnlockedMusic.getFactory()); + + private UnlockBackGroundMusicScRsp() { + } + + /** + * @return a new empty instance of {@code UnlockBackGroundMusicScRsp} + */ + public static UnlockBackGroundMusicScRsp newInstance() { + return new UnlockBackGroundMusicScRsp(); + } + + /** + * optional uint32 retcode = 12; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 12; + * @return this + */ + public UnlockBackGroundMusicScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 12; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 12; + * @param value the retcode to set + * @return this + */ + public UnlockBackGroundMusicScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @return whether the unlockedIds field is set + */ + public boolean hasUnlockedIds() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @return this + */ + public UnlockBackGroundMusicScRsp clearUnlockedIds() { + bitField0_ &= ~0x00000002; + unlockedIds.clear(); + return this; + } + + /** + * repeated uint32 unlocked_ids = 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 #getMutableUnlockedIds()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getUnlockedIds() { + return unlockedIds; + } + + /** + * repeated uint32 unlocked_ids = 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 getMutableUnlockedIds() { + bitField0_ |= 0x00000002; + return unlockedIds; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @param value the unlockedIds to add + * @return this + */ + public UnlockBackGroundMusicScRsp addUnlockedIds(final int value) { + bitField0_ |= 0x00000002; + unlockedIds.add(value); + return this; + } + + /** + * repeated uint32 unlocked_ids = 3; + * @param values the unlockedIds to add + * @return this + */ + public UnlockBackGroundMusicScRsp addAllUnlockedIds(final int... values) { + bitField0_ |= 0x00000002; + unlockedIds.addAll(values); + return this; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @return whether the musicList field is set + */ + public boolean hasMusicList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @return this + */ + public UnlockBackGroundMusicScRsp clearMusicList() { + bitField0_ &= ~0x00000004; + musicList.clear(); + return this; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_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 #getMutableMusicList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMusicList() { + return musicList; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_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 getMutableMusicList() { + bitField0_ |= 0x00000004; + return musicList; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @param value the musicList to add + * @return this + */ + public UnlockBackGroundMusicScRsp addMusicList(final UnlockedMusic value) { + bitField0_ |= 0x00000004; + musicList.add(value); + return this; + } + + /** + * repeated .UnlockBackGroundMusicScRsp.UnlockedMusic music_list = 6; + * @param values the musicList to add + * @return this + */ + public UnlockBackGroundMusicScRsp addAllMusicList(final UnlockedMusic... values) { + bitField0_ |= 0x00000004; + musicList.addAll(values); + return this; + } + + @Override + public UnlockBackGroundMusicScRsp copyFrom(final UnlockBackGroundMusicScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + unlockedIds.copyFrom(other.unlockedIds); + musicList.copyFrom(other.musicList); + } + return this; + } + + @Override + public UnlockBackGroundMusicScRsp mergeFrom(final UnlockBackGroundMusicScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasUnlockedIds()) { + getMutableUnlockedIds().addAll(other.unlockedIds); + } + if (other.hasMusicList()) { + getMutableMusicList().addAll(other.musicList); + } + return this; + } + + @Override + public UnlockBackGroundMusicScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + unlockedIds.clear(); + musicList.clear(); + return this; + } + + @Override + public UnlockBackGroundMusicScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + unlockedIds.clear(); + musicList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UnlockBackGroundMusicScRsp)) { + return false; + } + UnlockBackGroundMusicScRsp other = (UnlockBackGroundMusicScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasUnlockedIds() || unlockedIds.equals(other.unlockedIds)) + && (!hasMusicList() || musicList.equals(other.musicList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < unlockedIds.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(unlockedIds.array()[i]); + } + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < musicList.length(); i++) { + output.writeRawByte((byte) 50); + output.writeMessageNoTag(musicList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * unlockedIds.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(unlockedIds); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * musicList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(musicList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockBackGroundMusicScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 96: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // unlockedIds [packed=true] + input.readPackedUInt32(unlockedIds, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 50) { + break; + } + } + case 50: { + // musicList + tag = input.readRepeatedMessage(musicList, tag); + bitField0_ |= 0x00000004; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 24: { + // unlockedIds [packed=false] + tag = input.readRepeatedUInt32(unlockedIds, tag); + bitField0_ |= 0x00000002; + 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.writeRepeatedUInt32(FieldNames.unlockedIds, unlockedIds); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.musicList, musicList); + } + output.endObject(); + } + + @Override + public UnlockBackGroundMusicScRsp 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 -856496939: + case -780941476: { + if (input.isAtField(FieldNames.unlockedIds)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(unlockedIds); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 389904483: + case -780236168: { + if (input.isAtField(FieldNames.musicList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(musicList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockBackGroundMusicScRsp clone() { + return new UnlockBackGroundMusicScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockBackGroundMusicScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicScRsp(), data).checkInitialized(); + } + + public static UnlockBackGroundMusicScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicScRsp(), input).checkInitialized(); + } + + public static UnlockBackGroundMusicScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockBackGroundMusicScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockBackGroundMusicScRsp messages + */ + public static MessageFactory getFactory() { + return UnlockBackGroundMusicScRspFactory.INSTANCE; + } + + /** + * Protobuf type {@code UnlockedMusic} + */ + public static final class UnlockedMusic extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 group_id = 1; + */ + private int groupId; + + /** + * optional uint32 id = 8; + */ + private int id; + + /** + * optional bool unkbool = 7; + */ + private boolean unkbool; + + private UnlockedMusic() { + } + + /** + * @return a new empty instance of {@code UnlockedMusic} + */ + public static UnlockedMusic newInstance() { + return new UnlockedMusic(); + } + + /** + * optional uint32 group_id = 1; + * @return whether the groupId field is set + */ + public boolean hasGroupId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 group_id = 1; + * @return this + */ + public UnlockedMusic clearGroupId() { + bitField0_ &= ~0x00000001; + groupId = 0; + return this; + } + + /** + * optional uint32 group_id = 1; + * @return the groupId + */ + public int getGroupId() { + return groupId; + } + + /** + * optional uint32 group_id = 1; + * @param value the groupId to set + * @return this + */ + public UnlockedMusic setGroupId(final int value) { + bitField0_ |= 0x00000001; + groupId = value; + return this; + } + + /** + * optional uint32 id = 8; + * @return whether the id field is set + */ + public boolean hasId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 id = 8; + * @return this + */ + public UnlockedMusic clearId() { + bitField0_ &= ~0x00000002; + id = 0; + return this; + } + + /** + * optional uint32 id = 8; + * @return the id + */ + public int getId() { + return id; + } + + /** + * optional uint32 id = 8; + * @param value the id to set + * @return this + */ + public UnlockedMusic setId(final int value) { + bitField0_ |= 0x00000002; + id = value; + return this; + } + + /** + * optional bool unkbool = 7; + * @return whether the unkbool field is set + */ + public boolean hasUnkbool() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool unkbool = 7; + * @return this + */ + public UnlockedMusic clearUnkbool() { + bitField0_ &= ~0x00000004; + unkbool = false; + return this; + } + + /** + * optional bool unkbool = 7; + * @return the unkbool + */ + public boolean getUnkbool() { + return unkbool; + } + + /** + * optional bool unkbool = 7; + * @param value the unkbool to set + * @return this + */ + public UnlockedMusic setUnkbool(final boolean value) { + bitField0_ |= 0x00000004; + unkbool = value; + return this; + } + + @Override + public UnlockedMusic copyFrom(final UnlockedMusic other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + groupId = other.groupId; + id = other.id; + unkbool = other.unkbool; + } + return this; + } + + @Override + public UnlockedMusic mergeFrom(final UnlockedMusic other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasGroupId()) { + setGroupId(other.groupId); + } + if (other.hasId()) { + setId(other.id); + } + if (other.hasUnkbool()) { + setUnkbool(other.unkbool); + } + return this; + } + + @Override + public UnlockedMusic clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + groupId = 0; + id = 0; + unkbool = false; + return this; + } + + @Override + public UnlockedMusic 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 UnlockedMusic)) { + return false; + } + UnlockedMusic other = (UnlockedMusic) o; + return bitField0_ == other.bitField0_ + && (!hasGroupId() || groupId == other.groupId) + && (!hasId() || id == other.id) + && (!hasUnkbool() || unkbool == other.unkbool); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 56); + output.writeBoolNoTag(unkbool); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(id); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public UnlockedMusic mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // groupId + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // id + id = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // unkbool + unkbool = input.readBool(); + bitField0_ |= 0x00000004; + 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.groupId, groupId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.id, id); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.unkbool, unkbool); + } + output.endObject(); + } + + @Override + public UnlockedMusic mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 293428218: + case 506361563: { + if (input.isAtField(FieldNames.groupId)) { + if (!input.trySkipNullValue()) { + groupId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3355: { + if (input.isAtField(FieldNames.id)) { + if (!input.trySkipNullValue()) { + id = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -285198628: { + if (input.isAtField(FieldNames.unkbool)) { + if (!input.trySkipNullValue()) { + unkbool = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public UnlockedMusic clone() { + return new UnlockedMusic().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static UnlockedMusic parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), data).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + public static UnlockedMusic parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new UnlockedMusic(), input).checkInitialized(); + } + + /** + * @return factory for creating UnlockedMusic messages + */ + public static MessageFactory getFactory() { + return UnlockedMusicFactory.INSTANCE; + } + + private enum UnlockedMusicFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockedMusic create() { + return UnlockedMusic.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName groupId = FieldName.forField("groupId", "group_id"); + + static final FieldName id = FieldName.forField("id"); + + static final FieldName unkbool = FieldName.forField("unkbool"); + } + } + + private enum UnlockBackGroundMusicScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public UnlockBackGroundMusicScRsp create() { + return UnlockBackGroundMusicScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName unlockedIds = FieldName.forField("unlockedIds", "unlocked_ids"); + + static final FieldName musicList = FieldName.forField("musicList", "music_list"); + } + } +} diff --git a/src/main/java/emu/lunarcore/data/GameData.java b/src/main/java/emu/lunarcore/data/GameData.java index 0b8b270..38a003b 100644 --- a/src/main/java/emu/lunarcore/data/GameData.java +++ b/src/main/java/emu/lunarcore/data/GameData.java @@ -34,6 +34,7 @@ public class GameData { @Getter private static Int2ObjectMap playerIconExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap itemComposeExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap activityPanelExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap backGroundMusicExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap challengeGroupExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap challengeExcelMap = new Int2ObjectOpenHashMap<>(); @@ -97,6 +98,22 @@ public class GameData { return allIds; } + public static List getAllMusicIds() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : backGroundMusicExcelMap.int2ObjectEntrySet()) { + BackGroundMusicExcel backGroundMusicExcel = entry.getValue(); + allIds.add(backGroundMusicExcel.getId()); + } + + return allIds; + } + + public static int getMusicGroupId(int musicId) { + var excel = backGroundMusicExcelMap.get(musicId); + return excel != null ? excel.getGroupId() : 0; + } + public static List getAllPhoneThemes() { List allIds = new ArrayList<>(); diff --git a/src/main/java/emu/lunarcore/data/excel/BackGroundMusicExcel.java b/src/main/java/emu/lunarcore/data/excel/BackGroundMusicExcel.java new file mode 100644 index 0000000..7a00621 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/BackGroundMusicExcel.java @@ -0,0 +1,23 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import lombok.Getter; + +@Getter +@ResourceType(name = {"BackGroundMusic.json"}) +public class BackGroundMusicExcel extends GameResource { + private int ID; + private int GroupID; + + @Override + public int getId() { + return ID; + } + public int getGroupId() { + return GroupID; + } + +} diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index d475176..604a061 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -100,6 +100,8 @@ public class Player { private int planeId; private int floorId; private int entryId; + + private int currentBgm; private IntSet unlockedHeadIcons; private long lastActiveTime; @@ -161,6 +163,8 @@ public class Player { this.level = 1; this.stamina = GameConstants.MAX_STAMINA; this.nextStaminaRecover = System.currentTimeMillis(); + + this.currentBgm = 210000; this.unlockedHeadIcons = new IntOpenHashSet(); this.lineupManager = new LineupManager(this); @@ -254,6 +258,19 @@ public class Player { public int getChatBubble() { return this.chatBubble; } + + public int getCurrentBgm() { + if (this.currentBgm == 0) { + this.currentBgm = 210000; + this.save(); + } + return this.currentBgm; + } + + public void setCurrentBgm(int musicId) { + this.currentBgm = musicId; + this.save(); + } public Set getUnlockedHeadIcons() { if (this.unlockedHeadIcons == null) { diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetJukeboxDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetJukeboxDataCsReq.java new file mode 100644 index 0000000..7921c39 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetJukeboxDataCsReq.java @@ -0,0 +1,19 @@ +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.proto.GetJukeboxDataCsReqOuterClass.GetJukeboxDataCsReq; +import emu.lunarcore.server.packet.send.PacketGetJukeboxDataScRsp; + +@Opcodes(CmdId.GetJukeboxDataCsReq) +public class HandlerGetJukeboxDataCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + // var req = GetJukeboxDataCsReq.parseFrom(data); + session.send(new PacketGetJukeboxDataScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayBackGroundMusicCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayBackGroundMusicCsReq.java new file mode 100644 index 0000000..9b78c60 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayBackGroundMusicCsReq.java @@ -0,0 +1,21 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.PlayBackGroundMusicCsReqOuterClass.PlayBackGroundMusicCsReq; +import emu.lunarcore.server.packet.send.PacketPlayBackGroundMusicScRsp; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; + +@Opcodes(CmdId.PlayBackGroundMusicCsReq) +public class HandlerPlayBackGroundMusicCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = PlayBackGroundMusicCsReq.parseFrom(data); + + session.getPlayer().setCurrentBgm(req.getPlayMusicId()); + session.send(new PacketPlayBackGroundMusicScRsp(req.getPlayMusicId())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerUnlockBackGroundMusicCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerUnlockBackGroundMusicCsReq.java new file mode 100644 index 0000000..5c5967a --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerUnlockBackGroundMusicCsReq.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.UnlockBackGroundMusicCsReqOuterClass.UnlockBackGroundMusicCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import java.util.List; +import java.util.ArrayList; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketUnlockBackGroundMusicScRsp; + +@Opcodes(CmdId.UnlockBackGroundMusicCsReq) +public class HandlerUnlockBackGroundMusicCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = UnlockBackGroundMusicCsReq.parseFrom(data); + + var unlockIds = req.getUnlockIds(); + List unlockIdsList = new ArrayList<>(); + for (int unlockId : unlockIds) { + unlockIdsList.add(unlockId); + } + if (unlockIdsList.isEmpty()) { + session.send(new PacketUnlockBackGroundMusicScRsp()); + } + else { + session.send(new PacketUnlockBackGroundMusicScRsp(unlockIdsList)); + } + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetJukeboxDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetJukeboxDataScRsp.java new file mode 100644 index 0000000..e6fba5e --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetJukeboxDataScRsp.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.data.GameData; +import emu.lunarcore.proto.GetJukeboxDataScRspOuterClass.GetJukeboxDataScRsp; +import emu.lunarcore.proto.GetJukeboxDataScRspOuterClass.GetJukeboxDataScRsp.UnlockedMusic; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetJukeboxDataScRsp extends BasePacket { + + public PacketGetJukeboxDataScRsp(Player player) { + super(CmdId.GetJukeboxDataScRsp); + + var allmusicids = GameData.getAllMusicIds(); + + var data = GetJukeboxDataScRsp.newInstance() + .setPlayingId(player.getCurrentBgm()); + + for (int musicId : allmusicids) { + UnlockedMusic musicListEntry = UnlockedMusic.newInstance() + .setId(musicId) + .setUnkbool(true) + .setGroupId(GameData.getMusicGroupId(musicId)); + + data.addMusicList(musicListEntry); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketPlayBackGroundMusicScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketPlayBackGroundMusicScRsp.java new file mode 100644 index 0000000..802f84b --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketPlayBackGroundMusicScRsp.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.PlayBackGroundMusicScRspOuterClass.PlayBackGroundMusicScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketPlayBackGroundMusicScRsp extends BasePacket { + + public PacketPlayBackGroundMusicScRsp(int musicId) { + super(CmdId.PlayBackGroundMusicScRsp); + + var data = PlayBackGroundMusicScRsp.newInstance() + .setPlayingId(musicId) + .setPlayMusicId(musicId); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketUnlockBackGroundMusicScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketUnlockBackGroundMusicScRsp.java new file mode 100644 index 0000000..61d094e --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketUnlockBackGroundMusicScRsp.java @@ -0,0 +1,31 @@ +package emu.lunarcore.server.packet.send; + +import java.util.List; +import emu.lunarcore.proto.UnlockBackGroundMusicScRspOuterClass.UnlockBackGroundMusicScRsp.UnlockedMusic; +import emu.lunarcore.proto.UnlockBackGroundMusicScRspOuterClass.UnlockBackGroundMusicScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.data.GameData; + +public class PacketUnlockBackGroundMusicScRsp extends BasePacket { + + public PacketUnlockBackGroundMusicScRsp(List unlockIds) { + super(CmdId.UnlockBackGroundMusicScRsp); + + var data = UnlockBackGroundMusicScRsp.newInstance(); + + for (int unlockId : unlockIds) { + UnlockedMusic music = UnlockedMusic.newInstance() + .setGroupId(GameData.getMusicGroupId(unlockId)) + .setId(unlockId); + data.addMusicList(music); + } + + this.setData(data); + } + + public PacketUnlockBackGroundMusicScRsp() { + super(CmdId.UnlockBackGroundMusicScRsp); + this.setData(UnlockBackGroundMusicScRsp.newInstance()); + } +}