Skip to content

Commit

Permalink
Fix upgrading eidolons
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Jul 31, 2024
1 parent 17e3bf0 commit e80b0fd
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ public static final class RankUpAvatarCsReq extends ProtoMessage<RankUpAvatarCsR
private static final long serialVersionUID = 0L;

/**
* <pre>
* uint32 base_avatar_id = 2;
* </pre>
*
* <code>optional uint32 equip_avatar_id = 3;</code>
* <code>optional uint32 rank = 1;</code>
*/
private int equipAvatarId;
private int rank;

/**
* <code>optional uint32 rank = 13;</code>
* <code>optional uint32 avatar_id = 12;</code>
*/
private int rank;
private int avatarId;

/**
* <code>optional .ItemCostList item_cost_list = 5;</code>
* <code>optional .ItemCostList item_cost_list = 2;</code>
*/
private final ItemCostListOuterClass.ItemCostList itemCostList = ItemCostListOuterClass.ItemCostList.newInstance();

Expand All @@ -48,105 +44,89 @@ public static RankUpAvatarCsReq newInstance() {
}

/**
* <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>
* <code>optional uint32 rank = 1;</code>
* @return this
*/
public RankUpAvatarCsReq clearEquipAvatarId() {
public RankUpAvatarCsReq clearRank() {
bitField0_ &= ~0x00000001;
equipAvatarId = 0;
rank = 0;
return this;
}

/**
* <pre>
* uint32 base_avatar_id = 2;
* </pre>
*
* <code>optional uint32 equip_avatar_id = 3;</code>
* @return the equipAvatarId
* <code>optional uint32 rank = 1;</code>
* @return the rank
*/
public int getEquipAvatarId() {
return equipAvatarId;
public int getRank() {
return rank;
}

/**
* <pre>
* uint32 base_avatar_id = 2;
* </pre>
*
* <code>optional uint32 equip_avatar_id = 3;</code>
* @param value the equipAvatarId to set
* <code>optional uint32 rank = 1;</code>
* @param value the rank to set
* @return this
*/
public RankUpAvatarCsReq setEquipAvatarId(final int value) {
public RankUpAvatarCsReq setRank(final int value) {
bitField0_ |= 0x00000001;
equipAvatarId = value;
rank = value;
return this;
}

/**
* <code>optional uint32 rank = 13;</code>
* @return whether the rank field is set
* <code>optional uint32 avatar_id = 12;</code>
* @return whether the avatarId field is set
*/
public boolean hasRank() {
public boolean hasAvatarId() {
return (bitField0_ & 0x00000002) != 0;
}

/**
* <code>optional uint32 rank = 13;</code>
* <code>optional uint32 avatar_id = 12;</code>
* @return this
*/
public RankUpAvatarCsReq clearRank() {
public RankUpAvatarCsReq clearAvatarId() {
bitField0_ &= ~0x00000002;
rank = 0;
avatarId = 0;
return this;
}

/**
* <code>optional uint32 rank = 13;</code>
* @return the rank
* <code>optional uint32 avatar_id = 12;</code>
* @return the avatarId
*/
public int getRank() {
return rank;
public int getAvatarId() {
return avatarId;
}

/**
* <code>optional uint32 rank = 13;</code>
* @param value the rank to set
* <code>optional uint32 avatar_id = 12;</code>
* @param value the avatarId to set
* @return this
*/
public RankUpAvatarCsReq setRank(final int value) {
public RankUpAvatarCsReq setAvatarId(final int value) {
bitField0_ |= 0x00000002;
rank = value;
avatarId = value;
return this;
}

/**
* <code>optional .ItemCostList item_cost_list = 5;</code>
* <code>optional .ItemCostList item_cost_list = 2;</code>
* @return whether the itemCostList field is set
*/
public boolean hasItemCostList() {
return (bitField0_ & 0x00000004) != 0;
}

/**
* <code>optional .ItemCostList item_cost_list = 5;</code>
* <code>optional .ItemCostList item_cost_list = 2;</code>
* @return this
*/
public RankUpAvatarCsReq clearItemCostList() {
Expand All @@ -156,7 +136,7 @@ public RankUpAvatarCsReq clearItemCostList() {
}

/**
* <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.
Expand All @@ -170,7 +150,7 @@ public ItemCostListOuterClass.ItemCostList getItemCostList() {
}

/**
* <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
Expand All @@ -184,7 +164,7 @@ public ItemCostListOuterClass.ItemCostList getMutableItemCostList() {
}

/**
* <code>optional .ItemCostList item_cost_list = 5;</code>
* <code>optional .ItemCostList item_cost_list = 2;</code>
* @param value the itemCostList to set
* @return this
*/
Expand All @@ -199,8 +179,8 @@ public RankUpAvatarCsReq copyFrom(final RankUpAvatarCsReq other) {
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;
Expand All @@ -212,12 +192,12 @@ public RankUpAvatarCsReq mergeFrom(final RankUpAvatarCsReq other) {
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);
}
Expand All @@ -231,8 +211,8 @@ public RankUpAvatarCsReq clear() {
}
cachedSize = -1;
bitField0_ = 0;
equipAvatarId = 0;
rank = 0;
avatarId = 0;
itemCostList.clear();
return this;
}
Expand All @@ -258,23 +238,23 @@ public boolean equals(Object o) {
}
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);
output.writeRawByte((byte) 8);
output.writeUInt32NoTag(rank);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 104);
output.writeUInt32NoTag(rank);
output.writeRawByte((byte) 96);
output.writeUInt32NoTag(avatarId);
}
if ((bitField0_ & 0x00000004) != 0) {
output.writeRawByte((byte) 42);
output.writeRawByte((byte) 18);
output.writeMessageNoTag(itemCostList);
}
}
Expand All @@ -283,10 +263,10 @@ public void writeTo(final ProtoSink output) throws IOException {
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);
Expand All @@ -301,25 +281,25 @@ public RankUpAvatarCsReq mergeFrom(final ProtoSource input) throws IOException {
int tag = input.readTag();
while (true) {
switch (tag) {
case 24: {
// equipAvatarId
equipAvatarId = input.readUInt32();
case 8: {
// rank
rank = input.readUInt32();
bitField0_ |= 0x00000001;
tag = input.readTag();
if (tag != 104) {
if (tag != 96) {
break;
}
}
case 104: {
// rank
rank = input.readUInt32();
case 96: {
// avatarId
avatarId = input.readUInt32();
bitField0_ |= 0x00000002;
tag = input.readTag();
if (tag != 42) {
if (tag != 18) {
break;
}
}
case 42: {
case 18: {
// itemCostList
input.readMessage(itemCostList);
bitField0_ |= 0x00000004;
Expand All @@ -346,10 +326,10 @@ public RankUpAvatarCsReq mergeFrom(final ProtoSource input) throws IOException {
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);
Expand All @@ -364,22 +344,22 @@ public RankUpAvatarCsReq mergeFrom(final JsonSource input) throws IOException {
}
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 {
input.skipUnknownField();
}
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 {
Expand Down Expand Up @@ -452,10 +432,10 @@ public RankUpAvatarCsReq create() {
* 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");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e80b0fd

Please sign in to comment.