From d306f904353b7055049cc74f29931da7ddc38271 Mon Sep 17 00:00:00 2001 From: Hiro Date: Thu, 30 Nov 2023 05:49:05 +0200 Subject: [PATCH] attempt to fix daily active + bp --- .../proto/BattlePassInfoNotifyOuterClass.java | 1320 +++++++++++++++++ .../DailyActiveInfoNotifyOuterClass.java | 501 +++++++ .../proto/DailyActivityInfoOuterClass.java | 502 +++++++ .../GetDailyActiveInfoCsReqOuterClass.java | 174 +++ .../GetDailyActiveInfoScRspOuterClass.java | 581 ++++++++ .../emu/lunarcore/game/player/Player.java | 4 + .../recv/HandlerGetDailyActiveInfoCsReq.java | 16 + .../recv/HandlerGetPlayerBoardDataCsReq.java | 2 + .../recv/HandlerPlayerLoginFinishCsReq.java | 4 + .../send/PacketBattlePassInfoNotify.java | 30 + .../send/PacketDailyActiveInfoNotify.java | 36 + .../send/PacketGetDailyActiveInfoScRsp.java | 37 + 12 files changed, 3207 insertions(+) create mode 100644 src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java create mode 100644 src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java diff --git a/src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java new file mode 100644 index 0000000..ed6597b --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/BattlePassInfoNotifyOuterClass.java @@ -0,0 +1,1320 @@ +// 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.ProtoEnum; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.ProtoUtil; + +public final class BattlePassInfoNotifyOuterClass { + /** + * Protobuf type {@code BattlePassInfoNotify} + */ + public static final class BattlePassInfoNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint64 taken_premium_extended_reward = 2; + */ + private long takenPremiumExtendedReward; + + /** + * optional uint64 taken_free_extended_reward = 5; + */ + private long takenFreeExtendedReward; + + /** + * optional uint64 unkfield = 6; + */ + private long unkfield; + + /** + * optional uint64 taken_premium_reward2 = 8; + */ + private long takenPremiumReward2; + + /** + * optional uint64 taken_free_reward = 9; + */ + private long takenFreeReward; + + /** + * optional uint64 taken_premium_reward1 = 10; + */ + private long takenPremiumReward1; + + /** + * optional uint64 taken_premium_optional_reward = 11; + */ + private long takenPremiumOptionalReward; + + /** + * optional uint32 exp = 4; + */ + private int exp; + + /** + * optional uint32 level = 7; + */ + private int level; + + /** + * optional uint32 cur_bp_id = 14; + */ + private int curBpId; + + /** + * optional uint32 cur_week_add_exp_sum = 15; + */ + private int curWeekAddExpSum; + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + */ + private int bpTierType; + + private BattlePassInfoNotify() { + } + + /** + * @return a new empty instance of {@code BattlePassInfoNotify} + */ + public static BattlePassInfoNotify newInstance() { + return new BattlePassInfoNotify(); + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @return whether the takenPremiumExtendedReward field is set + */ + public boolean hasTakenPremiumExtendedReward() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumExtendedReward() { + bitField0_ &= ~0x00000001; + takenPremiumExtendedReward = 0L; + return this; + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @return the takenPremiumExtendedReward + */ + public long getTakenPremiumExtendedReward() { + return takenPremiumExtendedReward; + } + + /** + * optional uint64 taken_premium_extended_reward = 2; + * @param value the takenPremiumExtendedReward to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumExtendedReward(final long value) { + bitField0_ |= 0x00000001; + takenPremiumExtendedReward = value; + return this; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @return whether the takenFreeExtendedReward field is set + */ + public boolean hasTakenFreeExtendedReward() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @return this + */ + public BattlePassInfoNotify clearTakenFreeExtendedReward() { + bitField0_ &= ~0x00000002; + takenFreeExtendedReward = 0L; + return this; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @return the takenFreeExtendedReward + */ + public long getTakenFreeExtendedReward() { + return takenFreeExtendedReward; + } + + /** + * optional uint64 taken_free_extended_reward = 5; + * @param value the takenFreeExtendedReward to set + * @return this + */ + public BattlePassInfoNotify setTakenFreeExtendedReward(final long value) { + bitField0_ |= 0x00000002; + takenFreeExtendedReward = value; + return this; + } + + /** + * optional uint64 unkfield = 6; + * @return whether the unkfield field is set + */ + public boolean hasUnkfield() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint64 unkfield = 6; + * @return this + */ + public BattlePassInfoNotify clearUnkfield() { + bitField0_ &= ~0x00000004; + unkfield = 0L; + return this; + } + + /** + * optional uint64 unkfield = 6; + * @return the unkfield + */ + public long getUnkfield() { + return unkfield; + } + + /** + * optional uint64 unkfield = 6; + * @param value the unkfield to set + * @return this + */ + public BattlePassInfoNotify setUnkfield(final long value) { + bitField0_ |= 0x00000004; + unkfield = value; + return this; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @return whether the takenPremiumReward2 field is set + */ + public boolean hasTakenPremiumReward2() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumReward2() { + bitField0_ &= ~0x00000008; + takenPremiumReward2 = 0L; + return this; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @return the takenPremiumReward2 + */ + public long getTakenPremiumReward2() { + return takenPremiumReward2; + } + + /** + * optional uint64 taken_premium_reward2 = 8; + * @param value the takenPremiumReward2 to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumReward2(final long value) { + bitField0_ |= 0x00000008; + takenPremiumReward2 = value; + return this; + } + + /** + * optional uint64 taken_free_reward = 9; + * @return whether the takenFreeReward field is set + */ + public boolean hasTakenFreeReward() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint64 taken_free_reward = 9; + * @return this + */ + public BattlePassInfoNotify clearTakenFreeReward() { + bitField0_ &= ~0x00000010; + takenFreeReward = 0L; + return this; + } + + /** + * optional uint64 taken_free_reward = 9; + * @return the takenFreeReward + */ + public long getTakenFreeReward() { + return takenFreeReward; + } + + /** + * optional uint64 taken_free_reward = 9; + * @param value the takenFreeReward to set + * @return this + */ + public BattlePassInfoNotify setTakenFreeReward(final long value) { + bitField0_ |= 0x00000010; + takenFreeReward = value; + return this; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @return whether the takenPremiumReward1 field is set + */ + public boolean hasTakenPremiumReward1() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumReward1() { + bitField0_ &= ~0x00000020; + takenPremiumReward1 = 0L; + return this; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @return the takenPremiumReward1 + */ + public long getTakenPremiumReward1() { + return takenPremiumReward1; + } + + /** + * optional uint64 taken_premium_reward1 = 10; + * @param value the takenPremiumReward1 to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumReward1(final long value) { + bitField0_ |= 0x00000020; + takenPremiumReward1 = value; + return this; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @return whether the takenPremiumOptionalReward field is set + */ + public boolean hasTakenPremiumOptionalReward() { + return (bitField0_ & 0x00000040) != 0; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @return this + */ + public BattlePassInfoNotify clearTakenPremiumOptionalReward() { + bitField0_ &= ~0x00000040; + takenPremiumOptionalReward = 0L; + return this; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @return the takenPremiumOptionalReward + */ + public long getTakenPremiumOptionalReward() { + return takenPremiumOptionalReward; + } + + /** + * optional uint64 taken_premium_optional_reward = 11; + * @param value the takenPremiumOptionalReward to set + * @return this + */ + public BattlePassInfoNotify setTakenPremiumOptionalReward(final long value) { + bitField0_ |= 0x00000040; + takenPremiumOptionalReward = value; + return this; + } + + /** + * optional uint32 exp = 4; + * @return whether the exp field is set + */ + public boolean hasExp() { + return (bitField0_ & 0x00000080) != 0; + } + + /** + * optional uint32 exp = 4; + * @return this + */ + public BattlePassInfoNotify clearExp() { + bitField0_ &= ~0x00000080; + exp = 0; + return this; + } + + /** + * optional uint32 exp = 4; + * @return the exp + */ + public int getExp() { + return exp; + } + + /** + * optional uint32 exp = 4; + * @param value the exp to set + * @return this + */ + public BattlePassInfoNotify setExp(final int value) { + bitField0_ |= 0x00000080; + exp = value; + return this; + } + + /** + * optional uint32 level = 7; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000100) != 0; + } + + /** + * optional uint32 level = 7; + * @return this + */ + public BattlePassInfoNotify clearLevel() { + bitField0_ &= ~0x00000100; + level = 0; + return this; + } + + /** + * optional uint32 level = 7; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 7; + * @param value the level to set + * @return this + */ + public BattlePassInfoNotify setLevel(final int value) { + bitField0_ |= 0x00000100; + level = value; + return this; + } + + /** + * optional uint32 cur_bp_id = 14; + * @return whether the curBpId field is set + */ + public boolean hasCurBpId() { + return (bitField0_ & 0x00000200) != 0; + } + + /** + * optional uint32 cur_bp_id = 14; + * @return this + */ + public BattlePassInfoNotify clearCurBpId() { + bitField0_ &= ~0x00000200; + curBpId = 0; + return this; + } + + /** + * optional uint32 cur_bp_id = 14; + * @return the curBpId + */ + public int getCurBpId() { + return curBpId; + } + + /** + * optional uint32 cur_bp_id = 14; + * @param value the curBpId to set + * @return this + */ + public BattlePassInfoNotify setCurBpId(final int value) { + bitField0_ |= 0x00000200; + curBpId = value; + return this; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @return whether the curWeekAddExpSum field is set + */ + public boolean hasCurWeekAddExpSum() { + return (bitField0_ & 0x00000400) != 0; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @return this + */ + public BattlePassInfoNotify clearCurWeekAddExpSum() { + bitField0_ &= ~0x00000400; + curWeekAddExpSum = 0; + return this; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @return the curWeekAddExpSum + */ + public int getCurWeekAddExpSum() { + return curWeekAddExpSum; + } + + /** + * optional uint32 cur_week_add_exp_sum = 15; + * @param value the curWeekAddExpSum to set + * @return this + */ + public BattlePassInfoNotify setCurWeekAddExpSum(final int value) { + bitField0_ |= 0x00000400; + curWeekAddExpSum = value; + return this; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @return whether the bpTierType field is set + */ + public boolean hasBpTierType() { + return (bitField0_ & 0x00000800) != 0; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @return this + */ + public BattlePassInfoNotify clearBpTierType() { + bitField0_ &= ~0x00000800; + bpTierType = 0; + return this; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @return the bpTierType + */ + public BpTierType getBpTierType() { + return BpTierType.forNumber(bpTierType); + } + + /** + * Gets the value of the internal enum store. The result is + * equivalent to {@link BattlePassInfoNotify#getBpTierType()}.getNumber(). + * + * @return numeric wire representation + */ + public int getBpTierTypeValue() { + return bpTierType; + } + + /** + * 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 BpTierType}. Setting an invalid value + * can cause {@link BattlePassInfoNotify#getBpTierType()} to return null + * + * @param value the numeric wire value to set + * @return this + */ + public BattlePassInfoNotify setBpTierTypeValue(final int value) { + bitField0_ |= 0x00000800; + bpTierType = value; + return this; + } + + /** + * optional .BattlePassInfoNotify.BpTierType bp_tier_type = 1; + * @param value the bpTierType to set + * @return this + */ + public BattlePassInfoNotify setBpTierType(final BpTierType value) { + bitField0_ |= 0x00000800; + bpTierType = value.getNumber(); + return this; + } + + @Override + public BattlePassInfoNotify copyFrom(final BattlePassInfoNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + takenPremiumExtendedReward = other.takenPremiumExtendedReward; + takenFreeExtendedReward = other.takenFreeExtendedReward; + unkfield = other.unkfield; + takenPremiumReward2 = other.takenPremiumReward2; + takenFreeReward = other.takenFreeReward; + takenPremiumReward1 = other.takenPremiumReward1; + takenPremiumOptionalReward = other.takenPremiumOptionalReward; + exp = other.exp; + level = other.level; + curBpId = other.curBpId; + curWeekAddExpSum = other.curWeekAddExpSum; + bpTierType = other.bpTierType; + } + return this; + } + + @Override + public BattlePassInfoNotify mergeFrom(final BattlePassInfoNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTakenPremiumExtendedReward()) { + setTakenPremiumExtendedReward(other.takenPremiumExtendedReward); + } + if (other.hasTakenFreeExtendedReward()) { + setTakenFreeExtendedReward(other.takenFreeExtendedReward); + } + if (other.hasUnkfield()) { + setUnkfield(other.unkfield); + } + if (other.hasTakenPremiumReward2()) { + setTakenPremiumReward2(other.takenPremiumReward2); + } + if (other.hasTakenFreeReward()) { + setTakenFreeReward(other.takenFreeReward); + } + if (other.hasTakenPremiumReward1()) { + setTakenPremiumReward1(other.takenPremiumReward1); + } + if (other.hasTakenPremiumOptionalReward()) { + setTakenPremiumOptionalReward(other.takenPremiumOptionalReward); + } + if (other.hasExp()) { + setExp(other.exp); + } + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasCurBpId()) { + setCurBpId(other.curBpId); + } + if (other.hasCurWeekAddExpSum()) { + setCurWeekAddExpSum(other.curWeekAddExpSum); + } + if (other.hasBpTierType()) { + setBpTierTypeValue(other.bpTierType); + } + return this; + } + + @Override + public BattlePassInfoNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + takenPremiumExtendedReward = 0L; + takenFreeExtendedReward = 0L; + unkfield = 0L; + takenPremiumReward2 = 0L; + takenFreeReward = 0L; + takenPremiumReward1 = 0L; + takenPremiumOptionalReward = 0L; + exp = 0; + level = 0; + curBpId = 0; + curWeekAddExpSum = 0; + bpTierType = 0; + return this; + } + + @Override + public BattlePassInfoNotify 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 BattlePassInfoNotify)) { + return false; + } + BattlePassInfoNotify other = (BattlePassInfoNotify) o; + return bitField0_ == other.bitField0_ + && (!hasTakenPremiumExtendedReward() || takenPremiumExtendedReward == other.takenPremiumExtendedReward) + && (!hasTakenFreeExtendedReward() || takenFreeExtendedReward == other.takenFreeExtendedReward) + && (!hasUnkfield() || unkfield == other.unkfield) + && (!hasTakenPremiumReward2() || takenPremiumReward2 == other.takenPremiumReward2) + && (!hasTakenFreeReward() || takenFreeReward == other.takenFreeReward) + && (!hasTakenPremiumReward1() || takenPremiumReward1 == other.takenPremiumReward1) + && (!hasTakenPremiumOptionalReward() || takenPremiumOptionalReward == other.takenPremiumOptionalReward) + && (!hasExp() || exp == other.exp) + && (!hasLevel() || level == other.level) + && (!hasCurBpId() || curBpId == other.curBpId) + && (!hasCurWeekAddExpSum() || curWeekAddExpSum == other.curWeekAddExpSum) + && (!hasBpTierType() || bpTierType == other.bpTierType); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt64NoTag(takenPremiumExtendedReward); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt64NoTag(takenFreeExtendedReward); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt64NoTag(unkfield); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt64NoTag(takenPremiumReward2); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt64NoTag(takenFreeReward); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt64NoTag(takenPremiumReward1); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt64NoTag(takenPremiumOptionalReward); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeRawByte((byte) 32); + output.writeUInt32NoTag(exp); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(curBpId); + } + if ((bitField0_ & 0x00000400) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(curWeekAddExpSum); + } + if ((bitField0_ & 0x00000800) != 0) { + output.writeRawByte((byte) 8); + output.writeEnumNoTag(bpTierType); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumExtendedReward); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenFreeExtendedReward); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(unkfield); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumReward2); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenFreeReward); + } + if ((bitField0_ & 0x00000020) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumReward1); + } + if ((bitField0_ & 0x00000040) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(takenPremiumOptionalReward); + } + if ((bitField0_ & 0x00000080) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(exp); + } + if ((bitField0_ & 0x00000100) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000200) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curBpId); + } + if ((bitField0_ & 0x00000400) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curWeekAddExpSum); + } + if ((bitField0_ & 0x00000800) != 0) { + size += 1 + ProtoSink.computeEnumSizeNoTag(bpTierType); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public BattlePassInfoNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // takenPremiumExtendedReward + takenPremiumExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 40) { + break; + } + } + case 40: { + // takenFreeExtendedReward + takenFreeExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 48) { + break; + } + } + case 48: { + // unkfield + unkfield = input.readUInt64(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // takenPremiumReward2 + takenPremiumReward2 = input.readUInt64(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // takenFreeReward + takenFreeReward = input.readUInt64(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // takenPremiumReward1 + takenPremiumReward1 = input.readUInt64(); + bitField0_ |= 0x00000020; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // takenPremiumOptionalReward + takenPremiumOptionalReward = input.readUInt64(); + bitField0_ |= 0x00000040; + tag = input.readTag(); + if (tag != 32) { + break; + } + } + case 32: { + // exp + exp = input.readUInt32(); + bitField0_ |= 0x00000080; + tag = input.readTag(); + if (tag != 56) { + break; + } + } + case 56: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000100; + tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // curBpId + curBpId = input.readUInt32(); + bitField0_ |= 0x00000200; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // curWeekAddExpSum + curWeekAddExpSum = input.readUInt32(); + bitField0_ |= 0x00000400; + tag = input.readTag(); + if (tag != 8) { + break; + } + } + case 8: { + // bpTierType + final int value = input.readInt32(); + if (BpTierType.forNumber(value) != null) { + bpTierType = value; + bitField0_ |= 0x00000800; + } + 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.writeUInt64(FieldNames.takenPremiumExtendedReward, takenPremiumExtendedReward); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt64(FieldNames.takenFreeExtendedReward, takenFreeExtendedReward); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt64(FieldNames.unkfield, unkfield); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt64(FieldNames.takenPremiumReward2, takenPremiumReward2); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt64(FieldNames.takenFreeReward, takenFreeReward); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeUInt64(FieldNames.takenPremiumReward1, takenPremiumReward1); + } + if ((bitField0_ & 0x00000040) != 0) { + output.writeUInt64(FieldNames.takenPremiumOptionalReward, takenPremiumOptionalReward); + } + if ((bitField0_ & 0x00000080) != 0) { + output.writeUInt32(FieldNames.exp, exp); + } + if ((bitField0_ & 0x00000100) != 0) { + output.writeUInt32(FieldNames.level, level); + } + if ((bitField0_ & 0x00000200) != 0) { + output.writeUInt32(FieldNames.curBpId, curBpId); + } + if ((bitField0_ & 0x00000400) != 0) { + output.writeUInt32(FieldNames.curWeekAddExpSum, curWeekAddExpSum); + } + if ((bitField0_ & 0x00000800) != 0) { + output.writeEnum(FieldNames.bpTierType, bpTierType, BpTierType.converter()); + } + output.endObject(); + } + + @Override + public BattlePassInfoNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1290021512: + case -2138632299: { + if (input.isAtField(FieldNames.takenPremiumExtendedReward)) { + if (!input.trySkipNullValue()) { + takenPremiumExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1116117893: + case 1257087386: { + if (input.isAtField(FieldNames.takenFreeExtendedReward)) { + if (!input.trySkipNullValue()) { + takenFreeExtendedReward = input.readUInt64(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -247717048: { + if (input.isAtField(FieldNames.unkfield)) { + if (!input.trySkipNullValue()) { + unkfield = input.readUInt64(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 226926899: + case 1195903363: { + if (input.isAtField(FieldNames.takenPremiumReward2)) { + if (!input.trySkipNullValue()) { + takenPremiumReward2 = input.readUInt64(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1065549026: + case 135671018: { + if (input.isAtField(FieldNames.takenFreeReward)) { + if (!input.trySkipNullValue()) { + takenFreeReward = input.readUInt64(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case 226926898: + case 1195903362: { + if (input.isAtField(FieldNames.takenPremiumReward1)) { + if (!input.trySkipNullValue()) { + takenPremiumReward1 = input.readUInt64(); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + case 736311903: + case 548161422: { + if (input.isAtField(FieldNames.takenPremiumOptionalReward)) { + if (!input.trySkipNullValue()) { + takenPremiumOptionalReward = input.readUInt64(); + bitField0_ |= 0x00000040; + } + } else { + input.skipUnknownField(); + } + break; + } + case 100893: { + if (input.isAtField(FieldNames.exp)) { + if (!input.trySkipNullValue()) { + exp = input.readUInt32(); + bitField0_ |= 0x00000080; + } + } else { + input.skipUnknownField(); + } + break; + } + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000100; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1125519465: + case 110923757: { + if (input.isAtField(FieldNames.curBpId)) { + if (!input.trySkipNullValue()) { + curBpId = input.readUInt32(); + bitField0_ |= 0x00000200; + } + } else { + input.skipUnknownField(); + } + break; + } + case 835771131: + case 26830815: { + if (input.isAtField(FieldNames.curWeekAddExpSum)) { + if (!input.trySkipNullValue()) { + curWeekAddExpSum = input.readUInt32(); + bitField0_ |= 0x00000400; + } + } else { + input.skipUnknownField(); + } + break; + } + case -584657238: + case 779964614: { + if (input.isAtField(FieldNames.bpTierType)) { + if (!input.trySkipNullValue()) { + final BpTierType value = input.readEnum(BpTierType.converter()); + if (value != null) { + bpTierType = value.getNumber(); + bitField0_ |= 0x00000800; + } else { + input.skipUnknownEnumValue(); + } + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public BattlePassInfoNotify clone() { + return new BattlePassInfoNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static BattlePassInfoNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new BattlePassInfoNotify(), data).checkInitialized(); + } + + public static BattlePassInfoNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new BattlePassInfoNotify(), input).checkInitialized(); + } + + public static BattlePassInfoNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new BattlePassInfoNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating BattlePassInfoNotify messages + */ + public static MessageFactory getFactory() { + return BattlePassInfoNotifyFactory.INSTANCE; + } + + /** + * Protobuf enum {@code BpTierType} + */ + public enum BpTierType implements ProtoEnum { + /** + * BP_TIER_TYPE_NONE = 0; + */ + BP_TIER_TYPE_NONE("BP_TIER_TYPE_NONE", 0), + + /** + * BP_TIER_TYPE_FREE = 1; + */ + BP_TIER_TYPE_FREE("BP_TIER_TYPE_FREE", 1), + + /** + * BP_TIER_TYPE_PREMIUM_1 = 2; + */ + BP_TIER_TYPE_PREMIUM_1("BP_TIER_TYPE_PREMIUM_1", 2), + + /** + * BP_TIER_TYPE_PREMIUM_2 = 3; + */ + BP_TIER_TYPE_PREMIUM_2("BP_TIER_TYPE_PREMIUM_2", 3); + + /** + * BP_TIER_TYPE_NONE = 0; + */ + public static final int BP_TIER_TYPE_NONE_VALUE = 0; + + /** + * BP_TIER_TYPE_FREE = 1; + */ + public static final int BP_TIER_TYPE_FREE_VALUE = 1; + + /** + * BP_TIER_TYPE_PREMIUM_1 = 2; + */ + public static final int BP_TIER_TYPE_PREMIUM_1_VALUE = 2; + + /** + * BP_TIER_TYPE_PREMIUM_2 = 3; + */ + public static final int BP_TIER_TYPE_PREMIUM_2_VALUE = 3; + + private final String name; + + private final int number; + + private BpTierType(String name, int number) { + this.name = name; + this.number = number; + } + + /** + * @return the string representation of enum entry + */ + @Override + public String getName() { + return name; + } + + /** + * @return the numeric wire value of this enum entry + */ + @Override + public int getNumber() { + return number; + } + + /** + * @return a converter that maps between this enum's numeric and text representations + */ + public static ProtoEnum.EnumConverter converter() { + return BpTierTypeConverter.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 BpTierType forNumber(int value) { + return BpTierTypeConverter.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 BpTierType forNumberOr(int number, BpTierType other) { + BpTierType value = forNumber(number); + return value == null ? other : value; + } + + enum BpTierTypeConverter implements ProtoEnum.EnumConverter { + INSTANCE; + + private static final BpTierType[] lookup = new BpTierType[4]; + + static { + lookup[0] = BP_TIER_TYPE_NONE; + lookup[1] = BP_TIER_TYPE_FREE; + lookup[2] = BP_TIER_TYPE_PREMIUM_1; + lookup[3] = BP_TIER_TYPE_PREMIUM_2; + } + + @Override + public final BpTierType forNumber(final int value) { + if (value >= 0 && value < lookup.length) { + return lookup[value]; + } + return null; + } + + @Override + public final BpTierType forName(final CharSequence value) { + if (value.length() == 17) { + if (ProtoUtil.isEqual("BP_TIER_TYPE_NONE", value)) { + return BP_TIER_TYPE_NONE; + } + if (ProtoUtil.isEqual("BP_TIER_TYPE_FREE", value)) { + return BP_TIER_TYPE_FREE; + } + } + if (value.length() == 22) { + if (ProtoUtil.isEqual("BP_TIER_TYPE_PREMIUM_1", value)) { + return BP_TIER_TYPE_PREMIUM_1; + } + if (ProtoUtil.isEqual("BP_TIER_TYPE_PREMIUM_2", value)) { + return BP_TIER_TYPE_PREMIUM_2; + } + } + return null; + } + } + } + + private enum BattlePassInfoNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public BattlePassInfoNotify create() { + return BattlePassInfoNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName takenPremiumExtendedReward = FieldName.forField("takenPremiumExtendedReward", "taken_premium_extended_reward"); + + static final FieldName takenFreeExtendedReward = FieldName.forField("takenFreeExtendedReward", "taken_free_extended_reward"); + + static final FieldName unkfield = FieldName.forField("unkfield"); + + static final FieldName takenPremiumReward2 = FieldName.forField("takenPremiumReward2", "taken_premium_reward2"); + + static final FieldName takenFreeReward = FieldName.forField("takenFreeReward", "taken_free_reward"); + + static final FieldName takenPremiumReward1 = FieldName.forField("takenPremiumReward1", "taken_premium_reward1"); + + static final FieldName takenPremiumOptionalReward = FieldName.forField("takenPremiumOptionalReward", "taken_premium_optional_reward"); + + static final FieldName exp = FieldName.forField("exp"); + + static final FieldName level = FieldName.forField("level"); + + static final FieldName curBpId = FieldName.forField("curBpId", "cur_bp_id"); + + static final FieldName curWeekAddExpSum = FieldName.forField("curWeekAddExpSum", "cur_week_add_exp_sum"); + + static final FieldName bpTierType = FieldName.forField("bpTierType", "bp_tier_type"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java new file mode 100644 index 0000000..f7442e6 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DailyActiveInfoNotifyOuterClass.java @@ -0,0 +1,501 @@ +// 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 DailyActiveInfoNotifyOuterClass { + /** + * Protobuf type {@code DailyActiveInfoNotify} + */ + public static final class DailyActiveInfoNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 daily_active_point = 12; + */ + private int dailyActivePoint; + + /** + * repeated uint32 daily_active_quest_id_list = 1; + */ + private final RepeatedInt dailyActiveQuestIdList = RepeatedInt.newEmptyInstance(); + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + */ + private final RepeatedMessage dailyActiveLevelList = RepeatedMessage.newEmptyInstance(DailyActivityInfoOuterClass.DailyActivityInfo.getFactory()); + + private DailyActiveInfoNotify() { + } + + /** + * @return a new empty instance of {@code DailyActiveInfoNotify} + */ + public static DailyActiveInfoNotify newInstance() { + return new DailyActiveInfoNotify(); + } + + /** + * optional uint32 daily_active_point = 12; + * @return whether the dailyActivePoint field is set + */ + public boolean hasDailyActivePoint() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 daily_active_point = 12; + * @return this + */ + public DailyActiveInfoNotify clearDailyActivePoint() { + bitField0_ &= ~0x00000001; + dailyActivePoint = 0; + return this; + } + + /** + * optional uint32 daily_active_point = 12; + * @return the dailyActivePoint + */ + public int getDailyActivePoint() { + return dailyActivePoint; + } + + /** + * optional uint32 daily_active_point = 12; + * @param value the dailyActivePoint to set + * @return this + */ + public DailyActiveInfoNotify setDailyActivePoint(final int value) { + bitField0_ |= 0x00000001; + dailyActivePoint = value; + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @return whether the dailyActiveQuestIdList field is set + */ + public boolean hasDailyActiveQuestIdList() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @return this + */ + public DailyActiveInfoNotify clearDailyActiveQuestIdList() { + bitField0_ &= ~0x00000002; + dailyActiveQuestIdList.clear(); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * + * 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 #getMutableDailyActiveQuestIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getDailyActiveQuestIdList() { + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * + * 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 getMutableDailyActiveQuestIdList() { + bitField0_ |= 0x00000002; + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @param value the dailyActiveQuestIdList to add + * @return this + */ + public DailyActiveInfoNotify addDailyActiveQuestIdList(final int value) { + bitField0_ |= 0x00000002; + dailyActiveQuestIdList.add(value); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 1; + * @param values the dailyActiveQuestIdList to add + * @return this + */ + public DailyActiveInfoNotify addAllDailyActiveQuestIdList(final int... values) { + bitField0_ |= 0x00000002; + dailyActiveQuestIdList.addAll(values); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @return whether the dailyActiveLevelList field is set + */ + public boolean hasDailyActiveLevelList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @return this + */ + public DailyActiveInfoNotify clearDailyActiveLevelList() { + bitField0_ &= ~0x00000004; + dailyActiveLevelList.clear(); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableDailyActiveLevelList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDailyActiveLevelList( + ) { + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableDailyActiveLevelList( + ) { + bitField0_ |= 0x00000004; + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @param value the dailyActiveLevelList to add + * @return this + */ + public DailyActiveInfoNotify addDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo value) { + bitField0_ |= 0x00000004; + dailyActiveLevelList.add(value); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 2; + * @param values the dailyActiveLevelList to add + * @return this + */ + public DailyActiveInfoNotify addAllDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo... values) { + bitField0_ |= 0x00000004; + dailyActiveLevelList.addAll(values); + return this; + } + + @Override + public DailyActiveInfoNotify copyFrom(final DailyActiveInfoNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + dailyActivePoint = other.dailyActivePoint; + dailyActiveQuestIdList.copyFrom(other.dailyActiveQuestIdList); + dailyActiveLevelList.copyFrom(other.dailyActiveLevelList); + } + return this; + } + + @Override + public DailyActiveInfoNotify mergeFrom(final DailyActiveInfoNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasDailyActivePoint()) { + setDailyActivePoint(other.dailyActivePoint); + } + if (other.hasDailyActiveQuestIdList()) { + getMutableDailyActiveQuestIdList().addAll(other.dailyActiveQuestIdList); + } + if (other.hasDailyActiveLevelList()) { + getMutableDailyActiveLevelList().addAll(other.dailyActiveLevelList); + } + return this; + } + + @Override + public DailyActiveInfoNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActivePoint = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clear(); + return this; + } + + @Override + public DailyActiveInfoNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof DailyActiveInfoNotify)) { + return false; + } + DailyActiveInfoNotify other = (DailyActiveInfoNotify) o; + return bitField0_ == other.bitField0_ + && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint) + && (!hasDailyActiveQuestIdList() || dailyActiveQuestIdList.equals(other.dailyActiveQuestIdList)) + && (!hasDailyActiveLevelList() || dailyActiveLevelList.equals(other.dailyActiveLevelList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + for (int i = 0; i < dailyActiveQuestIdList.length(); i++) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(dailyActiveQuestIdList.array()[i]); + } + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < dailyActiveLevelList.length(); i++) { + output.writeRawByte((byte) 18); + output.writeMessageNoTag(dailyActiveLevelList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + size += (1 * dailyActiveQuestIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * dailyActiveLevelList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dailyActiveLevelList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DailyActiveInfoNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 96: { + // dailyActivePoint + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 10) { + break; + } + } + case 10: { + // dailyActiveQuestIdList [packed=true] + input.readPackedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 18) { + break; + } + } + case 18: { + // dailyActiveLevelList + tag = input.readRepeatedMessage(dailyActiveLevelList, tag); + bitField0_ |= 0x00000004; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 8: { + // dailyActiveQuestIdList [packed=false] + tag = input.readRepeatedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000002; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRepeatedUInt32(FieldNames.dailyActiveQuestIdList, dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedMessage(FieldNames.dailyActiveLevelList, dailyActiveLevelList); + } + output.endObject(); + } + + @Override + public DailyActiveInfoNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 859671121: + case 1952864125: { + if (input.isAtField(FieldNames.dailyActivePoint)) { + if (!input.trySkipNullValue()) { + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1903124444: + case -752691246: { + if (input.isAtField(FieldNames.dailyActiveQuestIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(dailyActiveQuestIdList); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 705251971: + case 1821477548: { + if (input.isAtField(FieldNames.dailyActiveLevelList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(dailyActiveLevelList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DailyActiveInfoNotify clone() { + return new DailyActiveInfoNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DailyActiveInfoNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DailyActiveInfoNotify(), data).checkInitialized(); + } + + public static DailyActiveInfoNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActiveInfoNotify(), input).checkInitialized(); + } + + public static DailyActiveInfoNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActiveInfoNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating DailyActiveInfoNotify messages + */ + public static MessageFactory getFactory() { + return DailyActiveInfoNotifyFactory.INSTANCE; + } + + private enum DailyActiveInfoNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public DailyActiveInfoNotify create() { + return DailyActiveInfoNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point"); + + static final FieldName dailyActiveQuestIdList = FieldName.forField("dailyActiveQuestIdList", "daily_active_quest_id_list"); + + static final FieldName dailyActiveLevelList = FieldName.forField("dailyActiveLevelList", "daily_active_level_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java new file mode 100644 index 0000000..0e2c7a1 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/DailyActivityInfoOuterClass.java @@ -0,0 +1,502 @@ +// 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 DailyActivityInfoOuterClass { + /** + * Protobuf type {@code DailyActivityInfo} + */ + public static final class DailyActivityInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 level = 5; + */ + private int level; + + /** + * optional uint32 daily_active_point = 9; + */ + private int dailyActivePoint; + + /** + * optional uint32 world_level = 10; + */ + private int worldLevel; + + /** + * optional bool is_has_taken = 13; + */ + private boolean isHasTaken; + + private DailyActivityInfo() { + } + + /** + * @return a new empty instance of {@code DailyActivityInfo} + */ + public static DailyActivityInfo newInstance() { + return new DailyActivityInfo(); + } + + /** + * optional uint32 level = 5; + * @return whether the level field is set + */ + public boolean hasLevel() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 level = 5; + * @return this + */ + public DailyActivityInfo clearLevel() { + bitField0_ &= ~0x00000001; + level = 0; + return this; + } + + /** + * optional uint32 level = 5; + * @return the level + */ + public int getLevel() { + return level; + } + + /** + * optional uint32 level = 5; + * @param value the level to set + * @return this + */ + public DailyActivityInfo setLevel(final int value) { + bitField0_ |= 0x00000001; + level = value; + return this; + } + + /** + * optional uint32 daily_active_point = 9; + * @return whether the dailyActivePoint field is set + */ + public boolean hasDailyActivePoint() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 daily_active_point = 9; + * @return this + */ + public DailyActivityInfo clearDailyActivePoint() { + bitField0_ &= ~0x00000002; + dailyActivePoint = 0; + return this; + } + + /** + * optional uint32 daily_active_point = 9; + * @return the dailyActivePoint + */ + public int getDailyActivePoint() { + return dailyActivePoint; + } + + /** + * optional uint32 daily_active_point = 9; + * @param value the dailyActivePoint to set + * @return this + */ + public DailyActivityInfo setDailyActivePoint(final int value) { + bitField0_ |= 0x00000002; + dailyActivePoint = value; + return this; + } + + /** + * optional uint32 world_level = 10; + * @return whether the worldLevel field is set + */ + public boolean hasWorldLevel() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 world_level = 10; + * @return this + */ + public DailyActivityInfo clearWorldLevel() { + bitField0_ &= ~0x00000004; + worldLevel = 0; + return this; + } + + /** + * optional uint32 world_level = 10; + * @return the worldLevel + */ + public int getWorldLevel() { + return worldLevel; + } + + /** + * optional uint32 world_level = 10; + * @param value the worldLevel to set + * @return this + */ + public DailyActivityInfo setWorldLevel(final int value) { + bitField0_ |= 0x00000004; + worldLevel = value; + return this; + } + + /** + * optional bool is_has_taken = 13; + * @return whether the isHasTaken field is set + */ + public boolean hasIsHasTaken() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional bool is_has_taken = 13; + * @return this + */ + public DailyActivityInfo clearIsHasTaken() { + bitField0_ &= ~0x00000008; + isHasTaken = false; + return this; + } + + /** + * optional bool is_has_taken = 13; + * @return the isHasTaken + */ + public boolean getIsHasTaken() { + return isHasTaken; + } + + /** + * optional bool is_has_taken = 13; + * @param value the isHasTaken to set + * @return this + */ + public DailyActivityInfo setIsHasTaken(final boolean value) { + bitField0_ |= 0x00000008; + isHasTaken = value; + return this; + } + + @Override + public DailyActivityInfo copyFrom(final DailyActivityInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + level = other.level; + dailyActivePoint = other.dailyActivePoint; + worldLevel = other.worldLevel; + isHasTaken = other.isHasTaken; + } + return this; + } + + @Override + public DailyActivityInfo mergeFrom(final DailyActivityInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasLevel()) { + setLevel(other.level); + } + if (other.hasDailyActivePoint()) { + setDailyActivePoint(other.dailyActivePoint); + } + if (other.hasWorldLevel()) { + setWorldLevel(other.worldLevel); + } + if (other.hasIsHasTaken()) { + setIsHasTaken(other.isHasTaken); + } + return this; + } + + @Override + public DailyActivityInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + level = 0; + dailyActivePoint = 0; + worldLevel = 0; + isHasTaken = false; + return this; + } + + @Override + public DailyActivityInfo 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 DailyActivityInfo)) { + return false; + } + DailyActivityInfo other = (DailyActivityInfo) o; + return bitField0_ == other.bitField0_ + && (!hasLevel() || level == other.level) + && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint) + && (!hasWorldLevel() || worldLevel == other.worldLevel) + && (!hasIsHasTaken() || isHasTaken == other.isHasTaken); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(level); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 104); + output.writeBoolNoTag(isHasTaken); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 2; + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public DailyActivityInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 40: { + // level + level = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // dailyActivePoint + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // worldLevel + worldLevel = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // isHasTaken + isHasTaken = input.readBool(); + 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.level, level); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.worldLevel, worldLevel); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeBool(FieldNames.isHasTaken, isHasTaken); + } + output.endObject(); + } + + @Override + public DailyActivityInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 102865796: { + if (input.isAtField(FieldNames.level)) { + if (!input.trySkipNullValue()) { + level = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 859671121: + case 1952864125: { + if (input.isAtField(FieldNames.dailyActivePoint)) { + if (!input.trySkipNullValue()) { + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 440007442: + case 1305257111: { + if (input.isAtField(FieldNames.worldLevel)) { + if (!input.trySkipNullValue()) { + worldLevel = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -663154281: + case -1240296947: { + if (input.isAtField(FieldNames.isHasTaken)) { + if (!input.trySkipNullValue()) { + isHasTaken = input.readBool(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public DailyActivityInfo clone() { + return new DailyActivityInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static DailyActivityInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new DailyActivityInfo(), data).checkInitialized(); + } + + public static DailyActivityInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActivityInfo(), input).checkInitialized(); + } + + public static DailyActivityInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new DailyActivityInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating DailyActivityInfo messages + */ + public static MessageFactory getFactory() { + return DailyActivityInfoFactory.INSTANCE; + } + + private enum DailyActivityInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public DailyActivityInfo create() { + return DailyActivityInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName level = FieldName.forField("level"); + + static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point"); + + static final FieldName worldLevel = FieldName.forField("worldLevel", "world_level"); + + static final FieldName isHasTaken = FieldName.forField("isHasTaken", "is_has_taken"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java new file mode 100644 index 0000000..ea51047 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +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 GetDailyActiveInfoCsReqOuterClass { + /** + * Protobuf type {@code GetDailyActiveInfoCsReq} + */ + public static final class GetDailyActiveInfoCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetDailyActiveInfoCsReq() { + } + + /** + * @return a new empty instance of {@code GetDailyActiveInfoCsReq} + */ + public static GetDailyActiveInfoCsReq newInstance() { + return new GetDailyActiveInfoCsReq(); + } + + @Override + public GetDailyActiveInfoCsReq copyFrom(final GetDailyActiveInfoCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetDailyActiveInfoCsReq mergeFrom(final GetDailyActiveInfoCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetDailyActiveInfoCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetDailyActiveInfoCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetDailyActiveInfoCsReq)) { + return false; + } + GetDailyActiveInfoCsReq other = (GetDailyActiveInfoCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetDailyActiveInfoCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + 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(); + output.endObject(); + } + + @Override + public GetDailyActiveInfoCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetDailyActiveInfoCsReq clone() { + return new GetDailyActiveInfoCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetDailyActiveInfoCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoCsReq(), data).checkInitialized(); + } + + public static GetDailyActiveInfoCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoCsReq(), input).checkInitialized(); + } + + public static GetDailyActiveInfoCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetDailyActiveInfoCsReq messages + */ + public static MessageFactory getFactory() { + return GetDailyActiveInfoCsReqFactory.INSTANCE; + } + + private enum GetDailyActiveInfoCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetDailyActiveInfoCsReq create() { + return GetDailyActiveInfoCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java new file mode 100644 index 0000000..c9e713b --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetDailyActiveInfoScRspOuterClass.java @@ -0,0 +1,581 @@ +// 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 GetDailyActiveInfoScRspOuterClass { + /** + * Protobuf type {@code GetDailyActiveInfoScRsp} + */ + public static final class GetDailyActiveInfoScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 daily_active_point = 2; + */ + private int dailyActivePoint; + + /** + * optional uint32 retcode = 15; + */ + private int retcode; + + /** + * repeated uint32 daily_active_quest_id_list = 3; + */ + private final RepeatedInt dailyActiveQuestIdList = RepeatedInt.newEmptyInstance(); + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + */ + private final RepeatedMessage dailyActiveLevelList = RepeatedMessage.newEmptyInstance(DailyActivityInfoOuterClass.DailyActivityInfo.getFactory()); + + private GetDailyActiveInfoScRsp() { + } + + /** + * @return a new empty instance of {@code GetDailyActiveInfoScRsp} + */ + public static GetDailyActiveInfoScRsp newInstance() { + return new GetDailyActiveInfoScRsp(); + } + + /** + * optional uint32 daily_active_point = 2; + * @return whether the dailyActivePoint field is set + */ + public boolean hasDailyActivePoint() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 daily_active_point = 2; + * @return this + */ + public GetDailyActiveInfoScRsp clearDailyActivePoint() { + bitField0_ &= ~0x00000001; + dailyActivePoint = 0; + return this; + } + + /** + * optional uint32 daily_active_point = 2; + * @return the dailyActivePoint + */ + public int getDailyActivePoint() { + return dailyActivePoint; + } + + /** + * optional uint32 daily_active_point = 2; + * @param value the dailyActivePoint to set + * @return this + */ + public GetDailyActiveInfoScRsp setDailyActivePoint(final int value) { + bitField0_ |= 0x00000001; + dailyActivePoint = value; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 15; + * @return this + */ + public GetDailyActiveInfoScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 15; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 15; + * @param value the retcode to set + * @return this + */ + public GetDailyActiveInfoScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @return whether the dailyActiveQuestIdList field is set + */ + public boolean hasDailyActiveQuestIdList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @return this + */ + public GetDailyActiveInfoScRsp clearDailyActiveQuestIdList() { + bitField0_ &= ~0x00000004; + dailyActiveQuestIdList.clear(); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableDailyActiveQuestIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getDailyActiveQuestIdList() { + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableDailyActiveQuestIdList() { + bitField0_ |= 0x00000004; + return dailyActiveQuestIdList; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @param value the dailyActiveQuestIdList to add + * @return this + */ + public GetDailyActiveInfoScRsp addDailyActiveQuestIdList(final int value) { + bitField0_ |= 0x00000004; + dailyActiveQuestIdList.add(value); + return this; + } + + /** + * repeated uint32 daily_active_quest_id_list = 3; + * @param values the dailyActiveQuestIdList to add + * @return this + */ + public GetDailyActiveInfoScRsp addAllDailyActiveQuestIdList(final int... values) { + bitField0_ |= 0x00000004; + dailyActiveQuestIdList.addAll(values); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @return whether the dailyActiveLevelList field is set + */ + public boolean hasDailyActiveLevelList() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @return this + */ + public GetDailyActiveInfoScRsp clearDailyActiveLevelList() { + bitField0_ &= ~0x00000008; + dailyActiveLevelList.clear(); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableDailyActiveLevelList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getDailyActiveLevelList( + ) { + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedMessage getMutableDailyActiveLevelList( + ) { + bitField0_ |= 0x00000008; + return dailyActiveLevelList; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @param value the dailyActiveLevelList to add + * @return this + */ + public GetDailyActiveInfoScRsp addDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo value) { + bitField0_ |= 0x00000008; + dailyActiveLevelList.add(value); + return this; + } + + /** + * repeated .DailyActivityInfo daily_active_level_list = 10; + * @param values the dailyActiveLevelList to add + * @return this + */ + public GetDailyActiveInfoScRsp addAllDailyActiveLevelList( + final DailyActivityInfoOuterClass.DailyActivityInfo... values) { + bitField0_ |= 0x00000008; + dailyActiveLevelList.addAll(values); + return this; + } + + @Override + public GetDailyActiveInfoScRsp copyFrom(final GetDailyActiveInfoScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + dailyActivePoint = other.dailyActivePoint; + retcode = other.retcode; + dailyActiveQuestIdList.copyFrom(other.dailyActiveQuestIdList); + dailyActiveLevelList.copyFrom(other.dailyActiveLevelList); + } + return this; + } + + @Override + public GetDailyActiveInfoScRsp mergeFrom(final GetDailyActiveInfoScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasDailyActivePoint()) { + setDailyActivePoint(other.dailyActivePoint); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasDailyActiveQuestIdList()) { + getMutableDailyActiveQuestIdList().addAll(other.dailyActiveQuestIdList); + } + if (other.hasDailyActiveLevelList()) { + getMutableDailyActiveLevelList().addAll(other.dailyActiveLevelList); + } + return this; + } + + @Override + public GetDailyActiveInfoScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActivePoint = 0; + retcode = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clear(); + return this; + } + + @Override + public GetDailyActiveInfoScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + dailyActiveQuestIdList.clear(); + dailyActiveLevelList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetDailyActiveInfoScRsp)) { + return false; + } + GetDailyActiveInfoScRsp other = (GetDailyActiveInfoScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasDailyActivePoint() || dailyActivePoint == other.dailyActivePoint) + && (!hasRetcode() || retcode == other.retcode) + && (!hasDailyActiveQuestIdList() || dailyActiveQuestIdList.equals(other.dailyActiveQuestIdList)) + && (!hasDailyActiveLevelList() || dailyActiveLevelList.equals(other.dailyActiveLevelList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < dailyActiveQuestIdList.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(dailyActiveQuestIdList.array()[i]); + } + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < dailyActiveLevelList.length(); i++) { + output.writeRawByte((byte) 82); + output.writeMessageNoTag(dailyActiveLevelList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * dailyActiveQuestIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * dailyActiveLevelList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dailyActiveLevelList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetDailyActiveInfoScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // dailyActivePoint + dailyActivePoint = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 120) { + break; + } + } + case 120: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // dailyActiveQuestIdList [packed=true] + input.readPackedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // dailyActiveLevelList + tag = input.readRepeatedMessage(dailyActiveLevelList, tag); + bitField0_ |= 0x00000008; + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 24: { + // dailyActiveQuestIdList [packed=false] + tag = input.readRepeatedUInt32(dailyActiveQuestIdList, tag); + bitField0_ |= 0x00000004; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.dailyActivePoint, dailyActivePoint); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedUInt32(FieldNames.dailyActiveQuestIdList, dailyActiveQuestIdList); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedMessage(FieldNames.dailyActiveLevelList, dailyActiveLevelList); + } + output.endObject(); + } + + @Override + public GetDailyActiveInfoScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 859671121: + case 1952864125: { + if (input.isAtField(FieldNames.dailyActivePoint)) { + if (!input.trySkipNullValue()) { + dailyActivePoint = 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 1903124444: + case -752691246: { + if (input.isAtField(FieldNames.dailyActiveQuestIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(dailyActiveQuestIdList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case 705251971: + case 1821477548: { + if (input.isAtField(FieldNames.dailyActiveLevelList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(dailyActiveLevelList); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetDailyActiveInfoScRsp clone() { + return new GetDailyActiveInfoScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetDailyActiveInfoScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoScRsp(), data).checkInitialized(); + } + + public static GetDailyActiveInfoScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoScRsp(), input).checkInitialized(); + } + + public static GetDailyActiveInfoScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetDailyActiveInfoScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetDailyActiveInfoScRsp messages + */ + public static MessageFactory getFactory() { + return GetDailyActiveInfoScRspFactory.INSTANCE; + } + + private enum GetDailyActiveInfoScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetDailyActiveInfoScRsp create() { + return GetDailyActiveInfoScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName dailyActivePoint = FieldName.forField("dailyActivePoint", "daily_active_point"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName dailyActiveQuestIdList = FieldName.forField("dailyActiveQuestIdList", "daily_active_quest_id_list"); + + static final FieldName dailyActiveLevelList = FieldName.forField("dailyActiveLevelList", "daily_active_level_list"); + } + } +} diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index 604a061..5ccc09c 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -239,6 +239,10 @@ public class Player { this.sendPacket(new PacketPlayerSyncScNotify(this)); } + public int getWorldLevel() { + return this.worldLevel; + } + public void setPhoneTheme(int themeId) { this.phoneTheme = themeId; this.save(); diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java new file mode 100644 index 0000000..30691ac --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetDailyActiveInfoCsReq.java @@ -0,0 +1,16 @@ +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.server.packet.send.PacketGetDailyActiveInfoScRsp; + +@Opcodes(CmdId.GetDailyActiveInfoCsReq) +public class HandlerGetDailyActiveInfoCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + session.send(new PacketGetDailyActiveInfoScRsp(session.getPlayer())); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerBoardDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerBoardDataCsReq.java index a6bb62a..c5ec63e 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerBoardDataCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPlayerBoardDataCsReq.java @@ -5,6 +5,7 @@ import emu.lunarcore.server.packet.CmdId; import emu.lunarcore.server.packet.Opcodes; import emu.lunarcore.server.packet.PacketHandler; import emu.lunarcore.server.packet.send.PacketGetPlayerBoardDataScRsp; +import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify; @Opcodes(CmdId.GetPlayerBoardDataCsReq) public class HandlerGetPlayerBoardDataCsReq extends PacketHandler { @@ -12,6 +13,7 @@ public class HandlerGetPlayerBoardDataCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { session.send(new PacketGetPlayerBoardDataScRsp(session.getPlayer())); + session.send(new PacketBattlePassInfoNotify()); } } diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java index ee4e2a4..9586eb9 100644 --- a/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerPlayerLoginFinishCsReq.java @@ -4,6 +4,8 @@ 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.PacketDailyActiveInfoNotify; +import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify; import emu.lunarcore.server.packet.send.PacketGetArchiveDataScRsp; @Opcodes(CmdId.PlayerLoginFinishCsReq) @@ -12,6 +14,8 @@ public class HandlerPlayerLoginFinishCsReq extends PacketHandler { @Override public void handle(GameSession session, byte[] data) throws Exception { session.send(CmdId.PlayerLoginFinishScRsp); + session.send(new PacketBattlePassInfoNotify()); + // session.send(new PacketDailyActiveInfoNotify(session.getPlayer())); session.send(new PacketGetArchiveDataScRsp()); } diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java new file mode 100644 index 0000000..39f935c --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketBattlePassInfoNotify.java @@ -0,0 +1,30 @@ +package emu.lunarcore.server.packet.send; + +import java.util.*; +import java.math.*; +import emu.lunarcore.proto.BattlePassInfoNotifyOuterClass.BattlePassInfoNotify; +import emu.lunarcore.proto.BattlePassInfoNotifyOuterClass.BattlePassInfoNotify.BpTierType; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketBattlePassInfoNotify extends BasePacket { + + public PacketBattlePassInfoNotify() { + super(CmdId.BattlePassInfoNotify); + + var data = BattlePassInfoNotify.newInstance() + //.setTakenFreeReward(9223372036854775806L) + //.setTakenPremiumReward1(9223372036854775806L) + //.setTakenPremiumReward2(2251799813685246L) + //.setTakenPremiumOptionalReward(2251799813685246L) + .setTakenFreeExtendedReward(127) + .setTakenPremiumExtendedReward(127) + .setUnkfield(4) + .setLevel(70) + .setCurWeekAddExpSum(8000) + .setExp(800) + .setCurBpId(5) // doesn't matter + .setBpTierType(BpTierType.BP_TIER_TYPE_PREMIUM_2); + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java new file mode 100644 index 0000000..78f597d --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketDailyActiveInfoNotify.java @@ -0,0 +1,36 @@ +package emu.lunarcore.server.packet.send; + +import java.util.*; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.proto.DailyActiveInfoNotifyOuterClass.DailyActiveInfoNotify; +import emu.lunarcore.proto.DailyActivityInfoOuterClass.DailyActivityInfo; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketDailyActiveInfoNotify extends BasePacket { + + public PacketDailyActiveInfoNotify(Player player) { + super(CmdId.DailyActiveInfoNotify); + + List questIdList = Arrays.asList(2100003,2100102,2100112,2100115,2100119,2100129); + + var data = DailyActiveInfoNotify.newInstance() + .setDailyActivePoint(700); + + for (int questId : questIdList) { + data.addDailyActiveQuestIdList(questId); + } + + for (int level = 1; level <= 5; level++) { + DailyActivityInfo levelInfo = DailyActivityInfo.newInstance() + .setLevel(level) + .setDailyActivePoint(level * 100) + .setWorldLevel(player.getWorldLevel()) + .setIsHasTaken(true); + + data.addDailyActiveLevelList(levelInfo); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java new file mode 100644 index 0000000..cae7daf --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetDailyActiveInfoScRsp.java @@ -0,0 +1,37 @@ +package emu.lunarcore.server.packet.send; + +import java.util.*; +import emu.lunarcore.proto.GetDailyActiveInfoScRspOuterClass.GetDailyActiveInfoScRsp; +import emu.lunarcore.proto.DailyActivityInfoOuterClass.DailyActivityInfo; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketGetDailyActiveInfoScRsp extends BasePacket { + + public PacketGetDailyActiveInfoScRsp(Player target) { + super(CmdId.GetDailyActiveInfoScRsp); + + List questIdList = Arrays.asList(2100003,2100102,2100112,2100115,2100119,2100129); + + var data = GetDailyActiveInfoScRsp.newInstance() + .setDailyActivePoint(500); + + for (int questId : questIdList) { + data.addDailyActiveQuestIdList(questId); + } + + for (int level = 1; level <= 5; level++) { + DailyActivityInfo levelInfo = DailyActivityInfo.newInstance() + .setLevel(level) + .setDailyActivePoint(level * 100) + .setWorldLevel(target.getWorldLevel()) + .setIsHasTaken(true); + + data.addDailyActiveLevelList(levelInfo); + } + + this.setData(data); + } +}