GetMainMissionCustomValue handler

This commit is contained in:
Hiro
2023-11-30 11:12:56 +02:00
parent 775726459b
commit edee1accf2
5 changed files with 1115 additions and 0 deletions

View File

@@ -0,0 +1,303 @@
// 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 GetMainMissionCustomValueCsReqOuterClass {
/**
* Protobuf type {@code GetMainMissionCustomValueCsReq}
*/
public static final class GetMainMissionCustomValueCsReq extends ProtoMessage<GetMainMissionCustomValueCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>repeated uint32 main_mission_id_list = 13;</code>
*/
private final RepeatedInt mainMissionIdList = RepeatedInt.newEmptyInstance();
private GetMainMissionCustomValueCsReq() {
}
/**
* @return a new empty instance of {@code GetMainMissionCustomValueCsReq}
*/
public static GetMainMissionCustomValueCsReq newInstance() {
return new GetMainMissionCustomValueCsReq();
}
/**
* <code>repeated uint32 main_mission_id_list = 13;</code>
* @return whether the mainMissionIdList field is set
*/
public boolean hasMainMissionIdList() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>repeated uint32 main_mission_id_list = 13;</code>
* @return this
*/
public GetMainMissionCustomValueCsReq clearMainMissionIdList() {
bitField0_ &= ~0x00000001;
mainMissionIdList.clear();
return this;
}
/**
* <code>repeated uint32 main_mission_id_list = 13;</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 #getMutableMainMissionIdList()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedInt getMainMissionIdList() {
return mainMissionIdList;
}
/**
* <code>repeated uint32 main_mission_id_list = 13;</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 getMutableMainMissionIdList() {
bitField0_ |= 0x00000001;
return mainMissionIdList;
}
/**
* <code>repeated uint32 main_mission_id_list = 13;</code>
* @param value the mainMissionIdList to add
* @return this
*/
public GetMainMissionCustomValueCsReq addMainMissionIdList(final int value) {
bitField0_ |= 0x00000001;
mainMissionIdList.add(value);
return this;
}
/**
* <code>repeated uint32 main_mission_id_list = 13;</code>
* @param values the mainMissionIdList to add
* @return this
*/
public GetMainMissionCustomValueCsReq addAllMainMissionIdList(final int... values) {
bitField0_ |= 0x00000001;
mainMissionIdList.addAll(values);
return this;
}
@Override
public GetMainMissionCustomValueCsReq copyFrom(final GetMainMissionCustomValueCsReq other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
mainMissionIdList.copyFrom(other.mainMissionIdList);
}
return this;
}
@Override
public GetMainMissionCustomValueCsReq mergeFrom(final GetMainMissionCustomValueCsReq other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasMainMissionIdList()) {
getMutableMainMissionIdList().addAll(other.mainMissionIdList);
}
return this;
}
@Override
public GetMainMissionCustomValueCsReq clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
mainMissionIdList.clear();
return this;
}
@Override
public GetMainMissionCustomValueCsReq clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
mainMissionIdList.clear();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof GetMainMissionCustomValueCsReq)) {
return false;
}
GetMainMissionCustomValueCsReq other = (GetMainMissionCustomValueCsReq) o;
return bitField0_ == other.bitField0_
&& (!hasMainMissionIdList() || mainMissionIdList.equals(other.mainMissionIdList));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
for (int i = 0; i < mainMissionIdList.length(); i++) {
output.writeRawByte((byte) 104);
output.writeUInt32NoTag(mainMissionIdList.array()[i]);
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += (1 * mainMissionIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(mainMissionIdList);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public GetMainMissionCustomValueCsReq mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 106: {
// mainMissionIdList [packed=true]
input.readPackedUInt32(mainMissionIdList, 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 104: {
// mainMissionIdList [packed=false]
tag = input.readRepeatedUInt32(mainMissionIdList, tag);
bitField0_ |= 0x00000001;
break;
}
}
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeRepeatedUInt32(FieldNames.mainMissionIdList, mainMissionIdList);
}
output.endObject();
}
@Override
public GetMainMissionCustomValueCsReq mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 1438400460:
case -1382679799: {
if (input.isAtField(FieldNames.mainMissionIdList)) {
if (!input.trySkipNullValue()) {
input.readRepeatedUInt32(mainMissionIdList);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public GetMainMissionCustomValueCsReq clone() {
return new GetMainMissionCustomValueCsReq().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static GetMainMissionCustomValueCsReq parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new GetMainMissionCustomValueCsReq(), data).checkInitialized();
}
public static GetMainMissionCustomValueCsReq parseFrom(final ProtoSource input) throws
IOException {
return ProtoMessage.mergeFrom(new GetMainMissionCustomValueCsReq(), input).checkInitialized();
}
public static GetMainMissionCustomValueCsReq parseFrom(final JsonSource input) throws
IOException {
return ProtoMessage.mergeFrom(new GetMainMissionCustomValueCsReq(), input).checkInitialized();
}
/**
* @return factory for creating GetMainMissionCustomValueCsReq messages
*/
public static MessageFactory<GetMainMissionCustomValueCsReq> getFactory() {
return GetMainMissionCustomValueCsReqFactory.INSTANCE;
}
private enum GetMainMissionCustomValueCsReqFactory implements MessageFactory<GetMainMissionCustomValueCsReq> {
INSTANCE;
@Override
public GetMainMissionCustomValueCsReq create() {
return GetMainMissionCustomValueCsReq.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName mainMissionIdList = FieldName.forField("mainMissionIdList", "main_mission_id_list");
}
}
}

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 GetMainMissionCustomValueScRspOuterClass {
/**
* Protobuf type {@code GetMainMissionCustomValueScRsp}
*/
public static final class GetMainMissionCustomValueScRsp extends ProtoMessage<GetMainMissionCustomValueScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 retcode = 2;</code>
*/
private int retcode;
/**
* <code>repeated .MainMission main_mission_list = 5;</code>
*/
private final RepeatedMessage<MainMissionOuterClass.MainMission> mainMissionList = RepeatedMessage.newEmptyInstance(MainMissionOuterClass.MainMission.getFactory());
private GetMainMissionCustomValueScRsp() {
}
/**
* @return a new empty instance of {@code GetMainMissionCustomValueScRsp}
*/
public static GetMainMissionCustomValueScRsp newInstance() {
return new GetMainMissionCustomValueScRsp();
}
/**
* <code>optional uint32 retcode = 2;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 retcode = 2;</code>
* @return this
*/
public GetMainMissionCustomValueScRsp clearRetcode() {
bitField0_ &= ~0x00000001;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 2;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 2;</code>
* @param value the retcode to set
* @return this
*/
public GetMainMissionCustomValueScRsp setRetcode(final int value) {
bitField0_ |= 0x00000001;
retcode = value;
return this;
}
/**
* <code>repeated .MainMission main_mission_list = 5;</code>
* @return whether the mainMissionList field is set
*/
public boolean hasMainMissionList() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>repeated .MainMission main_mission_list = 5;</code>
* @return this
*/
public GetMainMissionCustomValueScRsp clearMainMissionList() {
bitField0_ &= ~0x00000002;
mainMissionList.clear();
return this;
}
/**
* <code>repeated .MainMission main_mission_list = 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 #getMutableMainMissionList()} if you want to modify it.
*
* @return internal storage object for reading
*/
public RepeatedMessage<MainMissionOuterClass.MainMission> getMainMissionList() {
return mainMissionList;
}
/**
* <code>repeated .MainMission main_mission_list = 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 RepeatedMessage<MainMissionOuterClass.MainMission> getMutableMainMissionList() {
bitField0_ |= 0x00000002;
return mainMissionList;
}
/**
* <code>repeated .MainMission main_mission_list = 5;</code>
* @param value the mainMissionList to add
* @return this
*/
public GetMainMissionCustomValueScRsp addMainMissionList(
final MainMissionOuterClass.MainMission value) {
bitField0_ |= 0x00000002;
mainMissionList.add(value);
return this;
}
/**
* <code>repeated .MainMission main_mission_list = 5;</code>
* @param values the mainMissionList to add
* @return this
*/
public GetMainMissionCustomValueScRsp addAllMainMissionList(
final MainMissionOuterClass.MainMission... values) {
bitField0_ |= 0x00000002;
mainMissionList.addAll(values);
return this;
}
@Override
public GetMainMissionCustomValueScRsp copyFrom(final GetMainMissionCustomValueScRsp other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
retcode = other.retcode;
mainMissionList.copyFrom(other.mainMissionList);
}
return this;
}
@Override
public GetMainMissionCustomValueScRsp mergeFrom(final GetMainMissionCustomValueScRsp other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasRetcode()) {
setRetcode(other.retcode);
}
if (other.hasMainMissionList()) {
getMutableMainMissionList().addAll(other.mainMissionList);
}
return this;
}
@Override
public GetMainMissionCustomValueScRsp clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
retcode = 0;
mainMissionList.clear();
return this;
}
@Override
public GetMainMissionCustomValueScRsp clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
mainMissionList.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof GetMainMissionCustomValueScRsp)) {
return false;
}
GetMainMissionCustomValueScRsp other = (GetMainMissionCustomValueScRsp) o;
return bitField0_ == other.bitField0_
&& (!hasRetcode() || retcode == other.retcode)
&& (!hasMainMissionList() || mainMissionList.equals(other.mainMissionList));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 16);
output.writeUInt32NoTag(retcode);
}
if ((bitField0_ & 0x00000002) != 0) {
for (int i = 0; i < mainMissionList.length(); i++) {
output.writeRawByte((byte) 42);
output.writeMessageNoTag(mainMissionList.get(i));
}
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
}
if ((bitField0_ & 0x00000002) != 0) {
size += (1 * mainMissionList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(mainMissionList);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public GetMainMissionCustomValueScRsp mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 16: {
// retcode
retcode = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 42) {
break;
}
}
case 42: {
// mainMissionList
tag = input.readRepeatedMessage(mainMissionList, 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.mainMissionList, mainMissionList);
}
output.endObject();
}
@Override
public GetMainMissionCustomValueScRsp 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 -1352596271:
case 939604023: {
if (input.isAtField(FieldNames.mainMissionList)) {
if (!input.trySkipNullValue()) {
input.readRepeatedMessage(mainMissionList);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public GetMainMissionCustomValueScRsp clone() {
return new GetMainMissionCustomValueScRsp().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static GetMainMissionCustomValueScRsp parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new GetMainMissionCustomValueScRsp(), data).checkInitialized();
}
public static GetMainMissionCustomValueScRsp parseFrom(final ProtoSource input) throws
IOException {
return ProtoMessage.mergeFrom(new GetMainMissionCustomValueScRsp(), input).checkInitialized();
}
public static GetMainMissionCustomValueScRsp parseFrom(final JsonSource input) throws
IOException {
return ProtoMessage.mergeFrom(new GetMainMissionCustomValueScRsp(), input).checkInitialized();
}
/**
* @return factory for creating GetMainMissionCustomValueScRsp messages
*/
public static MessageFactory<GetMainMissionCustomValueScRsp> getFactory() {
return GetMainMissionCustomValueScRspFactory.INSTANCE;
}
private enum GetMainMissionCustomValueScRspFactory implements MessageFactory<GetMainMissionCustomValueScRsp> {
INSTANCE;
@Override
public GetMainMissionCustomValueScRsp create() {
return GetMainMissionCustomValueScRsp.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName retcode = FieldName.forField("retcode");
static final FieldName mainMissionList = FieldName.forField("mainMissionList", "main_mission_list");
}
}
}

View File

@@ -0,0 +1,391 @@
// 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 MainMissionOuterClass {
/**
* Protobuf type {@code MainMission}
*/
public static final class MainMission extends ProtoMessage<MainMission> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 id = 4;</code>
*/
private int id;
/**
* <pre>
* repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
* </pre>
*
* <code>optional .MissionStatus status = 9;</code>
*/
private int status;
private MainMission() {
}
/**
* @return a new empty instance of {@code MainMission}
*/
public static MainMission newInstance() {
return new MainMission();
}
/**
* <code>optional uint32 id = 4;</code>
* @return whether the id field is set
*/
public boolean hasId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 id = 4;</code>
* @return this
*/
public MainMission clearId() {
bitField0_ &= ~0x00000001;
id = 0;
return this;
}
/**
* <code>optional uint32 id = 4;</code>
* @return the id
*/
public int getId() {
return id;
}
/**
* <code>optional uint32 id = 4;</code>
* @param value the id to set
* @return this
*/
public MainMission setId(final int value) {
bitField0_ |= 0x00000001;
id = value;
return this;
}
/**
* <pre>
* repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
* </pre>
*
* <code>optional .MissionStatus status = 9;</code>
* @return whether the status field is set
*/
public boolean hasStatus() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <pre>
* repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
* </pre>
*
* <code>optional .MissionStatus status = 9;</code>
* @return this
*/
public MainMission clearStatus() {
bitField0_ &= ~0x00000002;
status = 0;
return this;
}
/**
* <pre>
* repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
* </pre>
*
* <code>optional .MissionStatus status = 9;</code>
* @return the status
*/
public MissionStatusOuterClass.MissionStatus getStatus() {
return MissionStatusOuterClass.MissionStatus.forNumber(status);
}
/**
* Gets the value of the internal enum store. The result is
* equivalent to {@link MainMission#getStatus()}.getNumber().
*
* @return numeric wire representation
*/
public int getStatusValue() {
return status;
}
/**
* 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 MissionStatusOuterClass.MissionStatus}. Setting an invalid value
* can cause {@link MainMission#getStatus()} to return null
*
* @param value the numeric wire value to set
* @return this
*/
public MainMission setStatusValue(final int value) {
bitField0_ |= 0x00000002;
status = value;
return this;
}
/**
* <pre>
* repeated AMHBFDNMDLF AKGBLNHFPLG = 14;
* </pre>
*
* <code>optional .MissionStatus status = 9;</code>
* @param value the status to set
* @return this
*/
public MainMission setStatus(final MissionStatusOuterClass.MissionStatus value) {
bitField0_ |= 0x00000002;
status = value.getNumber();
return this;
}
@Override
public MainMission copyFrom(final MainMission other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
id = other.id;
status = other.status;
}
return this;
}
@Override
public MainMission mergeFrom(final MainMission other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasId()) {
setId(other.id);
}
if (other.hasStatus()) {
setStatusValue(other.status);
}
return this;
}
@Override
public MainMission clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
id = 0;
status = 0;
return this;
}
@Override
public MainMission 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 MainMission)) {
return false;
}
MainMission other = (MainMission) o;
return bitField0_ == other.bitField0_
&& (!hasId() || id == other.id)
&& (!hasStatus() || status == other.status);
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 32);
output.writeUInt32NoTag(id);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 72);
output.writeEnumNoTag(status);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeEnumSizeNoTag(status);
}
return size;
}
@Override
@SuppressWarnings("fallthrough")
public MainMission mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
int tag = input.readTag();
while (true) {
switch (tag) {
case 32: {
// id
id = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 72) {
break;
}
}
case 72: {
// status
final int value = input.readInt32();
if (MissionStatusOuterClass.MissionStatus.forNumber(value) != null) {
status = 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.id, id);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeEnum(FieldNames.status, status, MissionStatusOuterClass.MissionStatus.converter());
}
output.endObject();
}
@Override
public MainMission mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case 3355: {
if (input.isAtField(FieldNames.id)) {
if (!input.trySkipNullValue()) {
id = input.readUInt32();
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -892481550: {
if (input.isAtField(FieldNames.status)) {
if (!input.trySkipNullValue()) {
final MissionStatusOuterClass.MissionStatus value = input.readEnum(MissionStatusOuterClass.MissionStatus.converter());
if (value != null) {
status = value.getNumber();
bitField0_ |= 0x00000002;
} else {
input.skipUnknownEnumValue();
}
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.skipUnknownField();
break;
}
}
}
input.endObject();
return this;
}
@Override
public MainMission clone() {
return new MainMission().copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
}
public static MainMission parseFrom(final byte[] data) throws InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new MainMission(), data).checkInitialized();
}
public static MainMission parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new MainMission(), input).checkInitialized();
}
public static MainMission parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new MainMission(), input).checkInitialized();
}
/**
* @return factory for creating MainMission messages
*/
public static MessageFactory<MainMission> getFactory() {
return MainMissionFactory.INSTANCE;
}
private enum MainMissionFactory implements MessageFactory<MainMission> {
INSTANCE;
@Override
public MainMission create() {
return MainMission.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName id = FieldName.forField("id");
static final FieldName status = FieldName.forField("status");
}
}
}

