1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-01 08:27:46 +00:00

add estate guest access menu

This commit is contained in:
NotAdam 2018-11-29 00:19:37 +11:00
parent 392b098a02
commit 84d7159e47
5 changed files with 52 additions and 0 deletions

View file

@ -195,6 +195,7 @@ namespace Core::Network::Packets
HousingUpdateLandFlagsSlot = 0x0228, // updated 4.4
HousingLandFlags = 0x0229, // updated 4.4
HousingShowEstateGuestAccess = 0x022A, // updated 4.4
LandSetYardInitialize = 0x022C, // updated 4.4

View file

@ -1734,6 +1734,13 @@ struct FFXIVIpcHousingEstateGreeting : FFXIVIpcBasePacket< HousingEstateGreeting
char message[200];
};
struct FFXIVIpcHousingShowEstateGuestAccess :
FFXIVIpcBasePacket< HousingShowEstateGuestAccess >
{
uint32_t unknown[2];
Common::LandIdent ident;
};
/**
* Structural representation of the packet sent by the server
* to show the current shared estate settings

View file

@ -392,6 +392,22 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
break;
}
case ClientTriggerType::RequestEstateEditGuestAccessSettings:
{
uint16_t territoryTypeId = param11 & 0xFFFF;
uint16_t worldId = param11 >> 16;
uint8_t ward = ( param12 & 0xFF00 ) >> 8;
uint8_t plot = ( param12 & 0xFF );
auto pHousingMgr = g_fw.get< HousingMgr >();
if( !pHousingMgr )
break;
pHousingMgr->requestEstateEditGuestAccess( player, territoryTypeId, worldId, ward, plot );
break;
}
case ClientTriggerType::RequestHousingItemUI:
{
uint8_t ward = ( param12 & 0xFF00 ) >> 8;

View file

@ -400,3 +400,29 @@ void Core::HousingMgr::updateEstateGreeting( Entity::Player& player, const Commo
// Greeting updated.
player.sendLogMessage( 3381 );
}
void Core::HousingMgr::requestEstateEditGuestAccess( Entity::Player& player, uint16_t territoryTypeId, uint16_t worldId, uint8_t wardId, uint8_t plotId )
{
auto landSetId = toLandSetId( territoryTypeId, wardId );
auto hZone = getHousingZoneByLandSetId( landSetId );
if( !hZone )
return;
auto land = hZone->getLand( plotId );
if( !land )
return;
// todo: add proper permission check
if( land->getPlayerOwner() != player.getId() )
return;
auto packet = makeZonePacket< FFXIVIpcHousingShowEstateGuestAccess >( player.getId() );
packet->data().ident.landId = plotId;
packet->data().ident.territoryTypeId = territoryTypeId;
packet->data().ident.wardNum = wardId;
packet->data().ident.worldId = worldId;
player.queuePacket( packet );
}

View file

@ -41,6 +41,8 @@ namespace Core
void requestEstateEditGreeting( Entity::Player& player, uint16_t territoryTypeId, uint16_t worldId, uint8_t wardId, uint8_t plotId );
void updateEstateGreeting( Entity::Player& player, const Common::LandIdent& ident, const std::string& greeting );
void requestEstateEditGuestAccess( Entity::Player& player, uint16_t territoryTypeId, uint16_t worldId, uint8_t wardId, uint8_t plotId );
private:
};