1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 07:37:45 +00:00

Fixed initial housing settings and added another logmessage upon land purchase

This commit is contained in:
Mordred 2018-11-11 23:55:34 +01:00
parent 570b92313a
commit c5c76ebe13
6 changed files with 34 additions and 19 deletions

View file

@ -73,8 +73,6 @@ namespace Core::Network::Packets
SocialRequestResponse = 0x00BB, // updated 4.1 SocialRequestResponse = 0x00BB, // updated 4.1
CancelAllianceForming = 0x00C6, // updated 4.2 CancelAllianceForming = 0x00C6, // updated 4.2
Chat = 0x00F4, // updated 4.4 Chat = 0x00F4, // updated 4.4
SocialList = 0x00FB, // updated 4.4 SocialList = 0x00FB, // updated 4.4
@ -85,7 +83,6 @@ namespace Core::Network::Packets
ServerNotice = 0x0104, // updated 4.4 ServerNotice = 0x0104, // updated 4.4
SetOnlineStatus = 0x0105, // updated 4.4 SetOnlineStatus = 0x0105, // updated 4.4
CountdownInitiate = 0x010C, // updated 4.4 CountdownInitiate = 0x010C, // updated 4.4
CountdownCancel = 0x010D, // updated 4.4 CountdownCancel = 0x010D, // updated 4.4
@ -184,19 +181,27 @@ namespace Core::Network::Packets
EquipDisplayFlags = 0x020C, // updated 4.4 EquipDisplayFlags = 0x020C, // updated 4.4
// housing /// Housing //////////////////////////////////////
LandSetInitialize = 0x0220, // updated 4.4 LandSetInitialize = 0x0220, // updated 4.4
LandUpdate = 0x0221, // updated 4.4 LandUpdate = 0x0221, // updated 4.4
YardObjectSpawn = 0x0222, // updated 4.4 YardObjectSpawn = 0x0222, // updated 4.4
LandPriceUpdate = 0x0224, // updated 4.3 LandPriceUpdate = 0x0224, // updated 4.3
LandPermissionSlot = 0x0228, // updated 4.4
LandPermission = 0x0229, // updated 4.4 LandPermission = 0x0229, // updated 4.4
LandSetYardInitialize = 0x022C, // updated 4.4 LandSetYardInitialize = 0x022C, // updated 4.4
YardObjectMove = 0x0230, // updated 4.4 YardObjectMove = 0x0230, // updated 4.4
LandSetMap = 0x0251, // updated 4.4
SharedEstateSettingsResponse = 0x023C, // updated 4.4 SharedEstateSettingsResponse = 0x023C, // updated 4.4
LandSetMap = 0x0251, // updated 4.4
//////////////////////////////////////////////////
DuelChallenge = 0x0277, // 4.2; this is responsible for opening the ui DuelChallenge = 0x0277, // 4.2; this is responsible for opening the ui
PerformNote = 0x0286, // updated 4.3 PerformNote = 0x0286, // updated 4.3

View file

