diff --git a/src/generated/main/emu/lunarcore/proto/AddRogueBuffScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/AddRogueBuffScNotifyOuterClass.java new file mode 100644 index 0000000..cee38df --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/AddRogueBuffScNotifyOuterClass.java @@ -0,0 +1,394 @@ +// 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 AddRogueBuffScNotifyOuterClass { + /** + * Protobuf type {@code AddRogueBuffScNotify} + */ + public static final class AddRogueBuffScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .RogueBuffSource source = 15; + */ + private int source; + + /** + * optional .RogueBuff maze_buff_info = 11; + */ + private final RogueBuffOuterClass.RogueBuff mazeBuffInfo = RogueBuffOuterClass.RogueBuff.newInstance(); + + private AddRogueBuffScNotify() { + } + + /** + * @return a new empty instance of {@code AddRogueBuffScNotify} + */ + public static AddRogueBuffScNotify newInstance() { + return new AddRogueBuffScNotify(); + } + + /** + * optional .RogueBuffSource source = 15; + * @return whether the source field is set + */ + public boolean hasSource() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .RogueBuffSource source = 15; + * @return this + */ + public AddRogueBuffScNotify clearSource() { + bitField0_ &= ~0x00000001; + source = 0; + return this; + } + + /** + * optional .RogueBuffSource source = 15; + * @return the source + */ + public RogueBuffSourceOuterClass.RogueBuffSource getSource() { + return RogueBuffSourceOuterClass.RogueBuffSource.forNumber(source); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link AddRogueBuffScNotify#getSource()}.getNumber(). + * + * @return numeric wire representation + */ + public int getSourceValue() { + return source; + } + + /** + * Sets the value of the internal enum store. This does not + * do any validity checks, so be sure to use appropriate value + * constants from {@link RogueBuffSourceOuterClass.RogueBuffSource}. Setting an invalid value + * can cause {@link AddRogueBuffScNotify#getSource()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public AddRogueBuffScNotify setSourceValue(final int value) { + bitField0_ |= 0x00000001; + source = value; + return this; + } + + /** + * optional .RogueBuffSource source = 15; + * @param value the source to set + * @return this + */ + public AddRogueBuffScNotify setSource(final RogueBuffSourceOuterClass.RogueBuffSource value) { + bitField0_ |= 0x00000001; + source = value.getNumber(); + return this; + } + + /** + * optional .RogueBuff maze_buff_info = 11; + * @return whether the mazeBuffInfo field is set + */ + public boolean hasMazeBuffInfo() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .RogueBuff maze_buff_info = 11; + * @return this + */ + public AddRogueBuffScNotify clearMazeBuffInfo() { + bitField0_ &= ~0x00000002; + mazeBuffInfo.clear(); + return this; + } + + /** + * optional .RogueBuff maze_buff_info = 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 #getMutableMazeBuffInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueBuffOuterClass.RogueBuff getMazeBuffInfo() { + return mazeBuffInfo; + } + + /** + * optional .RogueBuff maze_buff_info = 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 RogueBuffOuterClass.RogueBuff getMutableMazeBuffInfo() { + bitField0_ |= 0x00000002; + return mazeBuffInfo; + } + + /** + * optional .RogueBuff maze_buff_info = 11; + * @param value the mazeBuffInfo to set + * @return this + */ + public AddRogueBuffScNotify setMazeBuffInfo(final RogueBuffOuterClass.RogueBuff value) { + bitField0_ |= 0x00000002; + mazeBuffInfo.copyFrom(value); + return this; + } + + @Override + public AddRogueBuffScNotify copyFrom(final AddRogueBuffScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + source = other.source; + mazeBuffInfo.copyFrom(other.mazeBuffInfo); + } + return this; + } + + @Override + public AddRogueBuffScNotify mergeFrom(final AddRogueBuffScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasSource()) { + setSourceValue(other.source); + } + if (other.hasMazeBuffInfo()) { + getMutableMazeBuffInfo().mergeFrom(other.mazeBuffInfo); + } + return this; + } + + @Override + public AddRogueBuffScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + source = 0; + mazeBuffInfo.clear(); + return this; + } + + @Override + public AddRogueBuffScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + mazeBuffInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof AddRogueBuffScNotify)) { + return false; + } + AddRogueBuffScNotify other = (AddRogueBuffScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasSource() || source == other.source) + && (!hasMazeBuffInfo() || mazeBuffInfo.equals(other.mazeBuffInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 120); + output.writeEnumNoTag(source); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 90); + output.writeMessageNoTag(mazeBuffInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(source); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(mazeBuffInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public AddRogueBuffScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 120: { + // source + final int value = input.readInt32(); + if (RogueBuffSourceOuterClass.RogueBuffSource.forNumber(value) != null) { + source = value; + bitField0_ |= 0x00000001; + } + tag = input.readTag(); + if (tag != 90) { + break; + } + } + case 90: { + // mazeBuffInfo + input.readMessage(mazeBuffInfo); + 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.writeEnum(FieldNames.source, source, RogueBuffSourceOuterClass.RogueBuffSource.converter()); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.mazeBuffInfo, mazeBuffInfo); + } + output.endObject(); + } + + @Override + public AddRogueBuffScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -896505829: { + if (input.isAtField(FieldNames.source)) { + if (!input.trySkipNullValue()) { + final RogueBuffSourceOuterClass.RogueBuffSource value = input.readEnum(RogueBuffSourceOuterClass.RogueBuffSource.converter()); + if (value != null) { + source = value.getNumber(); + bitField0_ |= 0x00000001; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + case 1147143296: + case -1635080038: { + if (input.isAtField(FieldNames.mazeBuffInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(mazeBuffInfo); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public AddRogueBuffScNotify clone() { + return new AddRogueBuffScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static AddRogueBuffScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new AddRogueBuffScNotify(), data).checkInitialized(); + } + + public static AddRogueBuffScNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new AddRogueBuffScNotify(), input).checkInitialized(); + } + + public static AddRogueBuffScNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new AddRogueBuffScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating AddRogueBuffScNotify messages + */ + public static MessageFactory getFactory() { + return AddRogueBuffScNotifyFactory.INSTANCE; + } + + private enum AddRogueBuffScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public AddRogueBuffScNotify create() { + return AddRogueBuffScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName source = FieldName.forField("source"); + + static final FieldName mazeBuffInfo = FieldName.forField("mazeBuffInfo", "maze_buff_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueBuffInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueBuffInfoOuterClass.java new file mode 100644 index 0000000..dbd28a8 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RogueBuffInfoOuterClass.java @@ -0,0 +1,396 @@ +// 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 RogueBuffInfoOuterClass { + /** + * Protobuf type {@code RogueBuffInfo} + */ + public static final class RogueBuffInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .RogueBuffSelectInfo buff_select_info = 5; + */ + private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo buffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance(); + + /** + * repeated .RogueBuff maze_buff_list = 11; + */ + private final RepeatedMessage mazeBuffList = RepeatedMessage.newEmptyInstance(RogueBuffOuterClass.RogueBuff.getFactory()); + + private RogueBuffInfo() { + } + + /** + * @return a new empty instance of {@code RogueBuffInfo} + */ + public static RogueBuffInfo newInstance() { + return new RogueBuffInfo(); + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 5; + * @return whether the buffSelectInfo field is set + */ + public boolean hasBuffSelectInfo() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 5; + * @return this + */ + public RogueBuffInfo clearBuffSelectInfo() { + bitField0_ &= ~0x00000001; + buffSelectInfo.clear(); + return this; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 5; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableBuffSelectInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getBuffSelectInfo() { + return buffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 5; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableBuffSelectInfo() { + bitField0_ |= 0x00000001; + return buffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 5; + * @param value the buffSelectInfo to set + * @return this + */ + public RogueBuffInfo setBuffSelectInfo( + final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) { + bitField0_ |= 0x00000001; + buffSelectInfo.copyFrom(value); + return this; + } + + /** + * repeated .RogueBuff maze_buff_list = 11; + * @return whether the mazeBuffList field is set + */ + public boolean hasMazeBuffList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated .RogueBuff maze_buff_list = 11; + * @return this + */ + public RogueBuffInfo clearMazeBuffList() { + bitField0_ &= ~0x00000002; + mazeBuffList.clear(); + return this; + } + + /** + * repeated .RogueBuff maze_buff_list = 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 #getMutableMazeBuffList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMazeBuffList() { + return mazeBuffList; + } + + /** + * repeated .RogueBuff maze_buff_list = 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 RepeatedMessage getMutableMazeBuffList() { + bitField0_ |= 0x00000002; + return mazeBuffList; + } + + /** + * repeated .RogueBuff maze_buff_list = 11; + * @param value the mazeBuffList to add + * @return this + */ + public RogueBuffInfo addMazeBuffList(final RogueBuffOuterClass.RogueBuff value) { + bitField0_ |= 0x00000002; + mazeBuffList.add(value); + return this; + } + + /** + * repeated .RogueBuff maze_buff_list = 11; + * @param values the mazeBuffList to add + * @return this + */ + public RogueBuffInfo addAllMazeBuffList(final RogueBuffOuterClass.RogueBuff... values) { + bitField0_ |= 0x00000002; + mazeBuffList.addAll(values); + return this; + } + + @Override + public RogueBuffInfo copyFrom(final RogueBuffInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + buffSelectInfo.copyFrom(other.buffSelectInfo); + mazeBuffList.copyFrom(other.mazeBuffList); + } + return this; + } + + @Override + public RogueBuffInfo mergeFrom(final RogueBuffInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBuffSelectInfo()) { + getMutableBuffSelectInfo().mergeFrom(other.buffSelectInfo); + } + if (other.hasMazeBuffList()) { + getMutableMazeBuffList().addAll(other.mazeBuffList); + } + return this; + } + + @Override + public RogueBuffInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffSelectInfo.clear(); + mazeBuffList.clear(); + return this; + } + + @Override + public RogueBuffInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffSelectInfo.clearQuick(); + mazeBuffList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RogueBuffInfo)) { + return false; + } + RogueBuffInfo other = (RogueBuffInfo) o; + return bitField0_ == other.bitField0_ + && (!hasBuffSelectInfo() || buffSelectInfo.equals(other.buffSelectInfo)) + && (!hasMazeBuffList() || mazeBuffList.equals(other.mazeBuffList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(buffSelectInfo); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < mazeBuffList.length(); i++) { + output.writeRawByte((byte) 90); + output.writeMessageNoTag(mazeBuffList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(buffSelectInfo); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * mazeBuffList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(mazeBuffList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RogueBuffInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 42: { + // buffSelectInfo + input.readMessage(buffSelectInfo); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 90) { + break; + } + } + case 90: { + // mazeBuffList + tag = input.readRepeatedMessage(mazeBuffList, tag); + bitField0_ |= 0x00000002; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeMessage(FieldNames.buffSelectInfo, buffSelectInfo); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedMessage(FieldNames.mazeBuffList, mazeBuffList); + } + output.endObject(); + } + + @Override + public RogueBuffInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -255242115: + case 1500540965: { + if (input.isAtField(FieldNames.buffSelectInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(buffSelectInfo); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1147228272: + case -1634995062: { + if (input.isAtField(FieldNames.mazeBuffList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(mazeBuffList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RogueBuffInfo clone() { + return new RogueBuffInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RogueBuffInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RogueBuffInfo(), data).checkInitialized(); + } + + public static RogueBuffInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueBuffInfo(), input).checkInitialized(); + } + + public static RogueBuffInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueBuffInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating RogueBuffInfo messages + */ + public static MessageFactory getFactory() { + return RogueBuffInfoFactory.INSTANCE; + } + + private enum RogueBuffInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public RogueBuffInfo create() { + return RogueBuffInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName buffSelectInfo = FieldName.forField("buffSelectInfo", "buff_select_info"); + + static final FieldName mazeBuffList = FieldName.forField("mazeBuffList", "maze_buff_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueBuffOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueBuffOuterClass.java new file mode 100644 index 0000000..6265e29 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RogueBuffOuterClass.java @@ -0,0 +1,339 @@ +// 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 RogueBuffOuterClass { + /** + * Protobuf type {@code RogueBuff} + */ + public static final class RogueBuff extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 buff_id = 8; + */ + private int buffId; + + /** + * optional uint32 level = 13; + */ + private int level; + + private RogueBuff() { + } + + /** + * @return a new empty instance of {@code RogueBuff} + */ + public static RogueBuff newInstance() { + return new RogueBuff(); + } + + /** + * optional uint32 buff_id = 8; + * @return whether the buffId field is set + */ + public boolean hasBuffId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 buff_id = 8; + * @return this + */ + public RogueBuff clearBuffId() { + bitField0_ &= ~0x00000001; + buffId = 0; + return this; + } + + /** + * optional uint32 buff_id = 8; + * @return the buffId + */ + public int getBuffId() { + return buffId; + } + + /** + * optional uint32 buff_id = 8; + * @param value the buffId to set + * @return this + */ + public RogueBuff setBuffId(final int value) { + bitField0_ |= 0x00000001; + buffId = value; + return this; + } + + /** + * optional uint32 level = 13; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 level = 13; + * @return this + */ + public RogueBuff clearLevel() { + bitField0_ &= ~0x00000002; + level = 0; + return this; + } + + /** + * optional uint32 level = 13; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 13; + * @param value the level to set + * @return this + */ + public RogueBuff setLevel(final int value) { + bitField0_ |= 0x00000002; + level = value; + return this; + } + + @Override + public RogueBuff copyFrom(final RogueBuff other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + buffId = other.buffId; + level = other.level; + } + return this; + } + + @Override + public RogueBuff mergeFrom(final RogueBuff other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBuffId()) { + setBuffId(other.buffId); + } + if (other.hasLevel()) { + setLevel(other.level); + } + return this; + } + + @Override + public RogueBuff clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffId = 0; + level = 0; + return this; + } + + @Override + public RogueBuff 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 RogueBuff)) { + return false; + } + RogueBuff other = (RogueBuff) o; + return bitField0_ == other.bitField0_ + && (!hasBuffId() || buffId == other.buffId) + && (!hasLevel() || level == other.level); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(buffId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(level); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(buffId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RogueBuff mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 64: { + // buffId + buffId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // level + level = input.readUInt32(); + 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.buffId, buffId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.level, level); + } + output.endObject(); + } + + @Override + public RogueBuff mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1378119474: + case 227990663: { + if (input.isAtField(FieldNames.buffId)) { + if (!input.trySkipNullValue()) { + buffId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RogueBuff clone() { + return new RogueBuff().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RogueBuff parseFrom(final byte[] data) throws InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RogueBuff(), data).checkInitialized(); + } + + public static RogueBuff parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueBuff(), input).checkInitialized(); + } + + public static RogueBuff parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueBuff(), input).checkInitialized(); + } + + /** + * @return factory for creating RogueBuff messages + */ + public static MessageFactory getFactory() { + return RogueBuffFactory.INSTANCE; + } + + private enum RogueBuffFactory implements MessageFactory { + INSTANCE; + + @Override + public RogueBuff create() { + return RogueBuff.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName buffId = FieldName.forField("buffId", "buff_id"); + + static final FieldName level = FieldName.forField("level"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueBuffSelectInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueBuffSelectInfoOuterClass.java new file mode 100644 index 0000000..e9e5faf --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RogueBuffSelectInfoOuterClass.java @@ -0,0 +1,1380 @@ +// 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 RogueBuffSelectInfoOuterClass { + /** + * Protobuf type {@code RogueBuffSelectInfo} + */ + public static final class RogueBuffSelectInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 select_buff_source_total_count = 1; + */ + private int selectBuffSourceTotalCount; + + /** + *
+     * repeated RogueHandbookBuff handbook_buff_list = 6;
+     * 
+ * + * optional uint32 BDDKDOICAGG = 3; + */ + private int bDDKDOICAGG; + + /** + * optional uint32 roll_buff_max_times = 4; + */ + private int rollBuffMaxTimes; + + /** + * optional uint32 roll_buff_times = 7; + */ + private int rollBuffTimes; + + /** + * optional uint32 select_buff_source_hint = 10; + */ + private int selectBuffSourceHint; + + /** + * optional uint32 select_buff_source_cur_count = 11; + */ + private int selectBuffSourceCurCount; + + /** + * optional uint32 rogue_coin = 13; + */ + private int rogueCoin; + + /** + * optional .RogueCommonBuffSelectSource source = 12; + */ + private int source; + + /** + * optional bool show_handbook_hint = 2; + */ + private boolean showHandbookHint; + + /** + * optional bool can_roll = 9; + */ + private boolean canRoll; + + /** + * optional .ItemCostList roll_buffs_cost = 8; + */ + private final ItemCostListOuterClass.ItemCostList rollBuffsCost = ItemCostListOuterClass.ItemCostList.newInstance(); + + /** + * repeated uint32 select_first_buff_list = 5; + */ + private final RepeatedInt selectFirstBuffList = RepeatedInt.newEmptyInstance(); + + /** + * repeated .RogueBuff maze_buff_list = 14; + */ + private final RepeatedMessage mazeBuffList = RepeatedMessage.newEmptyInstance(RogueBuffOuterClass.RogueBuff.getFactory()); + + private RogueBuffSelectInfo() { + } + + /** + * @return a new empty instance of {@code RogueBuffSelectInfo} + */ + public static RogueBuffSelectInfo newInstance() { + return new RogueBuffSelectInfo(); + } + + /** + * optional uint32 select_buff_source_total_count = 1; + * @return whether the selectBuffSourceTotalCount field is set + */ + public boolean hasSelectBuffSourceTotalCount() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 select_buff_source_total_count = 1; + * @return this + */ + public RogueBuffSelectInfo clearSelectBuffSourceTotalCount() { + bitField0_ &= ~0x00000001; + selectBuffSourceTotalCount = 0; + return this; + } + + /** + * optional uint32 select_buff_source_total_count = 1; + * @return the selectBuffSourceTotalCount + */ + public int getSelectBuffSourceTotalCount() { + return selectBuffSourceTotalCount; + } + + /** + * optional uint32 select_buff_source_total_count = 1; + * @param value the selectBuffSourceTotalCount to set + * @return this + */ + public RogueBuffSelectInfo setSelectBuffSourceTotalCount(final int value) { + bitField0_ |= 0x00000001; + selectBuffSourceTotalCount = value; + return this; + } + + /** + *
+     * repeated RogueHandbookBuff handbook_buff_list = 6;
+     * 
+ * + * optional uint32 BDDKDOICAGG = 3; + * @return whether the bDDKDOICAGG field is set + */ + public boolean hasBDDKDOICAGG() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + *
+     * repeated RogueHandbookBuff handbook_buff_list = 6;
+     * 
+ * + * optional uint32 BDDKDOICAGG = 3; + * @return this + */ + public RogueBuffSelectInfo clearBDDKDOICAGG() { + bitField0_ &= ~0x00000002; + bDDKDOICAGG = 0; + return this; + } + + /** + *
+     * repeated RogueHandbookBuff handbook_buff_list = 6;
+     * 
+ * + * optional uint32 BDDKDOICAGG = 3; + * @return the bDDKDOICAGG + */ + public int getBDDKDOICAGG() { + return bDDKDOICAGG; + } + + /** + *
+     * repeated RogueHandbookBuff handbook_buff_list = 6;
+     * 
+ * + * optional uint32 BDDKDOICAGG = 3; + * @param value the bDDKDOICAGG to set + * @return this + */ + public RogueBuffSelectInfo setBDDKDOICAGG(final int value) { + bitField0_ |= 0x00000002; + bDDKDOICAGG = value; + return this; + } + + /** + * optional uint32 roll_buff_max_times = 4; + * @return whether the rollBuffMaxTimes field is set + */ + public boolean hasRollBuffMaxTimes() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 roll_buff_max_times = 4; + * @return this + */ + public RogueBuffSelectInfo clearRollBuffMaxTimes() { + bitField0_ &= ~0x00000004; + rollBuffMaxTimes = 0; + return this; + } + + /** + * optional uint32 roll_buff_max_times = 4; + * @return the rollBuffMaxTimes + */ + public int getRollBuffMaxTimes() { + return rollBuffMaxTimes; + } + + /** + * optional uint32 roll_buff_max_times = 4; + * @param value the rollBuffMaxTimes to set + * @return this + */ + public RogueBuffSelectInfo setRollBuffMaxTimes(final int value) { + bitField0_ |= 0x00000004; + rollBuffMaxTimes = value; + return this; + } + + /** + * optional uint32 roll_buff_times = 7; + * @return whether the rollBuffTimes field is set + */ + public boolean hasRollBuffTimes() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 roll_buff_times = 7; + * @return this + */ + public RogueBuffSelectInfo clearRollBuffTimes() { + bitField0_ &= ~0x00000008; + rollBuffTimes = 0; + return this; + } + + /** + * optional uint32 roll_buff_times = 7; + * @return the rollBuffTimes + */ + public int getRollBuffTimes() { + return rollBuffTimes; + } + + /** + * optional uint32 roll_buff_times = 7; + * @param value the rollBuffTimes to set + * @return this + */ + public RogueBuffSelectInfo setRollBuffTimes(final int value) { + bitField0_ |= 0x00000008; + rollBuffTimes = value; + return this; + } + + /** + * optional uint32 select_buff_source_hint = 10; + * @return whether the selectBuffSourceHint field is set + */ + public boolean hasSelectBuffSourceHint() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 select_buff_source_hint = 10; + * @return this + */ + public RogueBuffSelectInfo clearSelectBuffSourceHint() { + bitField0_ &= ~0x00000010; + selectBuffSourceHint = 0; + return this; + } + + /** + * optional uint32 select_buff_source_hint = 10; + * @return the selectBuffSourceHint + */ + public int getSelectBuffSourceHint() { + return selectBuffSourceHint; + } + + /** + * optional uint32 select_buff_source_hint = 10; + * @param value the selectBuffSourceHint to set + * @return this + */ + public RogueBuffSelectInfo setSelectBuffSourceHint(final int value) { + bitField0_ |= 0x00000010; + selectBuffSourceHint = value; + return this; + } + + /** + * optional uint32 select_buff_source_cur_count = 11; + * @return whether the selectBuffSourceCurCount field is set + */ + public boolean hasSelectBuffSourceCurCount() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional uint32 select_buff_source_cur_count = 11; + * @return this + */ + public RogueBuffSelectInfo clearSelectBuffSourceCurCount() { + bitField0_ &= ~0x00000020; + selectBuffSourceCurCount = 0; + return this; + } + + /** + * optional uint32 select_buff_source_cur_count = 11; + * @return the selectBuffSourceCurCount + */ + public int getSelectBuffSourceCurCount() { + return selectBuffSourceCurCount; + } + + /** + * optional uint32 select_buff_source_cur_count = 11; + * @param value the selectBuffSourceCurCount to set + * @return this + */ + public RogueBuffSelectInfo setSelectBuffSourceCurCount(final int value) { + bitField0_ |= 0x00000020; + selectBuffSourceCurCount = value; + return this; + } + + /** + * optional uint32 rogue_coin = 13; + * @return whether the rogueCoin field is set + */ + public boolean hasRogueCoin() { + return (bitField0_ & 0x00000040) != 0; + } + + /** + * optional uint32 rogue_coin = 13; + * @return this + */ + public RogueBuffSelectInfo clearRogueCoin() { + bitField0_ &= ~0x00000040; + rogueCoin = 0; + return this; + } + + /** + * optional uint32 rogue_coin = 13; + * @return the rogueCoin + */ + public int getRogueCoin() { + return rogueCoin; + } + + /** + * optional uint32 rogue_coin = 13; + * @param value the rogueCoin to set + * @return this + */ + public RogueBuffSelectInfo setRogueCoin(final int value) { + bitField0_ |= 0x00000040; + rogueCoin = value; + return this; + } + + /** + * optional .RogueCommonBuffSelectSource source = 12; + * @return whether the source field is set + */ + public boolean hasSource() { + return (bitField0_ & 0x00000080) != 0; + } + + /** + * optional .RogueCommonBuffSelectSource source = 12; + * @return this + */ + public RogueBuffSelectInfo clearSource() { + bitField0_ &= ~0x00000080; + source = 0; + return this; + } + + /** + * optional .RogueCommonBuffSelectSource source = 12; + * @return the source + */ + public RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource getSource() { + return RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource.forNumber(source); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link RogueBuffSelectInfo#getSource()}.getNumber(). + * + * @return numeric wire representation + */ + public int getSourceValue() { + return source; + } + + /** + * Sets the value of the internal enum store. This does not + * do any validity checks, so be sure to use appropriate value + * constants from {@link RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource}. Setting an invalid value + * can cause {@link RogueBuffSelectInfo#getSource()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public RogueBuffSelectInfo setSourceValue(final int value) { + bitField0_ |= 0x00000080; + source = value; + return this; + } + + /** + * optional .RogueCommonBuffSelectSource source = 12; + * @param value the source to set + * @return this + */ + public RogueBuffSelectInfo setSource( + final RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource value) { + bitField0_ |= 0x00000080; + source = value.getNumber(); + return this; + } + + /** + * optional bool show_handbook_hint = 2; + * @return whether the showHandbookHint field is set + */ + public boolean hasShowHandbookHint() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + * optional bool show_handbook_hint = 2; + * @return this + */ + public RogueBuffSelectInfo clearShowHandbookHint() { + bitField0_ &= ~0x00000100; + showHandbookHint = false; + return this; + } + + /** + * optional bool show_handbook_hint = 2; + * @return the showHandbookHint + */ + public boolean getShowHandbookHint() { + return showHandbookHint; + } + + /** + * optional bool show_handbook_hint = 2; + * @param value the showHandbookHint to set + * @return this + */ + public RogueBuffSelectInfo setShowHandbookHint(final boolean value) { + bitField0_ |= 0x00000100; + showHandbookHint = value; + return this; + } + + /** + * optional bool can_roll = 9; + * @return whether the canRoll field is set + */ + public boolean hasCanRoll() { + return (bitField0_ & 0x00000200) != 0; + } + + /** + * optional bool can_roll = 9; + * @return this + */ + public RogueBuffSelectInfo clearCanRoll() { + bitField0_ &= ~0x00000200; + canRoll = false; + return this; + } + + /** + * optional bool can_roll = 9; + * @return the canRoll + */ + public boolean getCanRoll() { + return canRoll; + } + + /** + * optional bool can_roll = 9; + * @param value the canRoll to set + * @return this + */ + public RogueBuffSelectInfo setCanRoll(final boolean value) { + bitField0_ |= 0x00000200; + canRoll = value; + return this; + } + + /** + * optional .ItemCostList roll_buffs_cost = 8; + * @return whether the rollBuffsCost field is set + */ + public boolean hasRollBuffsCost() { + return (bitField0_ & 0x00000400) != 0; + } + + /** + * optional .ItemCostList roll_buffs_cost = 8; + * @return this + */ + public RogueBuffSelectInfo clearRollBuffsCost() { + bitField0_ &= ~0x00000400; + rollBuffsCost.clear(); + return this; + } + + /** + * optional .ItemCostList roll_buffs_cost = 8; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableRollBuffsCost()} if you want to modify it. + * + * @return internal storage object for reading + */ + public ItemCostListOuterClass.ItemCostList getRollBuffsCost() { + return rollBuffsCost; + } + + /** + * optional .ItemCostList roll_buffs_cost = 8; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public ItemCostListOuterClass.ItemCostList getMutableRollBuffsCost() { + bitField0_ |= 0x00000400; + return rollBuffsCost; + } + + /** + * optional .ItemCostList roll_buffs_cost = 8; + * @param value the rollBuffsCost to set + * @return this + */ + public RogueBuffSelectInfo setRollBuffsCost(final ItemCostListOuterClass.ItemCostList value) { + bitField0_ |= 0x00000400; + rollBuffsCost.copyFrom(value); + return this; + } + + /** + * repeated uint32 select_first_buff_list = 5; + * @return whether the selectFirstBuffList field is set + */ + public boolean hasSelectFirstBuffList() { + return (bitField0_ & 0x00000800) != 0; + } + + /** + * repeated uint32 select_first_buff_list = 5; + * @return this + */ + public RogueBuffSelectInfo clearSelectFirstBuffList() { + bitField0_ &= ~0x00000800; + selectFirstBuffList.clear(); + return this; + } + + /** + * repeated uint32 select_first_buff_list = 5; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableSelectFirstBuffList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getSelectFirstBuffList() { + return selectFirstBuffList; + } + + /** + * repeated uint32 select_first_buff_list = 5; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableSelectFirstBuffList() { + bitField0_ |= 0x00000800; + return selectFirstBuffList; + } + + /** + * repeated uint32 select_first_buff_list = 5; + * @param value the selectFirstBuffList to add + * @return this + */ + public RogueBuffSelectInfo addSelectFirstBuffList(final int value) { + bitField0_ |= 0x00000800; + selectFirstBuffList.add(value); + return this; + } + + /** + * repeated uint32 select_first_buff_list = 5; + * @param values the selectFirstBuffList to add + * @return this + */ + public RogueBuffSelectInfo addAllSelectFirstBuffList(final int... values) { + bitField0_ |= 0x00000800; + selectFirstBuffList.addAll(values); + return this; + } + + /** + * repeated .RogueBuff maze_buff_list = 14; + * @return whether the mazeBuffList field is set + */ + public boolean hasMazeBuffList() { + return (bitField0_ & 0x00001000) != 0; + } + + /** + * repeated .RogueBuff maze_buff_list = 14; + * @return this + */ + public RogueBuffSelectInfo clearMazeBuffList() { + bitField0_ &= ~0x00001000; + mazeBuffList.clear(); + return this; + } + + /** + * repeated .RogueBuff maze_buff_list = 14; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableMazeBuffList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getMazeBuffList() { + return mazeBuffList; + } + + /** + * repeated .RogueBuff maze_buff_list = 14; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableMazeBuffList() { + bitField0_ |= 0x00001000; + return mazeBuffList; + } + + /** + * repeated .RogueBuff maze_buff_list = 14; + * @param value the mazeBuffList to add + * @return this + */ + public RogueBuffSelectInfo addMazeBuffList(final RogueBuffOuterClass.RogueBuff value) { + bitField0_ |= 0x00001000; + mazeBuffList.add(value); + return this; + } + + /** + * repeated .RogueBuff maze_buff_list = 14; + * @param values the mazeBuffList to add + * @return this + */ + public RogueBuffSelectInfo addAllMazeBuffList(final RogueBuffOuterClass.RogueBuff... values) { + bitField0_ |= 0x00001000; + mazeBuffList.addAll(values); + return this; + } + + @Override + public RogueBuffSelectInfo copyFrom(final RogueBuffSelectInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + selectBuffSourceTotalCount = other.selectBuffSourceTotalCount; + bDDKDOICAGG = other.bDDKDOICAGG; + rollBuffMaxTimes = other.rollBuffMaxTimes; + rollBuffTimes = other.rollBuffTimes; + selectBuffSourceHint = other.selectBuffSourceHint; + selectBuffSourceCurCount = other.selectBuffSourceCurCount; + rogueCoin = other.rogueCoin; + source = other.source; + showHandbookHint = other.showHandbookHint; + canRoll = other.canRoll; + rollBuffsCost.copyFrom(other.rollBuffsCost); + selectFirstBuffList.copyFrom(other.selectFirstBuffList); + mazeBuffList.copyFrom(other.mazeBuffList); + } + return this; + } + + @Override + public RogueBuffSelectInfo mergeFrom(final RogueBuffSelectInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasSelectBuffSourceTotalCount()) { + setSelectBuffSourceTotalCount(other.selectBuffSourceTotalCount); + } + if (other.hasBDDKDOICAGG()) { + setBDDKDOICAGG(other.bDDKDOICAGG); + } + if (other.hasRollBuffMaxTimes()) { + setRollBuffMaxTimes(other.rollBuffMaxTimes); + } + if (other.hasRollBuffTimes()) { + setRollBuffTimes(other.rollBuffTimes); + } + if (other.hasSelectBuffSourceHint()) { + setSelectBuffSourceHint(other.selectBuffSourceHint); + } + if (other.hasSelectBuffSourceCurCount()) { + setSelectBuffSourceCurCount(other.selectBuffSourceCurCount); + } + if (other.hasRogueCoin()) { + setRogueCoin(other.rogueCoin); + } + if (other.hasSource()) { + setSourceValue(other.source); + } + if (other.hasShowHandbookHint()) { + setShowHandbookHint(other.showHandbookHint); + } + if (other.hasCanRoll()) { + setCanRoll(other.canRoll); + } + if (other.hasRollBuffsCost()) { + getMutableRollBuffsCost().mergeFrom(other.rollBuffsCost); + } + if (other.hasSelectFirstBuffList()) { + getMutableSelectFirstBuffList().addAll(other.selectFirstBuffList); + } + if (other.hasMazeBuffList()) { + getMutableMazeBuffList().addAll(other.mazeBuffList); + } + return this; + } + + @Override + public RogueBuffSelectInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + selectBuffSourceTotalCount = 0; + bDDKDOICAGG = 0; + rollBuffMaxTimes = 0; + rollBuffTimes = 0; + selectBuffSourceHint = 0; + selectBuffSourceCurCount = 0; + rogueCoin = 0; + source = 0; + showHandbookHint = false; + canRoll = false; + rollBuffsCost.clear(); + selectFirstBuffList.clear(); + mazeBuffList.clear(); + return this; + } + + @Override + public RogueBuffSelectInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + rollBuffsCost.clearQuick(); + selectFirstBuffList.clear(); + mazeBuffList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RogueBuffSelectInfo)) { + return false; + } + RogueBuffSelectInfo other = (RogueBuffSelectInfo) o; + return bitField0_ == other.bitField0_ + && (!hasSelectBuffSourceTotalCount() || selectBuffSourceTotalCount == other.selectBuffSourceTotalCount) + && (!hasBDDKDOICAGG() || bDDKDOICAGG == other.bDDKDOICAGG) + && (!hasRollBuffMaxTimes() || rollBuffMaxTimes == other.rollBuffMaxTimes) + && (!hasRollBuffTimes() || rollBuffTimes == other.rollBuffTimes) + && (!hasSelectBuffSourceHint() || selectBuffSourceHint == other.selectBuffSourceHint) + && (!hasSelectBuffSourceCurCount() || selectBuffSourceCurCount == other.selectBuffSourceCurCount) + && (!hasRogueCoin() || rogueCoin == other.rogueCoin) + && (!hasSource() || source == other.source) + && (!hasShowHandbookHint() || showHandbookHint == other.showHandbookHint) + && (!hasCanRoll() || canRoll == other.canRoll) + && (!hasRollBuffsCost() || rollBuffsCost.equals(other.rollBuffsCost)) + && (!hasSelectFirstBuffList() || selectFirstBuffList.equals(other.selectFirstBuffList)) + && (!hasMazeBuffList() || mazeBuffList.equals(other.mazeBuffList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(selectBuffSourceTotalCount); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(bDDKDOICAGG); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(rollBuffMaxTimes); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(rollBuffTimes); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(selectBuffSourceHint); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(selectBuffSourceCurCount); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(rogueCoin); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeRawByte((byte) 96); + output.writeEnumNoTag(source); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRawByte((byte) 16); + output.writeBoolNoTag(showHandbookHint); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeRawByte((byte) 72); + output.writeBoolNoTag(canRoll); + } + if ((bitField0_ & 0x00000400) != 0) { + output.writeRawByte((byte) 66); + output.writeMessageNoTag(rollBuffsCost); + } + if ((bitField0_ & 0x00000800) != 0) { + for (int i = 0; i < selectFirstBuffList.length(); i++) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(selectFirstBuffList.array()[i]); + } + } + if ((bitField0_ & 0x00001000) != 0) { + for (int i = 0; i < mazeBuffList.length(); i++) { + output.writeRawByte((byte) 114); + output.writeMessageNoTag(mazeBuffList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(selectBuffSourceTotalCount); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(bDDKDOICAGG); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(rollBuffMaxTimes); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(rollBuffTimes); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(selectBuffSourceHint); + } + if ((bitField0_ & 0x00000020) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(selectBuffSourceCurCount); + } + if ((bitField0_ & 0x00000040) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(rogueCoin); + } + if ((bitField0_ & 0x00000080) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(source); + } + if ((bitField0_ & 0x00000100) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000200) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000400) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(rollBuffsCost); + } + if ((bitField0_ & 0x00000800) != 0) { + size += (1 * selectFirstBuffList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(selectFirstBuffList); + } + if ((bitField0_ & 0x00001000) != 0) { + size += (1 * mazeBuffList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(mazeBuffList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RogueBuffSelectInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // selectBuffSourceTotalCount + selectBuffSourceTotalCount = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 24) { + break; + } + } + case 24: { + // bDDKDOICAGG + bDDKDOICAGG = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 32) { + break; + } + } + case 32: { + // rollBuffMaxTimes + rollBuffMaxTimes = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // rollBuffTimes + rollBuffTimes = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // selectBuffSourceHint + selectBuffSourceHint = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // selectBuffSourceCurCount + selectBuffSourceCurCount = input.readUInt32(); + bitField0_ |= 0x00000020; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // rogueCoin + rogueCoin = input.readUInt32(); + bitField0_ |= 0x00000040; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // source + final int value = input.readInt32(); + if (RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource.forNumber(value) != null) { + source = value; + bitField0_ |= 0x00000080; + } + tag = input.readTag(); + if (tag != 16) { + break; + } + } + case 16: { + // showHandbookHint + showHandbookHint = input.readBool(); + bitField0_ |= 0x00000100; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // canRoll + canRoll = input.readBool(); + bitField0_ |= 0x00000200; + tag = input.readTag(); + if (tag != 66) { + break; + } + } + case 66: { + // rollBuffsCost + input.readMessage(rollBuffsCost); + bitField0_ |= 0x00000400; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // selectFirstBuffList [packed=true] + input.readPackedUInt32(selectFirstBuffList, tag); + bitField0_ |= 0x00000800; + tag = input.readTag(); + if (tag != 114) { + break; + } + } + case 114: { + // mazeBuffList + tag = input.readRepeatedMessage(mazeBuffList, tag); + bitField0_ |= 0x00001000; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 40: { + // selectFirstBuffList [packed=false] + tag = input.readRepeatedUInt32(selectFirstBuffList, tag); + bitField0_ |= 0x00000800; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.selectBuffSourceTotalCount, selectBuffSourceTotalCount); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.bDDKDOICAGG, bDDKDOICAGG); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.rollBuffMaxTimes, rollBuffMaxTimes); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.rollBuffTimes, rollBuffTimes); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt32(FieldNames.selectBuffSourceHint, selectBuffSourceHint); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeUInt32(FieldNames.selectBuffSourceCurCount, selectBuffSourceCurCount); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeUInt32(FieldNames.rogueCoin, rogueCoin); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeEnum(FieldNames.source, source, RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource.converter()); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeBool(FieldNames.showHandbookHint, showHandbookHint); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeBool(FieldNames.canRoll, canRoll); + } + if ((bitField0_ & 0x00000400) != 0) { + output.writeMessage(FieldNames.rollBuffsCost, rollBuffsCost); + } + if ((bitField0_ & 0x00000800) != 0) { + output.writeRepeatedUInt32(FieldNames.selectFirstBuffList, selectFirstBuffList); + } + if ((bitField0_ & 0x00001000) != 0) { + output.writeRepeatedMessage(FieldNames.mazeBuffList, mazeBuffList); + } + output.endObject(); + } + + @Override + public RogueBuffSelectInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 94416949: + case 204078937: { + if (input.isAtField(FieldNames.selectBuffSourceTotalCount)) { + if (!input.trySkipNullValue()) { + selectBuffSourceTotalCount = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1346863245: { + if (input.isAtField(FieldNames.bDDKDOICAGG)) { + if (!input.trySkipNullValue()) { + bDDKDOICAGG = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -564731182: + case -792528959: { + if (input.isAtField(FieldNames.rollBuffMaxTimes)) { + if (!input.trySkipNullValue()) { + rollBuffMaxTimes = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -436216138: + case 2038334812: { + if (input.isAtField(FieldNames.rollBuffTimes)) { + if (!input.trySkipNullValue()) { + rollBuffTimes = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1160450543: + case -335538398: { + if (input.isAtField(FieldNames.selectBuffSourceHint)) { + if (!input.trySkipNullValue()) { + selectBuffSourceHint = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1017675463: + case -1138919787: { + if (input.isAtField(FieldNames.selectBuffSourceCurCount)) { + if (!input.trySkipNullValue()) { + selectBuffSourceCurCount = input.readUInt32(); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + case 655631243: + case -1124761130: { + if (input.isAtField(FieldNames.rogueCoin)) { + if (!input.trySkipNullValue()) { + rogueCoin = input.readUInt32(); + bitField0_ |= 0x00000040; + } + } else { + input.skipUnknownField(); + } + break; + } + case -896505829: { + if (input.isAtField(FieldNames.source)) { + if (!input.trySkipNullValue()) { + final RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource value = input.readEnum(RogueCommonBuffSelectSourceOuterClass.RogueCommonBuffSelectSource.converter()); + if (value != null) { + source = value.getNumber(); + bitField0_ |= 0x00000080; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + case -1843696100: + case 641745100: { + if (input.isAtField(FieldNames.showHandbookHint)) { + if (!input.trySkipNullValue()) { + showHandbookHint = input.readBool(); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } + case 549719149: + case -126477428: { + if (input.isAtField(FieldNames.canRoll)) { + if (!input.trySkipNullValue()) { + canRoll = input.readBool(); + bitField0_ |= 0x00000200; + } + } else { + input.skipUnknownField(); + } + break; + } + case -408716688: + case -1703619794: { + if (input.isAtField(FieldNames.rollBuffsCost)) { + if (!input.trySkipNullValue()) { + input.readMessage(rollBuffsCost); + bitField0_ |= 0x00000400; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1380355781: + case -936470280: { + if (input.isAtField(FieldNames.selectFirstBuffList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(selectFirstBuffList); + bitField0_ |= 0x00000800; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1147228272: + case -1634995062: { + if (input.isAtField(FieldNames.mazeBuffList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(mazeBuffList); + bitField0_ |= 0x00001000; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RogueBuffSelectInfo clone() { + return new RogueBuffSelectInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RogueBuffSelectInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RogueBuffSelectInfo(), data).checkInitialized(); + } + + public static RogueBuffSelectInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueBuffSelectInfo(), input).checkInitialized(); + } + + public static RogueBuffSelectInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RogueBuffSelectInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating RogueBuffSelectInfo messages + */ + public static MessageFactory getFactory() { + return RogueBuffSelectInfoFactory.INSTANCE; + } + + private enum RogueBuffSelectInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public RogueBuffSelectInfo create() { + return RogueBuffSelectInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName selectBuffSourceTotalCount = FieldName.forField("selectBuffSourceTotalCount", "select_buff_source_total_count"); + + static final FieldName bDDKDOICAGG = FieldName.forField("BDDKDOICAGG"); + + static final FieldName rollBuffMaxTimes = FieldName.forField("rollBuffMaxTimes", "roll_buff_max_times"); + + static final FieldName rollBuffTimes = FieldName.forField("rollBuffTimes", "roll_buff_times"); + + static final FieldName selectBuffSourceHint = FieldName.forField("selectBuffSourceHint", "select_buff_source_hint"); + + static final FieldName selectBuffSourceCurCount = FieldName.forField("selectBuffSourceCurCount", "select_buff_source_cur_count"); + + static final FieldName rogueCoin = FieldName.forField("rogueCoin", "rogue_coin"); + + static final FieldName source = FieldName.forField("source"); + + static final FieldName showHandbookHint = FieldName.forField("showHandbookHint", "show_handbook_hint"); + + static final FieldName canRoll = FieldName.forField("canRoll", "can_roll"); + + static final FieldName rollBuffsCost = FieldName.forField("rollBuffsCost", "roll_buffs_cost"); + + static final FieldName selectFirstBuffList = FieldName.forField("selectFirstBuffList", "select_first_buff_list"); + + static final FieldName mazeBuffList = FieldName.forField("mazeBuffList", "maze_buff_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueBuffSourceOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueBuffSourceOuterClass.java new file mode 100644 index 0000000..9b1e15f --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RogueBuffSourceOuterClass.java @@ -0,0 +1,250 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import us.hebi.quickbuf.ProtoEnum; +import us.hebi.quickbuf.ProtoUtil; + +public final class RogueBuffSourceOuterClass { + /** + * Protobuf enum {@code RogueBuffSource} + */ + public enum RogueBuffSource implements ProtoEnum { + /** + * ROGUE_BUFF_SOURCE_TYPE_NONE = 0; + */ + ROGUE_BUFF_SOURCE_TYPE_NONE("ROGUE_BUFF_SOURCE_TYPE_NONE", 0), + + /** + * ROGUE_BUFF_SOURCE_TYPE_SELECT = 1; + */ + ROGUE_BUFF_SOURCE_TYPE_SELECT("ROGUE_BUFF_SOURCE_TYPE_SELECT", 1), + + /** + * ROGUE_BUFF_SOURCE_TYPE_ENHANCE = 2; + */ + ROGUE_BUFF_SOURCE_TYPE_ENHANCE("ROGUE_BUFF_SOURCE_TYPE_ENHANCE", 2), + + /** + * ROGUE_BUFF_SOURCE_TYPE_MIRACLE = 3; + */ + ROGUE_BUFF_SOURCE_TYPE_MIRACLE("ROGUE_BUFF_SOURCE_TYPE_MIRACLE", 3), + + /** + * ROGUE_BUFF_SOURCE_TYPE_DIALOGUE = 4; + */ + ROGUE_BUFF_SOURCE_TYPE_DIALOGUE("ROGUE_BUFF_SOURCE_TYPE_DIALOGUE", 4), + + /** + * ROGUE_BUFF_SOURCE_TYPE_BONUS = 5; + */ + ROGUE_BUFF_SOURCE_TYPE_BONUS("ROGUE_BUFF_SOURCE_TYPE_BONUS", 5), + + /** + * ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL = 6; + */ + ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL("ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL", 6), + + /** + * ROGUE_BUFF_SOURCE_TYPE_SHOP = 7; + */ + ROGUE_BUFF_SOURCE_TYPE_SHOP("ROGUE_BUFF_SOURCE_TYPE_SHOP", 7), + + /** + * ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM = 8; + */ + ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM("ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM", 8), + + /** + * ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START = 9; + */ + ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START("ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START", 9); + + /** + * ROGUE_BUFF_SOURCE_TYPE_NONE = 0; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_NONE_VALUE = 0; + + /** + * ROGUE_BUFF_SOURCE_TYPE_SELECT = 1; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_SELECT_VALUE = 1; + + /** + * ROGUE_BUFF_SOURCE_TYPE_ENHANCE = 2; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_ENHANCE_VALUE = 2; + + /** + * ROGUE_BUFF_SOURCE_TYPE_MIRACLE = 3; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_MIRACLE_VALUE = 3; + + /** + * ROGUE_BUFF_SOURCE_TYPE_DIALOGUE = 4; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_DIALOGUE_VALUE = 4; + + /** + * ROGUE_BUFF_SOURCE_TYPE_BONUS = 5; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_BONUS_VALUE = 5; + + /** + * ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL = 6; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL_VALUE = 6; + + /** + * ROGUE_BUFF_SOURCE_TYPE_SHOP = 7; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_SHOP_VALUE = 7; + + /** + * ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM = 8; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM_VALUE = 8; + + /** + * ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START = 9; + */ + public static final int ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START_VALUE = 9; + + private final String name; + + private final int number; + + private RogueBuffSource(String name, int number) { + this.name = name; + this.number = number; + } + + /** + * @return the string representation of enum entry + */ + @Override + public String getName() { + return name; + } + + /** + * @return the numeric wire value of this enum entry + */ + @Override + public int getNumber() { + return number; + } + + /** + * @return a converter that maps between this enum's numeric and text representations + */ + public static ProtoEnum.EnumConverter converter() { + return RogueBuffSourceConverter.INSTANCE; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value, or null if unknown. + */ + public static RogueBuffSource forNumber(int value) { + return RogueBuffSourceConverter.INSTANCE.forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @param other Fallback value in case the value is not known. + * @return The enum associated with the given numeric wire value, or the fallback value if unknown. + */ + public static RogueBuffSource forNumberOr(int number, RogueBuffSource other) { + RogueBuffSource value = forNumber(number); + return value == null ? other : value; + } + + enum RogueBuffSourceConverter implements ProtoEnum.EnumConverter { + INSTANCE; + + private static final RogueBuffSource[] lookup = new RogueBuffSource[10]; + + static { + lookup[0] = ROGUE_BUFF_SOURCE_TYPE_NONE; + lookup[1] = ROGUE_BUFF_SOURCE_TYPE_SELECT; + lookup[2] = ROGUE_BUFF_SOURCE_TYPE_ENHANCE; + lookup[3] = ROGUE_BUFF_SOURCE_TYPE_MIRACLE; + lookup[4] = ROGUE_BUFF_SOURCE_TYPE_DIALOGUE; + lookup[5] = ROGUE_BUFF_SOURCE_TYPE_BONUS; + lookup[6] = ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL; + lookup[7] = ROGUE_BUFF_SOURCE_TYPE_SHOP; + lookup[8] = ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM; + lookup[9] = ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START; + } + + @Override + public final RogueBuffSource forNumber(final int value) { + if (value >= 0 && value < lookup.length) { + return lookup[value]; + } + return null; + } + + @Override + public final RogueBuffSource forName(final CharSequence value) { + switch (value.length()) { + case 27: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_NONE", value)) { + return ROGUE_BUFF_SOURCE_TYPE_NONE; + } + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_SHOP", value)) { + return ROGUE_BUFF_SOURCE_TYPE_SHOP; + } + break; + } + case 28: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_BONUS", value)) { + return ROGUE_BUFF_SOURCE_TYPE_BONUS; + } + break; + } + case 29: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_SELECT", value)) { + return ROGUE_BUFF_SOURCE_TYPE_SELECT; + } + break; + } + case 30: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_ENHANCE", value)) { + return ROGUE_BUFF_SOURCE_TYPE_ENHANCE; + } + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_MIRACLE", value)) { + return ROGUE_BUFF_SOURCE_TYPE_MIRACLE; + } + break; + } + case 31: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_DIALOGUE", value)) { + return ROGUE_BUFF_SOURCE_TYPE_DIALOGUE; + } + break; + } + case 33: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL", value)) { + return ROGUE_BUFF_SOURCE_TYPE_MAZE_SKILL; + } + break; + } + case 38: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM", value)) { + return ROGUE_BUFF_SOURCE_TYPE_LEVEL_MECHANISM; + } + break; + } + case 42: { + if (ProtoUtil.isEqual("ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START", value)) { + return ROGUE_BUFF_SOURCE_TYPE_ENDLESS_LEVEL_START; + } + break; + } + } + return null; + } + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueCommonBuffSelectSourceOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueCommonBuffSelectSourceOuterClass.java new file mode 100644 index 0000000..ed117d8 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RogueCommonBuffSelectSourceOuterClass.java @@ -0,0 +1,169 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import us.hebi.quickbuf.ProtoEnum; +import us.hebi.quickbuf.ProtoUtil; + +public final class RogueCommonBuffSelectSourceOuterClass { + /** + * Protobuf enum {@code RogueCommonBuffSelectSource} + */ + public enum RogueCommonBuffSelectSource implements ProtoEnum { + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE = 0; + */ + ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE", 0), + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL = 1; + */ + ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL", 1), + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON = 2; + */ + ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON", 2), + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT = 3; + */ + ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT", 3), + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM = 4; + */ + ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM", 4); + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE = 0; + */ + public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE_VALUE = 0; + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL = 1; + */ + public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL_VALUE = 1; + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON = 2; + */ + public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON_VALUE = 2; + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT = 3; + */ + public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT_VALUE = 3; + + /** + * ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM = 4; + */ + public static final int ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM_VALUE = 4; + + private final String name; + + private final int number; + + private RogueCommonBuffSelectSource(String name, int number) { + this.name = name; + this.number = number; + } + + /** + * @return the string representation of enum entry + */ + @Override + public String getName() { + return name; + } + + /** + * @return the numeric wire value of this enum entry + */ + @Override + public int getNumber() { + return number; + } + + /** + * @return a converter that maps between this enum's numeric and text representations + */ + public static ProtoEnum.EnumConverter converter() { + return RogueCommonBuffSelectSourceConverter.INSTANCE; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value, or null if unknown. + */ + public static RogueCommonBuffSelectSource forNumber(int value) { + return RogueCommonBuffSelectSourceConverter.INSTANCE.forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @param other Fallback value in case the value is not known. + * @return The enum associated with the given numeric wire value, or the fallback value if unknown. + */ + public static RogueCommonBuffSelectSource forNumberOr(int number, + RogueCommonBuffSelectSource other) { + RogueCommonBuffSelectSource value = forNumber(number); + return value == null ? other : value; + } + + enum RogueCommonBuffSelectSourceConverter implements ProtoEnum.EnumConverter { + INSTANCE; + + private static final RogueCommonBuffSelectSource[] lookup = new RogueCommonBuffSelectSource[5]; + + static { + lookup[0] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE; + lookup[1] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL; + lookup[2] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON; + lookup[3] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT; + lookup[4] = ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM; + } + + @Override + public final RogueCommonBuffSelectSource forNumber(final int value) { + if (value >= 0 && value < lookup.length) { + return lookup[value]; + } + return null; + } + + @Override + public final RogueCommonBuffSelectSource forName(final CharSequence value) { + switch (value.length()) { + case 41: { + if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE", value)) { + return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_NONE; + } + if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON", value)) { + return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_AEON; + } + break; + } + case 46: { + if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL", value)) { + return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_DICE_ROLL; + } + break; + } + case 48: { + if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT", value)) { + return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_BOARD_EVENT; + } + break; + } + case 52: { + if (ProtoUtil.isEqual("ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM", value)) { + return ROGUE_COMMON_BUFF_SELECT_SOURCE_TYPE_LEVEL_MECHANISM; + } + break; + } + } + return null; + } + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RogueCurrentInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/RogueCurrentInfoOuterClass.java index 08c0932..6b8fd5c 100644 --- a/src/generated/main/emu/lunarcore/proto/RogueCurrentInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/RogueCurrentInfoOuterClass.java @@ -28,6 +28,11 @@ public final class RogueCurrentInfoOuterClass { */ private final RogueMapInfoOuterClass.RogueMapInfo roomMap = RogueMapInfoOuterClass.RogueMapInfo.newInstance(); + /** + * optional .RogueBuffInfo rogue_buff_info = 14; + */ + private final RogueBuffInfoOuterClass.RogueBuffInfo rogueBuffInfo = RogueBuffInfoOuterClass.RogueBuffInfo.newInstance(); + private RogueCurrentInfo() { } @@ -157,6 +162,63 @@ public final class RogueCurrentInfoOuterClass { return this; } + /** + * optional .RogueBuffInfo rogue_buff_info = 14; + * @return whether the rogueBuffInfo field is set + */ + public boolean hasRogueBuffInfo() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional .RogueBuffInfo rogue_buff_info = 14; + * @return this + */ + public RogueCurrentInfo clearRogueBuffInfo() { + bitField0_ &= ~0x00000004; + rogueBuffInfo.clear(); + return this; + } + + /** + * optional .RogueBuffInfo rogue_buff_info = 14; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableRogueBuffInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueBuffInfoOuterClass.RogueBuffInfo getRogueBuffInfo() { + return rogueBuffInfo; + } + + /** + * optional .RogueBuffInfo rogue_buff_info = 14; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RogueBuffInfoOuterClass.RogueBuffInfo getMutableRogueBuffInfo() { + bitField0_ |= 0x00000004; + return rogueBuffInfo; + } + + /** + * optional .RogueBuffInfo rogue_buff_info = 14; + * @param value the rogueBuffInfo to set + * @return this + */ + public RogueCurrentInfo setRogueBuffInfo(final RogueBuffInfoOuterClass.RogueBuffInfo value) { + bitField0_ |= 0x00000004; + rogueBuffInfo.copyFrom(value); + return this; + } + @Override public RogueCurrentInfo copyFrom(final RogueCurrentInfo other) { cachedSize = other.cachedSize; @@ -164,6 +226,7 @@ public final class RogueCurrentInfoOuterClass { bitField0_ = other.bitField0_; status = other.status; roomMap.copyFrom(other.roomMap); + rogueBuffInfo.copyFrom(other.rogueBuffInfo); } return this; } @@ -180,6 +243,9 @@ public final class RogueCurrentInfoOuterClass { if (other.hasRoomMap()) { getMutableRoomMap().mergeFrom(other.roomMap); } + if (other.hasRogueBuffInfo()) { + getMutableRogueBuffInfo().mergeFrom(other.rogueBuffInfo); + } return this; } @@ -192,6 +258,7 @@ public final class RogueCurrentInfoOuterClass { bitField0_ = 0; status = 0; roomMap.clear(); + rogueBuffInfo.clear(); return this; } @@ -203,6 +270,7 @@ public final class RogueCurrentInfoOuterClass { cachedSize = -1; bitField0_ = 0; roomMap.clearQuick(); + rogueBuffInfo.clearQuick(); return this; } @@ -217,7 +285,8 @@ public final class RogueCurrentInfoOuterClass { RogueCurrentInfo other = (RogueCurrentInfo) o; return bitField0_ == other.bitField0_ && (!hasStatus() || status == other.status) - && (!hasRoomMap() || roomMap.equals(other.roomMap)); + && (!hasRoomMap() || roomMap.equals(other.roomMap)) + && (!hasRogueBuffInfo() || rogueBuffInfo.equals(other.rogueBuffInfo)); } @Override @@ -230,6 +299,10 @@ public final class RogueCurrentInfoOuterClass { output.writeRawByte((byte) 82); output.writeMessageNoTag(roomMap); } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 114); + output.writeMessageNoTag(rogueBuffInfo); + } } @Override @@ -241,6 +314,9 @@ public final class RogueCurrentInfoOuterClass { if ((bitField0_ & 0x00000002) != 0) { size += 1 + ProtoSink.computeMessageSizeNoTag(roomMap); } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(rogueBuffInfo); + } return size; } @@ -268,6 +344,15 @@ public final class RogueCurrentInfoOuterClass { input.readMessage(roomMap); bitField0_ |= 0x00000002; tag = input.readTag(); + if (tag != 114) { + break; + } + } + case 114: { + // rogueBuffInfo + input.readMessage(rogueBuffInfo); + bitField0_ |= 0x00000004; + tag = input.readTag(); if (tag != 0) { break; } @@ -295,6 +380,9 @@ public final class RogueCurrentInfoOuterClass { if ((bitField0_ & 0x00000002) != 0) { output.writeMessage(FieldNames.roomMap, roomMap); } + if ((bitField0_ & 0x00000004) != 0) { + output.writeMessage(FieldNames.rogueBuffInfo, rogueBuffInfo); + } output.endObject(); } @@ -333,6 +421,18 @@ public final class RogueCurrentInfoOuterClass { } break; } + case 1107898267: + case -694847243: { + if (input.isAtField(FieldNames.rogueBuffInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(rogueBuffInfo); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } default: { input.skipUnknownField(); break; @@ -389,6 +489,8 @@ public final class RogueCurrentInfoOuterClass { static final FieldName status = FieldName.forField("status"); static final FieldName roomMap = FieldName.forField("roomMap", "room_map"); + + static final FieldName rogueBuffInfo = FieldName.forField("rogueBuffInfo", "rogue_buff_info"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/RollRogueBuffScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/RollRogueBuffScRspOuterClass.java new file mode 100644 index 0000000..fbf5ea9 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RollRogueBuffScRspOuterClass.java @@ -0,0 +1,362 @@ +// 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 RollRogueBuffScRspOuterClass { + /** + * Protobuf type {@code RollRogueBuffScRsp} + */ + public static final class RollRogueBuffScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 14; + */ + private int retcode; + + /** + * optional .RogueBuffSelectInfo rogue_buff_select_info = 10; + */ + private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo rogueBuffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance(); + + private RollRogueBuffScRsp() { + } + + /** + * @return a new empty instance of {@code RollRogueBuffScRsp} + */ + public static RollRogueBuffScRsp newInstance() { + return new RollRogueBuffScRsp(); + } + + /** + * optional uint32 retcode = 14; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 14; + * @return this + */ + public RollRogueBuffScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + 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 RollRogueBuffScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * optional .RogueBuffSelectInfo rogue_buff_select_info = 10; + * @return whether the rogueBuffSelectInfo field is set + */ + public boolean hasRogueBuffSelectInfo() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .RogueBuffSelectInfo rogue_buff_select_info = 10; + * @return this + */ + public RollRogueBuffScRsp clearRogueBuffSelectInfo() { + bitField0_ &= ~0x00000002; + rogueBuffSelectInfo.clear(); + return this; + } + + /** + * optional .RogueBuffSelectInfo rogue_buff_select_info = 10; + * + * 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 #getMutableRogueBuffSelectInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getRogueBuffSelectInfo() { + return rogueBuffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo rogue_buff_select_info = 10; + * + * 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableRogueBuffSelectInfo() { + bitField0_ |= 0x00000002; + return rogueBuffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo rogue_buff_select_info = 10; + * @param value the rogueBuffSelectInfo to set + * @return this + */ + public RollRogueBuffScRsp setRogueBuffSelectInfo( + final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) { + bitField0_ |= 0x00000002; + rogueBuffSelectInfo.copyFrom(value); + return this; + } + + @Override + public RollRogueBuffScRsp copyFrom(final RollRogueBuffScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + rogueBuffSelectInfo.copyFrom(other.rogueBuffSelectInfo); + } + return this; + } + + @Override + public RollRogueBuffScRsp mergeFrom(final RollRogueBuffScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasRogueBuffSelectInfo()) { + getMutableRogueBuffSelectInfo().mergeFrom(other.rogueBuffSelectInfo); + } + return this; + } + + @Override + public RollRogueBuffScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + rogueBuffSelectInfo.clear(); + return this; + } + + @Override + public RollRogueBuffScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + rogueBuffSelectInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RollRogueBuffScRsp)) { + return false; + } + RollRogueBuffScRsp other = (RollRogueBuffScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasRogueBuffSelectInfo() || rogueBuffSelectInfo.equals(other.rogueBuffSelectInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 82); + output.writeMessageNoTag(rogueBuffSelectInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(rogueBuffSelectInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RollRogueBuffScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 112: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // rogueBuffSelectInfo + input.readMessage(rogueBuffSelectInfo); + 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.rogueBuffSelectInfo, rogueBuffSelectInfo); + } + output.endObject(); + } + + @Override + public RollRogueBuffScRsp 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 -2050730761: + case 1692632042: { + if (input.isAtField(FieldNames.rogueBuffSelectInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(rogueBuffSelectInfo); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RollRogueBuffScRsp clone() { + return new RollRogueBuffScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RollRogueBuffScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RollRogueBuffScRsp(), data).checkInitialized(); + } + + public static RollRogueBuffScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new RollRogueBuffScRsp(), input).checkInitialized(); + } + + public static RollRogueBuffScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RollRogueBuffScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating RollRogueBuffScRsp messages + */ + public static MessageFactory getFactory() { + return RollRogueBuffScRspFactory.INSTANCE; + } + + private enum RollRogueBuffScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public RollRogueBuffScRsp create() { + return RollRogueBuffScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName rogueBuffSelectInfo = FieldName.forField("rogueBuffSelectInfo", "rogue_buff_select_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectRogueBuffCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectRogueBuffCsReqOuterClass.java new file mode 100644 index 0000000..c6b0ce5 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectRogueBuffCsReqOuterClass.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 SelectRogueBuffCsReqOuterClass { + /** + * Protobuf type {@code SelectRogueBuffCsReq} + */ + public static final class SelectRogueBuffCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 maze_buff_id = 7; + */ + private int mazeBuffId; + + private SelectRogueBuffCsReq() { + } + + /** + * @return a new empty instance of {@code SelectRogueBuffCsReq} + */ + public static SelectRogueBuffCsReq newInstance() { + return new SelectRogueBuffCsReq(); + } + + /** + * optional uint32 maze_buff_id = 7; + * @return whether the mazeBuffId field is set + */ + public boolean hasMazeBuffId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 maze_buff_id = 7; + * @return this + */ + public SelectRogueBuffCsReq clearMazeBuffId() { + bitField0_ &= ~0x00000001; + mazeBuffId = 0; + return this; + } + + /** + * optional uint32 maze_buff_id = 7; + * @return the mazeBuffId + */ + public int getMazeBuffId() { + return mazeBuffId; + } + + /** + * optional uint32 maze_buff_id = 7; + * @param value the mazeBuffId to set + * @return this + */ + public SelectRogueBuffCsReq setMazeBuffId(final int value) { + bitField0_ |= 0x00000001; + mazeBuffId = value; + return this; + } + + @Override + public SelectRogueBuffCsReq copyFrom(final SelectRogueBuffCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + mazeBuffId = other.mazeBuffId; + } + return this; + } + + @Override + public SelectRogueBuffCsReq mergeFrom(final SelectRogueBuffCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasMazeBuffId()) { + setMazeBuffId(other.mazeBuffId); + } + return this; + } + + @Override + public SelectRogueBuffCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + mazeBuffId = 0; + return this; + } + + @Override + public SelectRogueBuffCsReq 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 SelectRogueBuffCsReq)) { + return false; + } + SelectRogueBuffCsReq other = (SelectRogueBuffCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasMazeBuffId() || mazeBuffId == other.mazeBuffId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(mazeBuffId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(mazeBuffId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectRogueBuffCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 56: { + // mazeBuffId + mazeBuffId = 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.mazeBuffId, mazeBuffId); + } + output.endObject(); + } + + @Override + public SelectRogueBuffCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 144210285: + case 896621575: { + if (input.isAtField(FieldNames.mazeBuffId)) { + if (!input.trySkipNullValue()) { + mazeBuffId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectRogueBuffCsReq clone() { + return new SelectRogueBuffCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectRogueBuffCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectRogueBuffCsReq(), data).checkInitialized(); + } + + public static SelectRogueBuffCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectRogueBuffCsReq(), input).checkInitialized(); + } + + public static SelectRogueBuffCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectRogueBuffCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectRogueBuffCsReq messages + */ + public static MessageFactory getFactory() { + return SelectRogueBuffCsReqFactory.INSTANCE; + } + + private enum SelectRogueBuffCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectRogueBuffCsReq create() { + return SelectRogueBuffCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName mazeBuffId = FieldName.forField("mazeBuffId", "maze_buff_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectRogueBuffScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectRogueBuffScRspOuterClass.java new file mode 100644 index 0000000..036226d --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectRogueBuffScRspOuterClass.java @@ -0,0 +1,524 @@ +// 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 SelectRogueBuffScRspOuterClass { + /** + * Protobuf type {@code SelectRogueBuffScRsp} + */ + public static final class SelectRogueBuffScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 maze_buff_level = 6; + */ + private int mazeBuffLevel; + + /** + * optional uint32 maze_buff_id = 12; + */ + private int mazeBuffId; + + /** + * optional uint32 retcode = 15; + */ + private int retcode; + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + */ + private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo buffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance(); + + private SelectRogueBuffScRsp() { + } + + /** + * @return a new empty instance of {@code SelectRogueBuffScRsp} + */ + public static SelectRogueBuffScRsp newInstance() { + return new SelectRogueBuffScRsp(); + } + + /** + * optional uint32 maze_buff_level = 6; + * @return whether the mazeBuffLevel field is set + */ + public boolean hasMazeBuffLevel() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 maze_buff_level = 6; + * @return this + */ + public SelectRogueBuffScRsp clearMazeBuffLevel() { + bitField0_ &= ~0x00000001; + mazeBuffLevel = 0; + return this; + } + + /** + * optional uint32 maze_buff_level = 6; + * @return the mazeBuffLevel + */ + public int getMazeBuffLevel() { + return mazeBuffLevel; + } + + /** + * optional uint32 maze_buff_level = 6; + * @param value the mazeBuffLevel to set + * @return this + */ + public SelectRogueBuffScRsp setMazeBuffLevel(final int value) { + bitField0_ |= 0x00000001; + mazeBuffLevel = value; + return this; + } + + /** + * optional uint32 maze_buff_id = 12; + * @return whether the mazeBuffId field is set + */ + public boolean hasMazeBuffId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 maze_buff_id = 12; + * @return this + */ + public SelectRogueBuffScRsp clearMazeBuffId() { + bitField0_ &= ~0x00000002; + mazeBuffId = 0; + return this; + } + + /** + * optional uint32 maze_buff_id = 12; + * @return the mazeBuffId + */ + public int getMazeBuffId() { + return mazeBuffId; + } + + /** + * optional uint32 maze_buff_id = 12; + * @param value the mazeBuffId to set + * @return this + */ + public SelectRogueBuffScRsp setMazeBuffId(final int value) { + bitField0_ |= 0x00000002; + mazeBuffId = value; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 retcode = 15; + * @return this + */ + public SelectRogueBuffScRsp clearRetcode() { + bitField0_ &= ~0x00000004; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 15; + * @param value the retcode to set + * @return this + */ + public SelectRogueBuffScRsp setRetcode(final int value) { + bitField0_ |= 0x00000004; + retcode = value; + return this; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + * @return whether the buffSelectInfo field is set + */ + public boolean hasBuffSelectInfo() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + * @return this + */ + public SelectRogueBuffScRsp clearBuffSelectInfo() { + bitField0_ &= ~0x00000008; + buffSelectInfo.clear(); + return this; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 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 #getMutableBuffSelectInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getBuffSelectInfo() { + return buffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableBuffSelectInfo() { + bitField0_ |= 0x00000008; + return buffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + * @param value the buffSelectInfo to set + * @return this + */ + public SelectRogueBuffScRsp setBuffSelectInfo( + final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) { + bitField0_ |= 0x00000008; + buffSelectInfo.copyFrom(value); + return this; + } + + @Override + public SelectRogueBuffScRsp copyFrom(final SelectRogueBuffScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + mazeBuffLevel = other.mazeBuffLevel; + mazeBuffId = other.mazeBuffId; + retcode = other.retcode; + buffSelectInfo.copyFrom(other.buffSelectInfo); + } + return this; + } + + @Override + public SelectRogueBuffScRsp mergeFrom(final SelectRogueBuffScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasMazeBuffLevel()) { + setMazeBuffLevel(other.mazeBuffLevel); + } + if (other.hasMazeBuffId()) { + setMazeBuffId(other.mazeBuffId); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasBuffSelectInfo()) { + getMutableBuffSelectInfo().mergeFrom(other.buffSelectInfo); + } + return this; + } + + @Override + public SelectRogueBuffScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + mazeBuffLevel = 0; + mazeBuffId = 0; + retcode = 0; + buffSelectInfo.clear(); + return this; + } + + @Override + public SelectRogueBuffScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffSelectInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectRogueBuffScRsp)) { + return false; + } + SelectRogueBuffScRsp other = (SelectRogueBuffScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasMazeBuffLevel() || mazeBuffLevel == other.mazeBuffLevel) + && (!hasMazeBuffId() || mazeBuffId == other.mazeBuffId) + && (!hasRetcode() || retcode == other.retcode) + && (!hasBuffSelectInfo() || buffSelectInfo.equals(other.buffSelectInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(mazeBuffLevel); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(mazeBuffId); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(buffSelectInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(mazeBuffLevel); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(mazeBuffId); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(buffSelectInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectRogueBuffScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // mazeBuffLevel + mazeBuffLevel = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // mazeBuffId + mazeBuffId = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // buffSelectInfo + input.readMessage(buffSelectInfo); + bitField0_ |= 0x00000008; + 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.mazeBuffLevel, mazeBuffLevel); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.mazeBuffId, mazeBuffId); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeMessage(FieldNames.buffSelectInfo, buffSelectInfo); + } + output.endObject(); + } + + @Override + public SelectRogueBuffScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1204221426: + case 854643992: { + if (input.isAtField(FieldNames.mazeBuffLevel)) { + if (!input.trySkipNullValue()) { + mazeBuffLevel = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 144210285: + case 896621575: { + if (input.isAtField(FieldNames.mazeBuffId)) { + if (!input.trySkipNullValue()) { + mazeBuffId = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -255242115: + case 1500540965: { + if (input.isAtField(FieldNames.buffSelectInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(buffSelectInfo); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectRogueBuffScRsp clone() { + return new SelectRogueBuffScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectRogueBuffScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectRogueBuffScRsp(), data).checkInitialized(); + } + + public static SelectRogueBuffScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectRogueBuffScRsp(), input).checkInitialized(); + } + + public static SelectRogueBuffScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectRogueBuffScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectRogueBuffScRsp messages + */ + public static MessageFactory getFactory() { + return SelectRogueBuffScRspFactory.INSTANCE; + } + + private enum SelectRogueBuffScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectRogueBuffScRsp create() { + return SelectRogueBuffScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName mazeBuffLevel = FieldName.forField("mazeBuffLevel", "maze_buff_level"); + + static final FieldName mazeBuffId = FieldName.forField("mazeBuffId", "maze_buff_id"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName buffSelectInfo = FieldName.forField("buffSelectInfo", "buff_select_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SyncRogueBuffSelectInfoScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/SyncRogueBuffSelectInfoScNotifyOuterClass.java new file mode 100644 index 0000000..fd443e8 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SyncRogueBuffSelectInfoScNotifyOuterClass.java @@ -0,0 +1,284 @@ +// 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 SyncRogueBuffSelectInfoScNotifyOuterClass { + /** + * Protobuf type {@code SyncRogueBuffSelectInfoScNotify} + */ + public static final class SyncRogueBuffSelectInfoScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + */ + private final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo buffSelectInfo = RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo.newInstance(); + + private SyncRogueBuffSelectInfoScNotify() { + } + + /** + * @return a new empty instance of {@code SyncRogueBuffSelectInfoScNotify} + */ + public static SyncRogueBuffSelectInfoScNotify newInstance() { + return new SyncRogueBuffSelectInfoScNotify(); + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + * @return whether the buffSelectInfo field is set + */ + public boolean hasBuffSelectInfo() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + * @return this + */ + public SyncRogueBuffSelectInfoScNotify clearBuffSelectInfo() { + bitField0_ &= ~0x00000001; + buffSelectInfo.clear(); + return this; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 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 #getMutableBuffSelectInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getBuffSelectInfo() { + return buffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 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 RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo getMutableBuffSelectInfo() { + bitField0_ |= 0x00000001; + return buffSelectInfo; + } + + /** + * optional .RogueBuffSelectInfo buff_select_info = 2; + * @param value the buffSelectInfo to set + * @return this + */ + public SyncRogueBuffSelectInfoScNotify setBuffSelectInfo( + final RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo value) { + bitField0_ |= 0x00000001; + buffSelectInfo.copyFrom(value); + return this; + } + + @Override + public SyncRogueBuffSelectInfoScNotify copyFrom(final SyncRogueBuffSelectInfoScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + buffSelectInfo.copyFrom(other.buffSelectInfo); + } + return this; + } + + @Override + public SyncRogueBuffSelectInfoScNotify mergeFrom(final SyncRogueBuffSelectInfoScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBuffSelectInfo()) { + getMutableBuffSelectInfo().mergeFrom(other.buffSelectInfo); + } + return this; + } + + @Override + public SyncRogueBuffSelectInfoScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffSelectInfo.clear(); + return this; + } + + @Override + public SyncRogueBuffSelectInfoScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffSelectInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SyncRogueBuffSelectInfoScNotify)) { + return false; + } + SyncRogueBuffSelectInfoScNotify other = (SyncRogueBuffSelectInfoScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasBuffSelectInfo() || buffSelectInfo.equals(other.buffSelectInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(buffSelectInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(buffSelectInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SyncRogueBuffSelectInfoScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 18: { + // buffSelectInfo + input.readMessage(buffSelectInfo); + 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.writeMessage(FieldNames.buffSelectInfo, buffSelectInfo); + } + output.endObject(); + } + + @Override + public SyncRogueBuffSelectInfoScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -255242115: + case 1500540965: { + if (input.isAtField(FieldNames.buffSelectInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(buffSelectInfo); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SyncRogueBuffSelectInfoScNotify clone() { + return new SyncRogueBuffSelectInfoScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SyncRogueBuffSelectInfoScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SyncRogueBuffSelectInfoScNotify(), data).checkInitialized(); + } + + public static SyncRogueBuffSelectInfoScNotify parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new SyncRogueBuffSelectInfoScNotify(), input).checkInitialized(); + } + + public static SyncRogueBuffSelectInfoScNotify parseFrom(final JsonSource input) throws + IOException { + return ProtoMessage.mergeFrom(new SyncRogueBuffSelectInfoScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating SyncRogueBuffSelectInfoScNotify messages + */ + public static MessageFactory getFactory() { + return SyncRogueBuffSelectInfoScNotifyFactory.INSTANCE; + } + + private enum SyncRogueBuffSelectInfoScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public SyncRogueBuffSelectInfoScNotify create() { + return SyncRogueBuffSelectInfoScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName buffSelectInfo = FieldName.forField("buffSelectInfo", "buff_select_info"); + } + } +} diff --git a/src/main/java/emu/lunarcore/data/GameDepot.java b/src/main/java/emu/lunarcore/data/GameDepot.java index 4b6ca94..3a2b3d1 100644 --- a/src/main/java/emu/lunarcore/data/GameDepot.java +++ b/src/main/java/emu/lunarcore/data/GameDepot.java @@ -4,10 +4,7 @@ import java.util.ArrayList; import java.util.List; import emu.lunarcore.GameConstants; -import emu.lunarcore.data.excel.RelicMainAffixExcel; -import emu.lunarcore.data.excel.RelicSubAffixExcel; -import emu.lunarcore.data.excel.RogueMapExcel; -import emu.lunarcore.data.excel.RogueManagerExcel; +import emu.lunarcore.data.excel.*; import emu.lunarcore.util.Utils; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; @@ -15,11 +12,13 @@ import lombok.Getter; // Game data that is parsed by the server goes here public class GameDepot { + // Relics private static Int2ObjectMap> relicMainAffixDepot = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap> relicSubAffixDepot = new Int2ObjectOpenHashMap<>(); - @Getter - private static Int2ObjectMap rogueMapGen = new Int2ObjectOpenHashMap<>(); + // Rogue + @Getter private static Int2ObjectMap rogueMapGen = new Int2ObjectOpenHashMap<>(); + @Getter private static List rogueBuffsList = new ArrayList<>(); private static Int2ObjectMap> rogueMapDepot = new Int2ObjectOpenHashMap<>(); public static void addRelicMainAffix(RelicMainAffixExcel affix) { diff --git a/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java b/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java new file mode 100644 index 0000000..0f48455 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/RogueBuffExcel.java @@ -0,0 +1,29 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameDepot; +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; + +import lombok.Getter; + +@Getter +@ResourceType(name = {"RogueBuff.json"}) +public class RogueBuffExcel extends GameResource { + private int MazeBuffID; + private int MazeBuffLevel; + private int RogueBuffType; + private int RogueBuffRarity; + private int AeonID; + + @Override + public int getId() { + return MazeBuffID; + } + + @Override + public void onLoad() { + if (RogueBuffType >= 120 && RogueBuffType <= 126 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) { + GameDepot.getRogueBuffsList().add(this); + } + } +} diff --git a/src/main/java/emu/lunarcore/game/battle/Battle.java b/src/main/java/emu/lunarcore/game/battle/Battle.java index 0fd9921..3976307 100644 --- a/src/main/java/emu/lunarcore/game/battle/Battle.java +++ b/src/main/java/emu/lunarcore/game/battle/Battle.java @@ -103,8 +103,11 @@ public class Battle { if (excel == null) return null; MazeBuff buff = new MazeBuff(excel, ownerIndex, waveFlag); + return addBuff(buff); + } + + public MazeBuff addBuff(MazeBuff buff) { this.buffs.add(buff); - return buff; } diff --git a/src/main/java/emu/lunarcore/game/battle/BattleService.java b/src/main/java/emu/lunarcore/game/battle/BattleService.java index 47d3b60..46ea9c2 100644 --- a/src/main/java/emu/lunarcore/game/battle/BattleService.java +++ b/src/main/java/emu/lunarcore/game/battle/BattleService.java @@ -140,6 +140,11 @@ public class BattleService extends BaseGameService { player.getChallengeInstance().onBattleStart(battle); } + // Rogue + if (player.getRogueInstance() != null) { + player.getRogueInstance().onBattleStart(battle); + } + // Set battle and send rsp packet player.setBattle(battle); player.sendPacket(new PacketSceneCastSkillScRsp(battle, attackedGroupId)); @@ -272,6 +277,11 @@ public class BattleService extends BaseGameService { player.getChallengeInstance().onBattleFinish(battle, result, stats); } + // Rogue + if (player.getRogueInstance() != null) { + player.getRogueInstance().onBattleFinish(battle, result, stats); + } + // Done - Clear battle object from player player.setBattle(null); return battle; diff --git a/src/main/java/emu/lunarcore/game/battle/MazeBuff.java b/src/main/java/emu/lunarcore/game/battle/MazeBuff.java index 457523e..28a6264 100644 --- a/src/main/java/emu/lunarcore/game/battle/MazeBuff.java +++ b/src/main/java/emu/lunarcore/game/battle/MazeBuff.java @@ -12,7 +12,8 @@ import lombok.Getter; @Getter public class MazeBuff { - private MazeBuffExcel excel; + private int id; + private int level; private int ownerIndex; private int waveFlag; private IntList targetIndex; @@ -21,7 +22,12 @@ public class MazeBuff { private Object2DoubleMap dynamicValues; public MazeBuff(MazeBuffExcel excel, int ownerIndex, int waveFlag) { - this.excel = excel; + this(excel.getBuffId(), excel.getLv(), ownerIndex, waveFlag); + } + + public MazeBuff(int id, int level, int ownerIndex, int waveFlag) { + this.id = id; + this.level = level; this.ownerIndex = ownerIndex; this.waveFlag = waveFlag; } @@ -44,8 +50,8 @@ public class MazeBuff { public BattleBuff toProto() { var proto = BattleBuff.newInstance() - .setId(excel.getBuffId()) - .setLevel(excel.getLv()) + .setId(this.getId()) + .setLevel(this.getLevel()) .setOwnerId(this.getOwnerIndex()) .setWaveFlag(this.getWaveFlag()); diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java new file mode 100644 index 0000000..0dc37a0 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffData.java @@ -0,0 +1,28 @@ +package emu.lunarcore.game.rogue; + +import emu.lunarcore.game.battle.MazeBuff; +import emu.lunarcore.proto.RogueBuffOuterClass.RogueBuff; +import lombok.Getter; + +@Getter +public class RogueBuffData { + private int buffId; + private int level; + + public RogueBuffData(int buffId, int level) { + this.buffId = buffId; + this.level = level; + } + + public MazeBuff toMazeBuff() { + return new MazeBuff(buffId, level, 0, 0xffffffff); + } + + public RogueBuff toProto() { + var proto = RogueBuff.newInstance() + .setBuffId(this.getBuffId()) + .setLevel(this.getLevel()); + + return proto; + } +} diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java new file mode 100644 index 0000000..bd2e4a7 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffSelectMenu.java @@ -0,0 +1,77 @@ +package emu.lunarcore.game.rogue; + +import java.util.ArrayList; +import java.util.List; + +import emu.lunarcore.data.GameDepot; +import emu.lunarcore.data.excel.RogueBuffExcel; +import emu.lunarcore.proto.RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo; +import emu.lunarcore.util.WeightedList; +import lombok.Getter; + +@Getter +public class RogueBuffSelectMenu { + private transient RogueInstance rogue; + + private int maxBuffs; + private int rerolls; + private int maxRerolls; + private List buffs; + + // Cache + private transient WeightedList randomBuffs; + + @Deprecated // Morphia only! + public RogueBuffSelectMenu() {} + + public RogueBuffSelectMenu(RogueInstance rogue) { + this.rogue = rogue; + this.maxBuffs = 3; + this.buffs = new ArrayList<>(); + + this.generateRandomBuffs(); + } + + public void generateRandomBuffs() { + if (this.randomBuffs == null) { + this.randomBuffs = new WeightedList<>(); + + for (RogueBuffExcel excel : GameDepot.getRogueBuffsList()) { + if (rogue.getBuffs().containsKey(excel.getMazeBuffID())) { + continue; + } + + this.randomBuffs.add(10.0 / excel.getRogueBuffRarity(), excel); + }; + } + + this.getBuffs().clear(); + + while (this.getBuffs().size() < this.getMaxBuffs()) { + RogueBuffExcel excel = this.randomBuffs.next(); + this.getBuffs().add(new RogueBuffData(excel.getMazeBuffID(), 1)); + } + } + + protected void onLoad(RogueInstance rogue) { + this.rogue = rogue; + } + + public RogueBuffSelectInfo toProto() { + var proto = RogueBuffSelectInfo.newInstance(); + + if (this.getMaxRerolls() > 0) { + proto.setCanRoll(true); + proto.setRollBuffTimes(this.getRerolls()); + proto.setRollBuffMaxTimes(this.getMaxRerolls()); + } + + for (var buff : this.getBuffs()) { + proto.addMazeBuffList(buff.toProto()); + } + + proto.getMutableRollBuffsCost(); + + return proto; + } +} diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java b/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java new file mode 100644 index 0000000..e23d213 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/rogue/RogueBuffType.java @@ -0,0 +1,22 @@ +package emu.lunarcore.game.rogue; + +import lombok.Getter; + +@Getter +public enum RogueBuffType { + Default (100), + Preservation (120), + Remembrance (121), + Nihility (122), + Abundance (123), + Hunt (124), + Destruction (125), + Elation (126), + Propagation (127); + + private final int val; + + private RogueBuffType(int val) { + this.val = val; + } +} diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java b/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java index cfe6168..1fa9659 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueInstance.java @@ -1,16 +1,22 @@ package emu.lunarcore.game.rogue; -import java.util.HashSet; -import java.util.Set; -import java.util.TreeMap; +import java.util.*; +import emu.lunarcore.data.GameData; import emu.lunarcore.data.config.AnchorInfo; import emu.lunarcore.data.excel.RogueAreaExcel; +import emu.lunarcore.game.battle.Battle; import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.BattleEndStatusOuterClass.BattleEndStatus; +import emu.lunarcore.proto.BattleStatisticsOuterClass.BattleStatistics; +import emu.lunarcore.proto.RogueBuffInfoOuterClass.RogueBuffInfo; +import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource; import emu.lunarcore.proto.RogueCurrentInfoOuterClass.RogueCurrentInfo; import emu.lunarcore.proto.RogueMapInfoOuterClass.RogueMapInfo; import emu.lunarcore.proto.RogueRoomStatusOuterClass.RogueRoomStatus; import emu.lunarcore.proto.RogueStatusOuterClass.RogueStatus; +import emu.lunarcore.server.packet.send.PacketAddRogueBuffScNotify; +import emu.lunarcore.server.packet.send.PacketSyncRogueBuffSelectInfoScNotify; import emu.lunarcore.server.packet.send.PacketSyncRogueMapRoomScNotify; import emu.lunarcore.util.Utils; import lombok.Getter; @@ -20,17 +26,28 @@ public class RogueInstance { private transient Player player; private transient RogueAreaExcel excel; + private int areaId; private int currentRoomProgress; private int currentSiteId; private int startSiteId; - private Set baseAvatarIds; private TreeMap rooms; + private Set baseAvatarIds; + private Map buffs; + + private RogueBuffSelectMenu buffSelect; + private int pendingBuffSelects; + + @Deprecated // Morphia only! + public RogueInstance() {} + public RogueInstance(Player player, RogueAreaExcel excel) { this.player = player; this.excel = excel; + this.areaId = excel.getRogueAreaID(); this.currentRoomProgress = 0; this.baseAvatarIds = new HashSet<>(); + this.buffs = new HashMap<>(); this.initRooms(); } @@ -62,6 +79,43 @@ public class RogueInstance { return this.getRoomBySiteId(this.getCurrentSiteId()); } + public synchronized void createBuffSelect(int amount) { + this.pendingBuffSelects += amount; + + RogueBuffSelectMenu buffSelect = this.updateBuffSelect(); + if (buffSelect != null) { + getPlayer().sendPacket(new PacketSyncRogueBuffSelectInfoScNotify(buffSelect)); + } + } + + public synchronized RogueBuffSelectMenu updateBuffSelect() { + if (this.pendingBuffSelects > 0 && this.getBuffSelect() == null) { + this.buffSelect = new RogueBuffSelectMenu(this); + this.pendingBuffSelects--; + return this.buffSelect; + } + + return null; + } + + public synchronized RogueBuffData selectBuff(int buffId) { + if (this.getBuffSelect() == null) return null; + + RogueBuffData buff = this.getBuffSelect().getBuffs() + .stream() + .filter(b -> b.getBuffId() == buffId) + .findFirst() + .orElse(null); + + if (buff == null) return null; + + this.buffSelect = null; + this.getBuffs().put(buff.getBuffId(), buff); + getPlayer().sendPacket(new PacketAddRogueBuffScNotify(buff, RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT)); + + return buff; + } + public synchronized RogueRoomData enterRoom(int siteId) { // Set status on previous room RogueRoomData prevRoom = getCurrentRoom(); @@ -108,12 +162,37 @@ public class RogueInstance { return nextRoom; } + public synchronized void onBattleStart(Battle battle) { + for (var buff : this.getBuffs().values()) { + battle.addBuff(buff.toMazeBuff()); + } + } + + public synchronized void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatistics stats) { + if (result == BattleEndStatus.BATTLE_END_WIN) { + int amount = battle.getNpcMonsters().size(); + this.createBuffSelect(amount); + } + } + + // Database + + public void onLoad(Player player) { + this.player = player; + this.excel = GameData.getRogueAreaExcelMap().get(areaId); + + if (this.getBuffSelect() != null) { + this.getBuffSelect().onLoad(this); + } + } + // Serialization public RogueCurrentInfo toProto() { var proto = RogueCurrentInfo.newInstance() .setStatus(this.getStatus()) - .setRoomMap(this.toMapProto()); + .setRoomMap(this.toMapProto()) + .setRogueBuffInfo(this.toBuffProto()); return proto; } @@ -134,4 +213,20 @@ public class RogueInstance { return proto; } + public RogueBuffInfo toBuffProto() { + var proto = RogueBuffInfo.newInstance(); + + if (this.getBuffSelect() != null) { + proto.setBuffSelectInfo(this.getBuffSelect().toProto()); + } else { + proto.getMutableBuffSelectInfo(); + } + + for (var buff : this.getBuffs().values()) { + proto.addMazeBuffList(buff.toProto()); + } + + return proto; + } + } \ No newline at end of file diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueBuffCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueBuffCsReq.java new file mode 100644 index 0000000..de2204a --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectRogueBuffCsReq.java @@ -0,0 +1,30 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.game.rogue.RogueBuffData; +import emu.lunarcore.game.rogue.RogueBuffSelectMenu; +import emu.lunarcore.proto.SelectRogueBuffCsReqOuterClass.SelectRogueBuffCsReq; +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.PacketSelectRogueBuffScRsp; + +@Opcodes(CmdId.SelectRogueBuffCsReq) +public class HandlerSelectRogueBuffCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] header, byte[] data) throws Exception { + var req = SelectRogueBuffCsReq.parseFrom(data); + + if (session.getPlayer().getRogueInstance() != null) { + RogueBuffData buff = session.getPlayer().getRogueInstance().selectBuff(req.getMazeBuffId()); + if (buff != null) { + RogueBuffSelectMenu buffSelect = session.getPlayer().getRogueInstance().updateBuffSelect(); + session.send(new PacketSelectRogueBuffScRsp(buff, buffSelect)); + } + } + + session.send(CmdId.SelectRogueBuffScRsp); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketAddRogueBuffScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketAddRogueBuffScNotify.java new file mode 100644 index 0000000..7b8db85 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketAddRogueBuffScNotify.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.rogue.RogueBuffData; +import emu.lunarcore.proto.AddRogueBuffScNotifyOuterClass.AddRogueBuffScNotify; +import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketAddRogueBuffScNotify extends BasePacket { + + public PacketAddRogueBuffScNotify(RogueBuffData buff, RogueBuffSource source) { + super(CmdId.AddRogueBuffScNotify); + + var data = AddRogueBuffScNotify.newInstance() + .setMazeBuffInfo(buff.toProto()) + .setSource(source); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSelectRogueBuffScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectRogueBuffScRsp.java new file mode 100644 index 0000000..8476a11 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectRogueBuffScRsp.java @@ -0,0 +1,26 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.rogue.RogueBuffData; +import emu.lunarcore.game.rogue.RogueBuffSelectMenu; +import emu.lunarcore.proto.SelectRogueBuffScRspOuterClass.SelectRogueBuffScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSelectRogueBuffScRsp extends BasePacket { + + public PacketSelectRogueBuffScRsp(RogueBuffData buff, RogueBuffSelectMenu buffSelect) { + super(CmdId.SelectRogueBuffScRsp); + + var data = SelectRogueBuffScRsp.newInstance() + .setMazeBuffId(buff.getBuffId()) + .setMazeBuffLevel(buff.getLevel()); + + if (buffSelect != null) { + data.setBuffSelectInfo(buffSelect.toProto()); + } else { + data.getMutableBuffSelectInfo(); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSyncRogueBuffSelectInfoScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncRogueBuffSelectInfoScNotify.java new file mode 100644 index 0000000..e54a6de --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncRogueBuffSelectInfoScNotify.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.rogue.RogueBuffSelectMenu; +import emu.lunarcore.proto.SyncRogueBuffSelectInfoScNotifyOuterClass.SyncRogueBuffSelectInfoScNotify; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSyncRogueBuffSelectInfoScNotify extends BasePacket { + + public PacketSyncRogueBuffSelectInfoScNotify(RogueBuffSelectMenu selectMenu) { + super(CmdId.SyncRogueBuffSelectInfoScNotify); + + var data = SyncRogueBuffSelectInfoScNotify.newInstance() + .setBuffSelectInfo(selectMenu.toProto()); + + this.setData(data); + } +}