Implement friend list

This commit is contained in:
Melledy
2023-11-23 01:14:49 -08:00
parent b605108ce7
commit f2be0d9942
40 changed files with 6818 additions and 129 deletions

View File

@@ -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<ApplyFriendCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 uid = 6;</code>
*/
private int uid;
/**
* <code>optional .FriendApplySource source = 8;</code>
*/
private int source;
private ApplyFriendCsReq() {
}
/**
* @return a new empty instance of {@code ApplyFriendCsReq}
*/
public static ApplyFriendCsReq newInstance() {
return new ApplyFriendCsReq();
}
/**
* <code>optional uint32 uid = 6;</code>
* @return whether the uid field is set
*/
public boolean hasUid() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 uid = 6;</code>
* @return this
*/
public ApplyFriendCsReq clearUid() {
bitField0_ &= ~0x00000001;
uid = 0;
return this;
}
/**
* <code>optional uint32 uid = 6;</code>
* @return the uid
*/
public int getUid() {
return uid;
}
/**
* <code>optional uint32 uid = 6;</code>
* @param value the uid to set
* @return this
*/
public ApplyFriendCsReq setUid(final int value) {
bitField0_ |= 0x00000001;
uid = value;
return this;
}
/**
* <code>optional .FriendApplySource source = 8;</code>
* @return whether the source field is set
*/
public boolean hasSource() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .FriendApplySource source = 8;</code>
* @return this
*/
public ApplyFriendCsReq clearSource() {
bitField0_ &= ~0x00000002;
source = 0;
return this;
}
/**
* <code>optional .FriendApplySource source = 8;</code>
* @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;
}
/**
* <code>optional .FriendApplySource source = 8;</code>
* @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<ApplyFriendCsReq> getFactory() {
return ApplyFriendCsReqFactory.INSTANCE;
}
private enum ApplyFriendCsReqFactory implements MessageFactory<ApplyFriendCsReq> {
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");
}
}
}

View File

@@ -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<DeleteFriendCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 uid = 2;</code>
*/
private int uid;
private DeleteFriendCsReq() {
}
/**
* @return a new empty instance of {@code DeleteFriendCsReq}
*/
public static DeleteFriendCsReq newInstance() {
return new DeleteFriendCsReq();
}
/**
* <code>optional uint32 uid = 2;</code>
* @return whether the uid field is set
*/
public boolean hasUid() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 uid = 2;</code>
* @return this
*/
public DeleteFriendCsReq clearUid() {
bitField0_ &= ~0x00000001;
uid = 0;
return this;
}
/**
* <code>optional uint32 uid = 2;</code>
* @return the uid
*/
public int getUid() {
return uid;
}
/**
* <code>optional uint32 uid = 2;</code>
* @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<DeleteFriendCsReq> getFactory() {
return DeleteFriendCsReqFactory.INSTANCE;
}
private enum DeleteFriendCsReqFactory implements MessageFactory<DeleteFriendCsReq> {
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");
}
}
}

View File

@@ -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<FriendApplyListInfo> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional int64 JKBMJGNPCNN = 12;</code>
*/
private long jKBMJGNPCNN;
/**
* <code>optional .SimpleInfo simple_info = 10;</code>
*/
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();
}
/**
* <code>optional int64 JKBMJGNPCNN = 12;</code>
* @return whether the jKBMJGNPCNN field is set
*/
public boolean hasJKBMJGNPCNN() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional int64 JKBMJGNPCNN = 12;</code>
* @return this
*/
public FriendApplyListInfo clearJKBMJGNPCNN() {
bitField0_ &= ~0x00000001;
jKBMJGNPCNN = 0L;
return this;
}
/**
* <code>optional int64 JKBMJGNPCNN = 12;</code>
* @return the jKBMJGNPCNN
*/
public long getJKBMJGNPCNN() {
return jKBMJGNPCNN;
}
/**
* <code>optional int64 JKBMJGNPCNN = 12;</code>
* @param value the jKBMJGNPCNN to set
* @return this
*/
public FriendApplyListInfo setJKBMJGNPCNN(final long value) {
bitField0_ |= 0x00000001;
jKBMJGNPCNN = value;
return this;
}
/**
* <code>optional .SimpleInfo simple_info = 10;</code>
* @return whether the simpleInfo field is set
*/
public boolean hasSimpleInfo() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .SimpleInfo simple_info = 10;</code>
* @return this
*/
public FriendApplyListInfo clearSimpleInfo() {
bitField0_ &= ~0x00000002;
simpleInfo.clear();
return this;
}
/**
* <code>optional .SimpleInfo simple_info = 10;</code>
*
* 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;
}
/**
* <code>optional .SimpleInfo simple_info = 10;</code>
*
* 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;
}
/**
* <code>optional .SimpleInfo simple_info = 10;</code>
* @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<FriendApplyListInfo> getFactory() {
return FriendApplyListInfoFactory.INSTANCE;
}
private enum FriendApplyListInfoFactory implements MessageFactory<FriendApplyListInfo> {
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");
}
}
}

View File

@@ -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<FriendApplySource> {
/**
* <code>FRIEND_APPLY_SOURCE_NONE = 0;</code>
*/
FRIEND_APPLY_SOURCE_NONE("FRIEND_APPLY_SOURCE_NONE", 0),
/**
* <code>FRIEND_APPLY_SOURCE_SEARCH = 1;</code>
*/
FRIEND_APPLY_SOURCE_SEARCH("FRIEND_APPLY_SOURCE_SEARCH", 1),
/**
* <code>FRIEND_APPLY_SOURCE_RECOMMEND = 2;</code>
*/
FRIEND_APPLY_SOURCE_RECOMMEND("FRIEND_APPLY_SOURCE_RECOMMEND", 2),
/**
* <code>FRIEND_APPLY_SOURCE_ASSIST = 3;</code>
*/
FRIEND_APPLY_SOURCE_ASSIST("FRIEND_APPLY_SOURCE_ASSIST", 3),
/**
* <code>FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST = 4;</code>
*/
FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST("FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST", 4),
/**
* <code>FRIEND_APPLY_SOURCE_PSN_FRIEND = 5;</code>
*/
FRIEND_APPLY_SOURCE_PSN_FRIEND("FRIEND_APPLY_SOURCE_PSN_FRIEND", 5);
/**
* <code>FRIEND_APPLY_SOURCE_NONE = 0;</code>
*/
public static final int FRIEND_APPLY_SOURCE_NONE_VALUE = 0;
/**
* <code>FRIEND_APPLY_SOURCE_SEARCH = 1;</code>
*/
public static final int FRIEND_APPLY_SOURCE_SEARCH_VALUE = 1;
/**
* <code>FRIEND_APPLY_SOURCE_RECOMMEND = 2;</code>
*/
public static final int FRIEND_APPLY_SOURCE_RECOMMEND_VALUE = 2;
/**
* <code>FRIEND_APPLY_SOURCE_ASSIST = 3;</code>
*/
public static final int FRIEND_APPLY_SOURCE_ASSIST_VALUE = 3;
/**
* <code>FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST = 4;</code>
*/
public static final int FRIEND_APPLY_SOURCE_RECOMMEND_ASSIST_VALUE = 4;
/**
* <code>FRIEND_APPLY_SOURCE_PSN_FRIEND = 5;</code>
*/
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<FriendApplySource> 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<FriendApplySource> {
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;
}
}
}
}

