mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
Merge remote-tracking branch 'origin/housing' into develop
This commit is contained in:
commit
c0f2f7880c
21 changed files with 267 additions and 173 deletions
|
@ -13,9 +13,7 @@ matrix:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-trusty-6.0
|
|
||||||
packages:
|
packages:
|
||||||
- clang-6.0
|
|
||||||
- g++-7
|
- g++-7
|
||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||||
|
@ -29,8 +27,7 @@ cache:
|
||||||
# Setup build matrix and dependencies
|
# Setup build matrix and dependencies
|
||||||
before_install:
|
before_install:
|
||||||
- eval "${MATRIX_EVAL}"
|
- eval "${MATRIX_EVAL}"
|
||||||
- gem install --no-ri --no-rdoc mtime_cache
|
- gem install mtime_cache --no-document
|
||||||
- sudo add-apt-repository -y ppa:rexut/recoil
|
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get install -y libmysqlclient-dev
|
- sudo apt-get install -y libmysqlclient-dev
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://discord.gg/xxcdCER)
|
[](https://discord.gg/xxcdCER)
|
||||||
[](https://travis-ci.org/SapphireMordred/Sapphire)
|
[](https://travis-ci.org/SapphireServer/Sapphire)
|
||||||
[](https://ci.appveyor.com/project/SapphireMordred/Sapphire)
|
[](https://ci.appveyor.com/project/SapphireMordred/Sapphire)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -530,9 +530,10 @@ CREATE TABLE `landset` (
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
CREATE TABLE `houseiteminventory` (
|
CREATE TABLE `houseiteminventory` (
|
||||||
`landIdent` BIGINT(20) UNSIGNED NOT NULL,
|
`LandIdent` BIGINT(20) UNSIGNED NOT NULL,
|
||||||
`containerId` INT(10) UNSIGNED NOT NULL,
|
`ContainerId` INT(10) UNSIGNED NOT NULL,
|
||||||
`itemId` INT(20) NOT NULL,
|
`ItemId` INT(20) NOT NULL,
|
||||||
|
`SlotId` INT(10) UNSIGNED NOT NULL,
|
||||||
INDEX `landIdent` (`landIdent`)
|
INDEX `landIdent` (`landIdent`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
|
|
@ -222,10 +222,36 @@ namespace Sapphire::Common
|
||||||
FreeCompanyGil = 22000,
|
FreeCompanyGil = 22000,
|
||||||
FreeCompanyCrystal = 22001,
|
FreeCompanyCrystal = 22001,
|
||||||
|
|
||||||
HousingExternalAppearance = 25000,
|
// housing interior containers
|
||||||
HousingOutdoorItemStoreroom = 25001,
|
HousingInteriorAppearance = 25002,
|
||||||
HousingInternalAppearance = 25002,
|
|
||||||
HousingIndoorItemStoreroom = 25003,
|
// 50 in each container max, 300 slots max
|
||||||
|
HousingInteriorPlacedItems1 = 25003,
|
||||||
|
HousingInteriorPlacedItems2 = 25004,
|
||||||
|
HousingInteriorPlacedItems3 = 25005,
|
||||||
|
HousingInteriorPlacedItems4 = 25006,
|
||||||
|
HousingInteriorPlacedItems5 = 25007,
|
||||||
|
HousingInteriorPlacedItems6 = 25008,
|
||||||
|
|
||||||
|
// 50 max per container, 400 slots max
|
||||||
|
// slot limit increased 'temporarily' for relocation for all estates
|
||||||
|
// see: https://na.finalfantasyxiv.com/lodestone/topics/detail/d781e0d538428aef93b8bed4b50dd62c3c50fc74
|
||||||
|
HousingInteriorStoreroom1 = 27001,
|
||||||
|
HousingInteriorStoreroom2 = 27002,
|
||||||
|
HousingInteriorStoreroom3 = 27003,
|
||||||
|
HousingInteriorStoreroom4 = 27004,
|
||||||
|
HousingInteriorStoreroom5 = 27005,
|
||||||
|
HousingInteriorStoreroom6 = 27006,
|
||||||
|
HousingInteriorStoreroom7 = 27007,
|
||||||
|
HousingInteriorStoreroom8 = 27008,
|
||||||
|
|
||||||
|
|
||||||
|
// housing exterior containers
|
||||||
|
HousingOutdoorPlacedItems = 25001,
|
||||||
|
HousingOutdoorAppearance = 25000,
|
||||||
|
HousingOutdoorStoreroom = 27000,
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ContainerType : uint16_t
|
enum ContainerType : uint16_t
|
||||||
|
|
|
@ -200,6 +200,18 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements()
|
||||||
"UPDATE house SET BuildTime = ?, Aetheryte = ?, Comment = ?, HouseName = ?, Endorsements = ?, HousePartModels = ?, HousePartColours = ?, HouseInteriorModels = ? WHERE HouseId = ?;",
|
"UPDATE house SET BuildTime = ?, Aetheryte = ?, Comment = ?, HouseName = ?, Endorsements = ?, HousePartModels = ?, HousePartColours = ?, HouseInteriorModels = ? WHERE HouseId = ?;",
|
||||||
CONNECTION_BOTH );
|
CONNECTION_BOTH );
|
||||||
|
|
||||||
|
prepareStatement( LAND_INV_SEL_ALL,
|
||||||
|
"SELECT LandIdent, ContainerId, ItemId, SlotId FROM houseiteminventory;",
|
||||||
|
CONNECTION_BOTH );
|
||||||
|
|
||||||
|
prepareStatement( LAND_INV_SEL_HOUSE,
|
||||||
|
"SELECT LandIdent, ContainerId, ItemId, SlotId FROM houseiteminventory WHERE LandIdent = ?",
|
||||||
|
CONNECTION_SYNC );
|
||||||
|
|
||||||
|
prepareStatement( LANDSET_SEL,
|
||||||
|
"SELECT * FROM land WHERE LandSetId = ?;",
|
||||||
|
CONNECTION_SYNC );
|
||||||
|
|
||||||
/*prepareStatement( LAND_INS,
|
/*prepareStatement( LAND_INS,
|
||||||
"INSERT INTO land ( LandSetId ) VALUES ( ? );",
|
"INSERT INTO land ( LandSetId ) VALUES ( ? );",
|
||||||
CONNECTION_BOTH );
|
CONNECTION_BOTH );
|
||||||
|
|
|
@ -81,10 +81,16 @@ namespace Sapphire::Db
|
||||||
LAND_INS,
|
LAND_INS,
|
||||||
LAND_SEL,
|
LAND_SEL,
|
||||||
LAND_UP,
|
LAND_UP,
|
||||||
|
LANDSET_SEL,
|
||||||
HOUSING_HOUSE_INS,
|
HOUSING_HOUSE_INS,
|
||||||
HOUSING_HOUSE_UP,
|
HOUSING_HOUSE_UP,
|
||||||
HOUSING_HOUSE_DEL,
|
HOUSING_HOUSE_DEL,
|
||||||
|
|
||||||
|
LAND_INV_SEL_ALL,
|
||||||
|
LAND_INV_SEL_HOUSE,
|
||||||
|
LAND_INV_DEL,
|
||||||
|
LAND_INV_UP,
|
||||||
|
|
||||||
|
|
||||||
MAX_STATEMENTS
|
MAX_STATEMENTS
|
||||||
};
|
};
|
||||||
|
|
|
@ -304,6 +304,7 @@ enum ActorControlType : uint16_t
|
||||||
AchievementCritReq = 0x3E8,
|
AchievementCritReq = 0x3E8,
|
||||||
AchievementList = 0x3E9,
|
AchievementList = 0x3E9,
|
||||||
|
|
||||||
|
SetEstateLightingLevel = 0x40B, // param1 = light level 0 - 5 maps to UI val 5-0
|
||||||
RequestHousingBuildPreset = 0x44C,
|
RequestHousingBuildPreset = 0x44C,
|
||||||
RequestEstateHallRemoval = 0x44F,
|
RequestEstateHallRemoval = 0x44F,
|
||||||
RequestBuildPreset = 0x450, // no idea what this is, it gets sent with BuildPresetHandler and has the plot id in param1
|
RequestBuildPreset = 0x450, // no idea what this is, it gets sent with BuildPresetHandler and has the plot id in param1
|
||||||
|
|
|
@ -1618,7 +1618,7 @@ void Sapphire::Entity::Player::sendZonePackets()
|
||||||
state |= HasAetheryte;
|
state |= HasAetheryte;
|
||||||
}
|
}
|
||||||
|
|
||||||
setLandFlags( LandFlagsSlot::Private, state, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
setLandFlags( LandFlagsSlot::Private, state, pLand->getLandIdent() );
|
||||||
}
|
}
|
||||||
|
|
||||||
sendLandFlags();
|
sendLandFlags();
|
||||||
|
@ -1799,12 +1799,10 @@ bool Sapphire::Entity::Player::isOnEnterEventDone() const
|
||||||
return m_onEnterEventDone;
|
return m_onEnterEventDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags,
|
void Sapphire::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags, Common::LandIdent ident )
|
||||||
int16_t landId, int16_t wardNum, int16_t zoneId )
|
|
||||||
{
|
{
|
||||||
m_landFlags[ flagSlot ].landIdent.landId = landId;
|
m_landFlags[ flagSlot ].landIdent = ident;
|
||||||
m_landFlags[ flagSlot ].landIdent.wardNum = wardNum;
|
// todo: leave this in for now but we really need to handle this world id shit properly
|
||||||
m_landFlags[ flagSlot ].landIdent.territoryTypeId = zoneId;
|
|
||||||
m_landFlags[ flagSlot ].landIdent.worldId = 67;
|
m_landFlags[ flagSlot ].landIdent.worldId = 67;
|
||||||
m_landFlags[ flagSlot ].landFlags = landFlags;
|
m_landFlags[ flagSlot ].landFlags = landFlags;
|
||||||
m_landFlags[ flagSlot ].unkown1 = 0;
|
m_landFlags[ flagSlot ].unkown1 = 0;
|
||||||
|
|
|
@ -765,7 +765,7 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
// Housing Handling
|
// Housing Handling
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, int16_t landId, int16_t wardNum, int16_t zoneId );
|
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, Common::LandIdent ident );
|
||||||
|
|
||||||
void sendLandFlags();
|
void sendLandFlags();
|
||||||
void sendLandFlagsSlot( Common::LandFlagsSlot slot );
|
void sendLandFlagsSlot( Common::LandFlagsSlot slot );
|
||||||
|
@ -910,6 +910,8 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
bool isObtainable( uint32_t catalogId, uint8_t quantity );
|
bool isObtainable( uint32_t catalogId, uint8_t quantity );
|
||||||
|
|
||||||
|
uint32_t getNextInventorySequence();
|
||||||
|
|
||||||
void send();
|
void send();
|
||||||
|
|
||||||
uint8_t getFreeSlotsInBags();
|
uint8_t getFreeSlotsInBags();
|
||||||
|
@ -939,6 +941,8 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
bool m_onEnterEventDone;
|
bool m_onEnterEventDone;
|
||||||
|
|
||||||
|
uint32_t m_inventorySequence;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using InventoryMap = std::map< uint16_t, Sapphire::ItemContainerPtr >;
|
using InventoryMap = std::map< uint16_t, Sapphire::ItemContainerPtr >;
|
||||||
|
|
||||||
|
|
|
@ -357,14 +357,11 @@ void Sapphire::Entity::Player::removeCrystal( Common::CrystalType type, uint32_t
|
||||||
|
|
||||||
void Sapphire::Entity::Player::sendInventory()
|
void Sapphire::Entity::Player::sendInventory()
|
||||||
{
|
{
|
||||||
InventoryMap::iterator it;
|
|
||||||
|
|
||||||
auto pInvMgr = g_fw.get< World::Manager::InventoryMgr >();
|
auto pInvMgr = g_fw.get< World::Manager::InventoryMgr >();
|
||||||
|
|
||||||
uint32_t count = 0;
|
for( auto it = m_storageMap.begin(); it != m_storageMap.end(); ++it )
|
||||||
for( it = m_storageMap.begin(); it != m_storageMap.end(); ++it, ++count )
|
|
||||||
{
|
{
|
||||||
pInvMgr->sendInventoryContainer( *this, it->second, count );
|
pInvMgr->sendInventoryContainer( *this, it->second );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,3 +864,8 @@ bool Sapphire::Entity::Player::collectHandInItems( std::vector< uint32_t > itemI
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t Sapphire::Entity::Player::getNextInventorySequence()
|
||||||
|
{
|
||||||
|
return m_inventorySequence++;
|
||||||
|
}
|
||||||
|
|
|
@ -1006,29 +1006,34 @@ void Sapphire::DebugCommandHandler::housing( char* data, Entity::Player& player,
|
||||||
subCommand = params;
|
subCommand = params;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( subCommand == "permission" || subCommand == "perm" )
|
// if( subCommand == "permission" || subCommand == "perm" )
|
||||||
{
|
// {
|
||||||
uint8_t permissionSet;
|
// uint8_t permissionSet;
|
||||||
sscanf( params.c_str(), "%hhu", &permissionSet );
|
// sscanf( params.c_str(), "%hhu", &permissionSet );
|
||||||
|
//
|
||||||
if ( permissionSet < 5 )
|
// if ( permissionSet < 5 )
|
||||||
{
|
// {
|
||||||
auto pZone = player.getCurrentZone();
|
// auto pZone = player.getCurrentZone();
|
||||||
if( pTeriMgr->isHousingTerritory( pZone->getTerritoryTypeId() ) )
|
// if( pTeriMgr->isHousingTerritory( pZone->getTerritoryTypeId() ) )
|
||||||
{
|
// {
|
||||||
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
|
// auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
|
||||||
if( pHousing )
|
// if( pHousing )
|
||||||
{
|
// {
|
||||||
player.setLandFlags( permissionSet, 0, pHousing->getLandSetId(), pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
// // todo: wat?
|
||||||
player.sendLandFlags();
|
// Common::LandIdent ident {};
|
||||||
}
|
// ident.wardNum = pHousing->getWardNum();
|
||||||
else
|
// ident.territoryTypeId = pHousing->getTerritoryTypeId();
|
||||||
player.sendDebug( "You aren't in a housing Zone." );
|
//
|
||||||
}
|
// player.setLandFlags( permissionSet, 0, pHousing->getLandSetId(), ident );
|
||||||
}
|
// player.sendLandFlags();
|
||||||
else
|
// }
|
||||||
player.sendDebug( "PermissionSet out of range." );
|
// else
|
||||||
}
|
// player.sendDebug( "You aren't in a housing Zone." );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// player.sendDebug( "PermissionSet out of range." );
|
||||||
|
// }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.sendDebug( "Unknown sub command." );
|
player.sendDebug( "Unknown sub command." );
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "Framework.h"
|
#include "Framework.h"
|
||||||
#include "ServerMgr.h"
|
#include "ServerMgr.h"
|
||||||
#include "Territory/House.h"
|
#include "Territory/House.h"
|
||||||
|
#include "InventoryMgr.h"
|
||||||
|
|
||||||
using namespace Sapphire::Common;
|
using namespace Sapphire::Common;
|
||||||
using namespace Sapphire::Network;
|
using namespace Sapphire::Network;
|
||||||
|
@ -164,8 +165,7 @@ Sapphire::LandPurchaseResult Sapphire::World::Manager::HousingMgr::purchaseLand(
|
||||||
pLand->setState( HouseState::sold );
|
pLand->setState( HouseState::sold );
|
||||||
pLand->setLandType( Common::LandType::Private );
|
pLand->setLandType( Common::LandType::Private );
|
||||||
|
|
||||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, plot,
|
player.setLandFlags( LandFlagsSlot::Private, 0x00, pLand->getLandIdent() );
|
||||||
pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
|
||||||
|
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
|
@ -216,12 +216,14 @@ bool Sapphire::World::Manager::HousingMgr::relinquishLand( Entity::Player& playe
|
||||||
pLand->setLandType( Common::LandType::none );
|
pLand->setLandType( Common::LandType::none );
|
||||||
pLand->updateLandDb();
|
pLand->updateLandDb();
|
||||||
|
|
||||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, 0xFF, 0xFF, 0xFF );
|
Common::LandIdent ident { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||||
|
|
||||||
|
player.setLandFlags( LandFlagsSlot::Private, 0x00, ident );
|
||||||
|
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
auto screenMsgPkt2 = makeActorControl143( player.getId(), ActorControl::LogMsg, 3351, 0x1AA,
|
auto screenMsgPkt2 = makeActorControl143( player.getId(), ActorControl::LogMsg, 3351, 0x1AA,
|
||||||
pLand->getWardNum() + 1, plot + 1 );
|
pLand->getLandIdent().wardNum + 1, plot + 1 );
|
||||||
player.queuePacket( screenMsgPkt2 );
|
player.queuePacket( screenMsgPkt2 );
|
||||||
pHousing->sendLandUpdate( plot );
|
pHousing->sendLandUpdate( plot );
|
||||||
|
|
||||||
|
@ -350,7 +352,7 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
|
||||||
player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
||||||
player.playScene( 0x000B0095, 0, SET_BASE | HIDE_HOTBAR , 0, 1, plotNum, nullptr );
|
player.playScene( 0x000B0095, 0, SET_BASE | HIDE_HOTBAR , 0, 1, plotNum, nullptr );
|
||||||
|
|
||||||
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, pLand->getLandIdent() );
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
hZone->registerHouseEntranceEObj( plotNum );
|
hZone->registerHouseEntranceEObj( plotNum );
|
||||||
|
@ -508,5 +510,10 @@ void Sapphire::World::Manager::HousingMgr::sendHousingInventory( Entity::Player&
|
||||||
if( targetLand->getOwnerId() != player.getId() )
|
if( targetLand->getOwnerId() != player.getId() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
player.sendDebug( "got inventory for plot: " + targetLand->getHouse()->getHouseName() );
|
auto container = targetLand->getItemContainer( inventoryType );
|
||||||
|
if( !container )
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto invMgr = g_fw.get< Manager::InventoryMgr >();
|
||||||
|
invMgr->sendInventoryContainer( player, container );
|
||||||
}
|
}
|
|
@ -10,9 +10,9 @@
|
||||||
using namespace Sapphire::Network::Packets;
|
using namespace Sapphire::Network::Packets;
|
||||||
|
|
||||||
void Sapphire::World::Manager::InventoryMgr::sendInventoryContainer( Sapphire::Entity::Player& player,
|
void Sapphire::World::Manager::InventoryMgr::sendInventoryContainer( Sapphire::Entity::Player& player,
|
||||||
Sapphire::ItemContainerPtr container,
|
Sapphire::ItemContainerPtr container )
|
||||||
uint32_t sequence )
|
|
||||||
{
|
{
|
||||||
|
auto sequence = player.getNextInventorySequence();
|
||||||
auto pMap = container->getItemMap();
|
auto pMap = container->getItemMap();
|
||||||
|
|
||||||
for( auto itM = pMap.begin(); itM != pMap.end(); ++itM )
|
for( auto itM = pMap.begin(); itM != pMap.end(); ++itM )
|
||||||
|
|
|
@ -9,8 +9,7 @@ namespace Sapphire::World::Manager
|
||||||
class InventoryMgr
|
class InventoryMgr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void sendInventoryContainer( Sapphire::Entity::Player& player, Sapphire::ItemContainerPtr container,
|
void sendInventoryContainer( Sapphire::Entity::Player& player, Sapphire::ItemContainerPtr container );
|
||||||
uint32_t sequence = 0 );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,16 +423,18 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( const Packets::FFX
|
||||||
}
|
}
|
||||||
case ClientTriggerType::RequestLandInventory:
|
case ClientTriggerType::RequestLandInventory:
|
||||||
{
|
{
|
||||||
if( param2 != 1 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint8_t plot = ( param12 & 0xFF );
|
uint8_t plot = ( param12 & 0xFF );
|
||||||
|
|
||||||
|
|
||||||
auto housingMgr = g_fw.get< HousingMgr >();
|
auto housingMgr = g_fw.get< HousingMgr >();
|
||||||
if( !housingMgr )
|
if( !housingMgr )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
housingMgr->sendHousingInventory( player, Common::InventoryType::HousingOutdoorItemStoreroom, plot );
|
uint16_t inventoryType = Common::InventoryType::HousingOutdoorPlacedItems;
|
||||||
|
if( param2 == 1 )
|
||||||
|
inventoryType = Common::InventoryType::HousingOutdoorStoreroom;
|
||||||
|
|
||||||
|
housingMgr->sendHousingInventory( player, inventoryType, plot );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -446,7 +448,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( const Packets::FFX
|
||||||
if( !housingMgr )
|
if( !housingMgr )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
housingMgr->sendHousingInventory( player, Common::InventoryType::HousingIndoorItemStoreroom, 255 );
|
// housingMgr->sendHousingInventory( player, Common::InventoryType::HousingInd, 255 );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,10 @@
|
||||||
|
|
||||||
extern Sapphire::Framework g_fw;
|
extern Sapphire::Framework g_fw;
|
||||||
|
|
||||||
Sapphire::House::House( uint32_t houseId, uint32_t landSetId, uint8_t landId, uint8_t wardNum, uint16_t territoryTypeId ) :
|
Sapphire::House::House( uint32_t houseId, uint32_t landSetId, Common::LandIdent ident ) :
|
||||||
m_houseId( houseId ),
|
m_houseId( houseId ),
|
||||||
m_landSetId( landSetId ),
|
m_landSetId( landSetId ),
|
||||||
m_landId( landId ),
|
m_landIdent( ident )
|
||||||
m_wardNum( wardNum ),
|
|
||||||
m_territoryTypeId( territoryTypeId )
|
|
||||||
{
|
{
|
||||||
auto pDB = g_fw.get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
auto pDB = g_fw.get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
||||||
|
|
||||||
|
@ -37,7 +35,7 @@ Sapphire::House::House( uint32_t houseId, uint32_t landSetId, uint8_t landId, ui
|
||||||
pDB->execute( stmt );
|
pDB->execute( stmt );
|
||||||
|
|
||||||
// todo: make this nicer/configurable?
|
// todo: make this nicer/configurable?
|
||||||
m_houseName = "Estate #" + std::to_string( landId + 1 );
|
m_houseName = "Estate #" + std::to_string( m_landIdent.landId + 1 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -121,19 +119,9 @@ uint32_t Sapphire::House::getLandSetId() const
|
||||||
return m_landSetId;
|
return m_landSetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Sapphire::House::getLandId() const
|
Sapphire::Common::LandIdent Sapphire::House::getLandIdent() const
|
||||||
{
|
{
|
||||||
return m_landId;
|
return m_landIdent;
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Sapphire::House::getWardNum() const
|
|
||||||
{
|
|
||||||
return m_wardNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t Sapphire::House::getTerritoryTypeId() const
|
|
||||||
{
|
|
||||||
return m_territoryTypeId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Sapphire::House::getHouseId() const
|
uint32_t Sapphire::House::getHouseId() const
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Sapphire
|
||||||
class House
|
class House
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
House( uint32_t houseId, uint32_t landSetId, uint8_t landId, uint8_t wardNum, uint16_t territoryTypeId );
|
House( uint32_t houseId, uint32_t landSetId, Common::LandIdent ident );
|
||||||
virtual ~House();
|
virtual ~House();
|
||||||
|
|
||||||
using HousePart = std::pair< uint32_t, uint8_t >;
|
using HousePart = std::pair< uint32_t, uint8_t >;
|
||||||
|
@ -20,9 +20,7 @@ namespace Sapphire
|
||||||
|
|
||||||
//gerneral
|
//gerneral
|
||||||
uint32_t getLandSetId() const;
|
uint32_t getLandSetId() const;
|
||||||
uint8_t getLandId() const;
|
Common::LandIdent getLandIdent() const;
|
||||||
uint8_t getWardNum() const;
|
|
||||||
uint16_t getTerritoryTypeId() const;
|
|
||||||
uint32_t getHouseId() const;
|
uint32_t getHouseId() const;
|
||||||
|
|
||||||
const std::string& getHouseName() const;
|
const std::string& getHouseName() const;
|
||||||
|
@ -45,9 +43,7 @@ namespace Sapphire
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t m_landSetId;
|
uint32_t m_landSetId;
|
||||||
uint8_t m_landId;
|
Common::LandIdent m_landIdent;
|
||||||
uint8_t m_wardNum;
|
|
||||||
uint16_t m_territoryTypeId;
|
|
||||||
uint32_t m_houseId;
|
uint32_t m_houseId;
|
||||||
|
|
||||||
uint64_t m_buildTime;
|
uint64_t m_buildTime;
|
||||||
|
|
|
@ -42,11 +42,14 @@ bool Sapphire::HousingZone::init()
|
||||||
{
|
{
|
||||||
|
|
||||||
auto pDb = g_fw.get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
auto pDb = g_fw.get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
||||||
|
{
|
||||||
auto res = pDb->query( "SELECT * FROM landset WHERE landsetid = " + std::to_string( m_landSetId ) );
|
auto res = pDb->query( "SELECT * FROM landset WHERE landsetid = " + std::to_string( m_landSetId ) );
|
||||||
if( !res->next() )
|
if( !res->next() )
|
||||||
{
|
{
|
||||||
pDb->directExecute( "INSERT INTO landset ( landsetid ) VALUES ( " + std::to_string( m_landSetId ) + " );" );
|
pDb->directExecute( "INSERT INTO landset ( landsetid ) VALUES ( " + std::to_string( m_landSetId ) + " );" );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int housingIndex;
|
int housingIndex;
|
||||||
if( m_territoryTypeId == 339 )
|
if( m_territoryTypeId == 339 )
|
||||||
|
@ -61,25 +64,46 @@ bool Sapphire::HousingZone::init()
|
||||||
auto pExdData = g_fw.get< Data::ExdDataGenerated >();
|
auto pExdData = g_fw.get< Data::ExdDataGenerated >();
|
||||||
auto info = pExdData->get< Sapphire::Data::HousingLandSet >( housingIndex );
|
auto info = pExdData->get< Sapphire::Data::HousingLandSet >( housingIndex );
|
||||||
|
|
||||||
uint32_t landId;
|
auto stmt = pDb->getPreparedStatement( Db::LANDSET_SEL );
|
||||||
for( landId = 0; landId < 60; landId++ )
|
stmt->setUInt64( 1, m_landSetId );
|
||||||
{
|
auto res = pDb->query( stmt );
|
||||||
auto pLand = make_Land( m_territoryTypeId, getWardNum(), landId, m_landSetId, info );
|
|
||||||
m_landPtrMap[ landId ] = pLand;
|
|
||||||
|
|
||||||
if( auto house = pLand->getHouse() )
|
std::vector< QueuedLandInit > landInit;
|
||||||
|
|
||||||
|
while( res->next() )
|
||||||
{
|
{
|
||||||
registerHouseEntranceEObj( landId << 8 );
|
|
||||||
|
QueuedLandInit init;
|
||||||
|
init.m_landId = res->getUInt64( "LandId" );
|
||||||
|
init.m_type = static_cast< Common::LandType >( res->getUInt( "Type" ) );
|
||||||
|
init.m_size = res->getUInt( "Size" );
|
||||||
|
init.m_status = res->getUInt( "Status" );
|
||||||
|
init.m_currentPrice = res->getUInt( "LandPrice" );
|
||||||
|
init.m_ownerId = res->getUInt64( "OwnerId" );
|
||||||
|
init.m_houseId = res->getUInt64( "HouseId" );
|
||||||
|
|
||||||
|
landInit.push_back( init );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nuke current query connection so the queries still in land don't fail
|
||||||
|
res.reset();
|
||||||
|
|
||||||
|
// spawn land
|
||||||
|
for( auto& init : landInit )
|
||||||
|
{
|
||||||
|
auto land = make_Land( m_territoryTypeId, getWardNum(), init.m_landId, m_landSetId, info );
|
||||||
|
land->init( init.m_type, init.m_size, init.m_status, init.m_currentPrice, init.m_ownerId, init.m_houseId );
|
||||||
|
|
||||||
|
m_landPtrMap[ init.m_landId ] = land;
|
||||||
|
|
||||||
|
if( init.m_houseId > 0 )
|
||||||
|
registerHouseEntranceEObj( init.m_landId );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sapphire::HousingZone::~HousingZone()
|
Sapphire::HousingZone::~HousingZone() = default;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sapphire::HousingZone::onPlayerZoneIn( Entity::Player& player )
|
void Sapphire::HousingZone::onPlayerZoneIn( Entity::Player& player )
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,6 +53,17 @@ namespace Sapphire
|
||||||
Entity::EventObjectPtr registerHouseEntranceEObj( uint8_t plotId );
|
Entity::EventObjectPtr registerHouseEntranceEObj( uint8_t plotId );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
struct QueuedLandInit
|
||||||
|
{
|
||||||
|
uint64_t m_landId;
|
||||||
|
Common::LandType m_type;
|
||||||
|
uint8_t m_size;
|
||||||
|
uint8_t m_status;
|
||||||
|
uint32_t m_currentPrice;
|
||||||
|
uint64_t m_ownerId;
|
||||||
|
uint64_t m_houseId;
|
||||||
|
};
|
||||||
|
|
||||||
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
|
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
|
||||||
const uint32_t m_landSetMax = 18;
|
const uint32_t m_landSetMax = 18;
|
||||||
LandPtrMap m_landPtrMap;
|
LandPtrMap m_landPtrMap;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "Actor/Player.h"
|
#include "Actor/Player.h"
|
||||||
#include "Inventory/ItemContainer.h"
|
#include "Inventory/ItemContainer.h"
|
||||||
#include "Inventory/Item.h"
|
#include "Inventory/Item.h"
|
||||||
|
#include "Inventory/ItemUtil.h"
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "Forwards.h"
|
||||||
#include "Land.h"
|
#include "Land.h"
|
||||||
|
@ -28,9 +29,6 @@ using namespace Sapphire::Common;
|
||||||
|
|
||||||
Sapphire::Land::Land( uint16_t territoryTypeId, uint8_t wardNum, uint8_t landId, uint32_t landSetId,
|
Sapphire::Land::Land( uint16_t territoryTypeId, uint8_t wardNum, uint8_t landId, uint32_t landSetId,
|
||||||
Sapphire::Data::HousingLandSetPtr info ) :
|
Sapphire::Data::HousingLandSetPtr info ) :
|
||||||
m_territoryTypeId( territoryTypeId ),
|
|
||||||
m_wardNum( wardNum ),
|
|
||||||
m_landId( landId ),
|
|
||||||
m_currentPrice( 0 ),
|
m_currentPrice( 0 ),
|
||||||
m_minPrice( 0 ),
|
m_minPrice( 0 ),
|
||||||
m_nextDrop( static_cast< uint32_t >( Util::getTimeSeconds() ) + 21600 ),
|
m_nextDrop( static_cast< uint32_t >( Util::getTimeSeconds() ) + 21600 ),
|
||||||
|
@ -45,52 +43,31 @@ Sapphire::Land::Land( uint16_t territoryTypeId, uint8_t wardNum, uint8_t landId,
|
||||||
{
|
{
|
||||||
memset( &m_tag, 0x00, 3 );
|
memset( &m_tag, 0x00, 3 );
|
||||||
|
|
||||||
init();
|
m_landIdent.landId = landId;
|
||||||
|
m_landIdent.territoryTypeId = territoryTypeId;
|
||||||
|
m_landIdent.wardNum = wardNum;
|
||||||
|
m_landIdent.worldId = 67; // todo: fix this
|
||||||
|
|
||||||
|
m_minPrice = m_landInfo->minPrice[ m_landIdent.landId ];
|
||||||
|
m_maxPrice = m_landInfo->initialPrice[ m_landIdent.landId ];
|
||||||
}
|
}
|
||||||
|
|
||||||
Sapphire::Land::~Land()
|
Sapphire::Land::~Land() = default;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
void Sapphire::Land::init( Common::LandType type, uint8_t size, uint8_t state, uint32_t currentPrice, uint64_t ownerId, uint64_t houseId )
|
||||||
|
|
||||||
void Sapphire::Land::init()
|
|
||||||
{
|
{
|
||||||
auto pDb = g_fw.get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
m_type = type;
|
||||||
auto res = pDb->query( "SELECT * FROM land WHERE LandSetId = " + std::to_string( m_landSetId ) + " "
|
m_size = size;
|
||||||
"AND LandId = " + std::to_string( m_landId ) );
|
m_state = state;
|
||||||
if( !res->next() )
|
m_currentPrice = currentPrice;
|
||||||
{
|
m_ownerId = ownerId;
|
||||||
pDb->directExecute( "INSERT INTO land ( landsetid, landid, type, size, status, landprice, UpdateTime, OwnerId, HouseId ) "
|
|
||||||
"VALUES ( " + std::to_string( m_landSetId ) + "," + std::to_string( m_landId ) + ","
|
|
||||||
+ std::to_string( static_cast< uint8_t >( m_type ) ) + ","
|
|
||||||
+ std::to_string( m_landInfo->plotSize[ m_landId ] ) + ","
|
|
||||||
+ " 1, " + std::to_string( m_landInfo->initialPrice[ m_landId ] ) + ", 0, 0, 0 );" );
|
|
||||||
|
|
||||||
m_currentPrice = m_landInfo->initialPrice[ m_landId ];
|
|
||||||
m_minPrice = m_landInfo->minPrice[ m_landId ];
|
|
||||||
m_size = m_landInfo->plotSize[ m_landId ];
|
|
||||||
m_state = HouseState::forSale;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_type = static_cast< Common::LandType >( res->getUInt( "Type" ) );
|
|
||||||
m_size = res->getUInt( "Size" );
|
|
||||||
m_state = res->getUInt( "Status" );
|
|
||||||
m_currentPrice = res->getUInt( "LandPrice" );
|
|
||||||
m_ownerId = res->getUInt64( "OwnerId" );
|
|
||||||
m_minPrice = m_landInfo->minPrice[ m_landId ];
|
|
||||||
m_maxPrice = m_landInfo->initialPrice[ m_landId ];
|
|
||||||
|
|
||||||
auto houseId = res->getUInt( "HouseId" );
|
|
||||||
|
|
||||||
// fetch the house if we have one for this land
|
// fetch the house if we have one for this land
|
||||||
if( houseId > 0 )
|
if( houseId > 0 )
|
||||||
m_pHouse = make_House( houseId, m_landSetId, m_landId, m_wardNum, m_territoryTypeId );
|
m_pHouse = make_House( houseId, m_landSetId, getLandIdent() );
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
auto pExdData = g_fw.get< Data::ExdDataGenerated >();
|
auto pExdData = g_fw.get< Data::ExdDataGenerated >();
|
||||||
auto info = pExdData->get< Sapphire::Data::HousingMapMarkerInfo >( getTerritoryTypeId(), getLandId() );
|
auto info = pExdData->get< Sapphire::Data::HousingMapMarkerInfo >( m_landIdent.territoryTypeId, m_landIdent.landId );
|
||||||
if( info )
|
if( info )
|
||||||
{
|
{
|
||||||
m_mapMarkerPosition.x = info->x;
|
m_mapMarkerPosition.x = info->x;
|
||||||
|
@ -117,15 +94,65 @@ void Sapphire::Land::init()
|
||||||
}
|
}
|
||||||
|
|
||||||
// init item containers
|
// init item containers
|
||||||
auto setupContainer = [ this ]( InventoryType type, uint8_t maxSize )
|
auto setupContainer = [ this ]( InventoryType type, uint16_t maxSize )
|
||||||
{
|
{
|
||||||
m_landInventoryMap[ type ] = make_ItemContainer( type, maxSize, "houseiteminventory", true, true );
|
m_landInventoryMap[ type ] = make_ItemContainer( type, maxSize, "houseiteminventory", true, true );
|
||||||
};
|
};
|
||||||
|
|
||||||
setupContainer( InventoryType::HousingExternalAppearance, 8 );
|
setupContainer( InventoryType::HousingOutdoorAppearance, 8 );
|
||||||
setupContainer( InventoryType::HousingInternalAppearance, 8 );
|
setupContainer( InventoryType::HousingOutdoorPlacedItems, m_maxPlacedExternalItems );
|
||||||
setupContainer( InventoryType::HousingOutdoorItemStoreroom, m_maxPlacedExternalItems );
|
setupContainer( InventoryType::HousingOutdoorStoreroom, m_maxPlacedExternalItems );
|
||||||
setupContainer( InventoryType::HousingIndoorItemStoreroom, m_maxPlacedInternalItems );
|
|
||||||
|
setupContainer( InventoryType::HousingInteriorAppearance, 9 );
|
||||||
|
|
||||||
|
// nb: so we're going to store these internally in one container because SE is fucked in the head
|
||||||
|
// but when an inventory is requested, we will split them into groups of 50
|
||||||
|
setupContainer( InventoryType::HousingInteriorPlacedItems1, m_maxPlacedInternalItems );
|
||||||
|
setupContainer( InventoryType::HousingInteriorStoreroom1, m_maxPlacedInternalItems );
|
||||||
|
|
||||||
|
loadItemContainerContents();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sapphire::Land::loadItemContainerContents()
|
||||||
|
{
|
||||||
|
if( !m_pHouse )
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto ident = *reinterpret_cast< uint64_t* >( &m_landIdent );
|
||||||
|
g_fw.get< Sapphire::Logger >()->debug( "Loading housing inventory for ident: " + std::to_string( ident ) );
|
||||||
|
|
||||||
|
auto pDB = g_fw.get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
||||||
|
|
||||||
|
auto stmt = pDB->getPreparedStatement( Db::LAND_INV_SEL_HOUSE );
|
||||||
|
stmt->setUInt64( 1, ident );
|
||||||
|
|
||||||
|
auto res = pDB->query( stmt );
|
||||||
|
|
||||||
|
std::unordered_map< uint16_t, std::vector< std::pair< uint16_t, uint32_t > > > items;
|
||||||
|
|
||||||
|
while( res->next() )
|
||||||
|
{
|
||||||
|
auto containerId = res->getUInt( "ContainerId" );
|
||||||
|
auto itemId = res->getUInt64( "ItemId" );
|
||||||
|
auto slotId = res->getUInt( "SlotId" );
|
||||||
|
|
||||||
|
items[ containerId ].push_back( std::make_pair( slotId, itemId ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
res.reset();
|
||||||
|
|
||||||
|
for( auto it = items.begin(); it != items.end(); it++ )
|
||||||
|
{
|
||||||
|
auto container = m_landInventoryMap[ it->first ];
|
||||||
|
|
||||||
|
// todo: delet this
|
||||||
|
for( auto fuck = it->second.begin(); fuck != it->second.end(); fuck++ )
|
||||||
|
{
|
||||||
|
auto item = Sapphire::Items::Util::loadItem( fuck->second );
|
||||||
|
if( item )
|
||||||
|
container->setItem( fuck->first, item );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Sapphire::Land::convertItemIdToHousingItemId( uint32_t itemId )
|
uint32_t Sapphire::Land::convertItemIdToHousingItemId( uint32_t itemId )
|
||||||
|
@ -186,19 +213,9 @@ uint32_t Sapphire::Land::getLandSetId() const
|
||||||
return m_landSetId;
|
return m_landSetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Sapphire::Land::getWardNum() const
|
Sapphire::Common::LandIdent Sapphire::Land::getLandIdent() const
|
||||||
{
|
{
|
||||||
return m_wardNum;
|
return m_landIdent;
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Sapphire::Land::getLandId() const
|
|
||||||
{
|
|
||||||
return m_landId;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t Sapphire::Land::getTerritoryTypeId() const
|
|
||||||
{
|
|
||||||
return m_territoryTypeId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Sapphire::HousePtr Sapphire::Land::getHouse() const
|
Sapphire::HousePtr Sapphire::Land::getHouse() const
|
||||||
|
@ -286,7 +303,7 @@ void Sapphire::Land::updateLandDb()
|
||||||
+ ", HouseId = " + std::to_string( houseId )
|
+ ", HouseId = " + std::to_string( houseId )
|
||||||
+ ", Type = " + std::to_string( static_cast< uint32_t >( m_type ) ) //TODO: add house id
|
+ ", Type = " + std::to_string( static_cast< uint32_t >( m_type ) ) //TODO: add house id
|
||||||
+ " WHERE LandSetId = " + std::to_string( m_landSetId )
|
+ " WHERE LandSetId = " + std::to_string( m_landSetId )
|
||||||
+ " AND LandId = " + std::to_string( m_landId ) + ";" );
|
+ " AND LandId = " + std::to_string( m_landIdent.landId ) + ";" );
|
||||||
|
|
||||||
if( auto house = getHouse() )
|
if( auto house = getHouse() )
|
||||||
house->updateHouseDb();
|
house->updateHouseDb();
|
||||||
|
@ -332,7 +349,7 @@ bool Sapphire::Land::setPreset( uint32_t itemId )
|
||||||
{
|
{
|
||||||
// todo: i guess we'd create a house here?
|
// todo: i guess we'd create a house here?
|
||||||
auto newId = getNextHouseId();
|
auto newId = getNextHouseId();
|
||||||
m_pHouse = make_House( newId, getLandSetId(), getLandId(), getWardNum(), getTerritoryTypeId() );
|
m_pHouse = make_House( newId, getLandSetId(), getLandIdent() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace Sapphire
|
||||||
|
|
||||||
Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId, Sapphire::Data::HousingLandSetPtr info );
|
Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId, Sapphire::Data::HousingLandSetPtr info );
|
||||||
virtual ~Land();
|
virtual ~Land();
|
||||||
|
void init( Common::LandType type, uint8_t size, uint8_t state, uint32_t currentPrice, uint64_t ownerId, uint64_t houseId );
|
||||||
|
|
||||||
using LandInventoryMap = std::unordered_map< uint16_t, ItemContainerPtr >;
|
using LandInventoryMap = std::unordered_map< uint16_t, ItemContainerPtr >;
|
||||||
|
|
||||||
|
@ -31,12 +32,10 @@ namespace Sapphire
|
||||||
uint8_t getState() const;
|
uint8_t getState() const;
|
||||||
uint8_t getSharing() const;
|
uint8_t getSharing() const;
|
||||||
uint32_t getLandSetId() const;
|
uint32_t getLandSetId() const;
|
||||||
uint8_t getWardNum() const;
|
|
||||||
uint8_t getLandId() const;
|
|
||||||
uint16_t getTerritoryTypeId() const;
|
|
||||||
Common::LandType getLandType() const;
|
Common::LandType getLandType() const;
|
||||||
Sapphire::HousePtr getHouse() const;
|
Sapphire::HousePtr getHouse() const;
|
||||||
Common::FFXIVARR_POSITION3 getMapMarkerPosition();
|
Common::FFXIVARR_POSITION3 getMapMarkerPosition();
|
||||||
|
Common::LandIdent getLandIdent() const;
|
||||||
|
|
||||||
//Free Comapny
|
//Free Comapny
|
||||||
void setFreeCompany( uint32_t id, uint32_t icon, uint32_t color );
|
void setFreeCompany( uint32_t id, uint32_t icon, uint32_t color );
|
||||||
|
@ -62,16 +61,15 @@ namespace Sapphire
|
||||||
uint8_t getLandTag( uint8_t slot );
|
uint8_t getLandTag( uint8_t slot );
|
||||||
|
|
||||||
ItemContainerPtr getItemContainer( uint16_t inventoryType ) const;
|
ItemContainerPtr getItemContainer( uint16_t inventoryType ) const;
|
||||||
|
void loadItemContainerContents();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t convertItemIdToHousingItemId( uint32_t itemId );
|
uint32_t convertItemIdToHousingItemId( uint32_t itemId );
|
||||||
void init();
|
|
||||||
uint32_t getNextHouseId();
|
uint32_t getNextHouseId();
|
||||||
|
|
||||||
uint8_t m_wardNum;
|
Common::LandIdent m_landIdent;
|
||||||
uint8_t m_landId;
|
|
||||||
uint32_t m_landSetId;
|
uint32_t m_landSetId;
|
||||||
uint16_t m_territoryTypeId;
|
|
||||||
uint8_t m_size;
|
uint8_t m_size;
|
||||||
uint8_t m_state;
|
uint8_t m_state;
|
||||||
Common::LandType m_type;
|
Common::LandType m_type;
|
||||||
|
@ -89,8 +87,8 @@ namespace Sapphire
|
||||||
|
|
||||||
//item storage
|
//item storage
|
||||||
LandInventoryMap m_landInventoryMap;
|
LandInventoryMap m_landInventoryMap;
|
||||||
uint32_t m_maxPlacedExternalItems;
|
uint16_t m_maxPlacedExternalItems;
|
||||||
uint32_t m_maxPlacedInternalItems;
|
uint16_t m_maxPlacedInternalItems;
|
||||||
|
|
||||||
//price
|
//price
|
||||||
uint32_t m_initPrice;
|
uint32_t m_initPrice;
|
||||||
|
|
Loading…
Add table
Reference in a new issue