mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
more ident cleanup
This commit is contained in:
parent
4e3de5817f
commit
7aba36f963
4 changed files with 38 additions and 37 deletions
|
@ -1618,8 +1618,7 @@ void Sapphire::Entity::Player::sendZonePackets()
|
||||||
state |= HasAetheryte;
|
state |= HasAetheryte;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ident = pLand->getLandIdent();
|
setLandFlags( LandFlagsSlot::Private, state, pLand->getLandIdent() );
|
||||||
setLandFlags( LandFlagsSlot::Private, state, ident.landId, ident.wardNum, ident.territoryTypeId );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sendLandFlags();
|
sendLandFlags();
|
||||||
|
@ -1800,12 +1799,10 @@ bool Sapphire::Entity::Player::isOnEnterEventDone() const
|
||||||
return m_onEnterEventDone;
|
return m_onEnterEventDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags,
|
void Sapphire::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags, Common::LandIdent ident )
|
||||||
int16_t landId, int16_t wardNum, int16_t zoneId )
|
|
||||||
{
|
{
|
||||||
m_landFlags[ flagSlot ].landIdent.landId = landId;
|
m_landFlags[ flagSlot ].landIdent = ident;
|
||||||
m_landFlags[ flagSlot ].landIdent.wardNum = wardNum;
|
// todo: leave this in for now but we really need to handle this world id shit properly
|
||||||
m_landFlags[ flagSlot ].landIdent.territoryTypeId = zoneId;
|
|
||||||
m_landFlags[ flagSlot ].landIdent.worldId = 67;
|
m_landFlags[ flagSlot ].landIdent.worldId = 67;
|
||||||
m_landFlags[ flagSlot ].landFlags = landFlags;
|
m_landFlags[ flagSlot ].landFlags = landFlags;
|
||||||
m_landFlags[ flagSlot ].unkown1 = 0;
|
m_landFlags[ flagSlot ].unkown1 = 0;
|
||||||
|
|
|
@ -765,7 +765,7 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
// Housing Handling
|
// Housing Handling
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, int16_t landId, int16_t wardNum, int16_t zoneId );
|
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, Common::LandIdent ident );
|
||||||
|
|
||||||
void sendLandFlags();
|
void sendLandFlags();
|
||||||
void sendLandFlagsSlot( Common::LandFlagsSlot slot );
|
void sendLandFlagsSlot( Common::LandFlagsSlot slot );
|
||||||
|
|
|
@ -1006,29 +1006,34 @@ void Sapphire::DebugCommandHandler::housing( char* data, Entity::Player& player,
|
||||||
subCommand = params;
|
subCommand = params;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( subCommand == "permission" || subCommand == "perm" )
|
// if( subCommand == "permission" || subCommand == "perm" )
|
||||||
{
|
// {
|
||||||
uint8_t permissionSet;
|
// uint8_t permissionSet;
|
||||||
sscanf( params.c_str(), "%hhu", &permissionSet );
|
// sscanf( params.c_str(), "%hhu", &permissionSet );
|
||||||
|
//
|
||||||
if ( permissionSet < 5 )
|
// if ( permissionSet < 5 )
|
||||||
{
|
// {
|
||||||
auto pZone = player.getCurrentZone();
|
// auto pZone = player.getCurrentZone();
|
||||||
if( pTeriMgr->isHousingTerritory( pZone->getTerritoryTypeId() ) )
|
// if( pTeriMgr->isHousingTerritory( pZone->getTerritoryTypeId() ) )
|
||||||
{
|
// {
|
||||||
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
|
// auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
|
||||||
if( pHousing )
|
// if( pHousing )
|
||||||
{
|
// {
|
||||||
player.setLandFlags( permissionSet, 0, pHousing->getLandSetId(), pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
// // todo: wat?
|
||||||
player.sendLandFlags();
|
// Common::LandIdent ident {};
|
||||||
}
|
// ident.wardNum = pHousing->getWardNum();
|
||||||
else
|
// ident.territoryTypeId = pHousing->getTerritoryTypeId();
|
||||||
player.sendDebug( "You aren't in a housing Zone." );
|
//
|
||||||
}
|
// player.setLandFlags( permissionSet, 0, pHousing->getLandSetId(), ident );
|
||||||
}
|
// player.sendLandFlags();
|
||||||
else
|
// }
|
||||||
player.sendDebug( "PermissionSet out of range." );
|
// else
|
||||||
}
|
// player.sendDebug( "You aren't in a housing Zone." );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// player.sendDebug( "PermissionSet out of range." );
|
||||||
|
// }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.sendDebug( "Unknown sub command." );
|
player.sendDebug( "Unknown sub command." );
|
||||||
|
|
|
@ -165,8 +165,7 @@ Sapphire::LandPurchaseResult Sapphire::World::Manager::HousingMgr::purchaseLand(
|
||||||
pLand->setState( HouseState::sold );
|
pLand->setState( HouseState::sold );
|
||||||
pLand->setLandType( Common::LandType::Private );
|
pLand->setLandType( Common::LandType::Private );
|
||||||
|
|
||||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, plot,
|
player.setLandFlags( LandFlagsSlot::Private, 0x00, pLand->getLandIdent() );
|
||||||
pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
|
||||||
|
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
|
@ -217,7 +216,9 @@ bool Sapphire::World::Manager::HousingMgr::relinquishLand( Entity::Player& playe
|
||||||
pLand->setLandType( Common::LandType::none );
|
pLand->setLandType( Common::LandType::none );
|
||||||
pLand->updateLandDb();
|
pLand->updateLandDb();
|
||||||
|
|
||||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, 0xFF, 0xFF, 0xFF );
|
Common::LandIdent ident { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||||
|
|
||||||
|
player.setLandFlags( LandFlagsSlot::Private, 0x00, ident );
|
||||||
|
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
|
@ -351,9 +352,7 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
|
||||||
player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
||||||
player.playScene( 0x000B0095, 0, SET_BASE | HIDE_HOTBAR , 0, 1, plotNum, nullptr );
|
player.playScene( 0x000B0095, 0, SET_BASE | HIDE_HOTBAR , 0, 1, plotNum, nullptr );
|
||||||
|
|
||||||
auto ident = pLand->getLandIdent();
|
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, pLand->getLandIdent() );
|
||||||
|
|
||||||
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, ident.landId, ident.wardNum, ident.territoryTypeId );
|
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
hZone->registerHouseEntranceEObj( plotNum );
|
hZone->registerHouseEntranceEObj( plotNum );
|
||||||
|
|
Loading…
Add table
Reference in a new issue