Skip to content

Commit

Permalink
Update src/client/protocolgameparse.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Luan Luciano <[email protected]>
  • Loading branch information
kokekanon and luanluciano93 authored Nov 25, 2024
1 parent 7d4df98 commit 55f6a1e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/client/protocolgameparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3839,12 +3839,12 @@ void ProtocolGame::parseCyclopediaHousesInfo(const InputMessagePtr& msg)
void ProtocolGame::parseCyclopediaHouseList(const InputMessagePtr& msg)
{
const uint16_t housesCount = msg->getU16(); // housesCount
for (int i = 0; i < housesCount; ++i) {
for (auto i = 0; i < housesCount; ++i) {
msg->getU32(); // clientId
msg->getU8(); // 0x00 = Renovation, 0x01 = Available

const auto type = static_cast<Otc::CyclopediaHouseState_t>(msg->getU8());
switch (type) {

case Otc::CYCLOPEDIA_HOUSE_STATE_AVAILABLE: {
std::string bidderName = msg->getString();
const auto isBidder = static_cast<bool>(msg->getU8());
Expand All @@ -3859,18 +3859,17 @@ void ProtocolGame::parseCyclopediaHouseList(const InputMessagePtr& msg)
}
break;
}

case Otc::CYCLOPEDIA_HOUSE_STATE_RENTED: {
msg->getString(); // ownerName
msg->getU32(); // paidUntil

if (const auto isRented = static_cast<bool>(msg->getU8()); isRented) {

const auto isRented = static_cast<bool>(msg->getU8());
if (isRented) {
msg->getU8(); // unknown
msg->getU8(); // unknown
}
break;
}

case Otc::CYCLOPEDIA_HOUSE_STATE_TRANSFER: {
msg->getString(); // ownerName
msg->getU32(); // paidUntil
Expand All @@ -3883,8 +3882,9 @@ void ProtocolGame::parseCyclopediaHouseList(const InputMessagePtr& msg)
msg->getString(); // bidderName
msg->getU8(); // unknown
msg->getU64(); // internalBid

if (const auto isNewOwner = static_cast<bool>(msg->getU8()); isNewOwner) {

const auto isNewOwner = static_cast<bool>(msg->getU8());
if (isNewOwner) {
msg->getU8(); // acceptTransferError
msg->getU8(); // rejectTransferError
}
Expand All @@ -3894,12 +3894,12 @@ void ProtocolGame::parseCyclopediaHouseList(const InputMessagePtr& msg)
}
break;
}

case Otc::CYCLOPEDIA_HOUSE_STATE_MOVEOUT: {
msg->getString(); // ownerName
msg->getU32(); // paidUntil

if (const auto isOwner = static_cast<bool>(msg->getU8()); isOwner) {
const auto isOwner = static_cast<bool>(msg->getU8());
if (isOwner) {
msg->getU8(); // unknown
msg->getU8(); // unknown
msg->getU32(); // bidEndDate
Expand Down

0 comments on commit 55f6a1e

Please sign in to comment.