mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
Signs + rename
This commit is contained in:
parent
67b1b2edd6
commit
aa9e1e2450
11 changed files with 166 additions and 3 deletions
|
@ -290,6 +290,8 @@ enum ClientTriggerType
|
|||
AchievementList = 0x3E9,
|
||||
|
||||
RequestHousingSign = 0x451,
|
||||
RequestHousingInfoSign = 0x452,
|
||||
RequestHousingRename = 0x45A,
|
||||
RequestHousingItemUI = 0x463,
|
||||
RequestSharedEstateSettings = 0x46F,
|
||||
|
||||
|
|
|
@ -189,7 +189,9 @@ namespace Core::Network::Packets
|
|||
LandUpdate = 0x0221, // updated 4.4
|
||||
YardObjectSpawn = 0x0222, // updated 4.4
|
||||
|
||||
LandPriceUpdate = 0x0224, // updated 4.3
|
||||
LandPriceUpdate = 0x0224, // updated 4.4
|
||||
LandInfoSign = 0x0225, // updated 4.4
|
||||
RenameLand = 0x0226, // updated 4.4
|
||||
LandPermission = 0x0229, // updated 4.4
|
||||
LandSetYardInitialize = 0x022C, // updated 4.4
|
||||
YardObjectMove = 0x0230, // updated 4.4
|
||||
|
@ -287,6 +289,8 @@ namespace Core::Network::Packets
|
|||
LinkshellEventHandler = 0x0150, // updated 4.1 ??
|
||||
LinkshellEventHandler1 = 0x0151, // updated 4.1 ??
|
||||
|
||||
RenameLandHandler = 0x0171, // updated 4.4
|
||||
|
||||
SetSharedEstateSettings = 0x0177, // updated 4.4
|
||||
|
||||
PerformNoteHandler = 0x029B, // updated 4.3
|
||||
|
|
|
@ -189,6 +189,18 @@ struct FFXIVIpcInventoryModifyHandler :
|
|||
/* 0028 */ uint32_t splitCount;
|
||||
};
|
||||
|
||||
struct FFXIVIpcRenameLandHandler :
|
||||
FFXIVIpcBasePacket< RenameLandHandler >
|
||||
{
|
||||
/* 0000 */ uint16_t landId;
|
||||
/* 0002 */ uint16_t wardNum;
|
||||
/* 0004 */ uint16_t zoneId;
|
||||
/* 0006 */ uint16_t worldId;
|
||||
/* 0008 */ char landName[20];
|
||||
/* 0028 */ uint32_t padding;
|
||||
};
|
||||
|
||||
|
||||
struct FFXIVIpcSetSharedEstateSettings :
|
||||
FFXIVIpcBasePacket< SetSharedEstateSettings >
|
||||
{
|
||||
|
|
|
@ -1605,6 +1605,37 @@ struct FFXIVIpcLandPriceUpdate : FFXIVIpcBasePacket< LandPriceUpdate >
|
|||
uint32_t timeLeft;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLandInfoSign : FFXIVIpcBasePacket< LandInfoSign >
|
||||
{
|
||||
uint16_t landId;
|
||||
uint16_t wardNum;
|
||||
uint16_t zoneId;
|
||||
uint16_t worldId;
|
||||
uint32_t ownerId;
|
||||
uint16_t someState1;//private 0x0 : fc 0x17
|
||||
uint8_t someState2;//private 0x21 : fc 0x40
|
||||
uint8_t someState3; //private 0x80 : fc 0
|
||||
uint32_t unknow1; //seems like not always 0 (6 of 5 times 0, one time it was 0x14)
|
||||
uint8_t houseIconAdd;
|
||||
uint8_t houseState;
|
||||
uint8_t houseSize;
|
||||
char landName[23];
|
||||
char landMsg[193];
|
||||
char ownerName[31];
|
||||
char fcTag[7];
|
||||
uint8_t tag[3];
|
||||
};
|
||||
|
||||
struct FFXIVIpcRenameLand : FFXIVIpcBasePacket< RenameLand >
|
||||
{
|
||||
uint16_t landId;
|
||||
uint16_t wardNum;
|
||||
uint16_t zoneId;
|
||||
uint16_t worldId;
|
||||
char landName[20];
|
||||
uint32_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLandSetMap : FFXIVIpcBasePacket< LandSetMap >
|
||||
{
|
||||
uint8_t u1;
|
||||
|
|
|
@ -162,6 +162,8 @@ namespace Core::Network
|
|||
|
||||
DECLARE_HANDLER( performNoteHandler );
|
||||
|
||||
DECLARE_HANDLER( renameLandHandler );
|
||||
|
||||
DECLARE_HANDLER( tellHandler );
|
||||
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "Zone/Zone.h"
|
||||
#include "Zone/ZonePosition.h"
|
||||
#include "Zone/HousingZone.h"
|
||||
#include "Zone/HousingMgr.h"
|
||||
#include "Zone/Land.h"
|
||||
|
||||
#include "Network/GameConnection.h"
|
||||
|
@ -335,9 +336,77 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
|
|||
|
||||
break;
|
||||
}
|
||||
case ClientTriggerType::RequestHousingInfoSign:
|
||||
{
|
||||
|
||||
auto LandInfoSignPacket = makeZonePacket< Server::FFXIVIpcLandInfoSign >( player.getId() );
|
||||
|
||||
uint8_t ward = ( param12 & 0xFF00 ) >> 8;
|
||||
uint8_t plot = ( param12 & 0xFF );
|
||||
pLog->debug( " Ward: " + std::to_string( ward ) + " Plot: " + std::to_string( plot ) );
|
||||
|
||||
player.setActiveLand( plot, ward );
|
||||
|
||||
auto zone = player.getCurrentZone();
|
||||
|
||||
auto hZone = std::dynamic_pointer_cast< HousingZone >( zone );
|
||||
|
||||
auto land = hZone->getLand( plot );
|
||||
if( !land )
|
||||
{
|
||||
auto pHousingMgr = g_fw.get< HousingMgr >();
|
||||
land = pHousingMgr->getLandByOwnerId( player.getId() );
|
||||
}
|
||||
|
||||
memcpy( &LandInfoSignPacket->data().landMsg, "Hello World", 11 );
|
||||
//memcpy( &LandInfoSignPacket->data().landName, &land->getLandName(), 20 );
|
||||
memcpy( &LandInfoSignPacket->data().landName, "Hello World", 11 );
|
||||
LandInfoSignPacket->data().houseSize = land->getHouseSize();
|
||||
LandInfoSignPacket->data().houseState = land->getState();
|
||||
LandInfoSignPacket->data().landId = land->getLandId();
|
||||
LandInfoSignPacket->data().ownerId = land->getPlayerOwner();
|
||||
memcpy( &LandInfoSignPacket->data().ownerName, "Hello World", 11 );
|
||||
LandInfoSignPacket->data().wardNum = land->getWardNum();
|
||||
LandInfoSignPacket->data().worldId = 67;
|
||||
LandInfoSignPacket->data().zoneId = land->getZoneId();
|
||||
|
||||
player.queuePacket( LandInfoSignPacket );
|
||||
|
||||
break;
|
||||
}
|
||||
case ClientTriggerType::RequestHousingRename:
|
||||
{
|
||||
auto landRenamePacket = makeZonePacket< Server::FFXIVIpcRenameLand >( player.getId() );
|
||||
|
||||
uint8_t ward = ( param12 & 0xFF00 ) >> 8;
|
||||
uint8_t plot = ( param12 & 0xFF );
|
||||
|
||||
auto zone = player.getCurrentZone();
|
||||
|
||||
auto hZone = std::dynamic_pointer_cast< HousingZone >( zone );
|
||||
|
||||
auto land = hZone->getLand( plot );
|
||||
|
||||
if( !land )
|
||||
{
|
||||
auto pHousingMgr = g_fw.get< HousingMgr >();
|
||||
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(), 20 );
|
||||
|
||||
player.queuePacket( landRenamePacket );
|
||||
|
||||
break;
|
||||
}
|
||||
case ClientTriggerType::RequestHousingItemUI:
|
||||
{
|
||||
uint32_t plot = param2;
|
||||
uint8_t ward = ( param12 & 0xFF00 ) >> 8;
|
||||
uint8_t plot = ( param12 & 0xFF );
|
||||
auto pShowHousingItemUIPacket = makeActorControl142( player.getId(), ShowHousingItemUI, 0, plot );
|
||||
|
||||
player.queuePacket( pShowHousingItemUIPacket );
|
||||
|
|
|
@ -648,3 +648,10 @@ void Core::Network::GameConnection::performNoteHandler( const Core::Network::Pac
|
|||
memcpy( &performPacket->data().data[ 0 ], &inPacket.data[ 0x10 ], 32 );
|
||||
player.sendToInRangeSet( performPacket );
|
||||
}
|
||||
|
||||
void Core::Network::GameConnection::renameLandHandler(const Core::Network::Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||
Entity::Player& player)
|
||||
{
|
||||
const auto packet = ZoneChannelPacket< Client::FFXIVIpcRenameLandHandler >( inPacket );
|
||||
|
||||
}
|
||||
|
|
|
@ -53,6 +53,22 @@ Core::Data::HousingZonePtr Core::HousingMgr::getHousingZone( uint16_t id )
|
|||
return it->second;
|
||||
}
|
||||
|
||||
Core::Data::HousingZonePtr Core::HousingMgr::getHousingZoneByLandSetId( uint32_t id )
|
||||
{
|
||||
for( const auto& hZoneIt : m_housingZonePtrMap )
|
||||
{
|
||||
auto pHousingZone = hZoneIt.second;
|
||||
for( uint8_t landId = 0; landId < 60; landId++ )
|
||||
{
|
||||
if( pHousingZone->getLandSetId() == id )
|
||||
{
|
||||
return pHousingZone;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Core::LandPtr Core::HousingMgr::getLandByOwnerId( uint32_t id )
|
||||
{
|
||||
for( const auto& hZoneIt : m_housingZonePtrMap )
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Core
|
|||
uint16_t getNexLandId();
|
||||
void insertHousingZone( Core::Data::HousingZonePtr hZone );
|
||||
Core::Data::HousingZonePtr getHousingZone( uint16_t id );
|
||||
Core::Data::HousingZonePtr getHousingZoneByLandSetId( uint32_t id );
|
||||
Core::LandPtr getLandByOwnerId( uint32_t id );
|
||||
|
||||
private:
|
||||
|
|
|
@ -39,6 +39,9 @@ Core::Land::Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t lan
|
|||
{
|
||||
memset( &m_land, 0x00, sizeof( LandStruct ) );
|
||||
memset( &m_tag, 0x00, 3 );
|
||||
memset( &m_landMsg, 0x00, 193 );
|
||||
memset( &m_landName, 0x00, 23 );
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
|
@ -152,6 +155,11 @@ void Core::Land::setSharing( uint8_t state )
|
|||
m_land.iconAddIcon = state;
|
||||
}
|
||||
|
||||
void Core::Land::setLandName( std::string& name )
|
||||
{
|
||||
memcpy( &m_landName, &name, 20 );
|
||||
}
|
||||
|
||||
uint8_t Core::Land::getHouseSize()
|
||||
{
|
||||
return m_land.houseSize;
|
||||
|
@ -192,6 +200,11 @@ uint16_t Core::Land::getZoneId()
|
|||
return m_zoneId;
|
||||
}
|
||||
|
||||
std::string Core::Land::getLandName()
|
||||
{
|
||||
return std::string( m_landName );
|
||||
}
|
||||
|
||||
//Free Comapny
|
||||
void Core::Land::setFreeCompany( uint32_t id, uint32_t icon, uint32_t color )
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace Core
|
|||
void setState( uint8_t state );
|
||||
void setOwnership( uint8_t state );
|
||||
void setSharing( uint8_t state );
|
||||
void setLandName( std::string& name );
|
||||
|
||||
//Gerneral
|
||||
uint8_t getHouseSize();
|
||||
|
@ -34,6 +35,7 @@ namespace Core
|
|||
uint8_t getWardNum();
|
||||
uint8_t getLandId();
|
||||
uint16_t getZoneId();
|
||||
std::string getLandName();
|
||||
|
||||
//Free Comapny
|
||||
void setFreeCompany( uint32_t id, uint32_t icon, uint32_t color );
|
||||
|
@ -90,7 +92,11 @@ namespace Core
|
|||
uint32_t m_currentPrice;
|
||||
uint32_t m_minPrice;
|
||||
|
||||
//Tags
|
||||
//information
|
||||
char m_landName[23];
|
||||
char m_landMsg[193];
|
||||
char m_ownerName[31];
|
||||
char fcTag[7];
|
||||
uint8_t m_tag[3];
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue