diff --git a/src/generated/main/emu/lunarcore/proto/ApplyFriendCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/ApplyFriendCsReqOuterClass.java new file mode 100644 index 0000000..f6ba050 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ApplyFriendCsReqOuterClass.java @@ -0,0 +1,372 @@ +// 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 ApplyFriendCsReqOuterClass { + /** + * Protobuf type {@code ApplyFriendCsReq} + */ + public static final class ApplyFriendCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 uid = 6; + */ + private int uid; + + /** + * optional .FriendApplySource source = 8; + */ + private int source; + + private ApplyFriendCsReq() { + } + + /** + * @return a new empty instance of {@code ApplyFriendCsReq} + */ + public static ApplyFriendCsReq newInstance() { + return new ApplyFriendCsReq(); + } + + /** + * optional uint32 uid = 6; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 uid = 6; + * @return this + */ + public ApplyFriendCsReq clearUid() { + bitField0_ &= ~0x00000001; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 6; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 6; + * @param value the uid to set + * @return this + */ + public ApplyFriendCsReq setUid(final int value) { + bitField0_ |= 0x00000001; + uid = value; + return this; + } + + /** + * optional .FriendApplySource source = 8; + * @return whether the source field is set + */ + public boolean hasSource() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .FriendApplySource source = 8; + * @return this + */ + public ApplyFriendCsReq clearSource() { + bitField0_ &= ~0x00000002; + source = 0; + return this; + } + + /** + * optional .FriendApplySource source = 8; + * @return the source + */ + public FriendApplySourceOuterClass.FriendApplySource getSource() { + return FriendApplySourceOuterClass.FriendApplySource.forNumber(source); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link ApplyFriendCsReq#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 FriendApplySourceOuterClass.FriendApplySource}. Setting an invalid value + * can cause {@link ApplyFriendCsReq#getSource()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public ApplyFriendCsReq setSourceValue(final int value) { + bitField0_ |= 0x00000002; + source = value; + return this; + } + + /** + * optional .FriendApplySource source = 8; + * @param value the source to set + * @return this + */ + public ApplyFriendCsReq setSource(final FriendApplySourceOuterClass.FriendApplySource value) { + bitField0_ |= 0x00000002; + source = value.getNumber(); + return this; + } + + @Override + public ApplyFriendCsReq copyFrom(final ApplyFriendCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + uid = other.uid; + source = other.source; + } + return this; + } + + @Override + public ApplyFriendCsReq mergeFrom(final ApplyFriendCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUid()) { + setUid(other.uid); + } + if (other.hasSource()) { + setSourceValue(other.source); + } + return this; + } + + @Override + public ApplyFriendCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + uid = 0; + source = 0; + return this; + } + + @Override + public ApplyFriendCsReq 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 ApplyFriendCsReq)) { + return false; + } + ApplyFriendCsReq other = (ApplyFriendCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasUid() || uid == other.uid) + && (!hasSource() || source == other.source); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeEnumNoTag(source); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(source); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ApplyFriendCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // uid + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // source + final int value = input.readInt32(); + if (FriendApplySourceOuterClass.FriendApplySource.forNumber(value) != null) { + source = value; + 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.uid, uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeEnum(FieldNames.source, source, FriendApplySourceOuterClass.FriendApplySource.converter()); + } + output.endObject(); + } + + @Override + public ApplyFriendCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -896505829: { + if (input.isAtField(FieldNames.source)) { + if (!input.trySkipNullValue()) { + final FriendApplySourceOuterClass.FriendApplySource value = input.readEnum(FriendApplySourceOuterClass.FriendApplySource.converter()); + if (value != null) { + source = value.getNumber(); + bitField0_ |= 0x00000002; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ApplyFriendCsReq clone() { + return new ApplyFriendCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ApplyFriendCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ApplyFriendCsReq(), data).checkInitialized(); + } + + public static ApplyFriendCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ApplyFriendCsReq(), input).checkInitialized(); + } + + public static ApplyFriendCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ApplyFriendCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating ApplyFriendCsReq messages + */ + public static MessageFactory getFactory() { + return ApplyFriendCsReqFactory.INSTANCE; + } + + private enum ApplyFriendCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public ApplyFriendCsReq create() { + return ApplyFriendCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName uid = FieldName.forField("uid"); + + static final FieldName source = FieldName.forField("source"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DeleteFriendCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/DeleteFriendCsReqOuterClass.java new file mode 100644 index 0000000..d468153 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DeleteFriendCsReqOuterClass.java @@ -0,0 +1,259 @@ +// 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 DeleteFriendCsReqOuterClass { + /** + * Protobuf type {@code DeleteFriendCsReq} + */ + public static final class DeleteFriendCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 uid = 2; + */ + private int uid; + + private DeleteFriendCsReq() { + } + + /** + * @return a new empty instance of {@code DeleteFriendCsReq} + */ + public static DeleteFriendCsReq newInstance() { + return new DeleteFriendCsReq(); + } + + /** + * optional uint32 uid = 2; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 uid = 2; + * @return this + */ + public DeleteFriendCsReq clearUid() { + bitField0_ &= ~0x00000001; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 2; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 2; + * @param value the uid to set + * @return this + */ + public DeleteFriendCsReq setUid(final int value) { + bitField0_ |= 0x00000001; + uid = value; + return this; + } + + @Override + public DeleteFriendCsReq copyFrom(final DeleteFriendCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + uid = other.uid; + } + return this; + } + + @Override + public DeleteFriendCsReq mergeFrom(final DeleteFriendCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUid()) { + setUid(other.uid); + } + return this; + } + + @Override + public DeleteFriendCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + uid = 0; + return this; + } + + @Override + public DeleteFriendCsReq 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 DeleteFriendCsReq)) { + return false; + } + DeleteFriendCsReq other = (DeleteFriendCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasUid() || uid == other.uid); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(uid); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DeleteFriendCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // uid + uid = 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.uid, uid); + } + output.endObject(); + } + + @Override + public DeleteFriendCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DeleteFriendCsReq clone() { + return new DeleteFriendCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DeleteFriendCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DeleteFriendCsReq(), data).checkInitialized(); + } + + public static DeleteFriendCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DeleteFriendCsReq(), input).checkInitialized(); + } + + public static DeleteFriendCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DeleteFriendCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating DeleteFriendCsReq messages + */ + public static MessageFactory getFactory() { + return DeleteFriendCsReqFactory.INSTANCE; + } + + private enum DeleteFriendCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public DeleteFriendCsReq create() { + return DeleteFriendCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName uid = FieldName.forField("uid"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/FriendApplyListInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/FriendApplyListInfoOuterClass.java new file mode 100644 index 0000000..2020eda --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/FriendApplyListInfoOuterClass.java @@ -0,0 +1,361 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class FriendApplyListInfoOuterClass { + /** + * Protobuf type {@code FriendApplyListInfo} + */ + public static final class FriendApplyListInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional int64 JKBMJGNPCNN = 12; + */ + private long jKBMJGNPCNN; + + /** + * optional .SimpleInfo simple_info = 10; + */ + private final SimpleInfoOuterClass.SimpleInfo simpleInfo = SimpleInfoOuterClass.SimpleInfo.newInstance(); + + private FriendApplyListInfo() { + } + + /** + * @return a new empty instance of {@code FriendApplyListInfo} + */ + public static FriendApplyListInfo newInstance() { + return new FriendApplyListInfo(); + } + + /** + * optional int64 JKBMJGNPCNN = 12; + * @return whether the jKBMJGNPCNN field is set + */ + public boolean hasJKBMJGNPCNN() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional int64 JKBMJGNPCNN = 12; + * @return this + */ + public FriendApplyListInfo clearJKBMJGNPCNN() { + bitField0_ &= ~0x00000001; + jKBMJGNPCNN = 0L; + return this; + } + + /** + * optional int64 JKBMJGNPCNN = 12; + * @return the jKBMJGNPCNN + */ + public long getJKBMJGNPCNN() { + return jKBMJGNPCNN; + } + + /** + * optional int64 JKBMJGNPCNN = 12; + * @param value the jKBMJGNPCNN to set + * @return this + */ + public FriendApplyListInfo setJKBMJGNPCNN(final long value) { + bitField0_ |= 0x00000001; + jKBMJGNPCNN = value; + return this; + } + + /** + * optional .SimpleInfo simple_info = 10; + * @return whether the simpleInfo field is set + */ + public boolean hasSimpleInfo() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .SimpleInfo simple_info = 10; + * @return this + */ + public FriendApplyListInfo clearSimpleInfo() { + bitField0_ &= ~0x00000002; + simpleInfo.clear(); + return this; + } + + /** + * optional .SimpleInfo simple_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 #getMutableSimpleInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public SimpleInfoOuterClass.SimpleInfo getSimpleInfo() { + return simpleInfo; + } + + /** + * optional .SimpleInfo simple_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 SimpleInfoOuterClass.SimpleInfo getMutableSimpleInfo() { + bitField0_ |= 0x00000002; + return simpleInfo; + } + + /** + * optional .SimpleInfo simple_info = 10; + * @param value the simpleInfo to set + * @return this + */ + public FriendApplyListInfo setSimpleInfo(final SimpleInfoOuterClass.SimpleInfo value) { + bitField0_ |= 0x00000002; + simpleInfo.copyFrom(value); + return this; + } + + @Override + public FriendApplyListInfo copyFrom(final FriendApplyListInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + jKBMJGNPCNN = other.jKBMJGNPCNN; + simpleInfo.copyFrom(other.simpleInfo); + } + return this; + } + + @Override + public FriendApplyListInfo mergeFrom(final FriendApplyListInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasJKBMJGNPCNN()) { + setJKBMJGNPCNN(other.jKBMJGNPCNN); + } + if (other.hasSimpleInfo()) { + getMutableSimpleInfo().mergeFrom(other.simpleInfo); + } + return this; + } + + @Override + public FriendApplyListInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + jKBMJGNPCNN = 0L; + simpleInfo.clear(); + return this; + } + + @Override + public FriendApplyListInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + simpleInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof FriendApplyListInfo)) { + return false; + } + FriendApplyListInfo other = (FriendApplyListInfo) o; + return bitField0_ == other.bitField0_ + && (!hasJKBMJGNPCNN() || jKBMJGNPCNN == other.jKBMJGNPCNN) + && (!hasSimpleInfo() || simpleInfo.equals(other.simpleInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 96); + output.writeInt64NoTag(jKBMJGNPCNN); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 82); + output.writeMessageNoTag(simpleInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeInt64SizeNoTag(jKBMJGNPCNN); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(simpleInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public FriendApplyListInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 96: { + // jKBMJGNPCNN + jKBMJGNPCNN = input.readInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // simpleInfo + input.readMessage(simpleInfo); + 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.writeInt64(FieldNames.jKBMJGNPCNN, jKBMJGNPCNN); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.simpleInfo, simpleInfo); + } + output.endObject(); + } + + @Override + public FriendApplyListInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -601575848: { + if (input.isAtField(FieldNames.jKBMJGNPCNN)) { + if (!input.trySkipNullValue()) { + jKBMJGNPCNN = input.readInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1431903872: + case -1419171045: { + if (input.isAtField(FieldNames.simpleInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(simpleInfo); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public FriendApplyListInfo clone() { + return new FriendApplyListInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static FriendApplyListInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new FriendApplyListInfo(), data).checkInitialized(); + } + + public static FriendApplyListInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new FriendApplyListInfo(), input).checkInitialized(); + } + + public static FriendApplyListInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new FriendApplyListInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating FriendApplyListInfo messages + */ + public static MessageFactory getFactory() { + return FriendApplyListInfoFactory.INSTANCE; + } + + private enum FriendApplyListInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public FriendApplyListInfo create() { + return FriendApplyListInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName jKBMJGNPCNN = FieldName.forField("JKBMJGNPCNN"); + + static final FieldName simpleInfo = FieldName.forField("simpleInfo", "simple_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/FriendApplySourceOuterClass.java b/src/generated/main/emu/lunarcore/proto/FriendApplySourceOuterClass.java new file mode 100644 index 0000000..d68f888 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/FriendApplySourceOuterClass.java @@ -0,0 +1,185 @@ +// 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 FriendApplySourceOuterClass { + /** + * Protobuf enum {@code FriendApplySource} + */ + public enum FriendApplySource implements ProtoEnum { + /** + * FRIEND_APPLY_SOURCE_NONE = 0; + */ + FRIEND_APPLY_SOURCE_NONE("FRIEND_APPLY_SOURCE_NONE", 0), + + /** + * FRIEND_APPLY_SOURCE_SEARCH = 1; + */ + FRIEND_APPLY_SOURCE_SEARCH("FRIEND_APPLY_SOURCE_SEARCH", 1), + + /** + * FRIEND_APPLY_SOURCE_RECOMMEND = 2; + */ + FRIEND_APPLY_SOURCE_RECOMMEND("FRIEND_APPLY_SOURCE_RECOMMEND", 2), + + /** + * FRIEND_APPLY_SOURCE_ASSIST = 3; + */ + FRIEND_APPLY_SOURCE_ASSIST("FRIEND_APPLY_SOURCE_ASSIST", 3), + + /** + * FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST = 4; + */ + FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST("FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST", 4), + + /** + * FRIEND_APPLY_SOURCE_PSN_FRIEND = 5; + */ + FRIEND_APPLY_SOURCE_PSN_FRIEND("FRIEND_APPLY_SOURCE_PSN_FRIEND", 5); + + /** + * FRIEND_APPLY_SOURCE_NONE = 0; + */ + public static final int FRIEND_APPLY_SOURCE_NONE_VALUE = 0; + + /** + * FRIEND_APPLY_SOURCE_SEARCH = 1; + */ + public static final int FRIEND_APPLY_SOURCE_SEARCH_VALUE = 1; + + /** + * FRIEND_APPLY_SOURCE_RECOMMEND = 2; + */ + public static final int FRIEND_APPLY_SOURCE_RECOMMEND_VALUE = 2; + + /** + * FRIEND_APPLY_SOURCE_ASSIST = 3; + */ + public static final int FRIEND_APPLY_SOURCE_ASSIST_VALUE = 3; + + /** + * FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST = 4; + */ + public static final int FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST_VALUE = 4; + + /** + * FRIEND_APPLY_SOURCE_PSN_FRIEND = 5; + */ + public static final int FRIEND_APPLY_SOURCE_PSN_FRIEND_VALUE = 5; + + private final String name; + + private final int number; + + private FriendApplySource(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 FriendApplySourceConverter.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 FriendApplySource forNumber(int value) { + return FriendApplySourceConverter.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 FriendApplySource forNumberOr(int number, FriendApplySource other) { + FriendApplySource value = forNumber(number); + return value == null ? other : value; + } + + enum FriendApplySourceConverter implements ProtoEnum.EnumConverter { + INSTANCE; + + private static final FriendApplySource[] lookup = new FriendApplySource[6]; + + static { + lookup[0] = FRIEND_APPLY_SOURCE_NONE; + lookup[1] = FRIEND_APPLY_SOURCE_SEARCH; + lookup[2] = FRIEND_APPLY_SOURCE_RECOMMEND; + lookup[3] = FRIEND_APPLY_SOURCE_ASSIST; + lookup[4] = FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST; + lookup[5] = FRIEND_APPLY_SOURCE_PSN_FRIEND; + } + + @Override + public final FriendApplySource forNumber(final int value) { + if (value >= 0 && value < lookup.length) { + return lookup[value]; + } + return null; + } + + @Override + public final FriendApplySource forName(final CharSequence value) { + switch (value.length()) { + case 24: { + if (ProtoUtil.isEqual("FRIEND_APPLY_SOURCE_NONE", value)) { + return FRIEND_APPLY_SOURCE_NONE; + } + break; + } + case 26: { + if (ProtoUtil.isEqual("FRIEND_APPLY_SOURCE_SEARCH", value)) { + return FRIEND_APPLY_SOURCE_SEARCH; + } + if (ProtoUtil.isEqual("FRIEND_APPLY_SOURCE_ASSIST", value)) { + return FRIEND_APPLY_SOURCE_ASSIST; + } + break; + } + case 29: { + if (ProtoUtil.isEqual("FRIEND_APPLY_SOURCE_RECOMMEND", value)) { + return FRIEND_APPLY_SOURCE_RECOMMEND; + } + break; + } + case 30: { + if (ProtoUtil.isEqual("FRIEND_APPLY_SOURCE_PSN_FRIEND", value)) { + return FRIEND_APPLY_SOURCE_PSN_FRIEND; + } + break; + } + case 36: { + if (ProtoUtil.isEqual("FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST", value)) { + return FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST; + } + break; + } + } + return null; + } + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetFriendApplyListInfoScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetFriendApplyListInfoScRspOuterClass.java new file mode 100644 index 0000000..2545352 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetFriendApplyListInfoScRspOuterClass.java @@ -0,0 +1,378 @@ +// 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 GetFriendApplyListInfoScRspOuterClass { + /** + * Protobuf type {@code GetFriendApplyListInfoScRsp} + */ + public static final class GetFriendApplyListInfoScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 4; + */ + private int retcode; + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + */ + private final RepeatedMessage friendApplyList = RepeatedMessage.newEmptyInstance(FriendApplyListInfoOuterClass.FriendApplyListInfo.getFactory()); + + private GetFriendApplyListInfoScRsp() { + } + + /** + * @return a new empty instance of {@code GetFriendApplyListInfoScRsp} + */ + public static GetFriendApplyListInfoScRsp newInstance() { + return new GetFriendApplyListInfoScRsp(); + } + + /** + * optional uint32 retcode = 4; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 4; + * @return this + */ + public GetFriendApplyListInfoScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 4; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 4; + * @param value the retcode to set + * @return this + */ + public GetFriendApplyListInfoScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + * @return whether the friendApplyList field is set + */ + public boolean hasFriendApplyList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + * @return this + */ + public GetFriendApplyListInfoScRsp clearFriendApplyList() { + bitField0_ &= ~0x00000002; + friendApplyList.clear(); + return this; + } + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableFriendApplyList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getFriendApplyList() { + return friendApplyList; + } + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableFriendApplyList( + ) { + bitField0_ |= 0x00000002; + return friendApplyList; + } + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + * @param value the friendApplyList to add + * @return this + */ + public GetFriendApplyListInfoScRsp addFriendApplyList( + final FriendApplyListInfoOuterClass.FriendApplyListInfo value) { + bitField0_ |= 0x00000002; + friendApplyList.add(value); + return this; + } + + /** + * repeated .FriendApplyListInfo friend_apply_list = 8; + * @param values the friendApplyList to add + * @return this + */ + public GetFriendApplyListInfoScRsp addAllFriendApplyList( + final FriendApplyListInfoOuterClass.FriendApplyListInfo... values) { + bitField0_ |= 0x00000002; + friendApplyList.addAll(values); + return this; + } + + @Override + public GetFriendApplyListInfoScRsp copyFrom(final GetFriendApplyListInfoScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + friendApplyList.copyFrom(other.friendApplyList); + } + return this; + } + + @Override + public GetFriendApplyListInfoScRsp mergeFrom(final GetFriendApplyListInfoScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasFriendApplyList()) { + getMutableFriendApplyList().addAll(other.friendApplyList); + } + return this; + } + + @Override + public GetFriendApplyListInfoScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + friendApplyList.clear(); + return this; + } + + @Override + public GetFriendApplyListInfoScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + friendApplyList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetFriendApplyListInfoScRsp)) { + return false; + } + GetFriendApplyListInfoScRsp other = (GetFriendApplyListInfoScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasFriendApplyList() || friendApplyList.equals(other.friendApplyList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < friendApplyList.length(); i++) { + output.writeRawByte((byte) 66); + output.writeMessageNoTag(friendApplyList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * friendApplyList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(friendApplyList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetFriendApplyListInfoScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 32: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 66) { + break; + } + } + case 66: { + // friendApplyList + tag = input.readRepeatedMessage(friendApplyList, tag); + bitField0_ |= 0x00000002; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedMessage(FieldNames.friendApplyList, friendApplyList); + } + output.endObject(); + } + + @Override + public GetFriendApplyListInfoScRsp 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 -1582340050: + case 1375926032: { + if (input.isAtField(FieldNames.friendApplyList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(friendApplyList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetFriendApplyListInfoScRsp clone() { + return new GetFriendApplyListInfoScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetFriendApplyListInfoScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetFriendApplyListInfoScRsp(), data).checkInitialized(); + } + + public static GetFriendApplyListInfoScRsp parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new GetFriendApplyListInfoScRsp(), input).checkInitialized(); + } + + public static GetFriendApplyListInfoScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetFriendApplyListInfoScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetFriendApplyListInfoScRsp messages + */ + public static MessageFactory getFactory() { + return GetFriendApplyListInfoScRspFactory.INSTANCE; + } + + private enum GetFriendApplyListInfoScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetFriendApplyListInfoScRsp create() { + return GetFriendApplyListInfoScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName friendApplyList = FieldName.forField("friendApplyList", "friend_apply_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetFriendLoginInfoScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetFriendLoginInfoScRspOuterClass.java new file mode 100644 index 0000000..d4f885f --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetFriendLoginInfoScRspOuterClass.java @@ -0,0 +1,664 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedInt; + +public final class GetFriendLoginInfoScRspOuterClass { + /** + * Protobuf type {@code GetFriendLoginInfoScRsp} + */ + public static final class GetFriendLoginInfoScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 5; + */ + private int retcode; + + /** + * optional bool show_red_dot_flag = 1; + */ + private boolean showRedDotFlag; + + /** + * optional bool is_allow_other_apply = 10; + */ + private boolean isAllowOtherApply; + + /** + * repeated uint32 black_uid_list = 4; + */ + private final RepeatedInt blackUidList = RepeatedInt.newEmptyInstance(); + + /** + * repeated uint32 friend_uid_list = 14; + */ + private final RepeatedInt friendUidList = RepeatedInt.newEmptyInstance(); + + private GetFriendLoginInfoScRsp() { + } + + /** + * @return a new empty instance of {@code GetFriendLoginInfoScRsp} + */ + public static GetFriendLoginInfoScRsp newInstance() { + return new GetFriendLoginInfoScRsp(); + } + + /** + * optional uint32 retcode = 5; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 5; + * @return this + */ + public GetFriendLoginInfoScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 5; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 5; + * @param value the retcode to set + * @return this + */ + public GetFriendLoginInfoScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * optional bool show_red_dot_flag = 1; + * @return whether the showRedDotFlag field is set + */ + public boolean hasShowRedDotFlag() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional bool show_red_dot_flag = 1; + * @return this + */ + public GetFriendLoginInfoScRsp clearShowRedDotFlag() { + bitField0_ &= ~0x00000002; + showRedDotFlag = false; + return this; + } + + /** + * optional bool show_red_dot_flag = 1; + * @return the showRedDotFlag + */ + public boolean getShowRedDotFlag() { + return showRedDotFlag; + } + + /** + * optional bool show_red_dot_flag = 1; + * @param value the showRedDotFlag to set + * @return this + */ + public GetFriendLoginInfoScRsp setShowRedDotFlag(final boolean value) { + bitField0_ |= 0x00000002; + showRedDotFlag = value; + return this; + } + + /** + * optional bool is_allow_other_apply = 10; + * @return whether the isAllowOtherApply field is set + */ + public boolean hasIsAllowOtherApply() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool is_allow_other_apply = 10; + * @return this + */ + public GetFriendLoginInfoScRsp clearIsAllowOtherApply() { + bitField0_ &= ~0x00000004; + isAllowOtherApply = false; + return this; + } + + /** + * optional bool is_allow_other_apply = 10; + * @return the isAllowOtherApply + */ + public boolean getIsAllowOtherApply() { + return isAllowOtherApply; + } + + /** + * optional bool is_allow_other_apply = 10; + * @param value the isAllowOtherApply to set + * @return this + */ + public GetFriendLoginInfoScRsp setIsAllowOtherApply(final boolean value) { + bitField0_ |= 0x00000004; + isAllowOtherApply = value; + return this; + } + + /** + * repeated uint32 black_uid_list = 4; + * @return whether the blackUidList field is set + */ + public boolean hasBlackUidList() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated uint32 black_uid_list = 4; + * @return this + */ + public GetFriendLoginInfoScRsp clearBlackUidList() { + bitField0_ &= ~0x00000008; + blackUidList.clear(); + return this; + } + + /** + * repeated uint32 black_uid_list = 4; + * + * 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 #getMutableBlackUidList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getBlackUidList() { + return blackUidList; + } + + /** + * repeated uint32 black_uid_list = 4; + * + * 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 getMutableBlackUidList() { + bitField0_ |= 0x00000008; + return blackUidList; + } + + /** + * repeated uint32 black_uid_list = 4; + * @param value the blackUidList to add + * @return this + */ + public GetFriendLoginInfoScRsp addBlackUidList(final int value) { + bitField0_ |= 0x00000008; + blackUidList.add(value); + return this; + } + + /** + * repeated uint32 black_uid_list = 4; + * @param values the blackUidList to add + * @return this + */ + public GetFriendLoginInfoScRsp addAllBlackUidList(final int... values) { + bitField0_ |= 0x00000008; + blackUidList.addAll(values); + return this; + } + + /** + * repeated uint32 friend_uid_list = 14; + * @return whether the friendUidList field is set + */ + public boolean hasFriendUidList() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * repeated uint32 friend_uid_list = 14; + * @return this + */ + public GetFriendLoginInfoScRsp clearFriendUidList() { + bitField0_ &= ~0x00000010; + friendUidList.clear(); + return this; + } + + /** + * repeated uint32 friend_uid_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 #getMutableFriendUidList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getFriendUidList() { + return friendUidList; + } + + /** + * repeated uint32 friend_uid_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 RepeatedInt getMutableFriendUidList() { + bitField0_ |= 0x00000010; + return friendUidList; + } + + /** + * repeated uint32 friend_uid_list = 14; + * @param value the friendUidList to add + * @return this + */ + public GetFriendLoginInfoScRsp addFriendUidList(final int value) { + bitField0_ |= 0x00000010; + friendUidList.add(value); + return this; + } + + /** + * repeated uint32 friend_uid_list = 14; + * @param values the friendUidList to add + * @return this + */ + public GetFriendLoginInfoScRsp addAllFriendUidList(final int... values) { + bitField0_ |= 0x00000010; + friendUidList.addAll(values); + return this; + } + + @Override + public GetFriendLoginInfoScRsp copyFrom(final GetFriendLoginInfoScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + showRedDotFlag = other.showRedDotFlag; + isAllowOtherApply = other.isAllowOtherApply; + blackUidList.copyFrom(other.blackUidList); + friendUidList.copyFrom(other.friendUidList); + } + return this; + } + + @Override + public GetFriendLoginInfoScRsp mergeFrom(final GetFriendLoginInfoScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasShowRedDotFlag()) { + setShowRedDotFlag(other.showRedDotFlag); + } + if (other.hasIsAllowOtherApply()) { + setIsAllowOtherApply(other.isAllowOtherApply); + } + if (other.hasBlackUidList()) { + getMutableBlackUidList().addAll(other.blackUidList); + } + if (other.hasFriendUidList()) { + getMutableFriendUidList().addAll(other.friendUidList); + } + return this; + } + + @Override + public GetFriendLoginInfoScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + showRedDotFlag = false; + isAllowOtherApply = false; + blackUidList.clear(); + friendUidList.clear(); + return this; + } + + @Override + public GetFriendLoginInfoScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + blackUidList.clear(); + friendUidList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetFriendLoginInfoScRsp)) { + return false; + } + GetFriendLoginInfoScRsp other = (GetFriendLoginInfoScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasShowRedDotFlag() || showRedDotFlag == other.showRedDotFlag) + && (!hasIsAllowOtherApply() || isAllowOtherApply == other.isAllowOtherApply) + && (!hasBlackUidList() || blackUidList.equals(other.blackUidList)) + && (!hasFriendUidList() || friendUidList.equals(other.friendUidList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 8); + output.writeBoolNoTag(showRedDotFlag); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 80); + output.writeBoolNoTag(isAllowOtherApply); + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < blackUidList.length(); i++) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(blackUidList.array()[i]); + } + } + if ((bitField0_ & 0x00000010) != 0) { + for (int i = 0; i < friendUidList.length(); i++) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(friendUidList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * blackUidList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(blackUidList); + } + if ((bitField0_ & 0x00000010) != 0) { + size += (1 * friendUidList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(friendUidList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetFriendLoginInfoScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 40: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 8) { + break; + } + } + case 8: { + // showRedDotFlag + showRedDotFlag = input.readBool(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // isAllowOtherApply + isAllowOtherApply = input.readBool(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 34) { + break; + } + } + case 34: { + // blackUidList [packed=true] + input.readPackedUInt32(blackUidList, tag); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 114) { + break; + } + } + case 114: { + // friendUidList [packed=true] + input.readPackedUInt32(friendUidList, tag); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 32: { + // blackUidList [packed=false] + tag = input.readRepeatedUInt32(blackUidList, tag); + bitField0_ |= 0x00000008; + break; + } + case 112: { + // friendUidList [packed=false] + tag = input.readRepeatedUInt32(friendUidList, tag); + bitField0_ |= 0x00000010; + 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.writeBool(FieldNames.showRedDotFlag, showRedDotFlag); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.isAllowOtherApply, isAllowOtherApply); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedUInt32(FieldNames.blackUidList, blackUidList); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRepeatedUInt32(FieldNames.friendUidList, friendUidList); + } + output.endObject(); + } + + @Override + public GetFriendLoginInfoScRsp 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 197350753: + case 1123923602: { + if (input.isAtField(FieldNames.showRedDotFlag)) { + if (!input.trySkipNullValue()) { + showRedDotFlag = input.readBool(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 442705885: + case 1355216308: { + if (input.isAtField(FieldNames.isAllowOtherApply)) { + if (!input.trySkipNullValue()) { + isAllowOtherApply = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1562975247: + case -1854929043: { + if (input.isAtField(FieldNames.blackUidList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(blackUidList); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 2058895504: + case -2016931922: { + if (input.isAtField(FieldNames.friendUidList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(friendUidList); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetFriendLoginInfoScRsp clone() { + return new GetFriendLoginInfoScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetFriendLoginInfoScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetFriendLoginInfoScRsp(), data).checkInitialized(); + } + + public static GetFriendLoginInfoScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetFriendLoginInfoScRsp(), input).checkInitialized(); + } + + public static GetFriendLoginInfoScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetFriendLoginInfoScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetFriendLoginInfoScRsp messages + */ + public static MessageFactory getFactory() { + return GetFriendLoginInfoScRspFactory.INSTANCE; + } + + private enum GetFriendLoginInfoScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetFriendLoginInfoScRsp create() { + return GetFriendLoginInfoScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName showRedDotFlag = FieldName.forField("showRedDotFlag", "show_red_dot_flag"); + + static final FieldName isAllowOtherApply = FieldName.forField("isAllowOtherApply", "is_allow_other_apply"); + + static final FieldName blackUidList = FieldName.forField("blackUidList", "black_uid_list"); + + static final FieldName friendUidList = FieldName.forField("friendUidList", "friend_uid_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetPlayerDetailInfoScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetPlayerDetailInfoScRspOuterClass.java index 840930c..56f8809 100644 --- a/src/generated/main/emu/lunarcore/proto/GetPlayerDetailInfoScRspOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/GetPlayerDetailInfoScRspOuterClass.java @@ -23,6 +23,11 @@ public final class GetPlayerDetailInfoScRspOuterClass { */ private int retcode; + /** + * optional .PlayerDetailInfo player_detail_info = 6; + */ + private final PlayerDetailInfoOuterClass.PlayerDetailInfo playerDetailInfo = PlayerDetailInfoOuterClass.PlayerDetailInfo.newInstance(); + private GetPlayerDetailInfoScRsp() { } @@ -70,12 +75,71 @@ public final class GetPlayerDetailInfoScRspOuterClass { return this; } + /** + * optional .PlayerDetailInfo player_detail_info = 6; + * @return whether the playerDetailInfo field is set + */ + public boolean hasPlayerDetailInfo() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .PlayerDetailInfo player_detail_info = 6; + * @return this + */ + public GetPlayerDetailInfoScRsp clearPlayerDetailInfo() { + bitField0_ &= ~0x00000002; + playerDetailInfo.clear(); + return this; + } + + /** + * optional .PlayerDetailInfo player_detail_info = 6; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutablePlayerDetailInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public PlayerDetailInfoOuterClass.PlayerDetailInfo getPlayerDetailInfo() { + return playerDetailInfo; + } + + /** + * optional .PlayerDetailInfo player_detail_info = 6; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public PlayerDetailInfoOuterClass.PlayerDetailInfo getMutablePlayerDetailInfo() { + bitField0_ |= 0x00000002; + return playerDetailInfo; + } + + /** + * optional .PlayerDetailInfo player_detail_info = 6; + * @param value the playerDetailInfo to set + * @return this + */ + public GetPlayerDetailInfoScRsp setPlayerDetailInfo( + final PlayerDetailInfoOuterClass.PlayerDetailInfo value) { + bitField0_ |= 0x00000002; + playerDetailInfo.copyFrom(value); + return this; + } + @Override public GetPlayerDetailInfoScRsp copyFrom(final GetPlayerDetailInfoScRsp other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; retcode = other.retcode; + playerDetailInfo.copyFrom(other.playerDetailInfo); } return this; } @@ -89,6 +153,9 @@ public final class GetPlayerDetailInfoScRspOuterClass { if (other.hasRetcode()) { setRetcode(other.retcode); } + if (other.hasPlayerDetailInfo()) { + getMutablePlayerDetailInfo().mergeFrom(other.playerDetailInfo); + } return this; } @@ -100,6 +167,7 @@ public final class GetPlayerDetailInfoScRspOuterClass { cachedSize = -1; bitField0_ = 0; retcode = 0; + playerDetailInfo.clear(); return this; } @@ -110,6 +178,7 @@ public final class GetPlayerDetailInfoScRspOuterClass { } cachedSize = -1; bitField0_ = 0; + playerDetailInfo.clearQuick(); return this; } @@ -123,7 +192,8 @@ public final class GetPlayerDetailInfoScRspOuterClass { } GetPlayerDetailInfoScRsp other = (GetPlayerDetailInfoScRsp) o; return bitField0_ == other.bitField0_ - && (!hasRetcode() || retcode == other.retcode); + && (!hasRetcode() || retcode == other.retcode) + && (!hasPlayerDetailInfo() || playerDetailInfo.equals(other.playerDetailInfo)); } @Override @@ -132,6 +202,10 @@ public final class GetPlayerDetailInfoScRspOuterClass { output.writeRawByte((byte) 40); output.writeUInt32NoTag(retcode); } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 50); + output.writeMessageNoTag(playerDetailInfo); + } } @Override @@ -140,6 +214,9 @@ public final class GetPlayerDetailInfoScRspOuterClass { if ((bitField0_ & 0x00000001) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(playerDetailInfo); + } return size; } @@ -155,6 +232,15 @@ public final class GetPlayerDetailInfoScRspOuterClass { retcode = input.readUInt32(); bitField0_ |= 0x00000001; tag = input.readTag(); + if (tag != 50) { + break; + } + } + case 50: { + // playerDetailInfo + input.readMessage(playerDetailInfo); + bitField0_ |= 0x00000002; + tag = input.readTag(); if (tag != 0) { break; } @@ -179,6 +265,9 @@ public final class GetPlayerDetailInfoScRspOuterClass { if ((bitField0_ & 0x00000001) != 0) { output.writeUInt32(FieldNames.retcode, retcode); } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.playerDetailInfo, playerDetailInfo); + } output.endObject(); } @@ -200,6 +289,18 @@ public final class GetPlayerDetailInfoScRspOuterClass { } break; } + case 2035249760: + case -1408876674: { + if (input.isAtField(FieldNames.playerDetailInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(playerDetailInfo); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } default: { input.skipUnknownField(); break; @@ -254,6 +355,8 @@ public final class GetPlayerDetailInfoScRspOuterClass { */ static class FieldNames { static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName playerDetailInfo = FieldName.forField("playerDetailInfo", "player_detail_info"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/HandleFriendCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/HandleFriendCsReqOuterClass.java new file mode 100644 index 0000000..f9a837e --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/HandleFriendCsReqOuterClass.java @@ -0,0 +1,340 @@ +// 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 HandleFriendCsReqOuterClass { + /** + * Protobuf type {@code HandleFriendCsReq} + */ + public static final class HandleFriendCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 uid = 10; + */ + private int uid; + + /** + * optional bool handle_result = 2; + */ + private boolean handleResult; + + private HandleFriendCsReq() { + } + + /** + * @return a new empty instance of {@code HandleFriendCsReq} + */ + public static HandleFriendCsReq newInstance() { + return new HandleFriendCsReq(); + } + + /** + * optional uint32 uid = 10; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 uid = 10; + * @return this + */ + public HandleFriendCsReq clearUid() { + bitField0_ &= ~0x00000001; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 10; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 10; + * @param value the uid to set + * @return this + */ + public HandleFriendCsReq setUid(final int value) { + bitField0_ |= 0x00000001; + uid = value; + return this; + } + + /** + * optional bool handle_result = 2; + * @return whether the handleResult field is set + */ + public boolean hasHandleResult() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional bool handle_result = 2; + * @return this + */ + public HandleFriendCsReq clearHandleResult() { + bitField0_ &= ~0x00000002; + handleResult = false; + return this; + } + + /** + * optional bool handle_result = 2; + * @return the handleResult + */ + public boolean getHandleResult() { + return handleResult; + } + + /** + * optional bool handle_result = 2; + * @param value the handleResult to set + * @return this + */ + public HandleFriendCsReq setHandleResult(final boolean value) { + bitField0_ |= 0x00000002; + handleResult = value; + return this; + } + + @Override + public HandleFriendCsReq copyFrom(final HandleFriendCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + uid = other.uid; + handleResult = other.handleResult; + } + return this; + } + + @Override + public HandleFriendCsReq mergeFrom(final HandleFriendCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUid()) { + setUid(other.uid); + } + if (other.hasHandleResult()) { + setHandleResult(other.handleResult); + } + return this; + } + + @Override + public HandleFriendCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + uid = 0; + handleResult = false; + return this; + } + + @Override + public HandleFriendCsReq 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 HandleFriendCsReq)) { + return false; + } + HandleFriendCsReq other = (HandleFriendCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasUid() || uid == other.uid) + && (!hasHandleResult() || handleResult == other.handleResult); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 16); + output.writeBoolNoTag(handleResult); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public HandleFriendCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 80: { + // uid + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 16) { + break; + } + } + case 16: { + // handleResult + handleResult = input.readBool(); + 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.uid, uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeBool(FieldNames.handleResult, handleResult); + } + output.endObject(); + } + + @Override + public HandleFriendCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1331436443: + case 686987796: { + if (input.isAtField(FieldNames.handleResult)) { + if (!input.trySkipNullValue()) { + handleResult = input.readBool(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public HandleFriendCsReq clone() { + return new HandleFriendCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static HandleFriendCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new HandleFriendCsReq(), data).checkInitialized(); + } + + public static HandleFriendCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new HandleFriendCsReq(), input).checkInitialized(); + } + + public static HandleFriendCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new HandleFriendCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating HandleFriendCsReq messages + */ + public static MessageFactory getFactory() { + return HandleFriendCsReqFactory.INSTANCE; + } + + private enum HandleFriendCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public HandleFriendCsReq create() { + return HandleFriendCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName uid = FieldName.forField("uid"); + + static final FieldName handleResult = FieldName.forField("handleResult", "handle_result"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/HandleFriendScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/HandleFriendScRspOuterClass.java new file mode 100644 index 0000000..0bb7d12 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/HandleFriendScRspOuterClass.java @@ -0,0 +1,523 @@ +// 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 HandleFriendScRspOuterClass { + /** + * Protobuf type {@code HandleFriendScRsp} + */ + public static final class HandleFriendScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 uid = 8; + */ + private int uid; + + /** + * optional uint32 retcode = 9; + */ + private int retcode; + + /** + * optional bool handle_result = 7; + */ + private boolean handleResult; + + /** + * optional .FriendListInfo handle_friend_info = 10; + */ + private final FriendListInfoOuterClass.FriendListInfo handleFriendInfo = FriendListInfoOuterClass.FriendListInfo.newInstance(); + + private HandleFriendScRsp() { + } + + /** + * @return a new empty instance of {@code HandleFriendScRsp} + */ + public static HandleFriendScRsp newInstance() { + return new HandleFriendScRsp(); + } + + /** + * optional uint32 uid = 8; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 uid = 8; + * @return this + */ + public HandleFriendScRsp clearUid() { + bitField0_ &= ~0x00000001; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 8; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 8; + * @param value the uid to set + * @return this + */ + public HandleFriendScRsp setUid(final int value) { + bitField0_ |= 0x00000001; + uid = value; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 9; + * @return this + */ + public HandleFriendScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 9; + * @param value the retcode to set + * @return this + */ + public HandleFriendScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * optional bool handle_result = 7; + * @return whether the handleResult field is set + */ + public boolean hasHandleResult() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool handle_result = 7; + * @return this + */ + public HandleFriendScRsp clearHandleResult() { + bitField0_ &= ~0x00000004; + handleResult = false; + return this; + } + + /** + * optional bool handle_result = 7; + * @return the handleResult + */ + public boolean getHandleResult() { + return handleResult; + } + + /** + * optional bool handle_result = 7; + * @param value the handleResult to set + * @return this + */ + public HandleFriendScRsp setHandleResult(final boolean value) { + bitField0_ |= 0x00000004; + handleResult = value; + return this; + } + + /** + * optional .FriendListInfo handle_friend_info = 10; + * @return whether the handleFriendInfo field is set + */ + public boolean hasHandleFriendInfo() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional .FriendListInfo handle_friend_info = 10; + * @return this + */ + public HandleFriendScRsp clearHandleFriendInfo() { + bitField0_ &= ~0x00000008; + handleFriendInfo.clear(); + return this; + } + + /** + * optional .FriendListInfo handle_friend_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 #getMutableHandleFriendInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public FriendListInfoOuterClass.FriendListInfo getHandleFriendInfo() { + return handleFriendInfo; + } + + /** + * optional .FriendListInfo handle_friend_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 FriendListInfoOuterClass.FriendListInfo getMutableHandleFriendInfo() { + bitField0_ |= 0x00000008; + return handleFriendInfo; + } + + /** + * optional .FriendListInfo handle_friend_info = 10; + * @param value the handleFriendInfo to set + * @return this + */ + public HandleFriendScRsp setHandleFriendInfo( + final FriendListInfoOuterClass.FriendListInfo value) { + bitField0_ |= 0x00000008; + handleFriendInfo.copyFrom(value); + return this; + } + + @Override + public HandleFriendScRsp copyFrom(final HandleFriendScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + uid = other.uid; + retcode = other.retcode; + handleResult = other.handleResult; + handleFriendInfo.copyFrom(other.handleFriendInfo); + } + return this; + } + + @Override + public HandleFriendScRsp mergeFrom(final HandleFriendScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUid()) { + setUid(other.uid); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasHandleResult()) { + setHandleResult(other.handleResult); + } + if (other.hasHandleFriendInfo()) { + getMutableHandleFriendInfo().mergeFrom(other.handleFriendInfo); + } + return this; + } + + @Override + public HandleFriendScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + uid = 0; + retcode = 0; + handleResult = false; + handleFriendInfo.clear(); + return this; + } + + @Override + public HandleFriendScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + handleFriendInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof HandleFriendScRsp)) { + return false; + } + HandleFriendScRsp other = (HandleFriendScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasUid() || uid == other.uid) + && (!hasRetcode() || retcode == other.retcode) + && (!hasHandleResult() || handleResult == other.handleResult) + && (!hasHandleFriendInfo() || handleFriendInfo.equals(other.handleFriendInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 56); + output.writeBoolNoTag(handleResult); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 82); + output.writeMessageNoTag(handleFriendInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(handleFriendInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public HandleFriendScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 64: { + // uid + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // handleResult + handleResult = input.readBool(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // handleFriendInfo + input.readMessage(handleFriendInfo); + 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.uid, uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.handleResult, handleResult); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeMessage(FieldNames.handleFriendInfo, handleFriendInfo); + } + output.endObject(); + } + + @Override + public HandleFriendScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1331436443: + case 686987796: { + if (input.isAtField(FieldNames.handleResult)) { + if (!input.trySkipNullValue()) { + handleResult = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -215671628: + case 49075736: { + if (input.isAtField(FieldNames.handleFriendInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(handleFriendInfo); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public HandleFriendScRsp clone() { + return new HandleFriendScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static HandleFriendScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new HandleFriendScRsp(), data).checkInitialized(); + } + + public static HandleFriendScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new HandleFriendScRsp(), input).checkInitialized(); + } + + public static HandleFriendScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new HandleFriendScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating HandleFriendScRsp messages + */ + public static MessageFactory getFactory() { + return HandleFriendScRspFactory.INSTANCE; + } + + private enum HandleFriendScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public HandleFriendScRsp create() { + return HandleFriendScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName uid = FieldName.forField("uid"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName handleResult = FieldName.forField("handleResult", "handle_result"); + + static final FieldName handleFriendInfo = FieldName.forField("handleFriendInfo", "handle_friend_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java new file mode 100644 index 0000000..c4decee --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PlayerDetailInfoOuterClass.java @@ -0,0 +1,1086 @@ +// 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.Utf8String; + +public final class PlayerDetailInfoOuterClass { + /** + * Protobuf type {@code PlayerDetailInfo} + */ + public static final class PlayerDetailInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 head_icon = 7; + */ + private int headIcon; + + /** + * optional uint32 level = 9; + */ + private int level; + + /** + * optional uint32 world_level = 10; + */ + private int worldLevel; + + /** + * optional uint32 uid = 13; + */ + private int uid; + + /** + * optional .PlatformType platform_type = 4; + */ + private int platformType; + + /** + * optional string signature = 2; + */ + private final Utf8String signature = Utf8String.newEmptyInstance(); + + /** + * optional string nickname = 6; + */ + private final Utf8String nickname = Utf8String.newEmptyInstance(); + + /** + * optional string display_avatar_info = 14; + */ + private final Utf8String displayAvatarInfo = Utf8String.newEmptyInstance(); + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + */ + private final Utf8String recordInfo = Utf8String.newEmptyInstance(); + + private PlayerDetailInfo() { + } + + /** + * @return a new empty instance of {@code PlayerDetailInfo} + */ + public static PlayerDetailInfo newInstance() { + return new PlayerDetailInfo(); + } + + /** + * optional uint32 head_icon = 7; + * @return whether the headIcon field is set + */ + public boolean hasHeadIcon() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 head_icon = 7; + * @return this + */ + public PlayerDetailInfo clearHeadIcon() { + bitField0_ &= ~0x00000001; + headIcon = 0; + return this; + } + + /** + * optional uint32 head_icon = 7; + * @return the headIcon + */ + public int getHeadIcon() { + return headIcon; + } + + /** + * optional uint32 head_icon = 7; + * @param value the headIcon to set + * @return this + */ + public PlayerDetailInfo setHeadIcon(final int value) { + bitField0_ |= 0x00000001; + headIcon = value; + return this; + } + + /** + * optional uint32 level = 9; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 level = 9; + * @return this + */ + public PlayerDetailInfo clearLevel() { + bitField0_ &= ~0x00000002; + level = 0; + return this; + } + + /** + * optional uint32 level = 9; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 9; + * @param value the level to set + * @return this + */ + public PlayerDetailInfo setLevel(final int value) { + bitField0_ |= 0x00000002; + level = value; + return this; + } + + /** + * optional uint32 world_level = 10; + * @return whether the worldLevel field is set + */ + public boolean hasWorldLevel() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 world_level = 10; + * @return this + */ + public PlayerDetailInfo clearWorldLevel() { + bitField0_ &= ~0x00000004; + worldLevel = 0; + return this; + } + + /** + * optional uint32 world_level = 10; + * @return the worldLevel + */ + public int getWorldLevel() { + return worldLevel; + } + + /** + * optional uint32 world_level = 10; + * @param value the worldLevel to set + * @return this + */ + public PlayerDetailInfo setWorldLevel(final int value) { + bitField0_ |= 0x00000004; + worldLevel = value; + return this; + } + + /** + * optional uint32 uid = 13; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 uid = 13; + * @return this + */ + public PlayerDetailInfo clearUid() { + bitField0_ &= ~0x00000008; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 13; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 13; + * @param value the uid to set + * @return this + */ + public PlayerDetailInfo setUid(final int value) { + bitField0_ |= 0x00000008; + uid = value; + return this; + } + + /** + * optional .PlatformType platform_type = 4; + * @return whether the platformType field is set + */ + public boolean hasPlatformType() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional .PlatformType platform_type = 4; + * @return this + */ + public PlayerDetailInfo clearPlatformType() { + bitField0_ &= ~0x00000010; + platformType = 0; + return this; + } + + /** + * optional .PlatformType platform_type = 4; + * @return the platformType + */ + public PlatformTypeOuterClass.PlatformType getPlatformType() { + return PlatformTypeOuterClass.PlatformType.forNumber(platformType); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link PlayerDetailInfo#getPlatformType()}.getNumber(). + * + * @return numeric wire representation + */ + public int getPlatformTypeValue() { + return platformType; + } + + /** + * 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 PlatformTypeOuterClass.PlatformType}. Setting an invalid value + * can cause {@link PlayerDetailInfo#getPlatformType()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public PlayerDetailInfo setPlatformTypeValue(final int value) { + bitField0_ |= 0x00000010; + platformType = value; + return this; + } + + /** + * optional .PlatformType platform_type = 4; + * @param value the platformType to set + * @return this + */ + public PlayerDetailInfo setPlatformType(final PlatformTypeOuterClass.PlatformType value) { + bitField0_ |= 0x00000010; + platformType = value.getNumber(); + return this; + } + + /** + * optional string signature = 2; + * @return whether the signature field is set + */ + public boolean hasSignature() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional string signature = 2; + * @return this + */ + public PlayerDetailInfo clearSignature() { + bitField0_ &= ~0x00000020; + signature.clear(); + return this; + } + + /** + * optional string signature = 2; + * @return the signature + */ + public String getSignature() { + return signature.getString(); + } + + /** + * optional string signature = 2; + * @return internal {@code Utf8String} representation of signature for reading + */ + public Utf8String getSignatureBytes() { + return this.signature; + } + + /** + * optional string signature = 2; + * @return internal {@code Utf8String} representation of signature for modifications + */ + public Utf8String getMutableSignatureBytes() { + bitField0_ |= 0x00000020; + return this.signature; + } + + /** + * optional string signature = 2; + * @param value the signature to set + * @return this + */ + public PlayerDetailInfo setSignature(final CharSequence value) { + bitField0_ |= 0x00000020; + signature.copyFrom(value); + return this; + } + + /** + * optional string signature = 2; + * @param value the signature to set + * @return this + */ + public PlayerDetailInfo setSignature(final Utf8String value) { + bitField0_ |= 0x00000020; + signature.copyFrom(value); + return this; + } + + /** + * optional string nickname = 6; + * @return whether the nickname field is set + */ + public boolean hasNickname() { + return (bitField0_ & 0x00000040) != 0; + } + + /** + * optional string nickname = 6; + * @return this + */ + public PlayerDetailInfo clearNickname() { + bitField0_ &= ~0x00000040; + nickname.clear(); + return this; + } + + /** + * optional string nickname = 6; + * @return the nickname + */ + public String getNickname() { + return nickname.getString(); + } + + /** + * optional string nickname = 6; + * @return internal {@code Utf8String} representation of nickname for reading + */ + public Utf8String getNicknameBytes() { + return this.nickname; + } + + /** + * optional string nickname = 6; + * @return internal {@code Utf8String} representation of nickname for modifications + */ + public Utf8String getMutableNicknameBytes() { + bitField0_ |= 0x00000040; + return this.nickname; + } + + /** + * optional string nickname = 6; + * @param value the nickname to set + * @return this + */ + public PlayerDetailInfo setNickname(final CharSequence value) { + bitField0_ |= 0x00000040; + nickname.copyFrom(value); + return this; + } + + /** + * optional string nickname = 6; + * @param value the nickname to set + * @return this + */ + public PlayerDetailInfo setNickname(final Utf8String value) { + bitField0_ |= 0x00000040; + nickname.copyFrom(value); + return this; + } + + /** + * optional string display_avatar_info = 14; + * @return whether the displayAvatarInfo field is set + */ + public boolean hasDisplayAvatarInfo() { + return (bitField0_ & 0x00000080) != 0; + } + + /** + * optional string display_avatar_info = 14; + * @return this + */ + public PlayerDetailInfo clearDisplayAvatarInfo() { + bitField0_ &= ~0x00000080; + displayAvatarInfo.clear(); + return this; + } + + /** + * optional string display_avatar_info = 14; + * @return the displayAvatarInfo + */ + public String getDisplayAvatarInfo() { + return displayAvatarInfo.getString(); + } + + /** + * optional string display_avatar_info = 14; + * @return internal {@code Utf8String} representation of displayAvatarInfo for reading + */ + public Utf8String getDisplayAvatarInfoBytes() { + return this.displayAvatarInfo; + } + + /** + * optional string display_avatar_info = 14; + * @return internal {@code Utf8String} representation of displayAvatarInfo for modifications + */ + public Utf8String getMutableDisplayAvatarInfoBytes() { + bitField0_ |= 0x00000080; + return this.displayAvatarInfo; + } + + /** + * optional string display_avatar_info = 14; + * @param value the displayAvatarInfo to set + * @return this + */ + public PlayerDetailInfo setDisplayAvatarInfo(final CharSequence value) { + bitField0_ |= 0x00000080; + displayAvatarInfo.copyFrom(value); + return this; + } + + /** + * optional string display_avatar_info = 14; + * @param value the displayAvatarInfo to set + * @return this + */ + public PlayerDetailInfo setDisplayAvatarInfo(final Utf8String value) { + bitField0_ |= 0x00000080; + displayAvatarInfo.copyFrom(value); + return this; + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @return whether the recordInfo field is set + */ + public boolean hasRecordInfo() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @return this + */ + public PlayerDetailInfo clearRecordInfo() { + bitField0_ &= ~0x00000100; + recordInfo.clear(); + return this; + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @return the recordInfo + */ + public String getRecordInfo() { + return recordInfo.getString(); + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @return internal {@code Utf8String} representation of recordInfo for reading + */ + public Utf8String getRecordInfoBytes() { + return this.recordInfo; + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @return internal {@code Utf8String} representation of recordInfo for modifications + */ + public Utf8String getMutableRecordInfoBytes() { + bitField0_ |= 0x00000100; + return this.recordInfo; + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @param value the recordInfo to set + * @return this + */ + public PlayerDetailInfo setRecordInfo(final CharSequence value) { + bitField0_ |= 0x00000100; + recordInfo.copyFrom(value); + return this; + } + + /** + *
+     * DisplayAvatarDetailInfo display_avatar_info = 14;
+     * 
+ * + * optional string record_info = 15; + * @param value the recordInfo to set + * @return this + */ + public PlayerDetailInfo setRecordInfo(final Utf8String value) { + bitField0_ |= 0x00000100; + recordInfo.copyFrom(value); + return this; + } + + @Override + public PlayerDetailInfo copyFrom(final PlayerDetailInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + headIcon = other.headIcon; + level = other.level; + worldLevel = other.worldLevel; + uid = other.uid; + platformType = other.platformType; + signature.copyFrom(other.signature); + nickname.copyFrom(other.nickname); + displayAvatarInfo.copyFrom(other.displayAvatarInfo); + recordInfo.copyFrom(other.recordInfo); + } + return this; + } + + @Override + public PlayerDetailInfo mergeFrom(final PlayerDetailInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasHeadIcon()) { + setHeadIcon(other.headIcon); + } + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasWorldLevel()) { + setWorldLevel(other.worldLevel); + } + if (other.hasUid()) { + setUid(other.uid); + } + if (other.hasPlatformType()) { + setPlatformTypeValue(other.platformType); + } + if (other.hasSignature()) { + getMutableSignatureBytes().copyFrom(other.signature); + } + if (other.hasNickname()) { + getMutableNicknameBytes().copyFrom(other.nickname); + } + if (other.hasDisplayAvatarInfo()) { + getMutableDisplayAvatarInfoBytes().copyFrom(other.displayAvatarInfo); + } + if (other.hasRecordInfo()) { + getMutableRecordInfoBytes().copyFrom(other.recordInfo); + } + return this; + } + + @Override + public PlayerDetailInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + headIcon = 0; + level = 0; + worldLevel = 0; + uid = 0; + platformType = 0; + signature.clear(); + nickname.clear(); + displayAvatarInfo.clear(); + recordInfo.clear(); + return this; + } + + @Override + public PlayerDetailInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + signature.clear(); + nickname.clear(); + displayAvatarInfo.clear(); + recordInfo.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof PlayerDetailInfo)) { + return false; + } + PlayerDetailInfo other = (PlayerDetailInfo) o; + return bitField0_ == other.bitField0_ + && (!hasHeadIcon() || headIcon == other.headIcon) + && (!hasLevel() || level == other.level) + && (!hasWorldLevel() || worldLevel == other.worldLevel) + && (!hasUid() || uid == other.uid) + && (!hasPlatformType() || platformType == other.platformType) + && (!hasSignature() || signature.equals(other.signature)) + && (!hasNickname() || nickname.equals(other.nickname)) + && (!hasDisplayAvatarInfo() || displayAvatarInfo.equals(other.displayAvatarInfo)) + && (!hasRecordInfo() || recordInfo.equals(other.recordInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(headIcon); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(uid); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 32); + output.writeEnumNoTag(platformType); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 18); + output.writeStringNoTag(signature); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeRawByte((byte) 50); + output.writeStringNoTag(nickname); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeRawByte((byte) 114); + output.writeStringNoTag(displayAvatarInfo); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRawByte((byte) 122); + output.writeStringNoTag(recordInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(headIcon); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(platformType); + } + if ((bitField0_ & 0x00000020) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(signature); + } + if ((bitField0_ & 0x00000040) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(nickname); + } + if ((bitField0_ & 0x00000080) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(displayAvatarInfo); + } + if ((bitField0_ & 0x00000100) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(recordInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public PlayerDetailInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 56: { + // headIcon + headIcon = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // worldLevel + worldLevel = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // uid + uid = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 32) { + break; + } + } + case 32: { + // platformType + final int value = input.readInt32(); + if (PlatformTypeOuterClass.PlatformType.forNumber(value) != null) { + platformType = value; + bitField0_ |= 0x00000010; + } + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // signature + input.readString(signature); + bitField0_ |= 0x00000020; + tag = input.readTag(); + if (tag != 50) { + break; + } + } + case 50: { + // nickname + input.readString(nickname); + bitField0_ |= 0x00000040; + tag = input.readTag(); + if (tag != 114) { + break; + } + } + case 114: { + // displayAvatarInfo + input.readString(displayAvatarInfo); + bitField0_ |= 0x00000080; + tag = input.readTag(); + if (tag != 122) { + break; + } + } + case 122: { + // recordInfo + input.readString(recordInfo); + bitField0_ |= 0x00000100; + 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.headIcon, headIcon); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.worldLevel, worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.uid, uid); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeEnum(FieldNames.platformType, platformType, PlatformTypeOuterClass.PlatformType.converter()); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeString(FieldNames.signature, signature); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeString(FieldNames.nickname, nickname); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeString(FieldNames.displayAvatarInfo, displayAvatarInfo); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeString(FieldNames.recordInfo, recordInfo); + } + output.endObject(); + } + + @Override + public PlayerDetailInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1116107143: + case -219098248: { + if (input.isAtField(FieldNames.headIcon)) { + if (!input.trySkipNullValue()) { + headIcon = 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; + } + case 440007442: + case 1305257111: { + if (input.isAtField(FieldNames.worldLevel)) { + if (!input.trySkipNullValue()) { + worldLevel = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 155581005: + case 538062726: { + if (input.isAtField(FieldNames.platformType)) { + if (!input.trySkipNullValue()) { + final PlatformTypeOuterClass.PlatformType value = input.readEnum(PlatformTypeOuterClass.PlatformType.converter()); + if (value != null) { + platformType = value.getNumber(); + bitField0_ |= 0x00000010; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + case 1073584312: { + if (input.isAtField(FieldNames.signature)) { + if (!input.trySkipNullValue()) { + input.readString(signature); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + case 70690926: { + if (input.isAtField(FieldNames.nickname)) { + if (!input.trySkipNullValue()) { + input.readString(nickname); + bitField0_ |= 0x00000040; + } + } else { + input.skipUnknownField(); + } + break; + } + case 2117840905: + case 245477335: { + if (input.isAtField(FieldNames.displayAvatarInfo)) { + if (!input.trySkipNullValue()) { + input.readString(displayAvatarInfo); + bitField0_ |= 0x00000080; + } + } else { + input.skipUnknownField(); + } + break; + } + case 734573727: + case 1317125084: { + if (input.isAtField(FieldNames.recordInfo)) { + if (!input.trySkipNullValue()) { + input.readString(recordInfo); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public PlayerDetailInfo clone() { + return new PlayerDetailInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static PlayerDetailInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new PlayerDetailInfo(), data).checkInitialized(); + } + + public static PlayerDetailInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayerDetailInfo(), input).checkInitialized(); + } + + public static PlayerDetailInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new PlayerDetailInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating PlayerDetailInfo messages + */ + public static MessageFactory getFactory() { + return PlayerDetailInfoFactory.INSTANCE; + } + + private enum PlayerDetailInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public PlayerDetailInfo create() { + return PlayerDetailInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName headIcon = FieldName.forField("headIcon", "head_icon"); + + static final FieldName level = FieldName.forField("level"); + + static final FieldName worldLevel = FieldName.forField("worldLevel", "world_level"); + + static final FieldName uid = FieldName.forField("uid"); + + static final FieldName platformType = FieldName.forField("platformType", "platform_type"); + + static final FieldName signature = FieldName.forField("signature"); + + static final FieldName nickname = FieldName.forField("nickname"); + + static final FieldName displayAvatarInfo = FieldName.forField("displayAvatarInfo", "display_avatar_info"); + + static final FieldName recordInfo = FieldName.forField("recordInfo", "record_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SearchPlayerCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SearchPlayerCsReqOuterClass.java new file mode 100644 index 0000000..ee0e59c --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SearchPlayerCsReqOuterClass.java @@ -0,0 +1,301 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedInt; + +public final class SearchPlayerCsReqOuterClass { + /** + * Protobuf type {@code SearchPlayerCsReq} + */ + public static final class SearchPlayerCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated uint32 search_uid_list = 11; + */ + private final RepeatedInt searchUidList = RepeatedInt.newEmptyInstance(); + + private SearchPlayerCsReq() { + } + + /** + * @return a new empty instance of {@code SearchPlayerCsReq} + */ + public static SearchPlayerCsReq newInstance() { + return new SearchPlayerCsReq(); + } + + /** + * repeated uint32 search_uid_list = 11; + * @return whether the searchUidList field is set + */ + public boolean hasSearchUidList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated uint32 search_uid_list = 11; + * @return this + */ + public SearchPlayerCsReq clearSearchUidList() { + bitField0_ &= ~0x00000001; + searchUidList.clear(); + return this; + } + + /** + * repeated uint32 search_uid_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 #getMutableSearchUidList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getSearchUidList() { + return searchUidList; + } + + /** + * repeated uint32 search_uid_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 RepeatedInt getMutableSearchUidList() { + bitField0_ |= 0x00000001; + return searchUidList; + } + + /** + * repeated uint32 search_uid_list = 11; + * @param value the searchUidList to add + * @return this + */ + public SearchPlayerCsReq addSearchUidList(final int value) { + bitField0_ |= 0x00000001; + searchUidList.add(value); + return this; + } + + /** + * repeated uint32 search_uid_list = 11; + * @param values the searchUidList to add + * @return this + */ + public SearchPlayerCsReq addAllSearchUidList(final int... values) { + bitField0_ |= 0x00000001; + searchUidList.addAll(values); + return this; + } + + @Override + public SearchPlayerCsReq copyFrom(final SearchPlayerCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + searchUidList.copyFrom(other.searchUidList); + } + return this; + } + + @Override + public SearchPlayerCsReq mergeFrom(final SearchPlayerCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasSearchUidList()) { + getMutableSearchUidList().addAll(other.searchUidList); + } + return this; + } + + @Override + public SearchPlayerCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + searchUidList.clear(); + return this; + } + + @Override + public SearchPlayerCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + searchUidList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SearchPlayerCsReq)) { + return false; + } + SearchPlayerCsReq other = (SearchPlayerCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasSearchUidList() || searchUidList.equals(other.searchUidList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < searchUidList.length(); i++) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(searchUidList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * searchUidList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(searchUidList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SearchPlayerCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 90: { + // searchUidList [packed=true] + input.readPackedUInt32(searchUidList, tag); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 88: { + // searchUidList [packed=false] + tag = input.readRepeatedUInt32(searchUidList, tag); + bitField0_ |= 0x00000001; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeRepeatedUInt32(FieldNames.searchUidList, searchUidList); + } + output.endObject(); + } + + @Override + public SearchPlayerCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 881018438: + case -85426204: { + if (input.isAtField(FieldNames.searchUidList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(searchUidList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SearchPlayerCsReq clone() { + return new SearchPlayerCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SearchPlayerCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SearchPlayerCsReq(), data).checkInitialized(); + } + + public static SearchPlayerCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SearchPlayerCsReq(), input).checkInitialized(); + } + + public static SearchPlayerCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SearchPlayerCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SearchPlayerCsReq messages + */ + public static MessageFactory getFactory() { + return SearchPlayerCsReqFactory.INSTANCE; + } + + private enum SearchPlayerCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SearchPlayerCsReq create() { + return SearchPlayerCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName searchUidList = FieldName.forField("searchUidList", "search_uid_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SearchPlayerScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SearchPlayerScRspOuterClass.java new file mode 100644 index 0000000..ac270a7 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SearchPlayerScRspOuterClass.java @@ -0,0 +1,496 @@ +// 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 SearchPlayerScRspOuterClass { + /** + * Protobuf type {@code SearchPlayerScRsp} + */ + public static final class SearchPlayerScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 retcode = 1; + */ + private int retcode; + + /** + * repeated uint32 HBCDGNCPNGB = 5; + */ + private final RepeatedInt hBCDGNCPNGB = RepeatedInt.newEmptyInstance(); + + /** + * repeated .SimpleInfo search_result_list = 15; + */ + private final RepeatedMessage searchResultList = RepeatedMessage.newEmptyInstance(SimpleInfoOuterClass.SimpleInfo.getFactory()); + + private SearchPlayerScRsp() { + } + + /** + * @return a new empty instance of {@code SearchPlayerScRsp} + */ + public static SearchPlayerScRsp newInstance() { + return new SearchPlayerScRsp(); + } + + /** + * optional uint32 retcode = 1; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 retcode = 1; + * @return this + */ + public SearchPlayerScRsp clearRetcode() { + bitField0_ &= ~0x00000001; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 1; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 1; + * @param value the retcode to set + * @return this + */ + public SearchPlayerScRsp setRetcode(final int value) { + bitField0_ |= 0x00000001; + retcode = value; + return this; + } + + /** + * repeated uint32 HBCDGNCPNGB = 5; + * @return whether the hBCDGNCPNGB field is set + */ + public boolean hasHBCDGNCPNGB() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 HBCDGNCPNGB = 5; + * @return this + */ + public SearchPlayerScRsp clearHBCDGNCPNGB() { + bitField0_ &= ~0x00000002; + hBCDGNCPNGB.clear(); + return this; + } + + /** + * repeated uint32 HBCDGNCPNGB = 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 #getMutableHBCDGNCPNGB()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getHBCDGNCPNGB() { + return hBCDGNCPNGB; + } + + /** + * repeated uint32 HBCDGNCPNGB = 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 getMutableHBCDGNCPNGB() { + bitField0_ |= 0x00000002; + return hBCDGNCPNGB; + } + + /** + * repeated uint32 HBCDGNCPNGB = 5; + * @param value the hBCDGNCPNGB to add + * @return this + */ + public SearchPlayerScRsp addHBCDGNCPNGB(final int value) { + bitField0_ |= 0x00000002; + hBCDGNCPNGB.add(value); + return this; + } + + /** + * repeated uint32 HBCDGNCPNGB = 5; + * @param values the hBCDGNCPNGB to add + * @return this + */ + public SearchPlayerScRsp addAllHBCDGNCPNGB(final int... values) { + bitField0_ |= 0x00000002; + hBCDGNCPNGB.addAll(values); + return this; + } + + /** + * repeated .SimpleInfo search_result_list = 15; + * @return whether the searchResultList field is set + */ + public boolean hasSearchResultList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .SimpleInfo search_result_list = 15; + * @return this + */ + public SearchPlayerScRsp clearSearchResultList() { + bitField0_ &= ~0x00000004; + searchResultList.clear(); + return this; + } + + /** + * repeated .SimpleInfo search_result_list = 15; + * + * 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 #getMutableSearchResultList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getSearchResultList() { + return searchResultList; + } + + /** + * repeated .SimpleInfo search_result_list = 15; + * + * 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 getMutableSearchResultList() { + bitField0_ |= 0x00000004; + return searchResultList; + } + + /** + * repeated .SimpleInfo search_result_list = 15; + * @param value the searchResultList to add + * @return this + */ + public SearchPlayerScRsp addSearchResultList(final SimpleInfoOuterClass.SimpleInfo value) { + bitField0_ |= 0x00000004; + searchResultList.add(value); + return this; + } + + /** + * repeated .SimpleInfo search_result_list = 15; + * @param values the searchResultList to add + * @return this + */ + public SearchPlayerScRsp addAllSearchResultList( + final SimpleInfoOuterClass.SimpleInfo... values) { + bitField0_ |= 0x00000004; + searchResultList.addAll(values); + return this; + } + + @Override + public SearchPlayerScRsp copyFrom(final SearchPlayerScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + retcode = other.retcode; + hBCDGNCPNGB.copyFrom(other.hBCDGNCPNGB); + searchResultList.copyFrom(other.searchResultList); + } + return this; + } + + @Override + public SearchPlayerScRsp mergeFrom(final SearchPlayerScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasHBCDGNCPNGB()) { + getMutableHBCDGNCPNGB().addAll(other.hBCDGNCPNGB); + } + if (other.hasSearchResultList()) { + getMutableSearchResultList().addAll(other.searchResultList); + } + return this; + } + + @Override + public SearchPlayerScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + retcode = 0; + hBCDGNCPNGB.clear(); + searchResultList.clear(); + return this; + } + + @Override + public SearchPlayerScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + hBCDGNCPNGB.clear(); + searchResultList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SearchPlayerScRsp)) { + return false; + } + SearchPlayerScRsp other = (SearchPlayerScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasRetcode() || retcode == other.retcode) + && (!hasHBCDGNCPNGB() || hBCDGNCPNGB.equals(other.hBCDGNCPNGB)) + && (!hasSearchResultList() || searchResultList.equals(other.searchResultList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < hBCDGNCPNGB.length(); i++) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(hBCDGNCPNGB.array()[i]); + } + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < searchResultList.length(); i++) { + output.writeRawByte((byte) 122); + output.writeMessageNoTag(searchResultList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * hBCDGNCPNGB.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(hBCDGNCPNGB); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * searchResultList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(searchResultList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SearchPlayerScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 42) { + break; + } + } + case 42: { + // hBCDGNCPNGB [packed=true] + input.readPackedUInt32(hBCDGNCPNGB, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 122) { + break; + } + } + case 122: { + // searchResultList + tag = input.readRepeatedMessage(searchResultList, tag); + bitField0_ |= 0x00000004; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 40: { + // hBCDGNCPNGB [packed=false] + tag = input.readRepeatedUInt32(hBCDGNCPNGB, tag); + bitField0_ |= 0x00000002; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedUInt32(FieldNames.hBCDGNCPNGB, hBCDGNCPNGB); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.searchResultList, searchResultList); + } + output.endObject(); + } + + @Override + public SearchPlayerScRsp 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 1975814746: { + if (input.isAtField(FieldNames.hBCDGNCPNGB)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(hBCDGNCPNGB); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1590552099: + case -1788038295: { + if (input.isAtField(FieldNames.searchResultList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(searchResultList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SearchPlayerScRsp clone() { + return new SearchPlayerScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SearchPlayerScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SearchPlayerScRsp(), data).checkInitialized(); + } + + public static SearchPlayerScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SearchPlayerScRsp(), input).checkInitialized(); + } + + public static SearchPlayerScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SearchPlayerScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SearchPlayerScRsp messages + */ + public static MessageFactory getFactory() { + return SearchPlayerScRspFactory.INSTANCE; + } + + private enum SearchPlayerScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SearchPlayerScRsp create() { + return SearchPlayerScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName hBCDGNCPNGB = FieldName.forField("HBCDGNCPNGB"); + + static final FieldName searchResultList = FieldName.forField("searchResultList", "search_result_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/FriendAvatarInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/SimpleAvatarInfoOuterClass.java similarity index 82% rename from src/generated/main/emu/lunarcore/proto/FriendAvatarInfoOuterClass.java rename to src/generated/main/emu/lunarcore/proto/SimpleAvatarInfoOuterClass.java index c9d2a2d..628f60f 100644 --- a/src/generated/main/emu/lunarcore/proto/FriendAvatarInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/SimpleAvatarInfoOuterClass.java @@ -11,11 +11,11 @@ import us.hebi.quickbuf.ProtoMessage; import us.hebi.quickbuf.ProtoSink; import us.hebi.quickbuf.ProtoSource; -public final class FriendAvatarInfoOuterClass { +public final class SimpleAvatarInfoOuterClass { /** - * Protobuf type {@code FriendAvatarInfo} + * Protobuf type {@code SimpleAvatarInfo} */ - public static final class FriendAvatarInfo extends ProtoMessage implements Cloneable { + public static final class SimpleAvatarInfo extends ProtoMessage implements Cloneable { private static final long serialVersionUID = 0L; /** @@ -33,14 +33,14 @@ public final class FriendAvatarInfoOuterClass { */ private int avatarId; - private FriendAvatarInfo() { + private SimpleAvatarInfo() { } /** - * @return a new empty instance of {@code FriendAvatarInfo} + * @return a new empty instance of {@code SimpleAvatarInfo} */ - public static FriendAvatarInfo newInstance() { - return new FriendAvatarInfo(); + public static SimpleAvatarInfo newInstance() { + return new SimpleAvatarInfo(); } /** @@ -55,7 +55,7 @@ public final class FriendAvatarInfoOuterClass { * optional uint32 level = 8; * @return this */ - public FriendAvatarInfo clearLevel() { + public SimpleAvatarInfo clearLevel() { bitField0_ &= ~0x00000001; level = 0; return this; @@ -74,7 +74,7 @@ public final class FriendAvatarInfoOuterClass { * @param value the level to set * @return this */ - public FriendAvatarInfo setLevel(final int value) { + public SimpleAvatarInfo setLevel(final int value) { bitField0_ |= 0x00000001; level = value; return this; @@ -92,7 +92,7 @@ public final class FriendAvatarInfoOuterClass { * optional uint32 equipment_unique_id = 13; * @return this */ - public FriendAvatarInfo clearEquipmentUniqueId() { + public SimpleAvatarInfo clearEquipmentUniqueId() { bitField0_ &= ~0x00000002; equipmentUniqueId = 0; return this; @@ -111,7 +111,7 @@ public final class FriendAvatarInfoOuterClass { * @param value the equipmentUniqueId to set * @return this */ - public FriendAvatarInfo setEquipmentUniqueId(final int value) { + public SimpleAvatarInfo setEquipmentUniqueId(final int value) { bitField0_ |= 0x00000002; equipmentUniqueId = value; return this; @@ -129,7 +129,7 @@ public final class FriendAvatarInfoOuterClass { * optional uint32 avatar_id = 15; * @return this */ - public FriendAvatarInfo clearAvatarId() { + public SimpleAvatarInfo clearAvatarId() { bitField0_ &= ~0x00000004; avatarId = 0; return this; @@ -148,14 +148,14 @@ public final class FriendAvatarInfoOuterClass { * @param value the avatarId to set * @return this */ - public FriendAvatarInfo setAvatarId(final int value) { + public SimpleAvatarInfo setAvatarId(final int value) { bitField0_ |= 0x00000004; avatarId = value; return this; } @Override - public FriendAvatarInfo copyFrom(final FriendAvatarInfo other) { + public SimpleAvatarInfo copyFrom(final SimpleAvatarInfo other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; @@ -167,7 +167,7 @@ public final class FriendAvatarInfoOuterClass { } @Override - public FriendAvatarInfo mergeFrom(final FriendAvatarInfo other) { + public SimpleAvatarInfo mergeFrom(final SimpleAvatarInfo other) { if (other.isEmpty()) { return this; } @@ -185,7 +185,7 @@ public final class FriendAvatarInfoOuterClass { } @Override - public FriendAvatarInfo clear() { + public SimpleAvatarInfo clear() { if (isEmpty()) { return this; } @@ -198,7 +198,7 @@ public final class FriendAvatarInfoOuterClass { } @Override - public FriendAvatarInfo clearQuick() { + public SimpleAvatarInfo clearQuick() { if (isEmpty()) { return this; } @@ -212,10 +212,10 @@ public final class FriendAvatarInfoOuterClass { if (o == this) { return true; } - if (!(o instanceof FriendAvatarInfo)) { + if (!(o instanceof SimpleAvatarInfo)) { return false; } - FriendAvatarInfo other = (FriendAvatarInfo) o; + SimpleAvatarInfo other = (SimpleAvatarInfo) o; return bitField0_ == other.bitField0_ && (!hasLevel() || level == other.level) && (!hasEquipmentUniqueId() || equipmentUniqueId == other.equipmentUniqueId) @@ -255,7 +255,7 @@ public final class FriendAvatarInfoOuterClass { @Override @SuppressWarnings("fallthrough") - public FriendAvatarInfo mergeFrom(final ProtoSource input) throws IOException { + public SimpleAvatarInfo mergeFrom(final ProtoSource input) throws IOException { // Enabled Fall-Through Optimization (QuickBuffers) int tag = input.readTag(); while (true) { @@ -317,7 +317,7 @@ public final class FriendAvatarInfoOuterClass { } @Override - public FriendAvatarInfo mergeFrom(final JsonSource input) throws IOException { + public SimpleAvatarInfo mergeFrom(final JsonSource input) throws IOException { if (!input.beginObject()) { return this; } @@ -369,8 +369,8 @@ public final class FriendAvatarInfoOuterClass { } @Override - public FriendAvatarInfo clone() { - return new FriendAvatarInfo().copyFrom(this); + public SimpleAvatarInfo clone() { + return new SimpleAvatarInfo().copyFrom(this); } @Override @@ -378,32 +378,32 @@ public final class FriendAvatarInfoOuterClass { return ((bitField0_) == 0); } - public static FriendAvatarInfo parseFrom(final byte[] data) throws + public static SimpleAvatarInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException { - return ProtoMessage.mergeFrom(new FriendAvatarInfo(), data).checkInitialized(); + return ProtoMessage.mergeFrom(new SimpleAvatarInfo(), data).checkInitialized(); } - public static FriendAvatarInfo parseFrom(final ProtoSource input) throws IOException { - return ProtoMessage.mergeFrom(new FriendAvatarInfo(), input).checkInitialized(); + public static SimpleAvatarInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SimpleAvatarInfo(), input).checkInitialized(); } - public static FriendAvatarInfo parseFrom(final JsonSource input) throws IOException { - return ProtoMessage.mergeFrom(new FriendAvatarInfo(), input).checkInitialized(); + public static SimpleAvatarInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SimpleAvatarInfo(), input).checkInitialized(); } /** - * @return factory for creating FriendAvatarInfo messages + * @return factory for creating SimpleAvatarInfo messages */ - public static MessageFactory getFactory() { - return FriendAvatarInfoFactory.INSTANCE; + public static MessageFactory getFactory() { + return SimpleAvatarInfoFactory.INSTANCE; } - private enum FriendAvatarInfoFactory implements MessageFactory { + private enum SimpleAvatarInfoFactory implements MessageFactory { INSTANCE; @Override - public FriendAvatarInfo create() { - return FriendAvatarInfo.newInstance(); + public SimpleAvatarInfo create() { + return SimpleAvatarInfo.newInstance(); } } diff --git a/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java index c6d67f1..23bb698 100644 --- a/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/SimpleInfoOuterClass.java @@ -30,9 +30,9 @@ public final class SimpleInfoOuterClass { private int level; /** - * optional uint32 profile_picture = 10; + * optional uint32 head_icon = 10; */ - private int profilePicture; + private int headIcon; /** * optional uint32 uid = 12; @@ -50,9 +50,9 @@ public final class SimpleInfoOuterClass { private int onlineStatus; /** - * optional .FriendAvatarInfo friend_avatar_info = 3; + * optional .SimpleAvatarInfo simple_avatar_info = 3; */ - private final FriendAvatarInfoOuterClass.FriendAvatarInfo friendAvatarInfo = FriendAvatarInfoOuterClass.FriendAvatarInfo.newInstance(); + private final SimpleAvatarInfoOuterClass.SimpleAvatarInfo simpleAvatarInfo = SimpleAvatarInfoOuterClass.SimpleAvatarInfo.newInstance(); /** * optional string nickname = 4; @@ -149,39 +149,39 @@ public final class SimpleInfoOuterClass { } /** - * optional uint32 profile_picture = 10; - * @return whether the profilePicture field is set + * optional uint32 head_icon = 10; + * @return whether the headIcon field is set */ - public boolean hasProfilePicture() { + public boolean hasHeadIcon() { return (bitField0_ & 0x00000004) != 0; } /** - * optional uint32 profile_picture = 10; + * optional uint32 head_icon = 10; * @return this */ - public SimpleInfo clearProfilePicture() { + public SimpleInfo clearHeadIcon() { bitField0_ &= ~0x00000004; - profilePicture = 0; + headIcon = 0; return this; } /** - * optional uint32 profile_picture = 10; - * @return the profilePicture + * optional uint32 head_icon = 10; + * @return the headIcon */ - public int getProfilePicture() { - return profilePicture; + public int getHeadIcon() { + return headIcon; } /** - * optional uint32 profile_picture = 10; - * @param value the profilePicture to set + * optional uint32 head_icon = 10; + * @param value the headIcon to set * @return this */ - public SimpleInfo setProfilePicture(final int value) { + public SimpleInfo setHeadIcon(final int value) { bitField0_ |= 0x00000004; - profilePicture = value; + headIcon = value; return this; } @@ -347,39 +347,39 @@ public final class SimpleInfoOuterClass { } /** - * optional .FriendAvatarInfo friend_avatar_info = 3; - * @return whether the friendAvatarInfo field is set + * optional .SimpleAvatarInfo simple_avatar_info = 3; + * @return whether the simpleAvatarInfo field is set */ - public boolean hasFriendAvatarInfo() { + public boolean hasSimpleAvatarInfo() { return (bitField0_ & 0x00000040) != 0; } /** - * optional .FriendAvatarInfo friend_avatar_info = 3; + * optional .SimpleAvatarInfo simple_avatar_info = 3; * @return this */ - public SimpleInfo clearFriendAvatarInfo() { + public SimpleInfo clearSimpleAvatarInfo() { bitField0_ &= ~0x00000040; - friendAvatarInfo.clear(); + simpleAvatarInfo.clear(); return this; } /** - * optional .FriendAvatarInfo friend_avatar_info = 3; + * optional .SimpleAvatarInfo simple_avatar_info = 3; * * This method returns the internal storage object without modifying any has state. * The returned object should not be modified and be treated as read-only. * - * Use {@link #getMutableFriendAvatarInfo()} if you want to modify it. + * Use {@link #getMutableSimpleAvatarInfo()} if you want to modify it. * * @return internal storage object for reading */ - public FriendAvatarInfoOuterClass.FriendAvatarInfo getFriendAvatarInfo() { - return friendAvatarInfo; + public SimpleAvatarInfoOuterClass.SimpleAvatarInfo getSimpleAvatarInfo() { + return simpleAvatarInfo; } /** - * optional .FriendAvatarInfo friend_avatar_info = 3; + * optional .SimpleAvatarInfo simple_avatar_info = 3; * * This method returns the internal storage object and sets the corresponding * has state. The returned object will become part of this message and its @@ -387,19 +387,19 @@ public final class SimpleInfoOuterClass { * * @return internal storage object for modifications */ - public FriendAvatarInfoOuterClass.FriendAvatarInfo getMutableFriendAvatarInfo() { + public SimpleAvatarInfoOuterClass.SimpleAvatarInfo getMutableSimpleAvatarInfo() { bitField0_ |= 0x00000040; - return friendAvatarInfo; + return simpleAvatarInfo; } /** - * optional .FriendAvatarInfo friend_avatar_info = 3; - * @param value the friendAvatarInfo to set + * optional .SimpleAvatarInfo simple_avatar_info = 3; + * @param value the simpleAvatarInfo to set * @return this */ - public SimpleInfo setFriendAvatarInfo(final FriendAvatarInfoOuterClass.FriendAvatarInfo value) { + public SimpleInfo setSimpleAvatarInfo(final SimpleAvatarInfoOuterClass.SimpleAvatarInfo value) { bitField0_ |= 0x00000040; - friendAvatarInfo.copyFrom(value); + simpleAvatarInfo.copyFrom(value); return this; } @@ -540,11 +540,11 @@ public final class SimpleInfoOuterClass { bitField0_ = other.bitField0_; lastActiveTime = other.lastActiveTime; level = other.level; - profilePicture = other.profilePicture; + headIcon = other.headIcon; uid = other.uid; platformType = other.platformType; onlineStatus = other.onlineStatus; - friendAvatarInfo.copyFrom(other.friendAvatarInfo); + simpleAvatarInfo.copyFrom(other.simpleAvatarInfo); nickname.copyFrom(other.nickname); signature.copyFrom(other.signature); } @@ -563,8 +563,8 @@ public final class SimpleInfoOuterClass { if (other.hasLevel()) { setLevel(other.level); } - if (other.hasProfilePicture()) { - setProfilePicture(other.profilePicture); + if (other.hasHeadIcon()) { + setHeadIcon(other.headIcon); } if (other.hasUid()) { setUid(other.uid); @@ -575,8 +575,8 @@ public final class SimpleInfoOuterClass { if (other.hasOnlineStatus()) { setOnlineStatusValue(other.onlineStatus); } - if (other.hasFriendAvatarInfo()) { - getMutableFriendAvatarInfo().mergeFrom(other.friendAvatarInfo); + if (other.hasSimpleAvatarInfo()) { + getMutableSimpleAvatarInfo().mergeFrom(other.simpleAvatarInfo); } if (other.hasNickname()) { getMutableNicknameBytes().copyFrom(other.nickname); @@ -596,11 +596,11 @@ public final class SimpleInfoOuterClass { bitField0_ = 0; lastActiveTime = 0L; level = 0; - profilePicture = 0; + headIcon = 0; uid = 0; platformType = 0; onlineStatus = 0; - friendAvatarInfo.clear(); + simpleAvatarInfo.clear(); nickname.clear(); signature.clear(); return this; @@ -613,7 +613,7 @@ public final class SimpleInfoOuterClass { } cachedSize = -1; bitField0_ = 0; - friendAvatarInfo.clearQuick(); + simpleAvatarInfo.clearQuick(); nickname.clear(); signature.clear(); return this; @@ -631,11 +631,11 @@ public final class SimpleInfoOuterClass { return bitField0_ == other.bitField0_ && (!hasLastActiveTime() || lastActiveTime == other.lastActiveTime) && (!hasLevel() || level == other.level) - && (!hasProfilePicture() || profilePicture == other.profilePicture) + && (!hasHeadIcon() || headIcon == other.headIcon) && (!hasUid() || uid == other.uid) && (!hasPlatformType() || platformType == other.platformType) && (!hasOnlineStatus() || onlineStatus == other.onlineStatus) - && (!hasFriendAvatarInfo() || friendAvatarInfo.equals(other.friendAvatarInfo)) + && (!hasSimpleAvatarInfo() || simpleAvatarInfo.equals(other.simpleAvatarInfo)) && (!hasNickname() || nickname.equals(other.nickname)) && (!hasSignature() || signature.equals(other.signature)); } @@ -652,7 +652,7 @@ public final class SimpleInfoOuterClass { } if ((bitField0_ & 0x00000004) != 0) { output.writeRawByte((byte) 80); - output.writeUInt32NoTag(profilePicture); + output.writeUInt32NoTag(headIcon); } if ((bitField0_ & 0x00000008) != 0) { output.writeRawByte((byte) 96); @@ -668,7 +668,7 @@ public final class SimpleInfoOuterClass { } if ((bitField0_ & 0x00000040) != 0) { output.writeRawByte((byte) 26); - output.writeMessageNoTag(friendAvatarInfo); + output.writeMessageNoTag(simpleAvatarInfo); } if ((bitField0_ & 0x00000080) != 0) { output.writeRawByte((byte) 34); @@ -690,7 +690,7 @@ public final class SimpleInfoOuterClass { size += 1 + ProtoSink.computeUInt32SizeNoTag(level); } if ((bitField0_ & 0x00000004) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(profilePicture); + size += 1 + ProtoSink.computeUInt32SizeNoTag(headIcon); } if ((bitField0_ & 0x00000008) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); @@ -702,7 +702,7 @@ public final class SimpleInfoOuterClass { size += 1 + ProtoSink.computeEnumSizeNoTag(onlineStatus); } if ((bitField0_ & 0x00000040) != 0) { - size += 1 + ProtoSink.computeMessageSizeNoTag(friendAvatarInfo); + size += 1 + ProtoSink.computeMessageSizeNoTag(simpleAvatarInfo); } if ((bitField0_ & 0x00000080) != 0) { size += 1 + ProtoSink.computeStringSizeNoTag(nickname); @@ -739,8 +739,8 @@ public final class SimpleInfoOuterClass { } } case 80: { - // profilePicture - profilePicture = input.readUInt32(); + // headIcon + headIcon = input.readUInt32(); bitField0_ |= 0x00000004; tag = input.readTag(); if (tag != 96) { @@ -781,8 +781,8 @@ public final class SimpleInfoOuterClass { } } case 26: { - // friendAvatarInfo - input.readMessage(friendAvatarInfo); + // simpleAvatarInfo + input.readMessage(simpleAvatarInfo); bitField0_ |= 0x00000040; tag = input.readTag(); if (tag != 34) { @@ -831,7 +831,7 @@ public final class SimpleInfoOuterClass { output.writeUInt32(FieldNames.level, level); } if ((bitField0_ & 0x00000004) != 0) { - output.writeUInt32(FieldNames.profilePicture, profilePicture); + output.writeUInt32(FieldNames.headIcon, headIcon); } if ((bitField0_ & 0x00000008) != 0) { output.writeUInt32(FieldNames.uid, uid); @@ -843,7 +843,7 @@ public final class SimpleInfoOuterClass { output.writeEnum(FieldNames.onlineStatus, onlineStatus, FriendOnlineStatusOuterClass.FriendOnlineStatus.converter()); } if ((bitField0_ & 0x00000040) != 0) { - output.writeMessage(FieldNames.friendAvatarInfo, friendAvatarInfo); + output.writeMessage(FieldNames.simpleAvatarInfo, simpleAvatarInfo); } if ((bitField0_ & 0x00000080) != 0) { output.writeString(FieldNames.nickname, nickname); @@ -884,11 +884,11 @@ public final class SimpleInfoOuterClass { } break; } - case -1406866667: - case 1782764648: { - if (input.isAtField(FieldNames.profilePicture)) { + case -1116107143: + case -219098248: { + if (input.isAtField(FieldNames.headIcon)) { if (!input.trySkipNullValue()) { - profilePicture = input.readUInt32(); + headIcon = input.readUInt32(); bitField0_ |= 0x00000004; } } else { @@ -941,11 +941,11 @@ public final class SimpleInfoOuterClass { } break; } - case 2012020453: - case 1631238067: { - if (input.isAtField(FieldNames.friendAvatarInfo)) { + case 272129273: + case 338092231: { + if (input.isAtField(FieldNames.simpleAvatarInfo)) { if (!input.trySkipNullValue()) { - input.readMessage(friendAvatarInfo); + input.readMessage(simpleAvatarInfo); bitField0_ |= 0x00000040; } } else { @@ -1031,7 +1031,7 @@ public final class SimpleInfoOuterClass { static final FieldName level = FieldName.forField("level"); - static final FieldName profilePicture = FieldName.forField("profilePicture", "profile_picture"); + static final FieldName headIcon = FieldName.forField("headIcon", "head_icon"); static final FieldName uid = FieldName.forField("uid"); @@ -1039,7 +1039,7 @@ public final class SimpleInfoOuterClass { static final FieldName onlineStatus = FieldName.forField("onlineStatus", "online_status"); - static final FieldName friendAvatarInfo = FieldName.forField("friendAvatarInfo", "friend_avatar_info"); + static final FieldName simpleAvatarInfo = FieldName.forField("simpleAvatarInfo", "simple_avatar_info"); static final FieldName nickname = FieldName.forField("nickname"); diff --git a/src/generated/main/emu/lunarcore/proto/SyncApplyFriendScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/SyncApplyFriendScNotifyOuterClass.java new file mode 100644 index 0000000..94802b3 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SyncApplyFriendScNotifyOuterClass.java @@ -0,0 +1,282 @@ +// 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 SyncApplyFriendScNotifyOuterClass { + /** + * Protobuf type {@code SyncApplyFriendScNotify} + */ + public static final class SyncApplyFriendScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .FriendApplyListInfo friend_apply_info = 5; + */ + private final FriendApplyListInfoOuterClass.FriendApplyListInfo friendApplyInfo = FriendApplyListInfoOuterClass.FriendApplyListInfo.newInstance(); + + private SyncApplyFriendScNotify() { + } + + /** + * @return a new empty instance of {@code SyncApplyFriendScNotify} + */ + public static SyncApplyFriendScNotify newInstance() { + return new SyncApplyFriendScNotify(); + } + + /** + * optional .FriendApplyListInfo friend_apply_info = 5; + * @return whether the friendApplyInfo field is set + */ + public boolean hasFriendApplyInfo() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .FriendApplyListInfo friend_apply_info = 5; + * @return this + */ + public SyncApplyFriendScNotify clearFriendApplyInfo() { + bitField0_ &= ~0x00000001; + friendApplyInfo.clear(); + return this; + } + + /** + * optional .FriendApplyListInfo friend_apply_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 #getMutableFriendApplyInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public FriendApplyListInfoOuterClass.FriendApplyListInfo getFriendApplyInfo() { + return friendApplyInfo; + } + + /** + * optional .FriendApplyListInfo friend_apply_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 FriendApplyListInfoOuterClass.FriendApplyListInfo getMutableFriendApplyInfo() { + bitField0_ |= 0x00000001; + return friendApplyInfo; + } + + /** + * optional .FriendApplyListInfo friend_apply_info = 5; + * @param value the friendApplyInfo to set + * @return this + */ + public SyncApplyFriendScNotify setFriendApplyInfo( + final FriendApplyListInfoOuterClass.FriendApplyListInfo value) { + bitField0_ |= 0x00000001; + friendApplyInfo.copyFrom(value); + return this; + } + + @Override + public SyncApplyFriendScNotify copyFrom(final SyncApplyFriendScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + friendApplyInfo.copyFrom(other.friendApplyInfo); + } + return this; + } + + @Override + public SyncApplyFriendScNotify mergeFrom(final SyncApplyFriendScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasFriendApplyInfo()) { + getMutableFriendApplyInfo().mergeFrom(other.friendApplyInfo); + } + return this; + } + + @Override + public SyncApplyFriendScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + friendApplyInfo.clear(); + return this; + } + + @Override + public SyncApplyFriendScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + friendApplyInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SyncApplyFriendScNotify)) { + return false; + } + SyncApplyFriendScNotify other = (SyncApplyFriendScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasFriendApplyInfo() || friendApplyInfo.equals(other.friendApplyInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(friendApplyInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(friendApplyInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SyncApplyFriendScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 42: { + // friendApplyInfo + input.readMessage(friendApplyInfo); + 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.friendApplyInfo, friendApplyInfo); + } + output.endObject(); + } + + @Override + public SyncApplyFriendScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1582425026: + case 1375841056: { + if (input.isAtField(FieldNames.friendApplyInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(friendApplyInfo); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SyncApplyFriendScNotify clone() { + return new SyncApplyFriendScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SyncApplyFriendScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SyncApplyFriendScNotify(), data).checkInitialized(); + } + + public static SyncApplyFriendScNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SyncApplyFriendScNotify(), input).checkInitialized(); + } + + public static SyncApplyFriendScNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SyncApplyFriendScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating SyncApplyFriendScNotify messages + */ + public static MessageFactory getFactory() { + return SyncApplyFriendScNotifyFactory.INSTANCE; + } + + private enum SyncApplyFriendScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public SyncApplyFriendScNotify create() { + return SyncApplyFriendScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName friendApplyInfo = FieldName.forField("friendApplyInfo", "friend_apply_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SyncDeleteFriendScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/SyncDeleteFriendScNotifyOuterClass.java new file mode 100644 index 0000000..1704f70 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SyncDeleteFriendScNotifyOuterClass.java @@ -0,0 +1,259 @@ +// 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 SyncDeleteFriendScNotifyOuterClass { + /** + * Protobuf type {@code SyncDeleteFriendScNotify} + */ + public static final class SyncDeleteFriendScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 uid = 11; + */ + private int uid; + + private SyncDeleteFriendScNotify() { + } + + /** + * @return a new empty instance of {@code SyncDeleteFriendScNotify} + */ + public static SyncDeleteFriendScNotify newInstance() { + return new SyncDeleteFriendScNotify(); + } + + /** + * optional uint32 uid = 11; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 uid = 11; + * @return this + */ + public SyncDeleteFriendScNotify clearUid() { + bitField0_ &= ~0x00000001; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 11; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 11; + * @param value the uid to set + * @return this + */ + public SyncDeleteFriendScNotify setUid(final int value) { + bitField0_ |= 0x00000001; + uid = value; + return this; + } + + @Override + public SyncDeleteFriendScNotify copyFrom(final SyncDeleteFriendScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + uid = other.uid; + } + return this; + } + + @Override + public SyncDeleteFriendScNotify mergeFrom(final SyncDeleteFriendScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUid()) { + setUid(other.uid); + } + return this; + } + + @Override + public SyncDeleteFriendScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + uid = 0; + return this; + } + + @Override + public SyncDeleteFriendScNotify 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 SyncDeleteFriendScNotify)) { + return false; + } + SyncDeleteFriendScNotify other = (SyncDeleteFriendScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasUid() || uid == other.uid); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(uid); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SyncDeleteFriendScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 88: { + // uid + uid = 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.uid, uid); + } + output.endObject(); + } + + @Override + public SyncDeleteFriendScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SyncDeleteFriendScNotify clone() { + return new SyncDeleteFriendScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SyncDeleteFriendScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SyncDeleteFriendScNotify(), data).checkInitialized(); + } + + public static SyncDeleteFriendScNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SyncDeleteFriendScNotify(), input).checkInitialized(); + } + + public static SyncDeleteFriendScNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SyncDeleteFriendScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating SyncDeleteFriendScNotify messages + */ + public static MessageFactory getFactory() { + return SyncDeleteFriendScNotifyFactory.INSTANCE; + } + + private enum SyncDeleteFriendScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public SyncDeleteFriendScNotify create() { + return SyncDeleteFriendScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName uid = FieldName.forField("uid"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SyncHandleFriendScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/SyncHandleFriendScNotifyOuterClass.java new file mode 100644 index 0000000..e639f86 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SyncHandleFriendScNotifyOuterClass.java @@ -0,0 +1,443 @@ +// 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 SyncHandleFriendScNotifyOuterClass { + /** + * Protobuf type {@code SyncHandleFriendScNotify} + */ + public static final class SyncHandleFriendScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 uid = 14; + */ + private int uid; + + /** + * optional bool handle_result = 13; + */ + private boolean handleResult; + + /** + * optional .FriendListInfo handle_friend_info = 12; + */ + private final FriendListInfoOuterClass.FriendListInfo handleFriendInfo = FriendListInfoOuterClass.FriendListInfo.newInstance(); + + private SyncHandleFriendScNotify() { + } + + /** + * @return a new empty instance of {@code SyncHandleFriendScNotify} + */ + public static SyncHandleFriendScNotify newInstance() { + return new SyncHandleFriendScNotify(); + } + + /** + * optional uint32 uid = 14; + * @return whether the uid field is set + */ + public boolean hasUid() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 uid = 14; + * @return this + */ + public SyncHandleFriendScNotify clearUid() { + bitField0_ &= ~0x00000001; + uid = 0; + return this; + } + + /** + * optional uint32 uid = 14; + * @return the uid + */ + public int getUid() { + return uid; + } + + /** + * optional uint32 uid = 14; + * @param value the uid to set + * @return this + */ + public SyncHandleFriendScNotify setUid(final int value) { + bitField0_ |= 0x00000001; + uid = value; + return this; + } + + /** + * optional bool handle_result = 13; + * @return whether the handleResult field is set + */ + public boolean hasHandleResult() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional bool handle_result = 13; + * @return this + */ + public SyncHandleFriendScNotify clearHandleResult() { + bitField0_ &= ~0x00000002; + handleResult = false; + return this; + } + + /** + * optional bool handle_result = 13; + * @return the handleResult + */ + public boolean getHandleResult() { + return handleResult; + } + + /** + * optional bool handle_result = 13; + * @param value the handleResult to set + * @return this + */ + public SyncHandleFriendScNotify setHandleResult(final boolean value) { + bitField0_ |= 0x00000002; + handleResult = value; + return this; + } + + /** + * optional .FriendListInfo handle_friend_info = 12; + * @return whether the handleFriendInfo field is set + */ + public boolean hasHandleFriendInfo() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional .FriendListInfo handle_friend_info = 12; + * @return this + */ + public SyncHandleFriendScNotify clearHandleFriendInfo() { + bitField0_ &= ~0x00000004; + handleFriendInfo.clear(); + return this; + } + + /** + * optional .FriendListInfo handle_friend_info = 12; + * + * 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 #getMutableHandleFriendInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public FriendListInfoOuterClass.FriendListInfo getHandleFriendInfo() { + return handleFriendInfo; + } + + /** + * optional .FriendListInfo handle_friend_info = 12; + * + * 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 FriendListInfoOuterClass.FriendListInfo getMutableHandleFriendInfo() { + bitField0_ |= 0x00000004; + return handleFriendInfo; + } + + /** + * optional .FriendListInfo handle_friend_info = 12; + * @param value the handleFriendInfo to set + * @return this + */ + public SyncHandleFriendScNotify setHandleFriendInfo( + final FriendListInfoOuterClass.FriendListInfo value) { + bitField0_ |= 0x00000004; + handleFriendInfo.copyFrom(value); + return this; + } + + @Override + public SyncHandleFriendScNotify copyFrom(final SyncHandleFriendScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + uid = other.uid; + handleResult = other.handleResult; + handleFriendInfo.copyFrom(other.handleFriendInfo); + } + return this; + } + + @Override + public SyncHandleFriendScNotify mergeFrom(final SyncHandleFriendScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasUid()) { + setUid(other.uid); + } + if (other.hasHandleResult()) { + setHandleResult(other.handleResult); + } + if (other.hasHandleFriendInfo()) { + getMutableHandleFriendInfo().mergeFrom(other.handleFriendInfo); + } + return this; + } + + @Override + public SyncHandleFriendScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + uid = 0; + handleResult = false; + handleFriendInfo.clear(); + return this; + } + + @Override + public SyncHandleFriendScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + handleFriendInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SyncHandleFriendScNotify)) { + return false; + } + SyncHandleFriendScNotify other = (SyncHandleFriendScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasUid() || uid == other.uid) + && (!hasHandleResult() || handleResult == other.handleResult) + && (!hasHandleFriendInfo() || handleFriendInfo.equals(other.handleFriendInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 104); + output.writeBoolNoTag(handleResult); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 98); + output.writeMessageNoTag(handleFriendInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(uid); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(handleFriendInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SyncHandleFriendScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 112: { + // uid + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // handleResult + handleResult = input.readBool(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 98) { + break; + } + } + case 98: { + // handleFriendInfo + input.readMessage(handleFriendInfo); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.uid, uid); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeBool(FieldNames.handleResult, handleResult); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeMessage(FieldNames.handleFriendInfo, handleFriendInfo); + } + output.endObject(); + } + + @Override + public SyncHandleFriendScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 115792: { + if (input.isAtField(FieldNames.uid)) { + if (!input.trySkipNullValue()) { + uid = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1331436443: + case 686987796: { + if (input.isAtField(FieldNames.handleResult)) { + if (!input.trySkipNullValue()) { + handleResult = input.readBool(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -215671628: + case 49075736: { + if (input.isAtField(FieldNames.handleFriendInfo)) { + if (!input.trySkipNullValue()) { + input.readMessage(handleFriendInfo); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SyncHandleFriendScNotify clone() { + return new SyncHandleFriendScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SyncHandleFriendScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SyncHandleFriendScNotify(), data).checkInitialized(); + } + + public static SyncHandleFriendScNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SyncHandleFriendScNotify(), input).checkInitialized(); + } + + public static SyncHandleFriendScNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SyncHandleFriendScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating SyncHandleFriendScNotify messages + */ + public static MessageFactory getFactory() { + return SyncHandleFriendScNotifyFactory.INSTANCE; + } + + private enum SyncHandleFriendScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public SyncHandleFriendScNotify create() { + return SyncHandleFriendScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName uid = FieldName.forField("uid"); + + static final FieldName handleResult = FieldName.forField("handleResult", "handle_result"); + + static final FieldName handleFriendInfo = FieldName.forField("handleFriendInfo", "handle_friend_info"); + } + } +} diff --git a/src/main/java/emu/lunarcore/GameConstants.java b/src/main/java/emu/lunarcore/GameConstants.java index 7e02eae..f46af09 100644 --- a/src/main/java/emu/lunarcore/GameConstants.java +++ b/src/main/java/emu/lunarcore/GameConstants.java @@ -18,6 +18,7 @@ public class GameConstants { public static final int MAX_STAMINA = 240; public static final int MAX_STAMINA_RESERVE = 2400; public static final int MAX_AVATARS_IN_TEAM = 4; + public static final int MAX_FRIENDSHIPS = 100; public static final int DEFAULT_TEAMS = 6; public static final int MAX_MP = 5; // Client doesnt like more than 5 diff --git a/src/main/java/emu/lunarcore/game/friends/FriendList.java b/src/main/java/emu/lunarcore/game/friends/FriendList.java new file mode 100644 index 0000000..a94c3dd --- /dev/null +++ b/src/main/java/emu/lunarcore/game/friends/FriendList.java @@ -0,0 +1,248 @@ +package emu.lunarcore.game.friends; + +import emu.lunarcore.GameConstants; +import emu.lunarcore.LunarCore; +import emu.lunarcore.game.player.BasePlayerManager; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.send.*; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import lombok.AccessLevel; +import lombok.Getter; + +@Getter(AccessLevel.PRIVATE) +public class FriendList extends BasePlayerManager { + @Getter(AccessLevel.PUBLIC) + private final Int2ObjectMap friends; + @Getter(AccessLevel.PUBLIC) + private final Int2ObjectMap pendingFriends; + + private long friendListCooldown = 0; + private long applyFriendListCooldown = 0; + private BasePacket friendListPacket; + private BasePacket applyFriendListPacket; + + public FriendList(Player player) { + super(player); + this.friends = new Int2ObjectOpenHashMap(); + this.pendingFriends = new Int2ObjectOpenHashMap(); + } + + private synchronized Friendship getFriendById(int id) { + if (this.getPlayer().isOnline()) { + return this.getFriends().get(id); + } else { + return LunarCore.getGameDatabase().getObjectByUid(Friendship.class, Friendship.generateUniqueKey(getPlayer().getUid(), id)); + } + } + + private synchronized Friendship getPendingFriendById(int id) { + if (this.getPlayer().isOnline()) { + return this.getPendingFriends().get(id); + } else { + return LunarCore.getGameDatabase().getObjectByUid(Friendship.class, Friendship.generateUniqueKey(getPlayer().getUid(), id)); + } + } + + private void addFriendship(Friendship friendship) { + getFriends().put(friendship.getFriendUid(), friendship); + this.friendListCooldown = 0; + } + + private void addPendingFriendship(Friendship friendship) { + getPendingFriends().put(friendship.getFriendUid(), friendship); + this.applyFriendListCooldown = 0; + } + + private void removeFriendship(int uid) { + getFriends().remove(uid); + this.friendListCooldown = 0; + } + + private void removePendingFriendship(int uid) { + getPendingFriends().remove(uid); + this.applyFriendListCooldown = 0; + } + + /** + * Gets total amount of potential friends + */ + public int getFullFriendCount() { + return this.getPendingFriends().size() + this.getFriends().size(); + } + + public synchronized void handleFriendRequest(int targetUid, boolean action) { + // Make sure we have enough room + if (this.getFriends().size() >= GameConstants.MAX_FRIENDSHIPS) { + return; + } + + // Check if player has sent friend request + Friendship myFriendship = this.getPendingFriendById(targetUid); + if (myFriendship == null) return; + + // Make sure this player is not the asker + if (myFriendship.getAskerUid() == this.getPlayer().getUid()) return; + + // Get target player + Player target = getServer().getPlayerByUid(targetUid, true); + if (target == null) return; + + // Get target player's friendship + Friendship theirFriendship = target.getFriendList().getPendingFriendById(getPlayer().getUid()); + + if (theirFriendship == null) { + // They dont have us on their friends list anymore, rip + this.removePendingFriendship(myFriendship.getOwnerUid()); + myFriendship.delete(); + getPlayer().sendPacket(new PacketHandleFriendScRsp(target, false)); + return; + } + + // Handle action + if (action) { + // Request accepted + myFriendship.setFriend(true); + theirFriendship.setFriend(true); + + this.removePendingFriendship(myFriendship.getOwnerUid()); + this.addFriendship(myFriendship); + + if (target.isOnline()) { + target.getFriendList().removePendingFriendship(this.getPlayer().getUid()); + target.getFriendList().addFriendship(theirFriendship); + target.sendPacket(new PacketSyncHandleFriendScNotify(getPlayer(), action)); + } + + // Save friendships to the database + myFriendship.save(); + theirFriendship.save(); + } else { + // Request declined - Delete from my pending friends + this.removePendingFriendship(myFriendship.getOwnerUid()); + + if (target.isOnline()) { + target.getFriendList().removePendingFriendship(getPlayer().getUid()); + target.sendPacket(new PacketSyncHandleFriendScNotify(getPlayer(), action)); + } + + // Delete friendships from the database + myFriendship.delete(); + theirFriendship.delete(); + } + + // Send packet + getPlayer().sendPacket(new PacketHandleFriendScRsp(target, action)); + } + + public synchronized void sendFriendRequest(int targetUid) { + // Get target and sanity check + Player target = getPlayer().getServer().getPlayerByUid(targetUid, true); + if (target == null || target == this.getPlayer()) return; + + // Check if friend already exists + if (getPendingFriends().containsKey(targetUid) || getFriends().containsKey(targetUid)) { + return; + } + + // Create friendships + Friendship myFriendship = new Friendship(getPlayer(), target, getPlayer()); + Friendship theirFriendship = new Friendship(target, getPlayer(), getPlayer()); + + // Add to our pending friendship list + this.addPendingFriendship(myFriendship); + + if (target.isOnline()) { + target.getFriendList().addPendingFriendship(theirFriendship); + target.sendPacket(new PacketSyncApplyFriendScNotify(this.getPlayer())); + } + + // Save friendships to the database + myFriendship.save(); + theirFriendship.save(); + } + + public synchronized void deleteFriend(int targetUid) { + // Get friendship + Friendship myFriendship = this.getFriendById(targetUid); + if (myFriendship == null) return; + + // Remove from friends list + this.removeFriendship(targetUid); + myFriendship.delete(); + + // Delete from friend's friend list + Player friend = getServer().getPlayerByUid(targetUid, true); + + if (friend != null) { + // Friend online + Friendship theirFriendship = friend.getFriendList().getFriendById(this.getPlayer().getUid()); + + if (theirFriendship != null) { + // Delete friendship on friends side + theirFriendship.delete(); + + if (friend.isOnline()) { + // Remove from online friend's friend list + friend.getFriendList().removeFriendship(theirFriendship.getFriendUid()); + + // Send packet to friend + getPlayer().sendPacket(new PacketSyncDeleteFriendScNotify(getPlayer().getUid())); + } + } + } + + // Send packet + getPlayer().sendPacket(new PacketSyncDeleteFriendScNotify(targetUid)); + } + + // Database + + public synchronized void loadFromDatabase() { + var friendships = LunarCore.getGameDatabase().getObjects(Friendship.class, "ownerUid", this.getPlayer().getUid()); + + friendships.forEach(friendship -> { + // Set ownership first + friendship.setOwner(getPlayer()); + + // Finally, load to our friends list + if (friendship.isFriend()) { + getFriends().put(friendship.getFriendUid(), friendship); + } else { + getPendingFriends().put(friendship.getFriendUid(), friendship); + } + }); + } + + // Protobuf serialization + + public synchronized int[] toFriendUidArray() { + IntArrayList list = new IntArrayList(); + + list.add(GameConstants.SERVER_CONSOLE_UID); + + for (var friendship : this.getFriends().values()) { + list.add(friendship.getFriendUid()); + } + + return list.toIntArray(); + } + + public synchronized BasePacket getFriendListPacket() { + if (this.friendListPacket == null || System.currentTimeMillis() >= this.friendListCooldown) { + this.friendListPacket = new PacketGetFriendListInfoScRsp(this); + this.friendListCooldown = System.currentTimeMillis() + 60000; + } + return this.friendListPacket; + } + + public synchronized BasePacket getApplyFriendListPacket() { + if (this.applyFriendListPacket == null || System.currentTimeMillis() >= this.applyFriendListCooldown) { + this.applyFriendListPacket = new PacketGetFriendApplyListInfoScRsp(this); + this.applyFriendListCooldown = System.currentTimeMillis() + 60000; + } + return this.applyFriendListPacket; + } +} diff --git a/src/main/java/emu/lunarcore/game/friends/Friendship.java b/src/main/java/emu/lunarcore/game/friends/Friendship.java new file mode 100644 index 0000000..470195c --- /dev/null +++ b/src/main/java/emu/lunarcore/game/friends/Friendship.java @@ -0,0 +1,55 @@ +package emu.lunarcore.game.friends; + +import dev.morphia.annotations.Entity; +import dev.morphia.annotations.Id; +import dev.morphia.annotations.Indexed; +import emu.lunarcore.LunarCore; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.SimpleInfoOuterClass.SimpleInfo; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Entity(value = "friendships", useDiscriminator = false) +public class Friendship { + @Id private long id; + + @Indexed private int ownerUid; + @Indexed private int friendUid; + + @Setter private boolean isFriend; + private int askerUid; + + @Setter private transient Player owner; + @Setter private transient SimpleInfo simpleInfo; + + @Deprecated // Morphia use only + public Friendship() { } + + public Friendship(Player owner, Player friend, Player asker) { + this.owner = owner; + this.id = Friendship.generateUniqueKey(owner.getUid(), this.getFriendUid()); + this.ownerUid = owner.getUid(); + this.friendUid = friend.getUid(); + this.askerUid = asker.getUid(); + } + + // Database functions + + public void save() { + LunarCore.getGameDatabase().save(this); + } + + public void delete() { + LunarCore.getGameDatabase().delete(this); + } + + // Extra + + /** + * Creates an unique key for a friendship object using 2 player uids + */ + public static long generateUniqueKey(int ownerUid, int targetUid) { + return ((long) ownerUid << 32) + targetUid; + } +} diff --git a/src/main/java/emu/lunarcore/game/player/BasePlayerManager.java b/src/main/java/emu/lunarcore/game/player/BasePlayerManager.java index ed2b893..5cdddac 100644 --- a/src/main/java/emu/lunarcore/game/player/BasePlayerManager.java +++ b/src/main/java/emu/lunarcore/game/player/BasePlayerManager.java @@ -1,5 +1,7 @@ package emu.lunarcore.game.player; +import emu.lunarcore.server.game.GameServer; + public abstract class BasePlayerManager { private transient Player player; @@ -10,4 +12,8 @@ public abstract class BasePlayerManager { public Player getPlayer() { return player; } + + public GameServer getServer() { + return player.getServer(); + } } diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index 8c85f78..7e08ac3 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -29,6 +29,7 @@ import emu.lunarcore.game.chat.ChatManager; import emu.lunarcore.game.chat.ChatMessage; import emu.lunarcore.game.enums.PlaneType; import emu.lunarcore.game.enums.PropState; +import emu.lunarcore.game.friends.FriendList; import emu.lunarcore.game.gacha.PlayerGachaInfo; import emu.lunarcore.game.inventory.GameItem; import emu.lunarcore.game.inventory.Inventory; @@ -45,16 +46,21 @@ import emu.lunarcore.game.scene.entity.EntityProp; import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.game.scene.triggers.PropTriggerType; import emu.lunarcore.proto.BoardDataSyncOuterClass.BoardDataSync; +import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus; import emu.lunarcore.proto.HeadIconOuterClass.HeadIcon; +import emu.lunarcore.proto.PlatformTypeOuterClass.PlatformType; import emu.lunarcore.proto.PlayerBasicInfoOuterClass.PlayerBasicInfo; +import emu.lunarcore.proto.PlayerDetailInfoOuterClass.PlayerDetailInfo; import emu.lunarcore.proto.RogueVirtualItemInfoOuterClass.RogueVirtualItemInfo; +import emu.lunarcore.proto.SimpleAvatarInfoOuterClass.SimpleAvatarInfo; +import emu.lunarcore.proto.SimpleInfoOuterClass.SimpleInfo; import emu.lunarcore.server.game.GameServer; import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.BasePacket; import emu.lunarcore.server.packet.CmdId; -import emu.lunarcore.server.packet.SessionState; import emu.lunarcore.server.packet.send.*; import emu.lunarcore.util.Position; + import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntSet; import lombok.Getter; @@ -99,6 +105,7 @@ public class Player { private transient final AvatarStorage avatars; private transient final Inventory inventory; private transient final ChatManager chatManager; + private transient final FriendList friendList; private transient final Mailbox mailbox; private transient final ChallengeManager challengeManager; private transient final RogueManager rogueManager; @@ -112,6 +119,7 @@ public class Player { @Setter private transient RogueInstance rogueInstance; // Etc + private transient boolean loggedIn; private transient boolean inAnchorRange; private transient int nextBattleId; @@ -124,6 +132,7 @@ public class Player { this.avatars = new AvatarStorage(this); this.inventory = new Inventory(this); this.chatManager = new ChatManager(this); + this.friendList = new FriendList(this); this.mailbox = new Mailbox(this); this.challengeManager = new ChallengeManager(this); this.rogueManager = new RogueManager(this); @@ -167,6 +176,10 @@ public class Player { public Account getAccount() { return session.getAccount(); } + + public boolean isOnline() { + return this.getSession() != null && this.loggedIn; + } public void setSession(GameSession session) { if (this.session == null) { @@ -238,7 +251,7 @@ public class Player { } public void resetPosition() { - if (this.hasLoggedIn()) { + if (this.isOnline()) { return; } @@ -249,10 +262,6 @@ public class Player { this.entryId = GameConstants.START_ENTRY_ID; } - public boolean hasLoggedIn() { - return this.getSession() != null && this.getSession().getState() != SessionState.WAITING_FOR_TOKEN; - } - public boolean addAvatar(GameAvatar avatar) { boolean success = getAvatars().addAvatar(avatar); if (success) { @@ -430,7 +439,7 @@ public class Player { } // Send packet - if (hasChanged && this.hasLoggedIn()) { + if (hasChanged && this.isOnline()) { this.getSession().send(new PacketStaminaInfoScNotify(this)); } } @@ -601,7 +610,7 @@ public class Player { } public void sendPacket(BasePacket packet) { - if (this.hasLoggedIn()) { + if (this.isOnline()) { this.getSession().send(packet); } } @@ -618,6 +627,7 @@ public class Player { this.getAvatars().loadFromDatabase(); this.getInventory().loadFromDatabase(); this.getLineupManager().loadFromDatabase(); + this.getFriendList().loadFromDatabase(); this.getMailbox().loadFromDatabase(); this.getChallengeManager().loadFromDatabase(); this.getRogueManager().loadFromDatabase(); @@ -638,8 +648,10 @@ public class Player { if (this.getScene() == null) { this.enterScene(GameConstants.START_ENTRY_ID, 0, false); } + + // Set flag + this.loggedIn = true; } - // Database @@ -692,6 +704,34 @@ public class Player { return proto; } + public PlayerDetailInfo toDetailInfo() { + var proto = PlayerDetailInfo.newInstance() + .setUid(this.getUid()) + .setNickname(this.getName()) + .setSignature(this.getSignature()) + .setLevel(this.getLevel()) + .setWorldLevel(this.getWorldLevel()) + .setPlatformType(PlatformType.PC) + .setRecordInfo("") + .setHeadIcon(this.getHeadIcon()); + + return proto; + } + + public SimpleInfo toSimpleInfo() { + var proto = SimpleInfo.newInstance() + .setUid(this.getUid()) + .setNickname(this.getName()) + .setSignature(this.getSignature()) + .setLevel(this.getLevel()) + .setOnlineStatus(this.isOnline() ? FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE : FriendOnlineStatus.FRIEND_ONLINE_STATUS_OFFLINE) + .setPlatformType(PlatformType.PC) + .setSimpleAvatarInfo(SimpleAvatarInfo.newInstance().setAvatarId(GameConstants.TRAILBLAZER_AVATAR_ID).setLevel(1)) // TODO + .setHeadIcon(this.getHeadIcon()); + + return proto; + } + public BoardDataSync toBoardData() { var proto = BoardDataSync.newInstance() .setSignature(this.getSignature()); diff --git a/src/main/java/emu/lunarcore/server/game/GameServer.java b/src/main/java/emu/lunarcore/server/game/GameServer.java index cb12dcd..099e483 100644 --- a/src/main/java/emu/lunarcore/server/game/GameServer.java +++ b/src/main/java/emu/lunarcore/server/game/GameServer.java @@ -86,11 +86,25 @@ public class GameServer extends KcpServer { } } } + + public Player getPlayerByUid(int uid, boolean allowOffline) { + Player target = null; + + // Get player if online + synchronized (this.players) { + target = this.players.get(uid); + } + + // Player is not online, but we arent requesting an online one + if (target == null && allowOffline) { + target = LunarCore.getGameDatabase().getObjectByUid(Player.class, uid); + } + + return target; + } public Player getOnlinePlayerByUid(int uid) { - synchronized (this.players) { - return this.players.get(uid); - } + return this.getPlayerByUid(uid, false); } public Player getOnlinePlayerByAccountId(String accountUid) { diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerApplyFriendCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerApplyFriendCsReq.java new file mode 100644 index 0000000..4e592a6 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerApplyFriendCsReq.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.ApplyFriendCsReqOuterClass.ApplyFriendCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; + +@Opcodes(CmdId.ApplyFriendCsReq) +public class HandlerApplyFriendCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = ApplyFriendCsReq.parseFrom(data); + + session.getPlayer().getFriendList().sendFriendRequest(req.getUid()); + session.send(CmdId.ApplyFriendScRsp); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerDeleteFriendCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerDeleteFriendCsReq.java new file mode 100644 index 0000000..b7869a0 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerDeleteFriendCsReq.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.DeleteFriendCsReqOuterClass.DeleteFriendCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; + +@Opcodes(CmdId.DeleteFriendCsReq) +public class HandlerDeleteFriendCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = DeleteFriendCsReq.parseFrom(data); + + session.getPlayer().getFriendList().deleteFriend(req.getUid()); + session.send(CmdId.DeleteFriendScRsp); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendApplyListInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendApplyListInfoCsReq.java index f117335..eb2a896 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendApplyListInfoCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendApplyListInfoCsReq.java @@ -10,7 +10,7 @@ public class HandlerGetFriendApplyListInfoCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { - session.send(CmdId.GetFriendApplyListInfoScRsp); + session.send(session.getPlayer().getFriendList().getApplyFriendListPacket()); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendListInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendListInfoCsReq.java index 80d154c..d2e206c 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendListInfoCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendListInfoCsReq.java @@ -4,14 +4,13 @@ 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.PacketGetFriendListInfoScRsp; @Opcodes(CmdId.GetFriendListInfoCsReq) public class HandlerGetFriendListInfoCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { - session.send(new PacketGetFriendListInfoScRsp()); + session.send(session.getPlayer().getFriendList().getFriendListPacket()); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendLoginInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendLoginInfoCsReq.java index 7347b03..d934b9a 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendLoginInfoCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetFriendLoginInfoCsReq.java @@ -4,13 +4,14 @@ 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.PacketGetFriendLoginInfoScRsp; @Opcodes(CmdId.GetFriendLoginInfoCsReq) public class HandlerGetFriendLoginInfoCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { - session.send(CmdId.GetFriendLoginInfoScRsp); + session.send(new PacketGetFriendLoginInfoScRsp(session.getPlayer())); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerDetailInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerDetailInfoCsReq.java index 22aabee..316c0a9 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerDetailInfoCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerDetailInfoCsReq.java @@ -1,5 +1,6 @@ package emu.lunarcore.server.packet.recv; +import emu.lunarcore.game.player.Player; import emu.lunarcore.proto.GetPlayerDetailInfoCsReqOuterClass.GetPlayerDetailInfoCsReq; import emu.lunarcore.server.game.GameSession; import emu.lunarcore.server.packet.CmdId; @@ -14,8 +15,9 @@ public class HandlerGetPlayerDetailInfoCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { var req = GetPlayerDetailInfoCsReq.parseFrom(data); - - session.send(new PacketGetPlayerDetailInfoScRsp()); + + Player player = session.getServer().getPlayerByUid(req.getUid(), true); + session.send(new PacketGetPlayerDetailInfoScRsp(player)); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerHandleFriendCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerHandleFriendCsReq.java new file mode 100644 index 0000000..76cf114 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerHandleFriendCsReq.java @@ -0,0 +1,19 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.HandleFriendCsReqOuterClass.HandleFriendCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; + +@Opcodes(CmdId.HandleFriendCsReq) +public class HandlerHandleFriendCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = HandleFriendCsReq.parseFrom(data); + + session.getPlayer().getFriendList().handleFriendRequest(req.getUid(), req.getHandleResult()); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java new file mode 100644 index 0000000..d747494 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSearchPlayerCsReq.java @@ -0,0 +1,34 @@ +package emu.lunarcore.server.packet.recv; + +import java.util.ArrayList; +import java.util.List; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.SearchPlayerCsReqOuterClass.SearchPlayerCsReq; +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.PacketSearchPlayerScRsp; + +@Opcodes(CmdId.SearchPlayerCsReq) +public class HandlerSearchPlayerCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = SearchPlayerCsReq.parseFrom(data); + + List results = new ArrayList<>(); + + for (int uid : req.getSearchUidList()) { + Player target = session.getServer().getPlayerByUid(uid, true); + + if (target != null) { + results.add(target); + } + } + + session.send(new PacketSearchPlayerScRsp(results)); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendApplyListInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendApplyListInfoScRsp.java new file mode 100644 index 0000000..505fe9b --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendApplyListInfoScRsp.java @@ -0,0 +1,32 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.friends.FriendList; +import emu.lunarcore.proto.FriendApplyListInfoOuterClass.FriendApplyListInfo; +import emu.lunarcore.proto.GetFriendApplyListInfoScRspOuterClass.GetFriendApplyListInfoScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetFriendApplyListInfoScRsp extends BasePacket { + + public PacketGetFriendApplyListInfoScRsp(FriendList friendList) { + super(CmdId.GetFriendApplyListInfoScRsp); + + var data = GetFriendApplyListInfoScRsp.newInstance(); + + for (var friendship : friendList.getPendingFriends().values()) { + // Skip if we are the asker + if (friendship.getAskerUid() == friendList.getPlayer().getUid()) continue; + + // Get friend info from the server + var friend = friendList.getServer().getPlayerByUid(friendship.getFriendUid(), true); + if (friend == null) continue; + + var friendInfo = FriendApplyListInfo.newInstance() + .setSimpleInfo(friend.toSimpleInfo()); + + data.addFriendApplyList(friendInfo); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java index bd4f8c7..2235aec 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendListInfoScRsp.java @@ -1,31 +1,43 @@ package emu.lunarcore.server.packet.send; import emu.lunarcore.GameConstants; -import emu.lunarcore.proto.FriendAvatarInfoOuterClass.FriendAvatarInfo; +import emu.lunarcore.game.friends.FriendList; import emu.lunarcore.proto.FriendListInfoOuterClass.FriendListInfo; import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus; import emu.lunarcore.proto.GetFriendListInfoScRspOuterClass.GetFriendListInfoScRsp; import emu.lunarcore.proto.PlatformTypeOuterClass.PlatformType; +import emu.lunarcore.proto.SimpleAvatarInfoOuterClass.SimpleAvatarInfo; import emu.lunarcore.proto.SimpleInfoOuterClass.SimpleInfo; import emu.lunarcore.server.packet.BasePacket; import emu.lunarcore.server.packet.CmdId; public class PacketGetFriendListInfoScRsp extends BasePacket { - public PacketGetFriendListInfoScRsp() { + public PacketGetFriendListInfoScRsp(FriendList friendList) { super(CmdId.GetFriendListInfoScRsp); + // Inject server console as friend var consoleFriend = SimpleInfo.newInstance() + .setUid(GameConstants.SERVER_CONSOLE_UID) .setNickname("Server") .setLevel(1) - .setUid(GameConstants.SERVER_CONSOLE_UID) .setOnlineStatus(FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE) .setPlatformType(PlatformType.PC) - .setFriendAvatarInfo(FriendAvatarInfo.newInstance().setAvatarId(1001).setLevel(1)) - .setProfilePicture(201001); + .setSimpleAvatarInfo(SimpleAvatarInfo.newInstance().setAvatarId(1001).setLevel(1)) + .setHeadIcon(201001); var data = GetFriendListInfoScRsp.newInstance() .addFriendList(FriendListInfo.newInstance().setSimpleInfo(consoleFriend)); + + for (var friendship : friendList.getFriends().values()) { + var friend = friendList.getServer().getPlayerByUid(friendship.getFriendUid(), true); + if (friend == null) continue; + + var friendInfo = FriendListInfo.newInstance() + .setSimpleInfo(friend.toSimpleInfo()); + + data.addFriendList(friendInfo); + } this.setData(data); } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendLoginInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendLoginInfoScRsp.java new file mode 100644 index 0000000..0ef56a4 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetFriendLoginInfoScRsp.java @@ -0,0 +1,18 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.GetFriendLoginInfoScRspOuterClass.GetFriendLoginInfoScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetFriendLoginInfoScRsp extends BasePacket { + + public PacketGetFriendLoginInfoScRsp(Player player) { + super(CmdId.GetFriendLoginInfoScRsp); + + var data = GetFriendLoginInfoScRsp.newInstance() + .addAllFriendUidList(player.getFriendList().toFriendUidArray()); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerDetailInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerDetailInfoScRsp.java index 6a12f64..cbb8de0 100644 --- a/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerDetailInfoScRsp.java +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPlayerDetailInfoScRsp.java @@ -1,17 +1,22 @@ package emu.lunarcore.server.packet.send; +import emu.lunarcore.game.player.Player; import emu.lunarcore.proto.GetPlayerDetailInfoScRspOuterClass.GetPlayerDetailInfoScRsp; import emu.lunarcore.server.packet.BasePacket; import emu.lunarcore.server.packet.CmdId; public class PacketGetPlayerDetailInfoScRsp extends BasePacket { - public PacketGetPlayerDetailInfoScRsp() { + public PacketGetPlayerDetailInfoScRsp(Player player) { super(CmdId.GetPlayerDetailInfoScRsp); - // TODO handle properly - var data = GetPlayerDetailInfoScRsp.newInstance() - .setRetcode(1); + var data = GetPlayerDetailInfoScRsp.newInstance(); + + if (player != null) { + data.setPlayerDetailInfo(player.toDetailInfo()); + } else { + data.setRetcode(1); + } this.setData(data); } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketHandleFriendScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketHandleFriendScRsp.java new file mode 100644 index 0000000..6cd430f --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketHandleFriendScRsp.java @@ -0,0 +1,24 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.FriendListInfoOuterClass.FriendListInfo; +import emu.lunarcore.proto.HandleFriendScRspOuterClass.HandleFriendScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketHandleFriendScRsp extends BasePacket { + + public PacketHandleFriendScRsp(Player friend, boolean result) { + super(CmdId.HandleFriendScRsp); + + var data = HandleFriendScRsp.newInstance() + .setUid(friend.getUid()) + .setHandleResult(result); + + if (result) { + data.setHandleFriendInfo(FriendListInfo.newInstance().setSimpleInfo(friend.toSimpleInfo())); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSearchPlayerScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSearchPlayerScRsp.java new file mode 100644 index 0000000..dd7ae92 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSearchPlayerScRsp.java @@ -0,0 +1,27 @@ +package emu.lunarcore.server.packet.send; + +import java.util.Collection; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.SearchPlayerScRspOuterClass.SearchPlayerScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSearchPlayerScRsp extends BasePacket { + + public PacketSearchPlayerScRsp(Collection players) { + super(CmdId.SearchPlayerScRsp); + + var data = SearchPlayerScRsp.newInstance(); + + if (players != null && players.size() > 0) { + for (Player player : players) { + data.addSearchResultList(player.toSimpleInfo()); + } + } else { + data.setRetcode(3612); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSyncApplyFriendScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncApplyFriendScNotify.java new file mode 100644 index 0000000..198bdd2 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncApplyFriendScNotify.java @@ -0,0 +1,19 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.FriendApplyListInfoOuterClass.FriendApplyListInfo; +import emu.lunarcore.proto.SyncApplyFriendScNotifyOuterClass.SyncApplyFriendScNotify; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSyncApplyFriendScNotify extends BasePacket { + + public PacketSyncApplyFriendScNotify(Player friend) { + super(CmdId.SyncApplyFriendScNotify); + + var data = SyncApplyFriendScNotify.newInstance() + .setFriendApplyInfo(FriendApplyListInfo.newInstance().setSimpleInfo(friend.toSimpleInfo())); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSyncDeleteFriendScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncDeleteFriendScNotify.java new file mode 100644 index 0000000..3661240 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncDeleteFriendScNotify.java @@ -0,0 +1,17 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.SyncDeleteFriendScNotifyOuterClass.SyncDeleteFriendScNotify; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSyncDeleteFriendScNotify extends BasePacket { + + public PacketSyncDeleteFriendScNotify(int uid) { + super(CmdId.SyncDeleteFriendScNotify); + + var data = SyncDeleteFriendScNotify.newInstance() + .setUid(uid); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSyncHandleFriendScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncHandleFriendScNotify.java new file mode 100644 index 0000000..ab93be9 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncHandleFriendScNotify.java @@ -0,0 +1,24 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.FriendListInfoOuterClass.FriendListInfo; +import emu.lunarcore.proto.SyncHandleFriendScNotifyOuterClass.SyncHandleFriendScNotify; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSyncHandleFriendScNotify extends BasePacket { + + public PacketSyncHandleFriendScNotify(Player friend, boolean result) { + super(CmdId.SyncHandleFriendScNotify); + + var data = SyncHandleFriendScNotify.newInstance() + .setUid(friend.getUid()) + .setHandleResult(result); + + if (result) { + data.setHandleFriendInfo(FriendListInfo.newInstance().setSimpleInfo(friend.toSimpleInfo())); + } + + this.setData(data); + } +}