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:
parent
3848fc60a6
commit
ebda186553
3 changed files with 13 additions and 16 deletions
|
@ -87,20 +87,14 @@ void Sapphire::World::Manager::HousingMgr::sendLandSignOwned( Entity::Player& pl
|
||||||
|
|
||||||
auto land = hZone->getLand( ident.landId );
|
auto land = hZone->getLand( ident.landId );
|
||||||
if( !land )
|
if( !land )
|
||||||
{
|
return;
|
||||||
land = getLandByOwnerId( player.getId() );
|
|
||||||
}
|
|
||||||
|
|
||||||
auto landInfoSignPacket = makeZonePacket< Server::FFXIVIpcLandInfoSign >( player.getId() );
|
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().houseSize = land->getSize();
|
||||||
landInfoSignPacket->data().houseType = static_cast< uint8_t >( land->getLandType() );
|
landInfoSignPacket->data().houseType = static_cast< uint8_t >( land->getLandType() );
|
||||||
landInfoSignPacket->data().landIdent = ident;
|
landInfoSignPacket->data().landIdent = ident;
|
||||||
landInfoSignPacket->data().houseIconAdd = land->getSharing();
|
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() )
|
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() );
|
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() );
|
memcpy( &landInfoSignPacket->data().ownerName, playerName.c_str(), playerName.size() );
|
||||||
|
|
||||||
player.queuePacket( landInfoSignPacket );
|
player.queuePacket( landInfoSignPacket );
|
||||||
|
@ -458,8 +455,8 @@ Sapphire::Common::LandIdent Sapphire::World::Manager::HousingMgr::clientTriggerP
|
||||||
Common::LandIdent ident;
|
Common::LandIdent ident;
|
||||||
ident.worldId = param11 >> 16;
|
ident.worldId = param11 >> 16;
|
||||||
ident.territoryTypeId = param11 & 0xFFFF;
|
ident.territoryTypeId = param11 & 0xFFFF;
|
||||||
ident.wardNum = param12 >> 16;
|
ident.wardNum = (param12 >> 8) & 0xFF;
|
||||||
ident.landId = param12 & 0xFFFF;
|
ident.landId = param12 & 0xFF;
|
||||||
|
|
||||||
return ident;
|
return ident;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ void Sapphire::Land::init()
|
||||||
m_size = res->getUInt( "Size" );
|
m_size = res->getUInt( "Size" );
|
||||||
m_state = res->getUInt( "Status" );
|
m_state = res->getUInt( "Status" );
|
||||||
m_currentPrice = res->getUInt( "LandPrice" );
|
m_currentPrice = res->getUInt( "LandPrice" );
|
||||||
m_ownerPlayerId = res->getUInt( "OwnerId" );
|
m_ownerPlayerId = res->getUInt64( "OwnerId" );
|
||||||
m_minPrice = m_landInfo->minPrice[ m_landId ];
|
m_minPrice = m_landInfo->minPrice[ m_landId ];
|
||||||
m_maxPrice = m_landInfo->initialPrice[ m_landId ];
|
m_maxPrice = m_landInfo->initialPrice[ m_landId ];
|
||||||
|
|
||||||
|
@ -240,12 +240,12 @@ uint32_t Sapphire::Land::getFcColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Player
|
//Player
|
||||||
void Sapphire::Land::setPlayerOwner( uint32_t id )
|
void Sapphire::Land::setPlayerOwner( uint64_t id )
|
||||||
{
|
{
|
||||||
m_ownerPlayerId = id;
|
m_ownerPlayerId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Sapphire::Land::getPlayerOwner()
|
uint64_t Sapphire::Land::getPlayerOwner()
|
||||||
{
|
{
|
||||||
return m_ownerPlayerId;
|
return m_ownerPlayerId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,8 @@ namespace Sapphire
|
||||||
uint32_t getFcColor();
|
uint32_t getFcColor();
|
||||||
|
|
||||||
//Player
|
//Player
|
||||||
void setPlayerOwner( uint32_t id );
|
void setPlayerOwner( uint64_t id );
|
||||||
uint32_t getPlayerOwner();
|
uint64_t getPlayerOwner();
|
||||||
//Housing Functions
|
//Housing Functions
|
||||||
void setCurrentPrice( uint32_t currentPrice );
|
void setCurrentPrice( uint32_t currentPrice );
|
||||||
bool setPreset( uint32_t itemId );
|
bool setPreset( uint32_t itemId );
|
||||||
|
@ -82,7 +82,7 @@ namespace Sapphire
|
||||||
|
|
||||||
Common::FFXIVARR_POSITION3 m_mapMarkerPosition;
|
Common::FFXIVARR_POSITION3 m_mapMarkerPosition;
|
||||||
|
|
||||||
uint32_t m_ownerPlayerId;
|
uint64_t m_ownerPlayerId;
|
||||||
Sapphire::Data::HousingLandSetPtr m_landInfo;
|
Sapphire::Data::HousingLandSetPtr m_landInfo;
|
||||||
|
|
||||||
Sapphire::HousePtr m_pHouse;
|
Sapphire::HousePtr m_pHouse;
|
||||||
|
|
Loading…
Add table
Reference in a new issue