mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
Fix land state being sent incorrectly and consistently name those IPCs
This commit is contained in:
parent
a271ee6d46
commit
392b098a02
6 changed files with 53 additions and 37 deletions
|
@ -758,7 +758,7 @@ namespace Core::Common
|
|||
SubTag2
|
||||
};
|
||||
|
||||
enum LandStateSlot
|
||||
enum LandFlagsSlot
|
||||
{
|
||||
FreeCompany,
|
||||
Private,
|
||||
|
|
|
@ -193,8 +193,8 @@ namespace Core::Network::Packets
|
|||
|
||||
HousingEstateGreeting = 0x0227, // updated 4.4
|
||||
|
||||
LandStateSlot = 0x0228, // updated 4.4
|
||||
LandPermission = 0x0229, // updated 4.4
|
||||
HousingUpdateLandFlagsSlot = 0x0228, // updated 4.4
|
||||
HousingLandFlags = 0x0229, // updated 4.4
|
||||
|
||||
LandSetYardInitialize = 0x022C, // updated 4.4
|
||||
|
||||
|
|
|
@ -1575,14 +1575,14 @@ struct FFXIVIpcPerformNote : FFXIVIpcBasePacket< PerformNote >
|
|||
uint8_t data[32];
|
||||
};
|
||||
|
||||
struct FFXIVIpcLandStateSlot : FFXIVIpcBasePacket< LandStateSlot >
|
||||
struct FFXIVIpcHousingUpdateLandFlagsSlot : FFXIVIpcBasePacket< HousingUpdateLandFlagsSlot >
|
||||
{
|
||||
uint32_t type;
|
||||
uint32_t unknown;
|
||||
Common::LandFlagSet permissionSet;
|
||||
Common::LandFlagSet flagSet;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLandPermission : FFXIVIpcBasePacket< LandPermission >
|
||||
struct FFXIVIpcHousingLandFlags : FFXIVIpcBasePacket< HousingLandFlags >
|
||||
{
|
||||
Common::LandFlagSet freeCompanyHouse; // 00
|
||||
uint64_t unkown1;
|
||||
|
|
|
@ -94,8 +94,8 @@ Core::Entity::Player::Player() :
|
|||
|
||||
for ( uint8_t i = 0; i < 5; i++ )
|
||||
{
|
||||
memset( &m_landPermission[i], 0xFF, 8 );
|
||||
memset( &m_landPermission[i].landFlags, 0, 8 );
|
||||
memset( &m_landFlags[i], 0xFF, 8 );
|
||||
memset( &m_landFlags[i].landFlags, 0, 8 );
|
||||
}
|
||||
|
||||
m_objSpawnIndexAllocator.init( MAX_DISPLAYED_EOBJS );
|
||||
|
@ -1603,7 +1603,7 @@ void Core::Entity::Player::sendZonePackets()
|
|||
state |= ESTATE_HAS_AETHERYTE;
|
||||
}
|
||||
|
||||
setLandFlags( LandStateSlot::Private, state, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
||||
setLandFlags( LandFlagsSlot::Private, state, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
||||
}
|
||||
|
||||
sendLandFlags();
|
||||
|
@ -1784,38 +1784,53 @@ bool Core::Entity::Player::isOnEnterEventDone() const
|
|||
return m_onEnterEventDone;
|
||||
}
|
||||
|
||||
void Core::Entity::Player::setLandFlags( uint8_t permissionSet, uint32_t landFlags,
|
||||
void Core::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags,
|
||||
int16_t landId, int16_t wardNum, int16_t zoneId )
|
||||
{
|
||||
m_landPermission[ permissionSet ].landIdent.landId = landId;
|
||||
m_landPermission[ permissionSet ].landIdent.wardNum = wardNum;
|
||||
m_landPermission[ permissionSet ].landIdent.territoryTypeId = zoneId;
|
||||
m_landPermission[ permissionSet ].landIdent.worldId = 67;
|
||||
m_landPermission[ permissionSet ].landFlags = landFlags;
|
||||
m_landPermission[ permissionSet ].unkown1 = 0;
|
||||
m_landFlags[ flagSlot ].landIdent.landId = landId;
|
||||
m_landFlags[ flagSlot ].landIdent.wardNum = wardNum;
|
||||
m_landFlags[ flagSlot ].landIdent.territoryTypeId = zoneId;
|
||||
m_landFlags[ flagSlot ].landIdent.worldId = 67;
|
||||
m_landFlags[ flagSlot ].landFlags = landFlags;
|
||||
m_landFlags[ flagSlot ].unkown1 = 0;
|
||||
}
|
||||
|
||||
void Core::Entity::Player::sendLandFlags()
|
||||
{
|
||||
auto landPermissions = makeZonePacket< FFXIVIpcLandPermission >( getId() );
|
||||
auto landFlags = makeZonePacket< FFXIVIpcHousingLandFlags >( getId() );
|
||||
|
||||
landPermissions->data().freeCompanyHouse = m_landPermission[ Common::LandStateSlot::FreeCompany ];
|
||||
landPermissions->data().privateHouse = m_landPermission[ Common::LandStateSlot::Private ];
|
||||
landPermissions->data().apartment = m_landPermission[ Common::LandStateSlot::Apartment ];
|
||||
landPermissions->data().sharedHouse[ 0 ] = m_landPermission[ Common::LandStateSlot::SharedHouse1 ];
|
||||
landPermissions->data().sharedHouse[ 1 ] = m_landPermission[ Common::LandStateSlot::SharedHouse2 ];
|
||||
landFlags->data().freeCompanyHouse = m_landFlags[ Common::LandFlagsSlot::FreeCompany ];
|
||||
landFlags->data().privateHouse = m_landFlags[ Common::LandFlagsSlot::Private ];
|
||||
landFlags->data().apartment = m_landFlags[ Common::LandFlagsSlot::Apartment ];
|
||||
landFlags->data().sharedHouse[ 0 ] = m_landFlags[ Common::LandFlagsSlot::SharedHouse1 ];
|
||||
landFlags->data().sharedHouse[ 1 ] = m_landFlags[ Common::LandFlagsSlot::SharedHouse2 ];
|
||||
|
||||
queuePacket( landPermissions );
|
||||
queuePacket( landFlags );
|
||||
}
|
||||
|
||||
void Core::Entity::Player::sendLandFlagsSlot( Common::LandStateSlot slot )
|
||||
void Core::Entity::Player::sendLandFlagsSlot( Common::LandFlagsSlot slot )
|
||||
{
|
||||
auto landPermissions = makeZonePacket< FFXIVIpcLandStateSlot >( getId() );
|
||||
auto landFlags = makeZonePacket< FFXIVIpcHousingUpdateLandFlagsSlot >( getId() );
|
||||
|
||||
auto slotId = static_cast< uint8_t >( slot );
|
||||
uint32_t type = 0;
|
||||
|
||||
landPermissions->data().type = slotId;
|
||||
landPermissions->data().permissionSet = m_landPermission[ slotId ];
|
||||
switch( slot )
|
||||
{
|
||||
case LandFlagsSlot::Private:
|
||||
type = static_cast< uint32_t >( LandType::Private );
|
||||
break;
|
||||
|
||||
queuePacket( landPermissions );
|
||||
case LandFlagsSlot::FreeCompany:
|
||||
type = static_cast< uint32_t >( LandType::FreeCompany );
|
||||
break;
|
||||
|
||||
default:
|
||||
// todo: other/unsupported land types
|
||||
return;
|
||||
}
|
||||
|
||||
landFlags->data().type = type;
|
||||
landFlags->data().flagSet = m_landFlags[ slot ];
|
||||
|
||||
queuePacket( landFlags );
|
||||
}
|
|
@ -768,7 +768,7 @@ namespace Core::Entity
|
|||
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, int16_t landId, int16_t wardNum, int16_t zoneId );
|
||||
|
||||
void sendLandFlags();
|
||||
void sendLandFlagsSlot( Common::LandStateSlot slot );
|
||||
void sendLandFlagsSlot( Common::LandFlagsSlot slot );
|
||||
|
||||
// Player Battle Handling
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1027,7 +1027,7 @@ namespace Core::Entity
|
|||
uint8_t m_searchSelectClass; // class selected to show up in profile
|
||||
|
||||
// housing info
|
||||
Common::LandFlagSet m_landPermission[5];
|
||||
Common::LandFlagSet m_landFlags[5];
|
||||
|
||||
Common::ActiveLand m_activeLand;
|
||||
|
||||
|
|
|
@ -167,10 +167,10 @@ Core::LandPurchaseResult Core::HousingMgr::purchaseLand( Entity::Player& player,
|
|||
pLand->setState( HouseState::sold );
|
||||
pLand->setLandType( Common::LandType::Private );
|
||||
|
||||
player.setLandFlags( LandStateSlot::Private, 0x00, plot,
|
||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, plot,
|
||||
pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
||||
|
||||
player.sendLandFlagsSlot( LandStateSlot::Private );
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
||||
//pLand->setLandName( "Private Estate" + std::to_string( pHousing->getWardNum() ) + "-" + std::to_string( plot ) );
|
||||
pLand->updateLandDb();
|
||||
|
@ -219,9 +219,9 @@ bool Core::HousingMgr::relinquishLand( Entity::Player& player, uint8_t plot )
|
|||
pLand->setLandType( Common::LandType::none );
|
||||
pLand->updateLandDb();
|
||||
|
||||
player.setLandFlags( LandStateSlot::Private, 0x00, 0xFF, 0xFF, 0xFF );
|
||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, 0xFF, 0xFF, 0xFF );
|
||||
|
||||
player.sendLandFlagsSlot( LandStateSlot::Private );
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
||||
auto screenMsgPkt2 = makeActorControl143( player.getId(), ActorControl::LogMsg, 3351, 0x1AA,
|
||||
pLand->getWardNum() + 1, plot + 1 );
|
||||
|
@ -319,8 +319,8 @@ void Core::HousingMgr::buildPresetEstate( Entity::Player& player, uint8_t plotNu
|
|||
// todo: wtf are these flags
|
||||
player.playScene( 0x000B0095, 0, 4164955899, 0, 1, plotNum, nullptr );
|
||||
|
||||
player.setLandFlags( LandStateSlot::Private, ESTATE_BUILT, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
||||
player.sendLandFlagsSlot( LandStateSlot::Private );
|
||||
player.setLandFlags( LandFlagsSlot::Private, ESTATE_BUILT, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
}
|
||||
|
||||
void Core::HousingMgr::requestEstateRename( Entity::Player& player, uint16_t territoryTypeId, uint16_t worldId, uint8_t wardId, uint8_t plotId )
|
||||
|
@ -397,5 +397,6 @@ void Core::HousingMgr::updateEstateGreeting( Entity::Player& player, const Commo
|
|||
|
||||
house->setHouseGreeting( greeting );
|
||||
|
||||
// Greeting updated.
|
||||
player.sendLogMessage( 3381 );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue