mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47:45 +00:00
Merge pull request #477 from NotAdam/develop
some 4.5 fixes for housing
This commit is contained in:
commit
dd381b16d5
12 changed files with 205 additions and 215 deletions
|
@ -576,10 +576,10 @@ CREATE TABLE `zonepositions` (
|
|||
|
||||
CREATE TABLE `landplaceditems` (
|
||||
`ItemId` INT(20) UNSIGNED NOT NULL,
|
||||
`PosX` INT(10) NOT NULL,
|
||||
`PosY` INT(10) NOT NULL,
|
||||
`PosZ` INT(10) NOT NULL,
|
||||
`Rotation` INT(10) NOT NULL,
|
||||
`PosX` FLOAT NOT NULL,
|
||||
`PosY` FLOAT NOT NULL,
|
||||
`PosZ` FLOAT NOT NULL,
|
||||
`Rotation` FLOAT NOT NULL,
|
||||
PRIMARY KEY (`ItemId`)
|
||||
)
|
||||
COLLATE='latin1_swedish_ci' ENGINE=InnoDB;
|
||||
|
|
|
@ -855,8 +855,9 @@ namespace Sapphire::Common
|
|||
struct HousingObject
|
||||
{
|
||||
uint32_t itemId;
|
||||
uint16_t itemRotation;
|
||||
Common::FFXIVARR_POSITION3_U16 pos;
|
||||
uint32_t padding; // was itemrotation + unknown/pad, looks unused now
|
||||
float rotation;
|
||||
Common::FFXIVARR_POSITION3 pos;
|
||||
};
|
||||
|
||||
enum HouseSize : uint8_t
|
||||
|
|
|
@ -482,10 +482,8 @@ struct FFXIVIpcPlayerSpawn :
|
|||
{
|
||||
uint16_t title;
|
||||
uint16_t u1b;
|
||||
uint8_t u2b;
|
||||
uint8_t u2ab;
|
||||
uint8_t u3a;
|
||||
uint8_t u3b;
|
||||
uint16_t currentWorldId;
|
||||
uint16_t homeWorldId;
|
||||
|
||||
uint8_t gmRank;
|
||||
uint8_t u3c;
|
||||
|
@ -783,8 +781,8 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket< InitUI >
|
|||
unsigned int fishCaught;
|
||||
unsigned int useBaitCatalogId;
|
||||
unsigned int unknown28;
|
||||
unsigned __int16 unknownPvp2C;
|
||||
unsigned __int16 unknown3;
|
||||
uint16_t unknownPvp2C;
|
||||
uint16_t unknown3;
|
||||
unsigned int pvpFrontlineOverallCampaigns;
|
||||
unsigned int unknownTimestamp34;
|
||||
unsigned int unknownTimestamp38;
|
||||
|
@ -793,123 +791,123 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket< InitUI >
|
|||
unsigned int unknown44;
|
||||
float companionTimePassed;
|
||||
unsigned int unknown4C;
|
||||
unsigned __int16 unknown50;
|
||||
unsigned __int16 unknownPvp52[4];
|
||||
unsigned __int16 playerCommendations;
|
||||
unsigned __int16 unknown5C;
|
||||
unsigned __int16 unknown5E;
|
||||
unsigned __int16 pvpFrontlineWeeklyCampaigns;
|
||||
unsigned __int16 enhancedAnimaGlassProgress;
|
||||
unsigned __int16 unknown64[4];
|
||||
unsigned __int16 pvpRivalWingsTotalMatches;
|
||||
unsigned __int16 pvpRivalWingsTotalVictories;
|
||||
unsigned __int16 pvpRivalWingsWeeklyMatches;
|
||||
unsigned __int16 pvpRivalWingsWeeklyVictories;
|
||||
unsigned __int8 maxLevel;
|
||||
unsigned __int8 expansion;
|
||||
unsigned __int8 unknown76;
|
||||
unsigned __int8 race;
|
||||
unsigned __int8 tribe;
|
||||
unsigned __int8 gender;
|
||||
unsigned __int8 currentJob;
|
||||
unsigned __int8 currentClass;
|
||||
unsigned __int8 deity;
|
||||
unsigned __int8 namedayMonth;
|
||||
unsigned __int8 namedayDay;
|
||||
unsigned __int8 cityState;
|
||||
unsigned __int8 homepoint;
|
||||
unsigned __int8 unknown81;
|
||||
unsigned __int8 petHotBar;
|
||||
unsigned __int8 companionRank;
|
||||
unsigned __int8 companionStars;
|
||||
unsigned __int8 companionSp;
|
||||
unsigned __int8 companionUnk86;
|
||||
unsigned __int8 companionColor;
|
||||
unsigned __int8 companionFavoFeed;
|
||||
unsigned __int8 unknown89;
|
||||
unsigned __int8 unknown8A[4];
|
||||
unsigned __int8 hasRelicBook;
|
||||
unsigned __int8 relicBookId;
|
||||
unsigned __int8 unknown90[4];
|
||||
unsigned __int8 craftingMasterMask;
|
||||
unsigned __int8 unknown95[10];
|
||||
unsigned __int8 unknown9F[2];
|
||||
unsigned __int8 unknownA1[3];
|
||||
uint16_t unknown50;
|
||||
uint16_t unknownPvp52[4];
|
||||
uint16_t playerCommendations;
|
||||
uint16_t unknown5C;
|
||||
uint16_t unknown5E;
|
||||
uint16_t pvpFrontlineWeeklyCampaigns;
|
||||
uint16_t enhancedAnimaGlassProgress;
|
||||
uint16_t unknown64[4];
|
||||
uint16_t pvpRivalWingsTotalMatches;
|
||||
uint16_t pvpRivalWingsTotalVictories;
|
||||
uint16_t pvpRivalWingsWeeklyMatches;
|
||||
uint16_t pvpRivalWingsWeeklyVictories;
|
||||
uint8_t maxLevel;
|
||||
uint8_t expansion;
|
||||
uint8_t unknown76;
|
||||
uint8_t race;
|
||||
uint8_t tribe;
|
||||
uint8_t gender;
|
||||
uint8_t currentJob;
|
||||
uint8_t currentClass;
|
||||
uint8_t deity;
|
||||
uint8_t namedayMonth;
|
||||
uint8_t namedayDay;
|
||||
uint8_t cityState;
|
||||
uint8_t homepoint;
|
||||
uint8_t unknown81;
|
||||
uint8_t petHotBar;
|
||||
uint8_t companionRank;
|
||||
uint8_t companionStars;
|
||||
uint8_t companionSp;
|
||||
uint8_t companionUnk86;
|
||||
uint8_t companionColor;
|
||||
uint8_t companionFavoFeed;
|
||||
uint8_t unknown89;
|
||||
uint8_t unknown8A[4];
|
||||
uint8_t hasRelicBook;
|
||||
uint8_t relicBookId;
|
||||
uint8_t unknown90[4];
|
||||
uint8_t craftingMasterMask;
|
||||
uint8_t unknown95[10];
|
||||
uint8_t unknown9F[2];
|
||||
uint8_t unknownA1[3];
|
||||
unsigned int exp[26];
|
||||
unsigned int unknown108;
|
||||
unsigned int pvpTotalExp;
|
||||
unsigned int unknownPvp110;
|
||||
unsigned int pvpExp;
|
||||
unsigned int pvpFrontlineOverallRanks[3];
|
||||
unsigned __int16 levels[26];
|
||||
uint16_t levels[26];
|
||||
unsigned int exploratoryMissionNextTimestamp;
|
||||
unsigned __int16 unknown15C[9];
|
||||
unsigned __int16 fishingRecordsFish[26];
|
||||
unsigned __int16 fishingRecordsFishWeight[26];
|
||||
unsigned __int16 beastExp[11];
|
||||
unsigned __int16 unknown1EA[5];
|
||||
unsigned __int16 pvpFrontlineWeeklyRanks[3];
|
||||
unsigned __int16 unknownMask1FA[3];
|
||||
unsigned __int8 companionName[21];
|
||||
unsigned __int8 companionDefRank;
|
||||
unsigned __int8 companionAttRank;
|
||||
unsigned __int8 companionHealRank;
|
||||
unsigned __int8 mountGuideMask[17];
|
||||
uint16_t unknown15C[9];
|
||||
uint16_t fishingRecordsFish[26];
|
||||
uint16_t fishingRecordsFishWeight[26];
|
||||
uint16_t beastExp[11];
|
||||
uint16_t unknown1EA[5];
|
||||
uint16_t pvpFrontlineWeeklyRanks[3];
|
||||
uint16_t unknownMask1FA[3];
|
||||
uint8_t companionName[21];
|
||||
uint8_t companionDefRank;
|
||||
uint8_t companionAttRank;
|
||||
uint8_t companionHealRank;
|
||||
uint8_t mountGuideMask[17];
|
||||
char name[32];
|
||||
unsigned __int8 unknownOword[15];
|
||||
unsigned __int8 unlockBitmask[64];
|
||||
unsigned __int8 aetheryte[17];
|
||||
unsigned __int8 unknown258;
|
||||
unsigned __int8 chocoboTaxiMask[8];
|
||||
unsigned __int8 unknown11111[118];
|
||||
unsigned __int8 companionBardingMask[9];
|
||||
unsigned __int8 companionEquippedHead;
|
||||
unsigned __int8 companionEquippedBody;
|
||||
unsigned __int8 companionEquippedLegs;
|
||||
unsigned __int8 unknown519[4];
|
||||
unsigned __int8 unknownMask51D[11];
|
||||
unsigned __int8 fishingGuideMask[89];
|
||||
unsigned __int8 fishingSpotVisited[25];
|
||||
unsigned __int8 unknown59A[15];
|
||||
unsigned __int8 unknown5A9[2];
|
||||
unsigned __int8 unknownPvp5AB[2];
|
||||
unsigned __int8 beastRank[11];
|
||||
unsigned __int8 pose;
|
||||
unsigned __int8 weaponPose;
|
||||
unsigned __int8 unknownMask5C4[3];
|
||||
unsigned __int8 unknown5C9[2];
|
||||
unsigned __int8 challengeLogComplete[9];
|
||||
unsigned __int8 unknownMask5DD[28];
|
||||
unsigned __int8 tripleTriadCards[30];
|
||||
unsigned __int8 unknownMask673[10];
|
||||
unsigned __int8 unknown5B9[11];
|
||||
unsigned __int8 unknown5D4[11];
|
||||
unsigned __int8 unknown694[3];
|
||||
unsigned __int8 pvpLevel;
|
||||
unsigned __int8 unknown67D;
|
||||
unsigned __int8 howto[34];
|
||||
unsigned __int8 minions[42];
|
||||
unsigned __int8 watchedCutscenes[118];
|
||||
unsigned __int8 discovery[421];
|
||||
unsigned __int8 relicCompletion[12];
|
||||
unsigned __int8 sightseeingMask[26];
|
||||
unsigned __int8 huntingMarkMask[55];
|
||||
unsigned __int8 aetherCurrentMask[22];
|
||||
unsigned __int8 orchestrionMask[40];
|
||||
unsigned __int8 hallOfNoviceCompleteMask[3];
|
||||
unsigned __int8 animaCompletion[11];
|
||||
unsigned __int8 unknown6CD[16];
|
||||
unsigned __int8 unknownMask6DB[11];
|
||||
unsigned __int8 unlockedRaids[28];
|
||||
unsigned __int8 unlockedDungeons[18];
|
||||
unsigned __int8 unlockedGuildhests[10];
|
||||
unsigned __int8 unlockedTrials[8];
|
||||
unsigned __int8 unlockedPvp[5];
|
||||
unsigned __int8 clearedRaids[28];
|
||||
unsigned __int8 clearedDungeons[18];
|
||||
unsigned __int8 clearedGuildhests[10];
|
||||
unsigned __int8 clearedTrials[8];
|
||||
unsigned __int8 clearedPvp[5];
|
||||
uint8_t unknownOword[15];
|
||||
uint8_t unlockBitmask[64];
|
||||
uint8_t aetheryte[17];
|
||||
uint8_t unknown258;
|
||||
uint8_t chocoboTaxiMask[8];
|
||||
uint8_t unknown11111[118];
|
||||
uint8_t companionBardingMask[9];
|
||||
uint8_t companionEquippedHead;
|
||||
uint8_t companionEquippedBody;
|
||||
uint8_t companionEquippedLegs;
|
||||
uint8_t unknown519[4];
|
||||
uint8_t unknownMask51D[11];
|
||||
uint8_t fishingGuideMask[89];
|
||||
uint8_t fishingSpotVisited[25];
|
||||
uint8_t unknown59A[15];
|
||||
uint8_t unknown5A9[2];
|
||||
uint8_t unknownPvp5AB[2];
|
||||
uint8_t beastRank[11];
|
||||
uint8_t pose;
|
||||
uint8_t weaponPose;
|
||||
uint8_t unknownMask5C4[3];
|
||||
uint8_t unknown5C9[2];
|
||||
uint8_t challengeLogComplete[9];
|
||||
uint8_t unknownMask5DD[28];
|
||||
uint8_t tripleTriadCards[30];
|
||||
uint8_t unknownMask673[10];
|
||||
uint8_t unknown5B9[11];
|
||||
uint8_t unknown5D4[11];
|
||||
uint8_t unknown694[3];
|
||||
uint8_t pvpLevel;
|
||||
uint8_t unknown67D;
|
||||
uint8_t howto[34];
|
||||
uint8_t minions[42];
|
||||
uint8_t watchedCutscenes[118];
|
||||
uint8_t discovery[421];
|
||||
uint8_t relicCompletion[12];
|
||||
uint8_t sightseeingMask[26];
|
||||
uint8_t huntingMarkMask[55];
|
||||
uint8_t aetherCurrentMask[22];
|
||||
uint8_t orchestrionMask[40];
|
||||
uint8_t hallOfNoviceCompleteMask[3];
|
||||
uint8_t animaCompletion[11];
|
||||
uint8_t unknown6CD[16];
|
||||
uint8_t unknownMask6DB[11];
|
||||
uint8_t unlockedRaids[28];
|
||||
uint8_t unlockedDungeons[18];
|
||||
uint8_t unlockedGuildhests[10];
|
||||
uint8_t unlockedTrials[8];
|
||||
uint8_t unlockedPvp[5];
|
||||
uint8_t clearedRaids[28];
|
||||
uint8_t clearedDungeons[18];
|
||||
uint8_t clearedGuildhests[10];
|
||||
uint8_t clearedTrials[8];
|
||||
uint8_t clearedPvp[5];
|
||||
|
||||
};
|
||||
|
||||
|
@ -1695,7 +1693,7 @@ struct FFXIVIpcHousingObjectMove : FFXIVIpcBasePacket< HousingObjectMove >
|
|||
uint16_t itemRotation;
|
||||
uint8_t objectArray;
|
||||
uint8_t landId;
|
||||
Common::FFXIVARR_POSITION3_U16 pos;
|
||||
Common::FFXIVARR_POSITION3 pos;
|
||||
uint16_t unknown1;
|
||||
uint16_t unknown2;
|
||||
uint16_t unknown3;
|
||||
|
@ -1726,7 +1724,7 @@ struct FFXIVIpcHousingInternalObjectSpawn : FFXIVIpcBasePacket< HousingInternalO
|
|||
uint8_t unk2;
|
||||
uint8_t pad2;
|
||||
uint16_t rotation;
|
||||
Common::FFXIVARR_POSITION3_U16 pos;
|
||||
Common::FFXIVARR_POSITION3 pos;
|
||||
};
|
||||
|
||||
struct FFXIVIpcHousingIndoorInitialize : FFXIVIpcBasePacket< HousingIndoorInitialize >
|
||||
|
|
|
@ -45,7 +45,7 @@ std::vector< std::string > cppKeyWords
|
|||
};
|
||||
|
||||
//std::string datLocation( "/home/mordred/sqpack" );
|
||||
std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack" );
|
||||
std::string datLocation( "/mnt/c/Program Files (x86)/Steam/steamapps/common/FINAL FANTASY XIV Online/game/sqpack" );
|
||||
std::map< uint8_t, std::string > g_typeMap;
|
||||
|
||||
|
||||
|
|
|
@ -8,22 +8,22 @@ Sapphire::Inventory::HousingItem::HousingItem( uint64_t uId, uint32_t catalogId,
|
|||
m_reservedFlag = 1092616192; // wat?
|
||||
}
|
||||
|
||||
uint16_t Sapphire::Inventory::HousingItem::getRot() const
|
||||
float Sapphire::Inventory::HousingItem::getRot() const
|
||||
{
|
||||
return m_rotation;
|
||||
}
|
||||
|
||||
void Sapphire::Inventory::HousingItem::setRot( uint16_t rot )
|
||||
void Sapphire::Inventory::HousingItem::setRot( float rot )
|
||||
{
|
||||
m_rotation = rot;
|
||||
}
|
||||
|
||||
Sapphire::Common::FFXIVARR_POSITION3_U16 Sapphire::Inventory::HousingItem::getPos() const
|
||||
Sapphire::Common::FFXIVARR_POSITION3 Sapphire::Inventory::HousingItem::getPos() const
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
|
||||
void Sapphire::Inventory::HousingItem::setPos( Sapphire::Common::FFXIVARR_POSITION3_U16 pos )
|
||||
void Sapphire::Inventory::HousingItem::setPos( Sapphire::Common::FFXIVARR_POSITION3 pos )
|
||||
{
|
||||
m_position = pos;
|
||||
}
|
|
@ -11,15 +11,15 @@ namespace Sapphire::Inventory
|
|||
HousingItem( uint64_t uId, uint32_t catalogId, FrameworkPtr pFw );
|
||||
virtual ~HousingItem() = default;
|
||||
|
||||
void setRot( uint16_t rot );
|
||||
uint16_t getRot() const;
|
||||
void setRot( float rot );
|
||||
float getRot() const;
|
||||
|
||||
void setPos( Common::FFXIVARR_POSITION3_U16 pos );
|
||||
Common::FFXIVARR_POSITION3_U16 getPos() const;
|
||||
void setPos( Common::FFXIVARR_POSITION3 pos );
|
||||
Common::FFXIVARR_POSITION3 getPos() const;
|
||||
|
||||
private:
|
||||
Common::FFXIVARR_POSITION3_U16 m_position;
|
||||
uint16_t m_rotation;
|
||||
Common::FFXIVARR_POSITION3 m_position;
|
||||
float m_rotation;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "Forwards.h"
|
||||
#include "ItemContainer.h"
|
||||
|
||||
Sapphire::ItemContainer::ItemContainer( uint16_t storageId, uint16_t maxSize, const std::string& tableName,
|
||||
Sapphire::ItemContainer::ItemContainer( uint16_t storageId, uint8_t maxSize, const std::string& tableName,
|
||||
bool isMultiStorage, FrameworkPtr pFw, bool isPersistentStorage ) :
|
||||
m_id( storageId ),
|
||||
m_size( maxSize ),
|
||||
|
@ -31,15 +31,15 @@ uint16_t Sapphire::ItemContainer::getId() const
|
|||
return m_id;
|
||||
}
|
||||
|
||||
uint16_t Sapphire::ItemContainer::getEntryCount() const
|
||||
uint8_t Sapphire::ItemContainer::getEntryCount() const
|
||||
{
|
||||
return static_cast< uint16_t >( m_itemMap.size() );
|
||||
return static_cast< uint8_t >( m_itemMap.size() );
|
||||
}
|
||||
|
||||
void Sapphire::ItemContainer::removeItem( uint16_t slotId, bool removeFromDb )
|
||||
void Sapphire::ItemContainer::removeItem( uint8_t slotId, bool removeFromDb )
|
||||
{
|
||||
auto pDb = m_pFw->get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
||||
ItemMap::iterator it = m_itemMap.find( slotId );
|
||||
auto it = m_itemMap.find( slotId );
|
||||
|
||||
if( it != m_itemMap.end() )
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ const Sapphire::ItemMap& Sapphire::ItemContainer::getItemMap() const
|
|||
return m_itemMap;
|
||||
}
|
||||
|
||||
int16_t Sapphire::ItemContainer::getFreeSlot()
|
||||
int8_t Sapphire::ItemContainer::getFreeSlot()
|
||||
{
|
||||
for( uint16_t slotId = 0; slotId < m_size; slotId++ )
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ int16_t Sapphire::ItemContainer::getFreeSlot()
|
|||
return -1;
|
||||
}
|
||||
|
||||
Sapphire::ItemPtr Sapphire::ItemContainer::getItem( uint16_t slotId )
|
||||
Sapphire::ItemPtr Sapphire::ItemContainer::getItem( uint8_t slotId )
|
||||
{
|
||||
|
||||
if( ( slotId > m_size ) )
|
||||
|
@ -90,7 +90,7 @@ Sapphire::ItemPtr Sapphire::ItemContainer::getItem( uint16_t slotId )
|
|||
return m_itemMap[ slotId ];
|
||||
}
|
||||
|
||||
void Sapphire::ItemContainer::setItem( uint16_t slotId, ItemPtr pItem )
|
||||
void Sapphire::ItemContainer::setItem( uint8_t slotId, ItemPtr pItem )
|
||||
{
|
||||
if( slotId > m_size )
|
||||
return;
|
||||
|
@ -98,7 +98,7 @@ void Sapphire::ItemContainer::setItem( uint16_t slotId, ItemPtr pItem )
|
|||
m_itemMap[ slotId ] = pItem;
|
||||
}
|
||||
|
||||
uint16_t Sapphire::ItemContainer::getMaxSize() const
|
||||
uint8_t Sapphire::ItemContainer::getMaxSize() const
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
|
|
@ -8,34 +8,34 @@
|
|||
namespace Sapphire
|
||||
{
|
||||
|
||||
using ItemMap = std::map< uint16_t, ItemPtr >;
|
||||
using ItemMap = std::map< uint8_t, ItemPtr >;
|
||||
|
||||
class ItemContainer
|
||||
{
|
||||
|
||||
public:
|
||||
ItemContainer( uint16_t storageId, uint16_t maxSize, const std::string& tableName, bool isMultiStorage,
|
||||
ItemContainer( uint16_t storageId, uint8_t maxSize, const std::string& tableName, bool isMultiStorage,
|
||||
FrameworkPtr pFw, bool isPersistentStorage = true );
|
||||
|
||||
~ItemContainer();
|
||||
|
||||
uint16_t getId() const;
|
||||
|
||||
uint16_t getEntryCount() const;
|
||||
uint8_t getEntryCount() const;
|
||||
|
||||
void removeItem( uint16_t slotId, bool removeFromDb = true );
|
||||
void removeItem( uint8_t slotId, bool removeFromDb = true );
|
||||
|
||||
ItemMap& getItemMap();
|
||||
|
||||
const ItemMap& getItemMap() const;
|
||||
|
||||
ItemPtr getItem( uint16_t slotId );
|
||||
ItemPtr getItem( uint8_t slotId );
|
||||
|
||||
void setItem( uint16_t slotId, ItemPtr item );
|
||||
void setItem( uint8_t slotId, ItemPtr item );
|
||||
|
||||
int16_t getFreeSlot();
|
||||
int8_t getFreeSlot();
|
||||
|
||||
uint16_t getMaxSize() const;
|
||||
uint8_t getMaxSize() const;
|
||||
|
||||
std::string getTableName() const;
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace Sapphire
|
|||
|
||||
private:
|
||||
uint16_t m_id;
|
||||
uint16_t m_size;
|
||||
uint8_t m_size;
|
||||
std::string m_tableName;
|
||||
bool m_bMultiStorage;
|
||||
FrameworkPtr m_pFw;
|
||||
|
|
|
@ -139,19 +139,25 @@ bool Sapphire::World::Manager::HousingMgr::loadEstateInventories()
|
|||
if( isPlacedItemsInventory( static_cast< Common::InventoryType >( containerId ) ) )
|
||||
{
|
||||
item->setPos( {
|
||||
res->getUInt16( "PosX" ),
|
||||
res->getUInt16( "PosY" ),
|
||||
res->getUInt16( "PosZ" )
|
||||
res->getFloat( "PosX" ),
|
||||
res->getFloat( "PosY" ),
|
||||
res->getFloat( "PosZ" )
|
||||
} );
|
||||
|
||||
item->setRot( res->getUInt16( "Rotation" ) );
|
||||
item->setRot( res->getFloat( "Rotation" ) );
|
||||
}
|
||||
|
||||
ContainerIdToContainerMap& estateInv = m_estateInventories[ ident ];
|
||||
|
||||
// check if containerId exists, it always should - if it doesn't, something went wrong
|
||||
auto container = estateInv.find( containerId );
|
||||
assert( container != estateInv.end() );
|
||||
if( container == estateInv.end() )
|
||||
{
|
||||
Logger::warn( "Skipping item#{0} for ident#{1} - container#{2} doesn't exist for estate.",
|
||||
itemId, ident, containerId );
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
container->second->setItem( slot, item );
|
||||
|
||||
|
@ -854,12 +860,12 @@ void Sapphire::World::Manager::HousingMgr::sendEstateInventory( Entity::Player&
|
|||
return;
|
||||
|
||||
auto& containers = getEstateInventory( targetLand->getLandIdent() );
|
||||
auto needle = containers.find( inventoryType );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( inventoryType );
|
||||
if( it == containers.end() )
|
||||
return;
|
||||
|
||||
auto invMgr = framework()->get< Manager::InventoryMgr >();
|
||||
invMgr->sendInventoryContainer( player, needle->second );
|
||||
invMgr->sendInventoryContainer( player, it->second );
|
||||
}
|
||||
|
||||
const Sapphire::World::Manager::HousingMgr::LandSetLandCacheMap&
|
||||
|
@ -1007,13 +1013,8 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceHousingItem( Sapphire::Entity
|
|||
return;
|
||||
|
||||
// set params
|
||||
item->setPos( {
|
||||
Util::floatToUInt16( pos.x ),
|
||||
Util::floatToUInt16( pos.y ),
|
||||
Util::floatToUInt16( pos.z )
|
||||
} );
|
||||
|
||||
item->setRot( Util::floatToUInt16Rot( rotation ) );
|
||||
item->setPos( pos );
|
||||
item->setRot( rotation );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1084,11 +1085,11 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceItemInStore( Sapphire::Entity
|
|||
{
|
||||
for( auto houseContainer : m_internalStoreroomContainers )
|
||||
{
|
||||
auto needle = containers.find( houseContainer );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( houseContainer );
|
||||
if( it == containers.end() )
|
||||
continue;
|
||||
|
||||
auto container = needle->second;
|
||||
auto container = it->second;
|
||||
auto freeSlot = container->getFreeSlot();
|
||||
if( freeSlot == -1 )
|
||||
{
|
||||
|
@ -1156,11 +1157,11 @@ bool Sapphire::World::Manager::HousingMgr::placeInteriorItem( Entity::Player& pl
|
|||
uint8_t containerIdx = 0;
|
||||
for( auto containerId : m_internalPlacedItemContainers )
|
||||
{
|
||||
auto needle = containers.find( containerId );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( containerId );
|
||||
if( it == containers.end() )
|
||||
continue;
|
||||
|
||||
auto container = needle->second;
|
||||
auto container = it->second;
|
||||
auto freeSlot = container->getFreeSlot();
|
||||
if( freeSlot == -1 )
|
||||
{
|
||||
|
@ -1192,7 +1193,7 @@ Sapphire::Common::HousingObject Sapphire::World::Manager::HousingMgr::getYardObj
|
|||
Sapphire::Common::HousingObject obj {};
|
||||
|
||||
obj.pos = item->getPos();
|
||||
obj.itemRotation = item->getRot();
|
||||
obj.rotation = item->getRot();
|
||||
obj.itemId = item->getAdditionalData();
|
||||
|
||||
return obj;
|
||||
|
@ -1271,23 +1272,18 @@ bool Sapphire::World::Manager::HousingMgr::moveInternalItem( Entity::Player& pla
|
|||
|
||||
auto& containers = getEstateInventory( ident );
|
||||
|
||||
auto needle = containers.find( containerId );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( containerId );
|
||||
if( it == containers.end() )
|
||||
return false;
|
||||
|
||||
auto container = needle->second;
|
||||
auto container = it->second;
|
||||
|
||||
auto item = std::dynamic_pointer_cast< Inventory::HousingItem >( container->getItem( slotIdx ) );
|
||||
if( !item )
|
||||
return false;
|
||||
|
||||
item->setPos( {
|
||||
Util::floatToUInt16( pos.x ),
|
||||
Util::floatToUInt16( pos.y ),
|
||||
Util::floatToUInt16( pos.z )
|
||||
} );
|
||||
|
||||
item->setRot( Util::floatToUInt16Rot( rot ) );
|
||||
item->setPos( pos );
|
||||
item->setRot( rot );
|
||||
|
||||
// save
|
||||
auto invMgr = framework()->get< InventoryMgr >();
|
||||
|
@ -1314,23 +1310,18 @@ bool Sapphire::World::Manager::HousingMgr::moveExternalItem( Entity::Player& pla
|
|||
return false;
|
||||
|
||||
auto& containers = getEstateInventory( ident );
|
||||
auto needle = containers.find( InventoryType::HousingExteriorPlacedItems );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( InventoryType::HousingExteriorPlacedItems );
|
||||
if( it == containers.end() )
|
||||
return false;
|
||||
|
||||
auto container = needle->second;
|
||||
auto container = it->second;
|
||||
|
||||
auto item = std::dynamic_pointer_cast< Inventory::HousingItem >( container->getItem( slot ) );
|
||||
if( !item )
|
||||
return false;
|
||||
|
||||
item->setPos( {
|
||||
Util::floatToUInt16( pos.x ),
|
||||
Util::floatToUInt16( pos.y ),
|
||||
Util::floatToUInt16( pos.z )
|
||||
} );
|
||||
|
||||
item->setRot( Util::floatToUInt16Rot( rot ) );
|
||||
item->setPos( pos );
|
||||
item->setRot( rot );
|
||||
|
||||
auto invMgr = framework()->get< InventoryMgr >();
|
||||
invMgr->updateHousingItemPosition( item );
|
||||
|
@ -1403,11 +1394,11 @@ bool Sapphire::World::Manager::HousingMgr::removeInternalItem( Entity::Player& p
|
|||
// eg, remove a permit and reuse it elsewhere
|
||||
// I'm not going to bother fixing it for now, but worth noting for future reference
|
||||
|
||||
auto needle = containers.find( containerId );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( containerId );
|
||||
if( it == containers.end() )
|
||||
return false;
|
||||
|
||||
auto container = needle->second;
|
||||
auto container = it->second;
|
||||
|
||||
auto item = std::dynamic_pointer_cast< Inventory::HousingItem >( container->getItem( slotId ) );
|
||||
if( !item )
|
||||
|
@ -1470,11 +1461,11 @@ bool Sapphire::World::Manager::HousingMgr::removeExternalItem( Entity::Player& p
|
|||
{
|
||||
auto& containers = getEstateInventory( land.getLandIdent() );
|
||||
|
||||
auto needle = containers.find( containerType );
|
||||
if( needle == containers.end() )
|
||||
auto it = containers.find( containerType );
|
||||
if( it == containers.end() )
|
||||
return false;
|
||||
|
||||
auto& sourceContainer = needle->second;
|
||||
auto& sourceContainer = it->second;
|
||||
|
||||
auto item = std::dynamic_pointer_cast< Inventory::HousingItem >( sourceContainer->getItem( slotId ) );
|
||||
if( !item )
|
||||
|
@ -1531,11 +1522,11 @@ Sapphire::ItemContainerPtr Sapphire::World::Manager::HousingMgr::getFreeEstateIn
|
|||
|
||||
for( auto bag : bagList )
|
||||
{
|
||||
auto needle = estateContainers.find( bag );
|
||||
if( needle == estateContainers.end() )
|
||||
auto it = estateContainers.find( bag );
|
||||
if( it == estateContainers.end() )
|
||||
continue;
|
||||
|
||||
auto container = needle->second;
|
||||
auto container = it->second;
|
||||
|
||||
auto freeSlot = container->getFreeSlot();
|
||||
|
||||
|
@ -1563,13 +1554,13 @@ void Sapphire::World::Manager::HousingMgr::reqEstateExteriorRemodel( Sapphire::E
|
|||
return;
|
||||
|
||||
auto& inv = getEstateInventory( land->getLandIdent() );
|
||||
auto needle = inv.find( InventoryType::HousingExteriorAppearance );
|
||||
if( needle == inv.end() )
|
||||
auto it = inv.find( InventoryType::HousingExteriorAppearance );
|
||||
if( it == inv.end() )
|
||||
return;
|
||||
|
||||
auto invMgr = framework()->get< InventoryMgr >();
|
||||
|
||||
invMgr->sendInventoryContainer( player, needle->second );
|
||||
invMgr->sendInventoryContainer( player, it->second );
|
||||
|
||||
auto pkt = Server::makeActorControl143( player.getId(), Network::ActorControl::ShowEstateExternalAppearanceUI, plot );
|
||||
player.queuePacket( pkt );
|
||||
|
@ -1593,13 +1584,13 @@ void Sapphire::World::Manager::HousingMgr::reqEstateInteriorRemodel( Sapphire::E
|
|||
return;
|
||||
|
||||
auto& inv = getEstateInventory( land->getLandIdent() );
|
||||
auto needle = inv.find( InventoryType::HousingInteriorAppearance );
|
||||
if( needle == inv.end() )
|
||||
auto it = inv.find( InventoryType::HousingInteriorAppearance );
|
||||
if( it == inv.end() )
|
||||
return;
|
||||
|
||||
auto invMgr = framework()->get< InventoryMgr >();
|
||||
|
||||
invMgr->sendInventoryContainer( player, needle->second );
|
||||
invMgr->sendInventoryContainer( player, it->second );
|
||||
|
||||
auto pkt = Server::makeActorControl143( player.getId(), Network::ActorControl::ShowEstateInternalAppearanceUI );
|
||||
player.queuePacket( pkt );
|
||||
|
|
|
@ -196,13 +196,13 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::spawnHousing
|
|||
|
||||
void Sapphire::World::Territory::Housing::HousingInteriorTerritory::updateHousingObjectPosition( Entity::Player& sourcePlayer,
|
||||
uint16_t slot,
|
||||
Common::FFXIVARR_POSITION3_U16 pos,
|
||||
Common::FFXIVARR_POSITION3 pos,
|
||||
uint16_t rot )
|
||||
{
|
||||
auto& obj = m_housingObjects[ slot ];
|
||||
|
||||
obj.pos = pos;
|
||||
obj.itemRotation = rot;
|
||||
obj.rotation = rot;
|
||||
|
||||
// todo: how does this update on other clients?
|
||||
|
||||
|
@ -213,7 +213,7 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::updateHousin
|
|||
|
||||
auto moveObjPkt = makeZonePacket< Server::FFXIVIpcHousingObjectMove >( player.second->getId() );
|
||||
|
||||
moveObjPkt->data().itemRotation = obj.itemRotation;
|
||||
moveObjPkt->data().itemRotation = obj.rotation;
|
||||
moveObjPkt->data().pos = obj.pos;
|
||||
|
||||
// todo: how does this work when an item is in a slot >50 or u8 max? my guess is landid is the container index, but not sure...
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Sapphire::World::Territory::Housing
|
|||
void spawnHousingObject( uint8_t containerIdx, uint16_t slot, uint16_t containerType,
|
||||
Inventory::HousingItemPtr item );
|
||||
void updateHousingObjectPosition(
|
||||
Entity::Player& sourcePlayer, uint16_t slot, Sapphire::Common::FFXIVARR_POSITION3_U16 pos, uint16_t rot );
|
||||
Entity::Player& sourcePlayer, uint16_t slot, Sapphire::Common::FFXIVARR_POSITION3 pos, uint16_t rot );
|
||||
void removeHousingObject( uint16_t slot );
|
||||
|
||||
private:
|
||||
|
|
|
@ -353,7 +353,7 @@ void Sapphire::HousingZone::spawnYardObject( uint8_t landId, uint16_t slotId, In
|
|||
Common::HousingObject obj {};
|
||||
|
||||
obj.itemId = item.getAdditionalData();
|
||||
obj.itemRotation = item.getRot();
|
||||
obj.rotation = item.getRot();
|
||||
|
||||
obj.pos = item.getPos();
|
||||
|
||||
|
@ -383,7 +383,7 @@ void Sapphire::HousingZone::updateYardObjectPos( Entity::Player& sourcePlayer, u
|
|||
|
||||
auto& obj = m_yardObjects[ yardMapIndex ][ offset ];
|
||||
|
||||
obj.itemRotation = item.getRot();
|
||||
obj.rotation = item.getRot();
|
||||
obj.pos = item.getPos();
|
||||
|
||||
for( const auto& player : m_playerMap )
|
||||
|
|
Loading…
Add table
Reference in a new issue