@ -1575,8 +1575,14 @@ struct FFXIVIpcPerformNote : FFXIVIpcBasePacket< PerformNote >
uint8_t data[32]; uint8_t data[32];
}; };
//IPCs struct FFXIVIpcLandPermissionSlot : FFXIVIpcBasePacket< LandPermissionSlot >
struct FFXIVIpcLandPermission : FFXIVIpcBasePacket<LandPermission > {
uint32_t type;
uint32_t unknown;
Common::LandPermissionSet permissionSet;
};
struct FFXIVIpcLandPermission : FFXIVIpcBasePacket< LandPermission >
{ {
Common::LandPermissionSet freeCompanyHouse; // 00 Common::LandPermissionSet freeCompanyHouse; // 00
uint64_t unkown1; uint64_t unkown1;

View file

@ -40,6 +40,9 @@ public:
{ {
auto screenMsgPkt = makeActorControl143( player.getId(), ActorControl::DutyQuestScreenMsg, m_id, 0x98 ); auto screenMsgPkt = makeActorControl143( player.getId(), ActorControl::DutyQuestScreenMsg, m_id, 0x98 );
player.queuePacket( screenMsgPkt ); player.queuePacket( screenMsgPkt );
auto screenMsgPkt2 = makeActorControl143( player.getId(), ActorControl::LogMsg, 0x0D16, 0x1AA,
activeLand.ward + 1, activeLand.plot + 1 );
player.queuePacket( screenMsgPkt2 );
break; break;
} }

View file

@ -1580,7 +1580,7 @@ void Core::Entity::Player::sendZonePackets()
auto pHousingMgr = g_fw.get< HousingMgr >(); auto pHousingMgr = g_fw.get< HousingMgr >();
if( Core::LandPtr pLand = pHousingMgr->getLandByOwnerId( getId() ) ) if( Core::LandPtr pLand = pHousingMgr->getLandByOwnerId( getId() ) )
{ {
setLandPermissions( LandPermissionSlot::Private, 0x0B, pLand->getLandId(), pLand->getWardNum(), pLand->getZoneId() ); setLandPermissions( LandPermissionSlot::Private, 0x00, pLand->getLandId(), pLand->getWardNum(), pLand->getZoneId() );
} }
sendLandPermissions(); sendLandPermissions();
@ -1761,14 +1761,15 @@ bool Core::Entity::Player::isOnEnterEventDone() const
return m_onEnterEventDone; return m_onEnterEventDone;
} }
void Core::Entity::Player::setLandPermissions( uint8_t permissionSet, uint32_t permissionMask, int16_t landId, int16_t wardNum, int16_t zoneId ) void Core::Entity::Player::setLandPermissions( uint8_t permissionSet, uint32_t permissionMask,
int16_t landId, int16_t wardNum, int16_t zoneId )
{ {
m_landPermission[permissionSet].landId = landId; m_landPermission[ permissionSet ].landId = landId;
m_landPermission[permissionSet].permissionMask = permissionMask; m_landPermission[ permissionSet ].permissionMask = permissionMask;
m_landPermission[permissionSet].wardNum = wardNum; m_landPermission[ permissionSet ].wardNum = wardNum;
m_landPermission[permissionSet].zoneId = zoneId; m_landPermission[ permissionSet ].zoneId = zoneId;
m_landPermission[permissionSet].worldId = 67; m_landPermission[ permissionSet ].worldId = 67;
m_landPermission[permissionSet].unkown1 = 0; m_landPermission[ permissionSet ].unkown1 = 0;
} }
void Core::Entity::Player::sendLandPermissions() void Core::Entity::Player::sendLandPermissions()

View file

@ -1018,7 +1018,7 @@ void Core::DebugCommandHandler::housing( char* data, Entity::Player& player, std
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone ); auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
if( pHousing ) if( pHousing )
{ {
player.setLandPermissions( permissionSet, 8, pHousing->getLandSetId(), pHousing->getWardNum(), pHousing->getTerritoryTypeId() ); player.setLandPermissions( permissionSet, 0, pHousing->getLandSetId(), pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
player.sendLandPermissions(); player.sendLandPermissions();
} }
else else

View file

@ -111,7 +111,7 @@ void Core::HousingZone::onPlayerZoneIn( Entity::Player& player )
//memcpy( , &getLand( i )->getLand(), sizeof( Common::LandStruct ) ); //memcpy( , &getLand( i )->getLand(), sizeof( Common::LandStruct ) );
} }
player.queuePacket( landSetMap ); //player.queuePacket( landSetMap );
} }
@ -190,7 +190,7 @@ Core::LandPurchaseResult Core::HousingZone::purchseLand( Entity::Player& player,
player.removeCurrency( CurrencyType::Gil, plotPrice ); player.removeCurrency( CurrencyType::Gil, plotPrice );
pLand->setPlayerOwner( player.getId() ); pLand->setPlayerOwner( player.getId() );
pLand->setState( HouseState::sold ); pLand->setState( HouseState::sold );
player.setLandPermissions( LandPermissionSlot::Private, 0x0B, plot, player.setLandPermissions( LandPermissionSlot::Private, 0x00, plot,
pHousing->getWardNum(), pHousing->getTerritoryTypeId() ); pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
player.sendLandPermissions(); player.sendLandPermissions();
pLand->UpdateLandDb(); pLand->UpdateLandDb();