mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-15 15:07:45 +00:00
WiP Buying plots reenabled.
This commit is contained in:
parent
597c0e9bd2
commit
850509f8bd
7 changed files with 62 additions and 15 deletions
|
@ -1591,9 +1591,12 @@ namespace Sapphire::Common
|
|||
uint8_t status;
|
||||
uint8_t flags;
|
||||
uint8_t __padding1;
|
||||
uint64_t fcCrestId;
|
||||
uint8_t patternIds[9];
|
||||
uint8_t colors[9];
|
||||
uint32_t fcCrestId;
|
||||
uint32_t fcCrestId1;
|
||||
uint8_t unknown1[4];
|
||||
uint8_t patternIds[8];
|
||||
uint8_t colors[8];
|
||||
uint8_t unknown2[8];
|
||||
};
|
||||
|
||||
struct Furniture
|
||||
|
@ -1608,7 +1611,8 @@ namespace Sapphire::Common
|
|||
struct CharaLandData
|
||||
{
|
||||
LandIdent landId;
|
||||
uint8_t flags;
|
||||
uint32_t landFlags;
|
||||
uint32_t unkown1;
|
||||
};
|
||||
|
||||
struct SimpleProfile
|
||||
|
|
|
@ -1970,6 +1970,8 @@ struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket< TimeOffset >
|
|||
struct FFXIVIpcHouseList : FFXIVIpcBasePacket< HouseList >
|
||||
{
|
||||
Common::LandIdent LandSetId;
|
||||
uint32_t Subdivision;
|
||||
uint32_t unknown1;
|
||||
Common::House Houses[30];
|
||||
};
|
||||
|
||||
|
@ -2052,11 +2054,11 @@ struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket< TimeOffset >
|
|||
|
||||
struct FFXIVIpcCharaHousing : FFXIVIpcBasePacket< CharaHousing >
|
||||
{
|
||||
Common::CharaLandData FcLands[1];
|
||||
uint8_t __padding1;
|
||||
uint8_t __padding2;
|
||||
uint8_t __padding3;
|
||||
Common::CharaLandData CharaLands[1];
|
||||
Common::CharaLandData FcLands;
|
||||
Common::CharaLandData CharaLands;
|
||||
Common::CharaLandData apartment;
|
||||
Common::CharaLandData sharedHouse[2];
|
||||
Common::CharaLandData unknownHouse;
|
||||
};
|
||||
|
||||
struct FFXIVIpcHousingWelcome : FFXIVIpcBasePacket< HousingWelcome >
|
||||
|
|
|
@ -17,6 +17,10 @@ const Sapphire::ScriptAPI::ScriptObject* ptrs[] =
|
|||
namespace Sapphire
|
||||
{
|
||||
class InstanceObjectCache;
|
||||
namespace World
|
||||
{
|
||||
class WorldServer;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Sapphire::Data
|
||||
|
@ -30,6 +34,17 @@ namespace Sapphire::World::Manager
|
|||
class LinkshellMgr;
|
||||
class WarpMgr;
|
||||
class RNGMgr;
|
||||
class HousingMgr;
|
||||
}
|
||||
|
||||
extern "C" EXPORT void win32initServerMgr( std::shared_ptr< Sapphire::World::WorldServer > rngMgr )
|
||||
{
|
||||
Sapphire::Common::Service< Sapphire::World::WorldServer >::set( rngMgr );
|
||||
}
|
||||
|
||||
extern "C" EXPORT void win32initHouMgr( std::shared_ptr< Sapphire::World::Manager::HousingMgr > rngMgr )
|
||||
{
|
||||
Sapphire::Common::Service< Sapphire::World::Manager::HousingMgr >::set( rngMgr );
|
||||
}
|
||||
|
||||
extern "C" EXPORT void win32initRngMgr( std::shared_ptr< Sapphire::World::Manager::RNGMgr > rngMgr )
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
auto callback = [ this ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
// Purchase Land
|
||||
if( result.getResult( 0 ) == 1 )
|
||||
if( result.getResult( 0 ) == 2 )
|
||||
{
|
||||
auto activeLand = player.getActiveLand();
|
||||
auto territoryId = player.getTerritoryId();
|
||||
|
|
|
@ -107,7 +107,7 @@ Player::Player() :
|
|||
for( auto& i : m_charaLandData )
|
||||
{
|
||||
memset( &i, 0xFF, 8 );
|
||||
memset( &i.flags, 0, 8 );
|
||||
memset( &i.landFlags, 0, 8 );
|
||||
}
|
||||
|
||||
m_objSpawnIndexAllocator.init( MAX_DISPLAYED_EOBJS );
|
||||
|
@ -1729,15 +1729,15 @@ void Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags, Common::LandIde
|
|||
|
||||
m_charaLandData[ flagSlot ].landId = ident;
|
||||
m_charaLandData[ flagSlot ].landId.worldId = server.getWorldId();
|
||||
m_charaLandData[ flagSlot ].flags = landFlags;
|
||||
m_charaLandData[ flagSlot ].landFlags = landFlags;
|
||||
}
|
||||
|
||||
void Player::sendLandFlags()
|
||||
{
|
||||
auto landFlags = makeZonePacket< FFXIVIpcCharaHousing >( getId() );
|
||||
|
||||
landFlags->data().FcLands[ 0 ] = m_charaLandData[ Common::LandFlagsSlot::FreeCompany ];
|
||||
landFlags->data().CharaLands[ 0 ] = m_charaLandData[ Common::LandFlagsSlot::Private ];
|
||||
landFlags->data().FcLands = m_charaLandData[ Common::LandFlagsSlot::FreeCompany ];
|
||||
landFlags->data().CharaLands = m_charaLandData[ Common::LandFlagsSlot::Private ];
|
||||
|
||||
queuePacket( landFlags );
|
||||
}
|
||||
|
|
|
@ -125,6 +125,8 @@ Sapphire::ScriptAPI::ScriptObject** Sapphire::Scripting::ScriptLoader::getScript
|
|||
using win32initFuncWarpMgr = void(*)( std::shared_ptr< Sapphire::World::Manager::WarpMgr > );
|
||||
using win32initIObjectCache = void(*)( std::shared_ptr< Sapphire::InstanceObjectCache > );
|
||||
using win32initRngMgr = void(*)( std::shared_ptr< Sapphire::World::Manager::RNGMgr > );
|
||||
using win32initHouMgr = void(*)( std::shared_ptr< Sapphire::World::Manager::HousingMgr > );
|
||||
using win32initServerMgr = void(*)( std::shared_ptr< Sapphire::World::WorldServer > );
|
||||
|
||||
auto win32init = reinterpret_cast< win32initFunc >( GetProcAddress( handle, "win32initExd" ) );
|
||||
auto win32initTeri = reinterpret_cast< win32initFuncTeri >( GetProcAddress( handle, "win32initTeri" ) );
|
||||
|
@ -132,6 +134,30 @@ Sapphire::ScriptAPI::ScriptObject** Sapphire::Scripting::ScriptLoader::getScript
|
|||
auto win32initWarp = reinterpret_cast< win32initFuncWarpMgr >( GetProcAddress( handle, "win32initWarpMgr" ) );
|
||||
auto win32initIObject = reinterpret_cast< win32initIObjectCache >( GetProcAddress( handle, "win32initIObjectCache" ) );
|
||||
auto win32initRng = reinterpret_cast< win32initRngMgr >( GetProcAddress( handle, "win32initRngMgr" ) );
|
||||
auto win32initHou = reinterpret_cast< win32initHouMgr >( GetProcAddress( handle, "win32initHouMgr" ) );
|
||||
auto win32initServer = reinterpret_cast< win32initServerMgr >( GetProcAddress( handle, "win32initServerMgr" ) );
|
||||
|
||||
if( win32initServer )
|
||||
{
|
||||
auto ioCache = Common::Service< Sapphire::World::WorldServer >::get();
|
||||
auto ptr = ioCache.lock();
|
||||
win32initServer( ptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger::warn( "did not find a win32initServer export on a windows script target - the server will likely crash!" );
|
||||
}
|
||||
|
||||
if( win32initHou )
|
||||
{
|
||||
auto ioCache = Common::Service< Sapphire::World::Manager::HousingMgr >::get();
|
||||
auto ptr = ioCache.lock();
|
||||
win32initHou( ptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger::warn( "did not find a win32initHou export on a windows script target - the server will likely crash!" );
|
||||
}
|
||||
|
||||
if( win32initRng )
|
||||
{
|
||||
|
|
|
@ -191,7 +191,7 @@ void Sapphire::HousingZone::sendLandSet( Entity::Player& player )
|
|||
landsetInitializePacket->data().LandSetId.territoryTypeId = m_territoryTypeId;
|
||||
//TODO: get current WorldId
|
||||
landsetInitializePacket->data().LandSetId.worldId = server.getWorldId();
|
||||
|
||||
landsetInitializePacket->data().Subdivision = 1;
|
||||
for( uint8_t i = 0, count = 0; i < 30; ++i, ++count )
|
||||
{
|
||||
auto pLand = getLand( i );
|
||||
|
|
Loading…
Add table
Reference in a new issue