Fix upgrading eidolons

This commit is contained in:
Melledy
2024-07-31 01:33:22 -07:00
parent 17e3bf0f20
commit e80b0fd6eb
2 changed files with 96 additions and 116 deletions

View File

@@ -19,21 +19,17 @@ public final class RankUpAvatarCsReqOuterClass {
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;
/** /**
* <pre> * <code>optional uint32 rank = 1;</code>
* uint32 base_avatar_id = 2;
* </pre>
*
* <code>optional uint32 equip_avatar_id = 3;</code>
*/
private int equipAvatarId;
/**
* <code>optional uint32 rank = 13;</code>
*/ */
private int rank; 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(); private final ItemCostListOuterClass.ItemCostList itemCostList = ItemCostListOuterClass.ItemCostList.newInstance();
@@ -48,78 +44,25 @@ public final class RankUpAvatarCsReqOuterClass {
} }
/** /**
* <pre> * <code>optional uint32 rank = 1;</code>
* uint32 base_avatar_id = 2; * @return whether the rank field is set
* </pre>
*
* <code>optional uint32 equip_avatar_id = 3;</code>
* @return whether the equipAvatarId field is set
*/ */
public boolean hasEquipAvatarId() { public boolean hasRank() {
return (bitField0_ & 0x00000001) != 0; return (bitField0_ & 0x00000001) != 0;
} }
/** /**
* <pre> * <code>optional uint32 rank = 1;</code>
* 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>
* @return this * @return this
*/ */
public RankUpAvatarCsReq clearRank() { public RankUpAvatarCsReq clearRank() {
bitField0_ &= ~0x00000002; bitField0_ &= ~0x00000001;
rank = 0; rank = 0;
return this; return this;
} }
/** /**
* <code>optional uint32 rank = 13;</code> * <code>optional uint32 rank = 1;</code>
* @return the rank * @return the rank
*/ */
public int getRank() { 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 * @param value the rank to set
* @return this * @return this
*/ */
public RankUpAvatarCsReq setRank(final int value) { public RankUpAvatarCsReq setRank(final int value) {
bitField0_ |= 0x00000002; bitField0_ |= 0x00000001;
rank = value; rank = value;
return this; 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 * @return whether the itemCostList field is set
*/ */
public boolean hasItemCostList() { 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 * @return this
*/ */
public RankUpAvatarCsReq clearItemCostList() { 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. * This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only. * The returned object should not be modified and be treated as read-only.
@@ -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 * This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its * has state. The returned object will become part of this message and its
@@ -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 * @param value the itemCostList to set
* @return this * @return this
*/ */
@@ -199,8 +179,8 @@ public final class RankUpAvatarCsReqOuterClass {
cachedSize = other.cachedSize; cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) { if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_; bitField0_ = other.bitField0_;
equipAvatarId = other.equipAvatarId;
rank = other.rank; rank = other.rank;
avatarId = other.avatarId;
itemCostList.copyFrom(other.itemCostList); itemCostList.copyFrom(other.itemCostList);
} }
return this; return this;
@@ -212,12 +192,12 @@ public final class RankUpAvatarCsReqOuterClass {
return this; return this;
} }
cachedSize = -1; cachedSize = -1;
if (other.hasEquipAvatarId()) {
setEquipAvatarId(other.equipAvatarId);
}
if (other.hasRank()) { if (other.hasRank()) {
setRank(other.rank); setRank(other.rank);
} }
if (other.hasAvatarId()) {
setAvatarId(other.avatarId);
}
if (other.hasItemCostList()) { if (other.hasItemCostList()) {
getMutableItemCostList().mergeFrom(other.itemCostList); getMutableItemCostList().mergeFrom(other.itemCostList);
} }
@@ -231,8 +211,8 @@ public final class RankUpAvatarCsReqOuterClass {
} }
cachedSize = -1; cachedSize = -1;
bitField0_ = 0; bitField0_ = 0;
equipAvatarId = 0;
rank = 0; rank = 0;
avatarId = 0;
itemCostList.clear(); itemCostList.clear();
return this; return this;
} }
@@ -258,23 +238,23 @@ public final class RankUpAvatarCsReqOuterClass {
} }
RankUpAvatarCsReq other = (RankUpAvatarCsReq) o; RankUpAvatarCsReq other = (RankUpAvatarCsReq) o;
return bitField0_ == other.bitField0_ return bitField0_ == other.bitField0_
&& (!hasEquipAvatarId() || equipAvatarId == other.equipAvatarId)
&& (!hasRank() || rank == other.rank) && (!hasRank() || rank == other.rank)
&& (!hasAvatarId() || avatarId == other.avatarId)
&& (!hasItemCostList() || itemCostList.equals(other.itemCostList)); && (!hasItemCostList() || itemCostList.equals(other.itemCostList));
} }
@Override @Override
public void writeTo(final ProtoSink output) throws IOException { public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) { if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 24); output.writeRawByte((byte) 8);
output.writeUInt32NoTag(equipAvatarId);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 104);
output.writeUInt32NoTag(rank); output.writeUInt32NoTag(rank);
} }
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 96);
output.writeUInt32NoTag(avatarId);
}
if ((bitField0_ & 0x00000004) != 0) { if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 42); output.writeRawByte((byte) 18);
output.writeMessageNoTag(itemCostList); output.writeMessageNoTag(itemCostList);
} }
} }
@@ -283,10 +263,10 @@ public final class RankUpAvatarCsReqOuterClass {
protected int computeSerializedSize() { protected int computeSerializedSize() {
int size = 0; int size = 0;
if ((bitField0_ & 0x00000001) != 0) { if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(equipAvatarId); size += 1 + ProtoSink.computeUInt32SizeNoTag(rank);
} }
if ((bitField0_ & 0x00000002) != 0) { if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeUInt32SizeNoTag(rank); size += 1 + ProtoSink.computeUInt32SizeNoTag(avatarId);
} }
if ((bitField0_ & 0x00000004) != 0) { if ((bitField0_ & 0x00000004) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(itemCostList); size += 1 + ProtoSink.computeMessageSizeNoTag(itemCostList);
@@ -301,25 +281,25 @@ public final class RankUpAvatarCsReqOuterClass {
int tag = input.readTag(); int tag = input.readTag();
while (true) { while (true) {
switch (tag) { switch (tag) {
case 24: { case 8: {
// equipAvatarId
equipAvatarId = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 104) {
break;
}
}
case 104: {
// rank // rank
rank = input.readUInt32(); rank = input.readUInt32();
bitField0_ |= 0x00000002; bitField0_ |= 0x00000001;
tag = input.readTag(); tag = input.readTag();
if (tag != 42) { if (tag != 96) {
break; break;
} }
} }
case 42: { case 96: {
// avatarId
avatarId = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 18) {
break;
}
}
case 18: {
// itemCostList // itemCostList
input.readMessage(itemCostList); input.readMessage(itemCostList);
bitField0_ |= 0x00000004; bitField0_ |= 0x00000004;
@@ -346,10 +326,10 @@ public final class RankUpAvatarCsReqOuterClass {
public void writeTo(final JsonSink output) throws IOException { public void writeTo(final JsonSink output) throws IOException {
output.beginObject(); output.beginObject();
if ((bitField0_ & 0x00000001) != 0) { if ((bitField0_ & 0x00000001) != 0) {
output.writeUInt32(FieldNames.equipAvatarId, equipAvatarId); output.writeUInt32(FieldNames.rank, rank);
} }
if ((bitField0_ & 0x00000002) != 0) { if ((bitField0_ & 0x00000002) != 0) {
output.writeUInt32(FieldNames.rank, rank); output.writeUInt32(FieldNames.avatarId, avatarId);
} }
if ((bitField0_ & 0x00000004) != 0) { if ((bitField0_ & 0x00000004) != 0) {
output.writeMessage(FieldNames.itemCostList, itemCostList); output.writeMessage(FieldNames.itemCostList, itemCostList);
@@ -364,11 +344,10 @@ public final class RankUpAvatarCsReqOuterClass {
} }
while (!input.isAtEnd()) { while (!input.isAtEnd()) {
switch (input.readFieldHash()) { switch (input.readFieldHash()) {
case 169047204: case 3492908: {
case 33057906: { if (input.isAtField(FieldNames.rank)) {
if (input.isAtField(FieldNames.equipAvatarId)) {
if (!input.trySkipNullValue()) { if (!input.trySkipNullValue()) {
equipAvatarId = input.readUInt32(); rank = input.readUInt32();
bitField0_ |= 0x00000001; bitField0_ |= 0x00000001;
} }
} else { } else {
@@ -376,10 +355,11 @@ public final class RankUpAvatarCsReqOuterClass {
} }
break; break;
} }
case 3492908: { case 1787287636:
if (input.isAtField(FieldNames.rank)) { case -428636735: {
if (input.isAtField(FieldNames.avatarId)) {
if (!input.trySkipNullValue()) { if (!input.trySkipNullValue()) {
rank = input.readUInt32(); avatarId = input.readUInt32();
bitField0_ |= 0x00000002; bitField0_ |= 0x00000002;
} }
} else { } else {
@@ -452,10 +432,10 @@ public final class RankUpAvatarCsReqOuterClass {
* Contains name constants used for serializing JSON * Contains name constants used for serializing JSON
*/ */
static class FieldNames { static class FieldNames {
static final FieldName equipAvatarId = FieldName.forField("equipAvatarId", "equip_avatar_id");
static final FieldName rank = FieldName.forField("rank"); 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"); static final FieldName itemCostList = FieldName.forField("itemCostList", "item_cost_list");
} }
} }

View File

@@ -13,7 +13,7 @@ public class HandlerRankUpAvatarCsReq extends PacketHandler {
public void handle(GameSession session, byte[] data) throws Exception { public void handle(GameSession session, byte[] data) throws Exception {
var req = RankUpAvatarCsReq.parseFrom(data); 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); session.send(CmdId.RankUpAvatarScRsp);
} }