View File

@@ -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<GetFriendApplyListInfoScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 retcode = 4;</code>
*/
private int retcode;
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
*/
private final RepeatedMessage<FriendApplyListInfoOuterClass.FriendApplyListInfo> friendApplyList = RepeatedMessage.newEmptyInstance(FriendApplyListInfoOuterClass.FriendApplyListInfo.getFactory());
private GetFriendApplyListInfoScRsp() {
}
/**
* @return a new empty instance of {@code GetFriendApplyListInfoScRsp}
*/
public static GetFriendApplyListInfoScRsp newInstance() {
return new GetFriendApplyListInfoScRsp();
}
/**
* <code>optional uint32 retcode = 4;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 retcode = 4;</code>
* @return this
*/
public GetFriendApplyListInfoScRsp clearRetcode() {
bitField0_ &= ~0x00000001;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 4;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 4;</code>
* @param value the retcode to set
* @return this
*/
public GetFriendApplyListInfoScRsp setRetcode(final int value) {
bitField0_ |= 0x00000001;
retcode = value;
return this;
}
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
* @return whether the friendApplyList field is set
*/
public boolean hasFriendApplyList() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
* @return this
*/
public GetFriendApplyListInfoScRsp clearFriendApplyList() {
bitField0_ &= ~0x00000002;
friendApplyList.clear();
return this;
}
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
*
* 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<FriendApplyListInfoOuterClass.FriendApplyListInfo> getFriendApplyList() {
return friendApplyList;
}
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
*
* 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<FriendApplyListInfoOuterClass.FriendApplyListInfo> getMutableFriendApplyList(
) {
bitField0_ |= 0x00000002;
return friendApplyList;
}
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
* @param value the friendApplyList to add
* @return this
*/
public GetFriendApplyListInfoScRsp addFriendApplyList(
final FriendApplyListInfoOuterClass.FriendApplyListInfo value) {
bitField0_ |= 0x00000002;
friendApplyList.add(value);
return this;
}
/**
* <code>repeated .FriendApplyListInfo friend_apply_list = 8;</code>
* @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<GetFriendApplyListInfoScRsp> getFactory() {
return GetFriendApplyListInfoScRspFactory.INSTANCE;
}
private enum GetFriendApplyListInfoScRspFactory implements MessageFactory<GetFriendApplyListInfoScRsp> {
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");
}
}
}

View File

@@ -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<GetFriendLoginInfoScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 retcode = 5;</code>
*/
private int retcode;
/**
* <code>optional bool show_red_dot_flag = 1;</code>
*/
private boolean showRedDotFlag;
/**
* <code>optional bool is_allow_other_apply = 10;</code>
*/
private boolean isAllowOtherApply;
/**
* <code>repeated uint32 black_uid_list = 4;</code>
*/
private final RepeatedInt blackUidList = RepeatedInt.newEmptyInstance();
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
*/
private final RepeatedInt friendUidList = RepeatedInt.newEmptyInstance();
private GetFriendLoginInfoScRsp() {
}
/**
* @return a new empty instance of {@code GetFriendLoginInfoScRsp}
*/
public static GetFriendLoginInfoScRsp newInstance() {
return new GetFriendLoginInfoScRsp();
}
/**
* <code>optional uint32 retcode = 5;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 retcode = 5;</code>
* @return this
*/
public GetFriendLoginInfoScRsp clearRetcode() {
bitField0_ &= ~0x00000001;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 5;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 5;</code>
* @param value the retcode to set
* @return this
*/
public GetFriendLoginInfoScRsp setRetcode(final int value) {
bitField0_ |= 0x00000001;
retcode = value;
return this;
}
/**
* <code>optional bool show_red_dot_flag = 1;</code>
* @return whether the showRedDotFlag field is set
*/
public boolean hasShowRedDotFlag() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional bool show_red_dot_flag = 1;</code>
* @return this
*/
public GetFriendLoginInfoScRsp clearShowRedDotFlag() {
bitField0_ &= ~0x00000002;
showRedDotFlag = false;
return this;
}
/**
* <code>optional bool show_red_dot_flag = 1;</code>
* @return the showRedDotFlag
*/
public boolean getShowRedDotFlag() {
return showRedDotFlag;
}
/**
* <code>optional bool show_red_dot_flag = 1;</code>
* @param value the showRedDotFlag to set
* @return this
*/
public GetFriendLoginInfoScRsp setShowRedDotFlag(final boolean value) {
bitField0_ |= 0x00000002;
showRedDotFlag = value;
return this;
}
/**
* <code>optional bool is_allow_other_apply = 10;</code>
* @return whether the isAllowOtherApply field is set
*/
public boolean hasIsAllowOtherApply() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional bool is_allow_other_apply = 10;</code>
* @return this
*/
public GetFriendLoginInfoScRsp clearIsAllowOtherApply() {
bitField0_ &= ~0x00000004;
isAllowOtherApply = false;
return this;
}
/**
* <code>optional bool is_allow_other_apply = 10;</code>
* @return the isAllowOtherApply
*/
public boolean getIsAllowOtherApply() {
return isAllowOtherApply;
}
/**
* <code>optional bool is_allow_other_apply = 10;</code>
* @param value the isAllowOtherApply to set
* @return this
*/
public GetFriendLoginInfoScRsp setIsAllowOtherApply(final boolean value) {
bitField0_ |= 0x00000004;
isAllowOtherApply = value;
return this;
}
/**
* <code>repeated uint32 black_uid_list = 4;</code>
* @return whether the blackUidList field is set
*/
public boolean hasBlackUidList() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>repeated uint32 black_uid_list = 4;</code>
* @return this
*/
public GetFriendLoginInfoScRsp clearBlackUidList() {
bitField0_ &= ~0x00000008;
blackUidList.clear();
return this;
}
/**
* <code>repeated uint32 black_uid_list = 4;</code>
*
* 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;
}
/**
* <code>repeated uint32 black_uid_list = 4;</code>
*
* 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;
}
/**
* <code>repeated uint32 black_uid_list = 4;</code>
* @param value the blackUidList to add
* @return this
*/
public GetFriendLoginInfoScRsp addBlackUidList(final int value) {
bitField0_ |= 0x00000008;
blackUidList.add(value);
return this;
}
/**
* <code>repeated uint32 black_uid_list = 4;</code>
* @param values the blackUidList to add
* @return this
*/
public GetFriendLoginInfoScRsp addAllBlackUidList(final int... values) {
bitField0_ |= 0x00000008;
blackUidList.addAll(values);
return this;
}
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
* @return whether the friendUidList field is set
*/
public boolean hasFriendUidList() {
return (bitField0_ & 0x00000010) != 0;
}
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
* @return this
*/
public GetFriendLoginInfoScRsp clearFriendUidList() {
bitField0_ &= ~0x00000010;
friendUidList.clear();
return this;
}
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
*
* 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;
}
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
*
* 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;
}
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
* @param value the friendUidList to add
* @return this
*/
public GetFriendLoginInfoScRsp addFriendUidList(final int value) {
bitField0_ |= 0x00000010;
friendUidList.add(value);
return this;
}
/**
* <code>repeated uint32 friend_uid_list = 14;</code>
* @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<GetFriendLoginInfoScRsp> getFactory() {
return GetFriendLoginInfoScRspFactory.INSTANCE;
}
private enum GetFriendLoginInfoScRspFactory implements MessageFactory<GetFriendLoginInfoScRsp> {
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");
}
}
}

View File

@@ -23,6 +23,11 @@ public final class GetPlayerDetailInfoScRspOuterClass {
*/
private int retcode;
/**
* <code>optional .PlayerDetailInfo player_detail_info = 6;</code>
*/
private final PlayerDetailInfoOuterClass.PlayerDetailInfo playerDetailInfo = PlayerDetailInfoOuterClass.PlayerDetailInfo.newInstance();
private GetPlayerDetailInfoScRsp() {
}
@@ -70,12 +75,71 @@ public final class GetPlayerDetailInfoScRspOuterClass {
return this;
}
/**
* <code>optional .PlayerDetailInfo player_detail_info = 6;</code>
* @return whether the playerDetailInfo field is set
*/
public boolean hasPlayerDetailInfo() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional .PlayerDetailInfo player_detail_info = 6;</code>
* @return this
*/
public GetPlayerDetailInfoScRsp clearPlayerDetailInfo() {
bitField0_ &= ~0x00000002;
playerDetailInfo.clear();
return this;
}
/**
* <code>optional .PlayerDetailInfo player_detail_info = 6;</code>
*
* 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;
}
/**
* <code>optional .PlayerDetailInfo player_detail_info = 6;</code>
*
* 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;
}
/**
* <code>optional .PlayerDetailInfo player_detail_info = 6;</code>
* @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");
}
}
}

View File

@@ -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<HandleFriendCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 uid = 10;</code>
*/
private int uid;
/**
* <code>optional bool handle_result = 2;</code>
*/
private boolean handleResult;
private HandleFriendCsReq() {
}
/**
* @return a new empty instance of {@code HandleFriendCsReq}
*/
public static HandleFriendCsReq newInstance() {
return new HandleFriendCsReq();
}
/**
* <code>optional uint32 uid = 10;</code>
* @return whether the uid field is set
*/
public boolean hasUid() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 uid = 10;</code>
* @return this
*/
public HandleFriendCsReq clearUid() {
bitField0_ &= ~0x00000001;
uid = 0;
return this;
}
/**
* <code>optional uint32 uid = 10;</code>
* @return the uid
*/
public int getUid() {
return uid;
}
/**
* <code>optional uint32 uid = 10;</code>
* @param value the uid to set
* @return this
*/
public HandleFriendCsReq setUid(final int value) {
bitField0_ |= 0x00000001;
uid = value;
return this;
}
/**
* <code>optional bool handle_result = 2;</code>
* @return whether the handleResult field is set
*/
public boolean hasHandleResult() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional bool handle_result = 2;</code>
* @return this
*/
public HandleFriendCsReq clearHandleResult() {
bitField0_ &= ~0x00000002;
handleResult = false;
return this;
}
/**
* <code>optional bool handle_result = 2;</code>
* @return the handleResult
*/
public boolean getHandleResult() {
return handleResult;
}
/**
* <code>optional bool handle_result = 2;</code>
* @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<HandleFriendCsReq> getFactory() {
return HandleFriendCsReqFactory.INSTANCE;
}
private enum HandleFriendCsReqFactory implements MessageFactory<HandleFriendCsReq> {
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");
}
}
}

View File

@@ -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<HandleFriendScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 uid = 8;</code>
*/
private int uid;
/**
* <code>optional uint32 retcode = 9;</code>
*/
private int retcode;
/**
* <code>optional bool handle_result = 7;</code>
*/
private boolean handleResult;
/**
* <code>optional .FriendListInfo handle_friend_info = 10;</code>
*/
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();
}
/**
* <code>optional uint32 uid = 8;</code>
* @return whether the uid field is set
*/
public boolean hasUid() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 uid = 8;</code>
* @return this
*/
public HandleFriendScRsp clearUid() {
bitField0_ &= ~0x00000001;
uid = 0;
return this;
}
/**
* <code>optional uint32 uid = 8;</code>
* @return the uid
*/
public int getUid() {
return uid;
}
/**
* <code>optional uint32 uid = 8;</code>
* @param value the uid to set
* @return this
*/
public HandleFriendScRsp setUid(final int value) {
bitField0_ |= 0x00000001;
uid = value;
return this;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @return this
*/
public HandleFriendScRsp clearRetcode() {
bitField0_ &= ~0x00000002;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @param value the retcode to set
* @return this
*/
public HandleFriendScRsp setRetcode(final int value) {
bitField0_ |= 0x00000002;
retcode = value;
return this;
}
/**
* <code>optional bool handle_result = 7;</code>
* @return whether the handleResult field is set
*/
public boolean hasHandleResult() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional bool handle_result = 7;</code>
* @return this
*/
public HandleFriendScRsp clearHandleResult() {
bitField0_ &= ~0x00000004;
handleResult = false;
return this;
}
/**
* <code>optional bool handle_result = 7;</code>
* @return the handleResult
*/
public boolean getHandleResult() {
return handleResult;
}
/**
* <code>optional bool handle_result = 7;</code>
* @param value the handleResult to set
* @return this
*/
public HandleFriendScRsp setHandleResult(final boolean value) {
bitField0_ |= 0x00000004;
handleResult = value;
return this;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 10;</code>
* @return whether the handleFriendInfo field is set
*/
public boolean hasHandleFriendInfo() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 10;</code>
* @return this
*/
public HandleFriendScRsp clearHandleFriendInfo() {
bitField0_ &= ~0x00000008;
handleFriendInfo.clear();
return this;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 10;</code>
*
* 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;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 10;</code>
*
* 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;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 10;</code>
* @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<HandleFriendScRsp> getFactory() {
return HandleFriendScRspFactory.INSTANCE;
}
private enum HandleFriendScRspFactory implements MessageFactory<HandleFriendScRsp> {
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");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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<SearchPlayerCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>repeated uint32 search_uid_list = 11;</code>
*/
private final RepeatedInt searchUidList = RepeatedInt.newEmptyInstance();
private SearchPlayerCsReq() {
}
/**
* @return a new empty instance of {@code SearchPlayerCsReq}
*/
public static SearchPlayerCsReq newInstance() {
return new SearchPlayerCsReq();
}
/**
* <code>repeated uint32 search_uid_list = 11;</code>
* @return whether the searchUidList field is set
*/
public boolean hasSearchUidList() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>repeated uint32 search_uid_list = 11;</code>
* @return this
*/
public SearchPlayerCsReq clearSearchUidList() {
bitField0_ &= ~0x00000001;
searchUidList.clear();
return this;
}
/**
* <code>repeated uint32 search_uid_list = 11;</code>
*
* 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;
}
/**
* <code>repeated uint32 search_uid_list = 11;</code>
*
* 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;
}
/**
* <code>repeated uint32 search_uid_list = 11;</code>
* @param value the searchUidList to add
* @return this
*/
public SearchPlayerCsReq addSearchUidList(final int value) {
bitField0_ |= 0x00000001;
searchUidList.add(value);
return this;
}
/**
* <code>repeated uint32 search_uid_list = 11;</code>
* @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<SearchPlayerCsReq> getFactory() {
return SearchPlayerCsReqFactory.INSTANCE;
}
private enum SearchPlayerCsReqFactory implements MessageFactory<SearchPlayerCsReq> {
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");
}
}
}

View File

@@ -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<SearchPlayerScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 retcode = 1;</code>
*/
private int retcode;
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
*/
private final RepeatedInt hBCDGNCPNGB = RepeatedInt.newEmptyInstance();
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
*/
private final RepeatedMessage<SimpleInfoOuterClass.SimpleInfo> searchResultList = RepeatedMessage.newEmptyInstance(SimpleInfoOuterClass.SimpleInfo.getFactory());
private SearchPlayerScRsp() {
}
/**
* @return a new empty instance of {@code SearchPlayerScRsp}
*/
public static SearchPlayerScRsp newInstance() {
return new SearchPlayerScRsp();
}
/**
* <code>optional uint32 retcode = 1;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 retcode = 1;</code>
* @return this
*/
public SearchPlayerScRsp clearRetcode() {
bitField0_ &= ~0x00000001;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 1;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 1;</code>
* @param value the retcode to set
* @return this
*/
public SearchPlayerScRsp setRetcode(final int value) {
bitField0_ |= 0x00000001;
retcode = value;
return this;
}
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
* @return whether the hBCDGNCPNGB field is set
*/
public boolean hasHBCDGNCPNGB() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
* @return this
*/
public SearchPlayerScRsp clearHBCDGNCPNGB() {
bitField0_ &= ~0x00000002;
hBCDGNCPNGB.clear();
return this;
}
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
*
* 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;
}
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
*
* 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;
}
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
* @param value the hBCDGNCPNGB to add
* @return this
*/
public SearchPlayerScRsp addHBCDGNCPNGB(final int value) {
bitField0_ |= 0x00000002;
hBCDGNCPNGB.add(value);
return this;
}
/**
* <code>repeated uint32 HBCDGNCPNGB = 5;</code>
* @param values the hBCDGNCPNGB to add
* @return this
*/
public SearchPlayerScRsp addAllHBCDGNCPNGB(final int... values) {
bitField0_ |= 0x00000002;
hBCDGNCPNGB.addAll(values);
return this;
}
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
* @return whether the searchResultList field is set
*/
public boolean hasSearchResultList() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
* @return this
*/
public SearchPlayerScRsp clearSearchResultList() {
bitField0_ &= ~0x00000004;
searchResultList.clear();
return this;
}
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
*
* 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<SimpleInfoOuterClass.SimpleInfo> getSearchResultList() {
return searchResultList;
}
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
*
* 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<SimpleInfoOuterClass.SimpleInfo> getMutableSearchResultList() {
bitField0_ |= 0x00000004;
return searchResultList;
}
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
* @param value the searchResultList to add
* @return this
*/
public SearchPlayerScRsp addSearchResultList(final SimpleInfoOuterClass.SimpleInfo value) {
bitField0_ |= 0x00000004;
searchResultList.add(value);
return this;
}
/**
* <code>repeated .SimpleInfo search_result_list = 15;</code>
* @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<SearchPlayerScRsp> getFactory() {
return SearchPlayerScRspFactory.INSTANCE;
}
private enum SearchPlayerScRspFactory implements MessageFactory<SearchPlayerScRsp> {
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");
}
}
}

View File

@@ -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<FriendAvatarInfo> implements Cloneable {
public static final class SimpleAvatarInfo extends ProtoMessage<SimpleAvatarInfo> 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 {
* <code>optional uint32 level = 8;</code>
* @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 {
* <code>optional uint32 equipment_unique_id = 13;</code>
* @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 {
* <code>optional uint32 avatar_id = 15;</code>
* @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<FriendAvatarInfo> getFactory() {
return FriendAvatarInfoFactory.INSTANCE;
public static MessageFactory<SimpleAvatarInfo> getFactory() {
return SimpleAvatarInfoFactory.INSTANCE;
}
private enum FriendAvatarInfoFactory implements MessageFactory<FriendAvatarInfo> {
private enum SimpleAvatarInfoFactory implements MessageFactory<SimpleAvatarInfo> {
INSTANCE;
@Override
public FriendAvatarInfo create() {
return FriendAvatarInfo.newInstance();
public SimpleAvatarInfo create() {
return SimpleAvatarInfo.newInstance();
}
}

View File

@@ -30,9 +30,9 @@ public final class SimpleInfoOuterClass {
private int level;
/**
* <code>optional uint32 profile_picture = 10;</code>
* <code>optional uint32 head_icon = 10;</code>
*/
private int profilePicture;
private int headIcon;
/**
* <code>optional uint32 uid = 12;</code>
@@ -50,9 +50,9 @@ public final class SimpleInfoOuterClass {
private int onlineStatus;
/**
* <code>optional .FriendAvatarInfo friend_avatar_info = 3;</code>
* <code>optional .SimpleAvatarInfo simple_avatar_info = 3;</code>
*/
private final FriendAvatarInfoOuterClass.FriendAvatarInfo friendAvatarInfo = FriendAvatarInfoOuterClass.FriendAvatarInfo.newInstance();
private final SimpleAvatarInfoOuterClass.SimpleAvatarInfo simpleAvatarInfo = SimpleAvatarInfoOuterClass.SimpleAvatarInfo.newInstance();
/**
* <code>optional string nickname = 4;</code>
@@ -149,39 +149,39 @@ public final class SimpleInfoOuterClass {
}
/**
* <code>optional uint32 profile_picture = 10;</code>
* @return whether the profilePicture field is set
* <code>optional uint32 head_icon = 10;</code>
* @return whether the headIcon field is set
*/
public boolean hasProfilePicture() {
public boolean hasHeadIcon() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional uint32 profile_picture = 10;</code>
* <code>optional uint32 head_icon = 10;</code>
* @return this
*/
public SimpleInfo clearProfilePicture() {
public SimpleInfo clearHeadIcon() {
bitField0_ &= ~0x00000004;
profilePicture = 0;
headIcon = 0;
return this;
}
/**
* <code>optional uint32 profile_picture = 10;</code>
* @return the profilePicture
* <code>optional uint32 head_icon = 10;</code>
* @return the headIcon
*/
public int getProfilePicture() {
return profilePicture;
public int getHeadIcon() {
return headIcon;
}
/**
* <code>optional uint32 profile_picture = 10;</code>
* @param value the profilePicture to set
* <code>optional uint32 head_icon = 10;</code>
* @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 {
}
/**
* <code>optional .FriendAvatarInfo friend_avatar_info = 3;</code>
* @return whether the friendAvatarInfo field is set
* <code>optional .SimpleAvatarInfo simple_avatar_info = 3;</code>
* @return whether the simpleAvatarInfo field is set
*/
public boolean hasFriendAvatarInfo() {
public boolean hasSimpleAvatarInfo() {
return (bitField0_ & 0x00000040) != 0;
}
/**
* <code>optional .FriendAvatarInfo friend_avatar_info = 3;</code>
* <code>optional .SimpleAvatarInfo simple_avatar_info = 3;</code>
* @return this
*/
public SimpleInfo clearFriendAvatarInfo() {
public SimpleInfo clearSimpleAvatarInfo() {
bitField0_ &= ~0x00000040;
friendAvatarInfo.clear();
simpleAvatarInfo.clear();
return this;
}
/**
* <code>optional .FriendAvatarInfo friend_avatar_info = 3;</code>
* <code>optional .SimpleAvatarInfo simple_avatar_info = 3;</code>
*
* 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;
}
/**
* <code>optional .FriendAvatarInfo friend_avatar_info = 3;</code>
* <code>optional .SimpleAvatarInfo simple_avatar_info = 3;</code>
*
* 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;
}
/**
* <code>optional .FriendAvatarInfo friend_avatar_info = 3;</code>
* @param value the friendAvatarInfo to set
* <code>optional .SimpleAvatarInfo simple_avatar_info = 3;</code>
* @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");

View File

@@ -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<SyncApplyFriendScNotify> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .FriendApplyListInfo friend_apply_info = 5;</code>
*/
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();
}
/**
* <code>optional .FriendApplyListInfo friend_apply_info = 5;</code>
* @return whether the friendApplyInfo field is set
*/
public boolean hasFriendApplyInfo() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .FriendApplyListInfo friend_apply_info = 5;</code>
* @return this
*/
public SyncApplyFriendScNotify clearFriendApplyInfo() {
bitField0_ &= ~0x00000001;
friendApplyInfo.clear();
return this;
}
/**
* <code>optional .FriendApplyListInfo friend_apply_info = 5;</code>
*
* 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;
}
/**
* <code>optional .FriendApplyListInfo friend_apply_info = 5;</code>
*
* 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;
}
/**
* <code>optional .FriendApplyListInfo friend_apply_info = 5;</code>
* @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<SyncApplyFriendScNotify> getFactory() {
return SyncApplyFriendScNotifyFactory.INSTANCE;
}
private enum SyncApplyFriendScNotifyFactory implements MessageFactory<SyncApplyFriendScNotify> {
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");
}
}
}

View File

@@ -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<SyncDeleteFriendScNotify> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 uid = 11;</code>
*/
private int uid;
private SyncDeleteFriendScNotify() {
}
/**
* @return a new empty instance of {@code SyncDeleteFriendScNotify}
*/
public static SyncDeleteFriendScNotify newInstance() {
return new SyncDeleteFriendScNotify();
}
/**
* <code>optional uint32 uid = 11;</code>
* @return whether the uid field is set
*/
public boolean hasUid() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 uid = 11;</code>
* @return this
*/
public SyncDeleteFriendScNotify clearUid() {
bitField0_ &= ~0x00000001;
uid = 0;
return this;
}
/**
* <code>optional uint32 uid = 11;</code>
* @return the uid
*/
public int getUid() {
return uid;
}
/**
* <code>optional uint32 uid = 11;</code>
* @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<SyncDeleteFriendScNotify> getFactory() {
return SyncDeleteFriendScNotifyFactory.INSTANCE;
}
private enum SyncDeleteFriendScNotifyFactory implements MessageFactory<SyncDeleteFriendScNotify> {
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");
}
}
}

View File

@@ -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<SyncHandleFriendScNotify> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 uid = 14;</code>
*/
private int uid;
/**
* <code>optional bool handle_result = 13;</code>
*/
private boolean handleResult;
/**
* <code>optional .FriendListInfo handle_friend_info = 12;</code>
*/
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();
}
/**
* <code>optional uint32 uid = 14;</code>
* @return whether the uid field is set
*/
public boolean hasUid() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 uid = 14;</code>
* @return this
*/
public SyncHandleFriendScNotify clearUid() {
bitField0_ &= ~0x00000001;
uid = 0;
return this;
}
/**
* <code>optional uint32 uid = 14;</code>
* @return the uid
*/
public int getUid() {
return uid;
}
/**
* <code>optional uint32 uid = 14;</code>
* @param value the uid to set
* @return this
*/
public SyncHandleFriendScNotify setUid(final int value) {
bitField0_ |= 0x00000001;
uid = value;
return this;
}
/**
* <code>optional bool handle_result = 13;</code>
* @return whether the handleResult field is set
*/
public boolean hasHandleResult() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional bool handle_result = 13;</code>
* @return this
*/
public SyncHandleFriendScNotify clearHandleResult() {
bitField0_ &= ~0x00000002;
handleResult = false;
return this;
}
/**
* <code>optional bool handle_result = 13;</code>
* @return the handleResult
*/
public boolean getHandleResult() {
return handleResult;
}
/**
* <code>optional bool handle_result = 13;</code>
* @param value the handleResult to set
* @return this
*/
public SyncHandleFriendScNotify setHandleResult(final boolean value) {
bitField0_ |= 0x00000002;
handleResult = value;
return this;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 12;</code>
* @return whether the handleFriendInfo field is set
*/
public boolean hasHandleFriendInfo() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 12;</code>
* @return this
*/
public SyncHandleFriendScNotify clearHandleFriendInfo() {
bitField0_ &= ~0x00000004;
handleFriendInfo.clear();
return this;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 12;</code>
*
* 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;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 12;</code>
*
* 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;
}
/**
* <code>optional .FriendListInfo handle_friend_info = 12;</code>
* @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<SyncHandleFriendScNotify> getFactory() {
return SyncHandleFriendScNotifyFactory.INSTANCE;
}
private enum SyncHandleFriendScNotifyFactory implements MessageFactory<SyncHandleFriendScNotify> {
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");
}
}
}

View File

@@ -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

View File

@@ -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<Friendship> friends;
@Getter(AccessLevel.PUBLIC)
private final Int2ObjectMap<Friendship> 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<Friendship>();
this.pendingFriends = new Int2ObjectOpenHashMap<Friendship>();
}
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;
}
}

View File

@@ -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;
}
}

View File

@@ -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();
}
}

View File

@@ -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());

View File

@@ -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) {

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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()));
}
}

View File

@@ -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));
}
}

View File

@@ -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());
}
}

View File

@@ -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<Player> 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));
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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<Player> 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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}