mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-15 06:45:04 +01:00
Fix challenge rewards not working due to new update behavior
This commit is contained in:
@@ -23,11 +23,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
*/
|
*/
|
||||||
private int groupId;
|
private int groupId;
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 10;</code>
|
|
||||||
*/
|
|
||||||
private int starCount;
|
|
||||||
|
|
||||||
private TakeChallengeRewardCsReq() {
|
private TakeChallengeRewardCsReq() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,50 +70,12 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 10;</code>
|
|
||||||
* @return whether the starCount field is set
|
|
||||||
*/
|
|
||||||
public boolean hasStarCount() {
|
|
||||||
return (bitField0_ & 0x00000002) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 10;</code>
|
|
||||||
* @return this
|
|
||||||
*/
|
|
||||||
public TakeChallengeRewardCsReq clearStarCount() {
|
|
||||||
bitField0_ &= ~0x00000002;
|
|
||||||
starCount = 0;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 10;</code>
|
|
||||||
* @return the starCount
|
|
||||||
*/
|
|
||||||
public int getStarCount() {
|
|
||||||
return starCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 10;</code>
|
|
||||||
* @param value the starCount to set
|
|
||||||
* @return this
|
|
||||||
*/
|
|
||||||
public TakeChallengeRewardCsReq setStarCount(final int value) {
|
|
||||||
bitField0_ |= 0x00000002;
|
|
||||||
starCount = value;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TakeChallengeRewardCsReq copyFrom(final TakeChallengeRewardCsReq other) {
|
public TakeChallengeRewardCsReq copyFrom(final TakeChallengeRewardCsReq other) {
|
||||||
cachedSize = other.cachedSize;
|
cachedSize = other.cachedSize;
|
||||||
if ((bitField0_ | other.bitField0_) != 0) {
|
if ((bitField0_ | other.bitField0_) != 0) {
|
||||||
bitField0_ = other.bitField0_;
|
bitField0_ = other.bitField0_;
|
||||||
groupId = other.groupId;
|
groupId = other.groupId;
|
||||||
starCount = other.starCount;
|
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -132,9 +89,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
if (other.hasGroupId()) {
|
if (other.hasGroupId()) {
|
||||||
setGroupId(other.groupId);
|
setGroupId(other.groupId);
|
||||||
}
|
}
|
||||||
if (other.hasStarCount()) {
|
|
||||||
setStarCount(other.starCount);
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +100,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
cachedSize = -1;
|
cachedSize = -1;
|
||||||
bitField0_ = 0;
|
bitField0_ = 0;
|
||||||
groupId = 0;
|
groupId = 0;
|
||||||
starCount = 0;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,8 +123,7 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
}
|
}
|
||||||
TakeChallengeRewardCsReq other = (TakeChallengeRewardCsReq) o;
|
TakeChallengeRewardCsReq other = (TakeChallengeRewardCsReq) o;
|
||||||
return bitField0_ == other.bitField0_
|
return bitField0_ == other.bitField0_
|
||||||
&& (!hasGroupId() || groupId == other.groupId)
|
&& (!hasGroupId() || groupId == other.groupId);
|
||||||
&& (!hasStarCount() || starCount == other.starCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -180,10 +132,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
output.writeRawByte((byte) 8);
|
output.writeRawByte((byte) 8);
|
||||||
output.writeUInt32NoTag(groupId);
|
output.writeUInt32NoTag(groupId);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000002) != 0) {
|
|
||||||
output.writeRawByte((byte) 80);
|
|
||||||
output.writeUInt32NoTag(starCount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -192,9 +140,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
if ((bitField0_ & 0x00000001) != 0) {
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId);
|
size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000002) != 0) {
|
|
||||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(starCount);
|
|
||||||
}
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,15 +155,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
groupId = input.readUInt32();
|
groupId = input.readUInt32();
|
||||||
bitField0_ |= 0x00000001;
|
bitField0_ |= 0x00000001;
|
||||||
tag = input.readTag();
|
tag = input.readTag();
|
||||||
if (tag != 80) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 80: {
|
|
||||||
// starCount
|
|
||||||
starCount = input.readUInt32();
|
|
||||||
bitField0_ |= 0x00000002;
|
|
||||||
tag = input.readTag();
|
|
||||||
if (tag != 0) {
|
if (tag != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -243,9 +179,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
if ((bitField0_ & 0x00000001) != 0) {
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
output.writeUInt32(FieldNames.groupId, groupId);
|
output.writeUInt32(FieldNames.groupId, groupId);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000002) != 0) {
|
|
||||||
output.writeUInt32(FieldNames.starCount, starCount);
|
|
||||||
}
|
|
||||||
output.endObject();
|
output.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,18 +201,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2121235933:
|
|
||||||
case 2124166370: {
|
|
||||||
if (input.isAtField(FieldNames.starCount)) {
|
|
||||||
if (!input.trySkipNullValue()) {
|
|
||||||
starCount = input.readUInt32();
|
|
||||||
bitField0_ |= 0x00000002;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
input.skipUnknownField();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
default: {
|
||||||
input.skipUnknownField();
|
input.skipUnknownField();
|
||||||
break;
|
break;
|
||||||
@@ -334,8 +255,6 @@ public final class TakeChallengeRewardCsReqOuterClass {
|
|||||||
*/
|
*/
|
||||||
static class FieldNames {
|
static class FieldNames {
|
||||||
static final FieldName groupId = FieldName.forField("groupId", "group_id");
|
static final FieldName groupId = FieldName.forField("groupId", "group_id");
|
||||||
|
|
||||||
static final FieldName starCount = FieldName.forField("starCount", "star_count");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import us.hebi.quickbuf.MessageFactory;
|
|||||||
import us.hebi.quickbuf.ProtoMessage;
|
import us.hebi.quickbuf.ProtoMessage;
|
||||||
import us.hebi.quickbuf.ProtoSink;
|
import us.hebi.quickbuf.ProtoSink;
|
||||||
import us.hebi.quickbuf.ProtoSource;
|
import us.hebi.quickbuf.ProtoSource;
|
||||||
|
import us.hebi.quickbuf.RepeatedMessage;
|
||||||
|
|
||||||
public final class TakeChallengeRewardScRspOuterClass {
|
public final class TakeChallengeRewardScRspOuterClass {
|
||||||
/**
|
/**
|
||||||
@@ -18,11 +19,6 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
public static final class TakeChallengeRewardScRsp extends ProtoMessage<TakeChallengeRewardScRsp> implements Cloneable {
|
public static final class TakeChallengeRewardScRsp extends ProtoMessage<TakeChallengeRewardScRsp> implements Cloneable {
|
||||||
private static final long serialVersionUID = 0L;
|
private static final long serialVersionUID = 0L;
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 1;</code>
|
|
||||||
*/
|
|
||||||
private int starCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional uint32 group_id = 6;</code>
|
* <code>optional uint32 group_id = 6;</code>
|
||||||
*/
|
*/
|
||||||
@@ -34,9 +30,9 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
private int retcode;
|
private int retcode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional .ItemList reward = 15;</code>
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
*/
|
*/
|
||||||
private final ItemListOuterClass.ItemList reward = ItemListOuterClass.ItemList.newInstance();
|
private final RepeatedMessage<TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo> takenRewardList = RepeatedMessage.newEmptyInstance(TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo.getFactory());
|
||||||
|
|
||||||
private TakeChallengeRewardScRsp() {
|
private TakeChallengeRewardScRsp() {
|
||||||
}
|
}
|
||||||
@@ -48,49 +44,12 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
return new TakeChallengeRewardScRsp();
|
return new TakeChallengeRewardScRsp();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 1;</code>
|
|
||||||
* @return whether the starCount field is set
|
|
||||||
*/
|
|
||||||
public boolean hasStarCount() {
|
|
||||||
return (bitField0_ & 0x00000001) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 1;</code>
|
|
||||||
* @return this
|
|
||||||
*/
|
|
||||||
public TakeChallengeRewardScRsp clearStarCount() {
|
|
||||||
bitField0_ &= ~0x00000001;
|
|
||||||
starCount = 0;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 1;</code>
|
|
||||||
* @return the starCount
|
|
||||||
*/
|
|
||||||
public int getStarCount() {
|
|
||||||
return starCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <code>optional uint32 star_count = 1;</code>
|
|
||||||
* @param value the starCount to set
|
|
||||||
* @return this
|
|
||||||
*/
|
|
||||||
public TakeChallengeRewardScRsp setStarCount(final int value) {
|
|
||||||
bitField0_ |= 0x00000001;
|
|
||||||
starCount = value;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional uint32 group_id = 6;</code>
|
* <code>optional uint32 group_id = 6;</code>
|
||||||
* @return whether the groupId field is set
|
* @return whether the groupId field is set
|
||||||
*/
|
*/
|
||||||
public boolean hasGroupId() {
|
public boolean hasGroupId() {
|
||||||
return (bitField0_ & 0x00000002) != 0;
|
return (bitField0_ & 0x00000001) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,7 +57,7 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public TakeChallengeRewardScRsp clearGroupId() {
|
public TakeChallengeRewardScRsp clearGroupId() {
|
||||||
bitField0_ &= ~0x00000002;
|
bitField0_ &= ~0x00000001;
|
||||||
groupId = 0;
|
groupId = 0;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -117,7 +76,7 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public TakeChallengeRewardScRsp setGroupId(final int value) {
|
public TakeChallengeRewardScRsp setGroupId(final int value) {
|
||||||
bitField0_ |= 0x00000002;
|
bitField0_ |= 0x00000001;
|
||||||
groupId = value;
|
groupId = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -127,7 +86,7 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
* @return whether the retcode field is set
|
* @return whether the retcode field is set
|
||||||
*/
|
*/
|
||||||
public boolean hasRetcode() {
|
public boolean hasRetcode() {
|
||||||
return (bitField0_ & 0x00000004) != 0;
|
return (bitField0_ & 0x00000002) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -135,7 +94,7 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public TakeChallengeRewardScRsp clearRetcode() {
|
public TakeChallengeRewardScRsp clearRetcode() {
|
||||||
bitField0_ &= ~0x00000004;
|
bitField0_ &= ~0x00000002;
|
||||||
retcode = 0;
|
retcode = 0;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -154,45 +113,46 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public TakeChallengeRewardScRsp setRetcode(final int value) {
|
public TakeChallengeRewardScRsp setRetcode(final int value) {
|
||||||
bitField0_ |= 0x00000004;
|
bitField0_ |= 0x00000002;
|
||||||
retcode = value;
|
retcode = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional .ItemList reward = 15;</code>
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
* @return whether the reward field is set
|
* @return whether the takenRewardList field is set
|
||||||
*/
|
*/
|
||||||
public boolean hasReward() {
|
public boolean hasTakenRewardList() {
|
||||||
return (bitField0_ & 0x00000008) != 0;
|
return (bitField0_ & 0x00000004) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional .ItemList reward = 15;</code>
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public TakeChallengeRewardScRsp clearReward() {
|
public TakeChallengeRewardScRsp clearTakenRewardList() {
|
||||||
bitField0_ &= ~0x00000008;
|
bitField0_ &= ~0x00000004;
|
||||||
reward.clear();
|
takenRewardList.clear();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional .ItemList reward = 15;</code>
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
*
|
*
|
||||||
* This method returns the internal storage object without modifying any has state.
|
* 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.
|
* The returned object should not be modified and be treated as read-only.
|
||||||
*
|
*
|
||||||
* Use {@link #getMutableReward()} if you want to modify it.
|
* Use {@link #getMutableTakenRewardList()} if you want to modify it.
|
||||||
*
|
*
|
||||||
* @return internal storage object for reading
|
* @return internal storage object for reading
|
||||||
*/
|
*/
|
||||||
public ItemListOuterClass.ItemList getReward() {
|
public RepeatedMessage<TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo> getTakenRewardList(
|
||||||
return reward;
|
) {
|
||||||
|
return takenRewardList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional .ItemList reward = 15;</code>
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
*
|
*
|
||||||
* This method returns the internal storage object and sets the corresponding
|
* This method returns the internal storage object and sets the corresponding
|
||||||
* has state. The returned object will become part of this message and its
|
* has state. The returned object will become part of this message and its
|
||||||
@@ -200,19 +160,33 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
*
|
*
|
||||||
* @return internal storage object for modifications
|
* @return internal storage object for modifications
|
||||||
*/
|
*/
|
||||||
public ItemListOuterClass.ItemList getMutableReward() {
|
public RepeatedMessage<TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo> getMutableTakenRewardList(
|
||||||
bitField0_ |= 0x00000008;
|
) {
|
||||||
return reward;
|
bitField0_ |= 0x00000004;
|
||||||
|
return takenRewardList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>optional .ItemList reward = 15;</code>
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
* @param value the reward to set
|
* @param value the takenRewardList to add
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public TakeChallengeRewardScRsp setReward(final ItemListOuterClass.ItemList value) {
|
public TakeChallengeRewardScRsp addTakenRewardList(
|
||||||
bitField0_ |= 0x00000008;
|
final TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo value) {
|
||||||
reward.copyFrom(value);
|
bitField0_ |= 0x00000004;
|
||||||
|
takenRewardList.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>repeated .TakenChallengeRewardInfo taken_reward_list = 10;</code>
|
||||||
|
* @param values the takenRewardList to add
|
||||||
|
* @return this
|
||||||
|
*/
|
||||||
|
public TakeChallengeRewardScRsp addAllTakenRewardList(
|
||||||
|
final TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo... values) {
|
||||||
|
bitField0_ |= 0x00000004;
|
||||||
|
takenRewardList.addAll(values);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,10 +195,9 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
cachedSize = other.cachedSize;
|
cachedSize = other.cachedSize;
|
||||||
if ((bitField0_ | other.bitField0_) != 0) {
|
if ((bitField0_ | other.bitField0_) != 0) {
|
||||||
bitField0_ = other.bitField0_;
|
bitField0_ = other.bitField0_;
|
||||||
starCount = other.starCount;
|
|
||||||
groupId = other.groupId;
|
groupId = other.groupId;
|
||||||
retcode = other.retcode;
|
retcode = other.retcode;
|
||||||
reward.copyFrom(other.reward);
|
takenRewardList.copyFrom(other.takenRewardList);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -235,17 +208,14 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
cachedSize = -1;
|
cachedSize = -1;
|
||||||
if (other.hasStarCount()) {
|
|
||||||
setStarCount(other.starCount);
|
|
||||||
}
|
|
||||||
if (other.hasGroupId()) {
|
if (other.hasGroupId()) {
|
||||||
setGroupId(other.groupId);
|
setGroupId(other.groupId);
|
||||||
}
|
}
|
||||||
if (other.hasRetcode()) {
|
if (other.hasRetcode()) {
|
||||||
setRetcode(other.retcode);
|
setRetcode(other.retcode);
|
||||||
}
|
}
|
||||||
if (other.hasReward()) {
|
if (other.hasTakenRewardList()) {
|
||||||
getMutableReward().mergeFrom(other.reward);
|
getMutableTakenRewardList().addAll(other.takenRewardList);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -257,10 +227,9 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
}
|
}
|
||||||
cachedSize = -1;
|
cachedSize = -1;
|
||||||
bitField0_ = 0;
|
bitField0_ = 0;
|
||||||
starCount = 0;
|
|
||||||
groupId = 0;
|
groupId = 0;
|
||||||
retcode = 0;
|
retcode = 0;
|
||||||
reward.clear();
|
takenRewardList.clear();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +240,7 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
}
|
}
|
||||||
cachedSize = -1;
|
cachedSize = -1;
|
||||||
bitField0_ = 0;
|
bitField0_ = 0;
|
||||||
reward.clearQuick();
|
takenRewardList.clearQuick();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,29 +254,26 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
}
|
}
|
||||||
TakeChallengeRewardScRsp other = (TakeChallengeRewardScRsp) o;
|
TakeChallengeRewardScRsp other = (TakeChallengeRewardScRsp) o;
|
||||||
return bitField0_ == other.bitField0_
|
return bitField0_ == other.bitField0_
|
||||||
&& (!hasStarCount() || starCount == other.starCount)
|
|
||||||
&& (!hasGroupId() || groupId == other.groupId)
|
&& (!hasGroupId() || groupId == other.groupId)
|
||||||
&& (!hasRetcode() || retcode == other.retcode)
|
&& (!hasRetcode() || retcode == other.retcode)
|
||||||
&& (!hasReward() || reward.equals(other.reward));
|
&& (!hasTakenRewardList() || takenRewardList.equals(other.takenRewardList));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(final ProtoSink output) throws IOException {
|
public void writeTo(final ProtoSink output) throws IOException {
|
||||||
if ((bitField0_ & 0x00000001) != 0) {
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
output.writeRawByte((byte) 8);
|
|
||||||
output.writeUInt32NoTag(starCount);
|
|
||||||
}
|
|
||||||
if ((bitField0_ & 0x00000002) != 0) {
|
|
||||||
output.writeRawByte((byte) 48);
|
output.writeRawByte((byte) 48);
|
||||||
output.writeUInt32NoTag(groupId);
|
output.writeUInt32NoTag(groupId);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000004) != 0) {
|
if ((bitField0_ & 0x00000002) != 0) {
|
||||||
output.writeRawByte((byte) 112);
|
output.writeRawByte((byte) 112);
|
||||||
output.writeUInt32NoTag(retcode);
|
output.writeUInt32NoTag(retcode);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000008) != 0) {
|
if ((bitField0_ & 0x00000004) != 0) {
|
||||||
output.writeRawByte((byte) 122);
|
for (int i = 0; i < takenRewardList.length(); i++) {
|
||||||
output.writeMessageNoTag(reward);
|
output.writeRawByte((byte) 82);
|
||||||
|
output.writeMessageNoTag(takenRewardList.get(i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,16 +281,13 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
protected int computeSerializedSize() {
|
protected int computeSerializedSize() {
|
||||||
int size = 0;
|
int size = 0;
|
||||||
if ((bitField0_ & 0x00000001) != 0) {
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(starCount);
|
|
||||||
}
|
|
||||||
if ((bitField0_ & 0x00000002) != 0) {
|
|
||||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId);
|
size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000004) != 0) {
|
if ((bitField0_ & 0x00000002) != 0) {
|
||||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
|
size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000008) != 0) {
|
if ((bitField0_ & 0x00000004) != 0) {
|
||||||
size += 1 + ProtoSink.computeMessageSizeNoTag(reward);
|
size += (1 * takenRewardList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(takenRewardList);
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@@ -336,19 +299,10 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
int tag = input.readTag();
|
int tag = input.readTag();
|
||||||
while (true) {
|
while (true) {
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 8: {
|
|
||||||
// starCount
|
|
||||||
starCount = input.readUInt32();
|
|
||||||
bitField0_ |= 0x00000001;
|
|
||||||
tag = input.readTag();
|
|
||||||
if (tag != 48) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 48: {
|
case 48: {
|
||||||
// groupId
|
// groupId
|
||||||
groupId = input.readUInt32();
|
groupId = input.readUInt32();
|
||||||
bitField0_ |= 0x00000002;
|
bitField0_ |= 0x00000001;
|
||||||
tag = input.readTag();
|
tag = input.readTag();
|
||||||
if (tag != 112) {
|
if (tag != 112) {
|
||||||
break;
|
break;
|
||||||
@@ -357,17 +311,16 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
case 112: {
|
case 112: {
|
||||||
// retcode
|
// retcode
|
||||||
retcode = input.readUInt32();
|
retcode = input.readUInt32();
|
||||||
bitField0_ |= 0x00000004;
|
bitField0_ |= 0x00000002;
|
||||||
tag = input.readTag();
|
tag = input.readTag();
|
||||||
if (tag != 122) {
|
if (tag != 82) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 122: {
|
case 82: {
|
||||||
// reward
|
// takenRewardList
|
||||||
input.readMessage(reward);
|
tag = input.readRepeatedMessage(takenRewardList, tag);
|
||||||
bitField0_ |= 0x00000008;
|
bitField0_ |= 0x00000004;
|
||||||
tag = input.readTag();
|
|
||||||
if (tag != 0) {
|
if (tag != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -390,16 +343,13 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
public void writeTo(final JsonSink output) throws IOException {
|
public void writeTo(final JsonSink output) throws IOException {
|
||||||
output.beginObject();
|
output.beginObject();
|
||||||
if ((bitField0_ & 0x00000001) != 0) {
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
output.writeUInt32(FieldNames.starCount, starCount);
|
|
||||||
}
|
|
||||||
if ((bitField0_ & 0x00000002) != 0) {
|
|
||||||
output.writeUInt32(FieldNames.groupId, groupId);
|
output.writeUInt32(FieldNames.groupId, groupId);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000004) != 0) {
|
if ((bitField0_ & 0x00000002) != 0) {
|
||||||
output.writeUInt32(FieldNames.retcode, retcode);
|
output.writeUInt32(FieldNames.retcode, retcode);
|
||||||
}
|
}
|
||||||
if ((bitField0_ & 0x00000008) != 0) {
|
if ((bitField0_ & 0x00000004) != 0) {
|
||||||
output.writeMessage(FieldNames.reward, reward);
|
output.writeRepeatedMessage(FieldNames.takenRewardList, takenRewardList);
|
||||||
}
|
}
|
||||||
output.endObject();
|
output.endObject();
|
||||||
}
|
}
|
||||||
@@ -411,24 +361,12 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
}
|
}
|
||||||
while (!input.isAtEnd()) {
|
while (!input.isAtEnd()) {
|
||||||
switch (input.readFieldHash()) {
|
switch (input.readFieldHash()) {
|
||||||
case 2121235933:
|
|
||||||
case 2124166370: {
|
|
||||||
if (input.isAtField(FieldNames.starCount)) {
|
|
||||||
if (!input.trySkipNullValue()) {
|
|
||||||
starCount = input.readUInt32();
|
|
||||||
bitField0_ |= 0x00000001;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
input.skipUnknownField();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 293428218:
|
case 293428218:
|
||||||
case 506361563: {
|
case 506361563: {
|
||||||
if (input.isAtField(FieldNames.groupId)) {
|
if (input.isAtField(FieldNames.groupId)) {
|
||||||
if (!input.trySkipNullValue()) {
|
if (!input.trySkipNullValue()) {
|
||||||
groupId = input.readUInt32();
|
groupId = input.readUInt32();
|
||||||
bitField0_ |= 0x00000002;
|
bitField0_ |= 0x00000001;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
input.skipUnknownField();
|
input.skipUnknownField();
|
||||||
@@ -439,18 +377,19 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
if (input.isAtField(FieldNames.retcode)) {
|
if (input.isAtField(FieldNames.retcode)) {
|
||||||
if (!input.trySkipNullValue()) {
|
if (!input.trySkipNullValue()) {
|
||||||
retcode = input.readUInt32();
|
retcode = input.readUInt32();
|
||||||
bitField0_ |= 0x00000004;
|
bitField0_ |= 0x00000002;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
input.skipUnknownField();
|
input.skipUnknownField();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case -934326481: {
|
case -600805228:
|
||||||
if (input.isAtField(FieldNames.reward)) {
|
case 1027082294: {
|
||||||
|
if (input.isAtField(FieldNames.takenRewardList)) {
|
||||||
if (!input.trySkipNullValue()) {
|
if (!input.trySkipNullValue()) {
|
||||||
input.readMessage(reward);
|
input.readRepeatedMessage(takenRewardList);
|
||||||
bitField0_ |= 0x00000008;
|
bitField0_ |= 0x00000004;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
input.skipUnknownField();
|
input.skipUnknownField();
|
||||||
@@ -510,13 +449,11 @@ public final class TakeChallengeRewardScRspOuterClass {
|
|||||||
* Contains name constants used for serializing JSON
|
* Contains name constants used for serializing JSON
|
||||||
*/
|
*/
|
||||||
static class FieldNames {
|
static class FieldNames {
|
||||||
static final FieldName starCount = FieldName.forField("starCount", "star_count");
|
|
||||||
|
|
||||||
static final FieldName groupId = FieldName.forField("groupId", "group_id");
|
static final FieldName groupId = FieldName.forField("groupId", "group_id");
|
||||||
|
|
||||||
static final FieldName retcode = FieldName.forField("retcode");
|
static final FieldName retcode = FieldName.forField("retcode");
|
||||||
|
|
||||||
static final FieldName reward = FieldName.forField("reward");
|
static final FieldName takenRewardList = FieldName.forField("takenRewardList", "taken_reward_list");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 TakenChallengeRewardInfoOuterClass {
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code TakenChallengeRewardInfo}
|
||||||
|
*/
|
||||||
|
public static final class TakenChallengeRewardInfo extends ProtoMessage<TakenChallengeRewardInfo> implements Cloneable {
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional uint32 star_count = 9;</code>
|
||||||
|
*/
|
||||||
|
private int starCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .ItemList reward = 14;</code>
|
||||||
|
*/
|
||||||
|
private final ItemListOuterClass.ItemList reward = ItemListOuterClass.ItemList.newInstance();
|
||||||
|
|
||||||
|
private TakenChallengeRewardInfo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a new empty instance of {@code TakenChallengeRewardInfo}
|
||||||
|
*/
|
||||||
|
public static TakenChallengeRewardInfo newInstance() {
|
||||||
|
return new TakenChallengeRewardInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional uint32 star_count = 9;</code>
|
||||||
|
* @return whether the starCount field is set
|
||||||
|
*/
|
||||||
|
public boolean hasStarCount() {
|
||||||
|
return (bitField0_ & 0x00000001) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional uint32 star_count = 9;</code>
|
||||||
|
* @return this
|
||||||
|
*/
|
||||||
|
public TakenChallengeRewardInfo clearStarCount() {
|
||||||
|
bitField0_ &= ~0x00000001;
|
||||||
|
starCount = 0;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional uint32 star_count = 9;</code>
|
||||||
|
* @return the starCount
|
||||||
|
*/
|
||||||
|
public int getStarCount() {
|
||||||
|
return starCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional uint32 star_count = 9;</code>
|
||||||
|
* @param value the starCount to set
|
||||||
|
* @return this
|
||||||
|
*/
|
||||||
|
public TakenChallengeRewardInfo setStarCount(final int value) {
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
starCount = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .ItemList reward = 14;</code>
|
||||||
|
* @return whether the reward field is set
|
||||||
|
*/
|
||||||
|
public boolean hasReward() {
|
||||||
|
return (bitField0_ & 0x00000002) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .ItemList reward = 14;</code>
|
||||||
|
* @return this
|
||||||
|
*/
|
||||||
|
public TakenChallengeRewardInfo clearReward() {
|
||||||
|
bitField0_ &= ~0x00000002;
|
||||||
|
reward.clear();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .ItemList reward = 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 #getMutableReward()} if you want to modify it.
|
||||||
|
*
|
||||||
|
* @return internal storage object for reading
|
||||||
|
*/
|
||||||
|
public ItemListOuterClass.ItemList getReward() {
|
||||||
|
return reward;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .ItemList reward = 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 ItemListOuterClass.ItemList getMutableReward() {
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
return reward;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .ItemList reward = 14;</code>
|
||||||
|
* @param value the reward to set
|
||||||
|
* @return this
|
||||||
|
*/
|
||||||
|
public TakenChallengeRewardInfo setReward(final ItemListOuterClass.ItemList value) {
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
reward.copyFrom(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo copyFrom(final TakenChallengeRewardInfo other) {
|
||||||
|
cachedSize = other.cachedSize;
|
||||||
|
if ((bitField0_ | other.bitField0_) != 0) {
|
||||||
|
bitField0_ = other.bitField0_;
|
||||||
|
starCount = other.starCount;
|
||||||
|
reward.copyFrom(other.reward);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo mergeFrom(final TakenChallengeRewardInfo other) {
|
||||||
|
if (other.isEmpty()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
cachedSize = -1;
|
||||||
|
if (other.hasStarCount()) {
|
||||||
|
setStarCount(other.starCount);
|
||||||
|
}
|
||||||
|
if (other.hasReward()) {
|
||||||
|
getMutableReward().mergeFrom(other.reward);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo clear() {
|
||||||
|
if (isEmpty()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
cachedSize = -1;
|
||||||
|
bitField0_ = 0;
|
||||||
|
starCount = 0;
|
||||||
|
reward.clear();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo clearQuick() {
|
||||||
|
if (isEmpty()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
cachedSize = -1;
|
||||||
|
bitField0_ = 0;
|
||||||
|
reward.clearQuick();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (o == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(o instanceof TakenChallengeRewardInfo)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TakenChallengeRewardInfo other = (TakenChallengeRewardInfo) o;
|
||||||
|
return bitField0_ == other.bitField0_
|
||||||
|
&& (!hasStarCount() || starCount == other.starCount)
|
||||||
|
&& (!hasReward() || reward.equals(other.reward));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeTo(final ProtoSink output) throws IOException {
|
||||||
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
|
output.writeRawByte((byte) 72);
|
||||||
|
output.writeUInt32NoTag(starCount);
|
||||||
|
}
|
||||||
|
if ((bitField0_ & 0x00000002) != 0) {
|
||||||
|
output.writeRawByte((byte) 114);
|
||||||
|
output.writeMessageNoTag(reward);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int computeSerializedSize() {
|
||||||
|
int size = 0;
|
||||||
|
if ((bitField0_ & 0x00000001) != 0) {
|
||||||
|
size += 1 + ProtoSink.computeUInt32SizeNoTag(starCount);
|
||||||
|
}
|
||||||
|
if ((bitField0_ & 0x00000002) != 0) {
|
||||||
|
size += 1 + ProtoSink.computeMessageSizeNoTag(reward);
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
|
public TakenChallengeRewardInfo mergeFrom(final ProtoSource input) throws IOException {
|
||||||
|
// Enabled Fall-Through Optimization (QuickBuffers)
|
||||||
|
int tag = input.readTag();
|
||||||
|
while (true) {
|
||||||
|
switch (tag) {
|
||||||
|
case 72: {
|
||||||
|
// starCount
|
||||||
|
starCount = input.readUInt32();
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
tag = input.readTag();
|
||||||
|
if (tag != 114) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 114: {
|
||||||
|
// reward
|
||||||
|
input.readMessage(reward);
|
||||||
|
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.starCount, starCount);
|
||||||
|
}
|
||||||
|
if ((bitField0_ & 0x00000002) != 0) {
|
||||||
|
output.writeMessage(FieldNames.reward, reward);
|
||||||
|
}
|
||||||
|
output.endObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo mergeFrom(final JsonSource input) throws IOException {
|
||||||
|
if (!input.beginObject()) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
while (!input.isAtEnd()) {
|
||||||
|
switch (input.readFieldHash()) {
|
||||||
|
case 2121235933:
|
||||||
|
case 2124166370: {
|
||||||
|
if (input.isAtField(FieldNames.starCount)) {
|
||||||
|
if (!input.trySkipNullValue()) {
|
||||||
|
starCount = input.readUInt32();
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
input.skipUnknownField();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case -934326481: {
|
||||||
|
if (input.isAtField(FieldNames.reward)) {
|
||||||
|
if (!input.trySkipNullValue()) {
|
||||||
|
input.readMessage(reward);
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
input.skipUnknownField();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
input.skipUnknownField();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
input.endObject();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo clone() {
|
||||||
|
return new TakenChallengeRewardInfo().copyFrom(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return ((bitField0_) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TakenChallengeRewardInfo parseFrom(final byte[] data) throws
|
||||||
|
InvalidProtocolBufferException {
|
||||||
|
return ProtoMessage.mergeFrom(new TakenChallengeRewardInfo(), data).checkInitialized();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TakenChallengeRewardInfo parseFrom(final ProtoSource input) throws IOException {
|
||||||
|
return ProtoMessage.mergeFrom(new TakenChallengeRewardInfo(), input).checkInitialized();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TakenChallengeRewardInfo parseFrom(final JsonSource input) throws IOException {
|
||||||
|
return ProtoMessage.mergeFrom(new TakenChallengeRewardInfo(), input).checkInitialized();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return factory for creating TakenChallengeRewardInfo messages
|
||||||
|
*/
|
||||||
|
public static MessageFactory<TakenChallengeRewardInfo> getFactory() {
|
||||||
|
return TakenChallengeRewardInfoFactory.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum TakenChallengeRewardInfoFactory implements MessageFactory<TakenChallengeRewardInfo> {
|
||||||
|
INSTANCE;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TakenChallengeRewardInfo create() {
|
||||||
|
return TakenChallengeRewardInfo.newInstance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains name constants used for serializing JSON
|
||||||
|
*/
|
||||||
|
static class FieldNames {
|
||||||
|
static final FieldName starCount = FieldName.forField("starCount", "star_count");
|
||||||
|
|
||||||
|
static final FieldName reward = FieldName.forField("reward");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,7 +46,6 @@ public class GameData {
|
|||||||
@Getter private static Int2ObjectMap<ChallengeGroupExcel> challengeGroupExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ChallengeGroupExcel> challengeGroupExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<ChallengeExcel> challengeExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ChallengeExcel> challengeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<ChallengeTargetExcel> challengeTargetExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ChallengeTargetExcel> challengeTargetExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<ChallengeRewardExcel> challengeRewardExcelMap = new Int2ObjectOpenHashMap<>();
|
|
||||||
|
|
||||||
@Getter private static Int2ObjectMap<RogueManagerExcel> rogueManagerExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueManagerExcel> rogueManagerExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueTalentExcel> rogueTalentExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueTalentExcel> rogueTalentExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@@ -221,10 +220,6 @@ public class GameData {
|
|||||||
return monsterDropExcelMap.get((monsterNpcId << 4) + worldLevel);
|
return monsterDropExcelMap.get((monsterNpcId << 4) + worldLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChallengeRewardExcel getChallengeRewardExcel(int groupId, int starCount) {
|
|
||||||
return challengeRewardExcelMap.get((groupId << 16) + starCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RogueMapExcel getRogueMapExcel(int rogueMapId, int siteId) {
|
public static RogueMapExcel getRogueMapExcel(int rogueMapId, int siteId) {
|
||||||
return rogueMapExcelMap.get((rogueMapId << 8) + siteId);
|
return rogueMapExcelMap.get((rogueMapId << 8) + siteId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ public class GameDepot {
|
|||||||
// Relics
|
// Relics
|
||||||
private static Int2ObjectMap<List<RelicMainAffixExcel>> relicMainAffixDepot = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<List<RelicMainAffixExcel>> relicMainAffixDepot = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<List<RelicSubAffixExcel>> relicSubAffixDepot = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<List<RelicSubAffixExcel>> relicSubAffixDepot = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
|
// Challenges
|
||||||
|
@Getter private static Int2ObjectMap<List<ChallengeRewardExcel>> challengeRewardLines = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
// Rogue
|
// Rogue
|
||||||
@Getter private static Int2ObjectMap<int[]> rogueMapGen = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<int[]> rogueMapGen = new Int2ObjectOpenHashMap<>();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package emu.lunarcore.data.common;
|
|||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
||||||
|
import emu.lunarcore.proto.ItemOuterClass.Item;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -48,4 +49,10 @@ public class ItemParam {
|
|||||||
public static enum ItemParamType {
|
public static enum ItemParamType {
|
||||||
UNKNOWN, PILE, UNIQUE;
|
UNKNOWN, PILE, UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Item toProto() {
|
||||||
|
return Item.newInstance()
|
||||||
|
.setItemId(this.getId())
|
||||||
|
.setNum(this.getCount());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import emu.lunarcore.data.ResourceType;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ResourceType(name = {"ChallengeGroupConfig.json"})
|
@ResourceType(name = {"ChallengeGroupConfig.json", "ChallengeStoryGroupConfig.json"})
|
||||||
public class ChallengeGroupExcel extends GameResource {
|
public class ChallengeGroupExcel extends GameResource {
|
||||||
private int GroupID;
|
private int GroupID;
|
||||||
private int RewardLineGroupID;
|
private int RewardLineGroupID;
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package emu.lunarcore.data.excel;
|
package emu.lunarcore.data.excel;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import emu.lunarcore.data.GameDepot;
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ResourceType(name = {"ChallengeMazeRewardLine.json"})
|
@ResourceType(name = {"ChallengeMazeRewardLine.json", "ChallengeStoryRewardLine.json"}, loadPriority = LoadPriority.LOW)
|
||||||
public class ChallengeRewardExcel extends GameResource {
|
public class ChallengeRewardExcel extends GameResource {
|
||||||
private int GroupID;
|
private int GroupID;
|
||||||
private int StarCount;
|
private int StarCount;
|
||||||
@@ -15,4 +19,10 @@ public class ChallengeRewardExcel extends GameResource {
|
|||||||
public int getId() {
|
public int getId() {
|
||||||
return (GroupID << 16) + StarCount;
|
return (GroupID << 16) + StarCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoad() {
|
||||||
|
var rewardLine = GameDepot.getChallengeRewardLines().computeIfAbsent(GroupID, id -> new ArrayList<>());
|
||||||
|
rewardLine.add(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
package emu.lunarcore.game.challenge;
|
package emu.lunarcore.game.challenge;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import emu.lunarcore.GameConstants;
|
import emu.lunarcore.GameConstants;
|
||||||
import emu.lunarcore.LunarCore;
|
import emu.lunarcore.LunarCore;
|
||||||
import emu.lunarcore.data.GameData;
|
import emu.lunarcore.data.GameData;
|
||||||
|
import emu.lunarcore.data.GameDepot;
|
||||||
|
import emu.lunarcore.data.common.ItemParam;
|
||||||
import emu.lunarcore.data.excel.ChallengeExcel;
|
import emu.lunarcore.data.excel.ChallengeExcel;
|
||||||
import emu.lunarcore.game.inventory.GameItem;
|
|
||||||
import emu.lunarcore.game.player.BasePlayerManager;
|
import emu.lunarcore.game.player.BasePlayerManager;
|
||||||
import emu.lunarcore.game.player.Player;
|
import emu.lunarcore.game.player.Player;
|
||||||
import emu.lunarcore.game.player.lineup.PlayerLineup;
|
import emu.lunarcore.game.player.lineup.PlayerLineup;
|
||||||
import emu.lunarcore.proto.ExtraLineupTypeOuterClass.ExtraLineupType;
|
import emu.lunarcore.proto.ExtraLineupTypeOuterClass.ExtraLineupType;
|
||||||
import emu.lunarcore.proto.StartChallengeStoryBuffInfoOuterClass.StartChallengeStoryBuffInfo;
|
import emu.lunarcore.proto.StartChallengeStoryBuffInfoOuterClass.StartChallengeStoryBuffInfo;
|
||||||
|
import emu.lunarcore.proto.TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo;
|
||||||
import emu.lunarcore.server.packet.Retcode;
|
import emu.lunarcore.server.packet.Retcode;
|
||||||
import emu.lunarcore.server.packet.send.PacketStartChallengeScRsp;
|
import emu.lunarcore.server.packet.send.PacketStartChallengeScRsp;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
@@ -119,18 +122,15 @@ public class ChallengeManager extends BasePlayerManager {
|
|||||||
info.save();
|
info.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized List<GameItem> takeRewards(int groupId, int starCount) {
|
public synchronized List<TakenChallengeRewardInfo> takeRewards(int groupId) {
|
||||||
// Get excels
|
// Get excels
|
||||||
var challengeGroup = GameData.getChallengeGroupExcelMap().get(groupId);
|
var challengeGroup = GameData.getChallengeGroupExcelMap().get(groupId);
|
||||||
if (challengeGroup == null) return null;
|
if (challengeGroup == null) return null;
|
||||||
|
|
||||||
var challengeReward = GameData.getChallengeRewardExcel(challengeGroup.getRewardLineGroupID(), starCount);
|
var challengeRewardLine = GameDepot.getChallengeRewardLines().get(challengeGroup.getRewardLineGroupID());
|
||||||
if (challengeReward == null) return null;
|
if (challengeRewardLine == null) return null;
|
||||||
|
|
||||||
var rewardExcel = GameData.getRewardExcelMap().get(challengeReward.getRewardID());
|
// Get total stars
|
||||||
if (rewardExcel == null) return null;
|
|
||||||
|
|
||||||
// Validate
|
|
||||||
int totalStars = 0;
|
int totalStars = 0;
|
||||||
for (ChallengeHistory ch : this.getHistory().values()) {
|
for (ChallengeHistory ch : this.getHistory().values()) {
|
||||||
// Legacy compatibility
|
// Legacy compatibility
|
||||||
@@ -148,22 +148,47 @@ public class ChallengeManager extends BasePlayerManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the player has enough stars
|
// Rewards
|
||||||
if (totalStars < starCount) {
|
List<TakenChallengeRewardInfo> rewardInfos = new ArrayList<>();
|
||||||
return null;
|
List<ItemParam> rewardItems = new ArrayList<>();
|
||||||
|
|
||||||
|
// Get challenge rewards
|
||||||
|
for (var challengeReward : challengeRewardLine) {
|
||||||
|
// Check if we have enough stars to take this reward
|
||||||
|
if (totalStars < challengeReward.getStarCount()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get reward info
|
||||||
|
var reward = this.getTakenRewards().computeIfAbsent(groupId, id -> new ChallengeGroupReward(getPlayer(), groupId));
|
||||||
|
|
||||||
|
// Check if reward has been taken
|
||||||
|
if (reward.hasTakenReward(challengeReward.getStarCount())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set reward as taken
|
||||||
|
reward.setTakenReward(challengeReward.getStarCount());
|
||||||
|
|
||||||
|
// Get reward excel
|
||||||
|
var rewardExcel = GameData.getRewardExcelMap().get(challengeReward.getRewardID());
|
||||||
|
if (rewardExcel == null) continue;
|
||||||
|
|
||||||
|
// Add rewards
|
||||||
|
var proto = TakenChallengeRewardInfo.newInstance()
|
||||||
|
.setStarCount(challengeReward.getStarCount());
|
||||||
|
|
||||||
|
for (ItemParam itemParam : rewardExcel.getRewards()) {
|
||||||
|
proto.getMutableReward().addItemList(itemParam.toProto());
|
||||||
|
rewardItems.add(itemParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
rewardInfos.add(proto);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get reward info
|
|
||||||
var reward = this.getTakenRewards().computeIfAbsent(groupId, id -> new ChallengeGroupReward(getPlayer(), groupId));
|
|
||||||
|
|
||||||
if (reward.hasTakenReward(starCount)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
reward.setTakenReward(starCount);
|
|
||||||
|
|
||||||
// Add items to inventory
|
// Add items to inventory
|
||||||
return getPlayer().getInventory().addItemParams(rewardExcel.getRewards());
|
getPlayer().getInventory().addItemParams(rewardItems);
|
||||||
|
return rewardInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadFromDatabase() {
|
public void loadFromDatabase() {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package emu.lunarcore.server.packet.recv;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import emu.lunarcore.game.inventory.GameItem;
|
|
||||||
import emu.lunarcore.proto.TakeChallengeRewardCsReqOuterClass.TakeChallengeRewardCsReq;
|
import emu.lunarcore.proto.TakeChallengeRewardCsReqOuterClass.TakeChallengeRewardCsReq;
|
||||||
|
import emu.lunarcore.proto.TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo;
|
||||||
import emu.lunarcore.server.game.GameSession;
|
import emu.lunarcore.server.game.GameSession;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
import emu.lunarcore.server.packet.Opcodes;
|
import emu.lunarcore.server.packet.Opcodes;
|
||||||
@@ -17,8 +17,8 @@ public class HandlerTakeChallengeRewardCsReq extends PacketHandler {
|
|||||||
public void handle(GameSession session, byte[] data) throws Exception {
|
public void handle(GameSession session, byte[] data) throws Exception {
|
||||||
var req = TakeChallengeRewardCsReq.parseFrom(data);
|
var req = TakeChallengeRewardCsReq.parseFrom(data);
|
||||||
|
|
||||||
List<GameItem> rewards = session.getPlayer().getChallengeManager().takeRewards(req.getGroupId(), req.getStarCount());
|
List<TakenChallengeRewardInfo> rewardInfos = session.getPlayer().getChallengeManager().takeRewards(req.getGroupId());
|
||||||
session.send(new PacketTakeChallengeRewardScRsp(req.getGroupId(), req.getStarCount(), rewards));
|
session.send(new PacketTakeChallengeRewardScRsp(req.getGroupId(), rewardInfos));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,24 +2,23 @@ package emu.lunarcore.server.packet.send;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import emu.lunarcore.game.inventory.GameItem;
|
|
||||||
import emu.lunarcore.proto.TakeChallengeRewardScRspOuterClass.TakeChallengeRewardScRsp;
|
import emu.lunarcore.proto.TakeChallengeRewardScRspOuterClass.TakeChallengeRewardScRsp;
|
||||||
|
import emu.lunarcore.proto.TakenChallengeRewardInfoOuterClass.TakenChallengeRewardInfo;
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
|
|
||||||
public class PacketTakeChallengeRewardScRsp extends BasePacket {
|
public class PacketTakeChallengeRewardScRsp extends BasePacket {
|
||||||
|
|
||||||
public PacketTakeChallengeRewardScRsp(int groupId, int starCount, Collection<GameItem> rewards) {
|
public PacketTakeChallengeRewardScRsp(int groupId, Collection<TakenChallengeRewardInfo> rewards) {
|
||||||
super(CmdId.TakeChallengeRewardScRsp);
|
super(CmdId.TakeChallengeRewardScRsp);
|
||||||
|
|
||||||
var data = TakeChallengeRewardScRsp.newInstance();
|
var data = TakeChallengeRewardScRsp.newInstance();
|
||||||
|
|
||||||
if (rewards != null) {
|
if (rewards != null) {
|
||||||
data.setGroupId(groupId)
|
data.setGroupId(groupId);
|
||||||
.setStarCount(starCount);
|
|
||||||
|
|
||||||
for (GameItem item : rewards) {
|
for (var rewardInfo : rewards) {
|
||||||
data.getMutableReward().addItemList(item.toProto());
|
data.getMutableTakenRewardList().add(rewardInfo);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data.setRetcode(1);
|
data.setRetcode(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user