mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 21:34:35 +01:00
Fix upgrading eidolons
This commit is contained in:
@@ -19,21 +19,17 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* uint32 base_avatar_id = 2;
|
||||
* </pre>
|
||||
*
|
||||
* <code>optional uint32 equip_avatar_id = 3;</code>
|
||||
*/
|
||||
private int equipAvatarId;
|
||||
|
||||
/**
|
||||
* <code>optional uint32 rank = 13;</code>
|
||||
* <code>optional uint32 rank = 1;</code>
|
||||
*/
|
||||
private int rank;
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 5;</code>
|
||||
* <code>optional uint32 avatar_id = 12;</code>
|
||||
*/
|
||||
private int avatarId;
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 2;</code>
|
||||
*/
|
||||
private final ItemCostListOuterClass.ItemCostList itemCostList = ItemCostListOuterClass.ItemCostList.newInstance();
|
||||
|
||||
@@ -48,78 +44,25 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* uint32 base_avatar_id = 2;
|
||||
* </pre>
|
||||
*
|
||||
* <code>optional uint32 equip_avatar_id = 3;</code>
|
||||
* @return whether the equipAvatarId field is set
|
||||
* <code>optional uint32 rank = 1;</code>
|
||||
* @return whether the rank field is set
|
||||
*/
|
||||
public boolean hasEquipAvatarId() {
|
||||
public boolean hasRank() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* uint32 base_avatar_id = 2;
|
||||
* </pre>
|
||||
*
|
||||
* <code>optional uint32 equip_avatar_id = 3;</code>
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq clearEquipAvatarId() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
equipAvatarId = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* uint32 base_avatar_id = 2;
|
||||
* </pre>
|
||||
*
|
||||
* <code>optional uint32 equip_avatar_id = 3;</code>
|
||||
* @return the equipAvatarId
|
||||
*/
|
||||
public int getEquipAvatarId() {
|
||||
return equipAvatarId;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* uint32 base_avatar_id = 2;
|
||||
* </pre>
|
||||
*
|
||||
* <code>optional uint32 equip_avatar_id = 3;</code>
|
||||
* @param value the equipAvatarId to set
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq setEquipAvatarId(final int value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
equipAvatarId = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 rank = 13;</code>
|
||||
* @return whether the rank field is set
|
||||
*/
|
||||
public boolean hasRank() {
|
||||
return (bitField0_ & 0x00000002) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 rank = 13;</code>
|
||||
* <code>optional uint32 rank = 1;</code>
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq clearRank() {
|
||||
bitField0_ &= ~0x00000002;
|
||||
bitField0_ &= ~0x00000001;
|
||||
rank = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 rank = 13;</code>
|
||||
* <code>optional uint32 rank = 1;</code>
|
||||
* @return the rank
|
||||
*/
|
||||
public int getRank() {
|
||||
@@ -127,18 +70,55 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 rank = 13;</code>
|
||||
* <code>optional uint32 rank = 1;</code>
|
||||
* @param value the rank to set
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq setRank(final int value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
bitField0_ |= 0x00000001;
|
||||
rank = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 5;</code>
|
||||
* <code>optional uint32 avatar_id = 12;</code>
|
||||
* @return whether the avatarId field is set
|
||||
*/
|
||||
public boolean hasAvatarId() {
|
||||
return (bitField0_ & 0x00000002) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 avatar_id = 12;</code>
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq clearAvatarId() {
|
||||
bitField0_ &= ~0x00000002;
|
||||
avatarId = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 avatar_id = 12;</code>
|
||||
* @return the avatarId
|
||||
*/
|
||||
public int getAvatarId() {
|
||||
return avatarId;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 avatar_id = 12;</code>
|
||||
* @param value the avatarId to set
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq setAvatarId(final int value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
avatarId = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 2;</code>
|
||||
* @return whether the itemCostList field is set
|
||||
*/
|
||||
public boolean hasItemCostList() {
|
||||
@@ -146,7 +126,7 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 5;</code>
|
||||
* <code>optional .ItemCostList item_cost_list = 2;</code>
|
||||
* @return this
|
||||
*/
|
||||
public RankUpAvatarCsReq clearItemCostList() {
|
||||
@@ -156,7 +136,7 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 5;</code>
|
||||
* <code>optional .ItemCostList item_cost_list = 2;</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.
|
||||
@@ -170,7 +150,7 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 5;</code>
|
||||
* <code>optional .ItemCostList item_cost_list = 2;</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
|
||||
@@ -184,7 +164,7 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .ItemCostList item_cost_list = 5;</code>
|
||||
* <code>optional .ItemCostList item_cost_list = 2;</code>
|
||||
* @param value the itemCostList to set
|
||||
* @return this
|
||||
*/
|
||||
@@ -199,8 +179,8 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
cachedSize = other.cachedSize;
|
||||
if ((bitField0_ | other.bitField0_) != 0) {
|
||||
bitField0_ = other.bitField0_;
|
||||
equipAvatarId = other.equipAvatarId;
|
||||
rank = other.rank;
|
||||
avatarId = other.avatarId;
|
||||
itemCostList.copyFrom(other.itemCostList);
|
||||
}
|
||||
return this;
|
||||
@@ -212,12 +192,12 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
if (other.hasEquipAvatarId()) {
|
||||
setEquipAvatarId(other.equipAvatarId);
|
||||
}
|
||||
if (other.hasRank()) {
|
||||
setRank(other.rank);
|
||||
}
|
||||
if (other.hasAvatarId()) {
|
||||
setAvatarId(other.avatarId);
|
||||
}
|
||||
if (other.hasItemCostList()) {
|
||||
getMutableItemCostList().mergeFrom(other.itemCostList);
|
||||
}
|
||||
@@ -231,8 +211,8 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
equipAvatarId = 0;
|
||||
rank = 0;
|
||||
avatarId = 0;
|
||||
itemCostList.clear();
|
||||
return this;
|
||||
}
|
||||
@@ -258,23 +238,23 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
RankUpAvatarCsReq other = (RankUpAvatarCsReq) o;
|
||||
return bitField0_ == other.bitField0_
|
||||
&& (!hasEquipAvatarId() || equipAvatarId == other.equipAvatarId)
|
||||
&& (!hasRank() || rank == other.rank)
|
||||
&& (!hasAvatarId() || avatarId == other.avatarId)
|
||||
&& (!hasItemCostList() || itemCostList.equals(other.itemCostList));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final ProtoSink output) throws IOException {
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeRawByte((byte) 24);
|
||||
output.writeUInt32NoTag(equipAvatarId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeRawByte((byte) 104);
|
||||
output.writeRawByte((byte) 8);
|
||||
output.writeUInt32NoTag(rank);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeRawByte((byte) 96);
|
||||
output.writeUInt32NoTag(avatarId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000004) != 0) {
|
||||
output.writeRawByte((byte) 42);
|
||||
output.writeRawByte((byte) 18);
|
||||
output.writeMessageNoTag(itemCostList);
|
||||
}
|
||||
}
|
||||
@@ -283,10 +263,10 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
protected int computeSerializedSize() {
|
||||
int size = 0;
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(equipAvatarId);
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(rank);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(rank);
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000004) != 0) {
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(itemCostList);
|
||||
@@ -301,25 +281,25 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
int tag = input.readTag();
|
||||
while (true) {
|
||||
switch (tag) {
|
||||
case 24: {
|
||||
// equipAvatarId
|
||||
equipAvatarId = input.readUInt32();
|
||||
bitField0_ |= 0x00000001;
|
||||
tag = input.readTag();
|
||||
if (tag != 104) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 104: {
|
||||
case 8: {
|
||||
// rank
|
||||
rank = input.readUInt32();
|
||||
bitField0_ |= 0x00000002;
|
||||
bitField0_ |= 0x00000001;
|
||||
tag = input.readTag();
|
||||
if (tag != 42) {
|
||||
if (tag != 96) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 42: {
|
||||
case 96: {
|
||||
// avatarId
|
||||
avatarId = input.readUInt32();
|
||||
bitField0_ |= 0x00000002;
|
||||
tag = input.readTag();
|
||||
if (tag != 18) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 18: {
|
||||
// itemCostList
|
||||
input.readMessage(itemCostList);
|
||||
bitField0_ |= 0x00000004;
|
||||
@@ -346,10 +326,10 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
public void writeTo(final JsonSink output) throws IOException {
|
||||
output.beginObject();
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeUInt32(FieldNames.equipAvatarId, equipAvatarId);
|
||||
output.writeUInt32(FieldNames.rank, rank);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeUInt32(FieldNames.rank, rank);
|
||||
output.writeUInt32(FieldNames.avatarId, avatarId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000004) != 0) {
|
||||
output.writeMessage(FieldNames.itemCostList, itemCostList);
|
||||
@@ -364,11 +344,10 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
while (!input.isAtEnd()) {
|
||||
switch (input.readFieldHash()) {
|
||||
case 169047204:
|
||||
case 33057906: {
|
||||
if (input.isAtField(FieldNames.equipAvatarId)) {
|
||||
case 3492908: {
|
||||
if (input.isAtField(FieldNames.rank)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
equipAvatarId = input.readUInt32();
|
||||
rank = input.readUInt32();
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
} else {
|
||||
@@ -376,10 +355,11 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3492908: {
|
||||
if (input.isAtField(FieldNames.rank)) {
|
||||
case 1787287636:
|
||||
case -428636735: {
|
||||
if (input.isAtField(FieldNames.avatarId)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
rank = input.readUInt32();
|
||||
avatarId = input.readUInt32();
|
||||
bitField0_ |= 0x00000002;
|
||||
}
|
||||
} else {
|
||||
@@ -452,10 +432,10 @@ public final class RankUpAvatarCsReqOuterClass {
|
||||
* Contains name constants used for serializing JSON
|
||||
*/
|
||||
static class FieldNames {
|
||||
static final FieldName equipAvatarId = FieldName.forField("equipAvatarId", "equip_avatar_id");
|
||||
|
||||
static final FieldName rank = FieldName.forField("rank");
|
||||
|
||||
static final FieldName avatarId = FieldName.forField("avatarId", "avatar_id");
|
||||
|
||||
static final FieldName itemCostList = FieldName.forField("itemCostList", "item_cost_list");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class HandlerRankUpAvatarCsReq extends PacketHandler {
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
var req = RankUpAvatarCsReq.parseFrom(data);
|
||||
|
||||
session.getServer().getInventoryService().rankUpAvatar(session.getPlayer(), req.getEquipAvatarId());
|
||||
session.getServer().getInventoryService().rankUpAvatar(session.getPlayer(), req.getAvatarId());
|
||||
session.send(CmdId.RankUpAvatarScRsp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user