mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
house renaming works 🎉
This commit is contained in:
parent
e24837629c
commit
fee7ed381e
7 changed files with 54 additions and 13 deletions
|
@ -204,6 +204,8 @@ namespace Core::Network::Packets
|
|||
|
||||
SharedEstateSettingsResponse = 0x023C, // updated 4.4
|
||||
|
||||
LandUpdateHouseName = 0x024D, // updated 4.4
|
||||
|
||||
LandSetMap = 0x0251, // updated 4.4
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
|
|
@ -203,7 +203,7 @@ struct FFXIVIpcRenameLandHandler :
|
|||
/* 0002 */ uint16_t wardNum;
|
||||
/* 0004 */ uint16_t zoneId;
|
||||
/* 0006 */ uint16_t worldId;
|
||||
/* 0008 */ char landName[20];
|
||||
/* 0008 */ char houseName[20];
|
||||
/* 0028 */ uint32_t padding;
|
||||
};
|
||||
|
||||
|
|
|
@ -1640,10 +1640,17 @@ struct FFXIVIpcLandInfoSign : FFXIVIpcBasePacket< LandInfoSign >
|
|||
struct FFXIVIpcLandRename : FFXIVIpcBasePacket< LandRename >
|
||||
{
|
||||
Common::LandIdent landIdent;
|
||||
char landName[20];
|
||||
char houseName[20];
|
||||
uint32_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLandUpdateHouseName : FFXIVIpcBasePacket< LandUpdateHouseName >
|
||||
{
|
||||
uint32_t unknown[3];
|
||||
char houseName[20];
|
||||
uint32_t unknown2[2];
|
||||
};
|
||||
|
||||
struct FFXIVIpcLandSetMap : FFXIVIpcBasePacket< LandSetMap >
|
||||
{
|
||||
uint8_t u1;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "Zone/HousingZone.h"
|
||||
#include "Zone/HousingMgr.h"
|
||||
#include "Zone/Land.h"
|
||||
#include "Zone/House.h"
|
||||
|
||||
#include "Network/GameConnection.h"
|
||||
|
||||
|
@ -365,7 +366,7 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
|
|||
case ClientTriggerType::RequestEstateRename:
|
||||
{
|
||||
// removed temporarly, there is no such thing as a LandName
|
||||
/* auto landRenamePacket = makeZonePacket< Server::FFXIVIpcLandRename >( player.getId() );
|
||||
auto landRenamePacket = makeZonePacket< Server::FFXIVIpcLandRename >( player.getId() );
|
||||
|
||||
uint8_t ward = ( param12 & 0xFF00 ) >> 8;
|
||||
uint8_t plot = ( param12 & 0xFF );
|
||||
|
@ -382,13 +383,17 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
|
|||
land = pHousingMgr->getLandByOwnerId( player.getId() );
|
||||
}
|
||||
|
||||
landRenamePacket->data().landId = land->getLandId();
|
||||
landRenamePacket->data().wardNum = land->getWardNum();
|
||||
landRenamePacket->data().worldId = 67;
|
||||
landRenamePacket->data().zoneId = land->getZoneId();
|
||||
memcpy( &landRenamePacket->data().landName, land->getLandName().c_str(), 20 );
|
||||
auto house = land->getHouse();
|
||||
if( !house )
|
||||
break;
|
||||
|
||||
player.queuePacket( landRenamePacket ); */
|
||||
landRenamePacket->data().landIdent.landId = land->getLandId();
|
||||
landRenamePacket->data().landIdent.wardNum = land->getWardNum();
|
||||
landRenamePacket->data().landIdent.worldId = 67;
|
||||
landRenamePacket->data().landIdent.territoryTypeId = land->getTerritoryTypeId();
|
||||
memcpy( &landRenamePacket->data().houseName, house->getHouseName().c_str(), 20 );
|
||||
|
||||
player.queuePacket( landRenamePacket );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "Zone/HousingMgr.h"
|
||||
#include "Zone/Land.h"
|
||||
#include "Zone/ZonePosition.h"
|
||||
#include "Zone/House.h"
|
||||
|
||||
#include "Network/PacketWrappers/InitUIPacket.h"
|
||||
#include "Network/PacketWrappers/PingPacket.h"
|
||||
|
@ -664,8 +665,20 @@ void Core::Network::GameConnection::landRenameHandler( const Core::Network::Pack
|
|||
if( !pLand )
|
||||
return;
|
||||
|
||||
// TODO set estate name
|
||||
//pLand->setLandName( packet.data().landName );
|
||||
// todo: check perms for fc houses and shit
|
||||
if( pLand->getPlayerOwner() != player.getId() )
|
||||
return;
|
||||
|
||||
auto pHouse = pLand->getHouse();
|
||||
if( pHouse )
|
||||
pHouse->setHouseName( packet.data().houseName );
|
||||
|
||||
// todo: this packet is weird, retail sends it with some unknown shit at the start but it doesn't seem to do anything
|
||||
auto nameUpdatePacket = makeZonePacket< Server::FFXIVIpcLandUpdateHouseName >( player.getId() );
|
||||
memcpy( &nameUpdatePacket->data().houseName, &packet.data().houseName, sizeof( packet.data().houseName ) );
|
||||
|
||||
// todo: who does this get sent to? just the person who renamed it?
|
||||
player.queuePacket( nameUpdatePacket );
|
||||
}
|
||||
|
||||
void Core::Network::GameConnection::buildPresetHandler( const Core::Network::Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||
|
|
|
@ -155,4 +155,18 @@ const std::string& Core::House::getHouseName() const
|
|||
const std::string& Core::House::getHouseGreeting() const
|
||||
{
|
||||
return m_estateMessage;
|
||||
}
|
||||
|
||||
void Core::House::setHouseGreeting( const std::string& greeting )
|
||||
{
|
||||
m_estateMessage = greeting;
|
||||
|
||||
updateHouseDb();
|
||||
}
|
||||
|
||||
void Core::House::setHouseName( const std::string& name )
|
||||
{
|
||||
m_houseName = name;
|
||||
|
||||
updateHouseDb();
|
||||
}
|
|
@ -26,10 +26,10 @@ namespace Core
|
|||
uint32_t getHouseId() const;
|
||||
|
||||
const std::string& getHouseName() const;
|
||||
void setHouseName( std::string& name );
|
||||
void setHouseName( const std::string& name );
|
||||
|
||||
const std::string& getHouseGreeting() const;
|
||||
void setHouseGreeting( std::string& greeting );
|
||||
void setHouseGreeting( const std::string& greeting );
|
||||
|
||||
//functions
|
||||
void setHousePart( Common::HousePartSlot slot, uint32_t id );
|
||||
|
|
Loading…
Add table
Reference in a new issue