1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

minor cleanup and fix ward/landid being read incorrectly

This commit is contained in:
NotAdam 2018-12-19 00:54:25 +11:00
parent f44c6b5efe
commit 107c94f33c
3 changed files with 13 additions and 16 deletions

View file

@ -87,20 +87,14 @@ void Sapphire::World::Manager::HousingMgr::sendLandSignOwned( Entity::Player& pl
auto land = hZone->getLand( ident.landId );
if( !land )
{
land = getLandByOwnerId( player.getId() );
}
return;
auto landInfoSignPacket = makeZonePacket< Server::FFXIVIpcLandInfoSign >( player.getId() );
uint32_t playerId = land->getPlayerOwner();
std::string playerName = g_fw.get< Sapphire::ServerMgr >()->getPlayerNameFromDb( playerId );
//memcpy( &landInfoSignPacket->data().estateGreeting, "Hello World", 11 );
//memcpy( &landInfoSignPacket->data().estateName, land->getLandName().c_str(), land->getLandName().size() );
landInfoSignPacket->data().houseSize = land->getSize();
landInfoSignPacket->data().houseType = static_cast< uint8_t >( land->getLandType() );
landInfoSignPacket->data().landIdent = ident;
landInfoSignPacket->data().houseIconAdd = land->getSharing();
landInfoSignPacket->data().ownerId = player.getContentId(); // should be real owner contentId, not player.contentId()
landInfoSignPacket->data().ownerId = player.getContentId(); // todo: should be real owner contentId, not player.contentId()
if( auto house = land->getHouse() )
{
@ -108,6 +102,9 @@ void Sapphire::World::Manager::HousingMgr::sendLandSignOwned( Entity::Player& pl
std::strcpy( landInfoSignPacket->data().estateGreeting, house->getHouseGreeting().c_str() );
}
uint32_t playerId = land->getPlayerOwner();
std::string playerName = g_fw.get< Sapphire::ServerMgr >()->getPlayerNameFromDb( playerId );
memcpy( &landInfoSignPacket->data().ownerName, playerName.c_str(), playerName.size() );
player.queuePacket( landInfoSignPacket );
@ -458,8 +455,8 @@ Sapphire::Common::LandIdent Sapphire::World::Manager::HousingMgr::clientTriggerP
Common::LandIdent ident;
ident.worldId = param11 >> 16;
ident.territoryTypeId = param11 & 0xFFFF;
ident.wardNum = param12 >> 16;
ident.landId = param12 & 0xFFFF;
ident.wardNum = (param12 >> 8) & 0xFF;
ident.landId = param12 & 0xFF;
return ident;
}

View file

@ -77,7 +77,7 @@ void Sapphire::Land::init()
m_size = res->getUInt( "Size" );
m_state = res->getUInt( "Status" );
m_currentPrice = res->getUInt( "LandPrice" );
m_ownerPlayerId = res->getUInt( "OwnerId" );
m_ownerPlayerId = res->getUInt64( "OwnerId" );
m_minPrice = m_landInfo->minPrice[ m_landId ];
m_maxPrice = m_landInfo->initialPrice[ m_landId ];
@ -240,12 +240,12 @@ uint32_t Sapphire::Land::getFcColor()
}
//Player
void Sapphire::Land::setPlayerOwner( uint32_t id )
void Sapphire::Land::setPlayerOwner( uint64_t id )
{
m_ownerPlayerId = id;
}
uint32_t Sapphire::Land::getPlayerOwner()
uint64_t Sapphire::Land::getPlayerOwner()
{
return m_ownerPlayerId;
}

View file

@ -45,8 +45,8 @@ namespace Sapphire
uint32_t getFcColor();
//Player
void setPlayerOwner( uint32_t id );
uint32_t getPlayerOwner();
void setPlayerOwner( uint64_t id );
uint64_t getPlayerOwner();
//Housing Functions
void setCurrentPrice( uint32_t currentPrice );
bool setPreset( uint32_t itemId );
@ -82,7 +82,7 @@ namespace Sapphire
Common::FFXIVARR_POSITION3 m_mapMarkerPosition;
uint32_t m_ownerPlayerId;
uint64_t m_ownerPlayerId;
Sapphire::Data::HousingLandSetPtr m_landInfo;
Sapphire::HousePtr m_pHouse;