View File

@@ -0,0 +1,18 @@
package emu.lunarcore.server.packet.recv;
import emu.lunarcore.server.game.GameSession;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.proto.GetMainMissionCustomValueCsReqOuterClass.GetMainMissionCustomValueCsReq;
import emu.lunarcore.server.packet.send.PacketGetMainMissionCustomValueScRsp;
@Opcodes(CmdId.GetMainMissionCustomValueCsReq)
public class HandlerGetMainMissionCustomValueCsReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] data) throws Exception {
var req = GetMainMissionCustomValueCsReq.parseFrom(data);
session.send(new PacketGetMainMissionCustomValueScRsp(req.getMainMissionIdList().toArray()));
}
}

View File

@@ -0,0 +1,25 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.data.GameData;
import emu.lunarcore.proto.GetMainMissionCustomValueScRspOuterClass.GetMainMissionCustomValueScRsp;
import emu.lunarcore.proto.MainMissionOuterClass.MainMission;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
public class PacketGetMainMissionCustomValueScRsp extends BasePacket {
// TODO cache packet
public PacketGetMainMissionCustomValueScRsp(int[] mainMissionIdList) {
super(CmdId.GetMainMissionCustomValueScRsp);
var data = GetMainMissionCustomValueScRsp.newInstance();
for (int mainMissionId : mainMissionIdList) {
MainMission mainMission = MainMission.newInstance()
.setId(mainMissionId);
data.addMainMissionList(mainMission);
}
this.setData(data);
}
}