mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
Temporary fix for resetting directors. Eventually zoning needs to be streamlined
This commit is contained in:
parent
c57cc0c9e1
commit
b5ceae58fb
7 changed files with 31 additions and 13 deletions
|
@ -1563,6 +1563,11 @@ struct FFXIVIpcDirectorVars : FFXIVIpcBasePacket< DirectorVars >
|
||||||
uint8_t m_branch;
|
uint8_t m_branch;
|
||||||
/*! raw storage for flags/vars */
|
/*! raw storage for flags/vars */
|
||||||
uint8_t m_unionData[10];
|
uint8_t m_unionData[10];
|
||||||
|
/*! unknown */
|
||||||
|
uint16_t u20;
|
||||||
|
uint16_t u22;
|
||||||
|
uint16_t u24;
|
||||||
|
uint16_t u28;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
#include "Session.h"
|
#include "Session.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
|
#include "Manager/HousingMgr.h"
|
||||||
#include "Manager/TerritoryMgr.h"
|
#include "Manager/TerritoryMgr.h"
|
||||||
|
|
||||||
#include "Territory/Zone.h"
|
#include "Territory/Zone.h"
|
||||||
#include "Territory/ZonePosition.h"
|
#include "Territory/ZonePosition.h"
|
||||||
|
#include "Territory/InstanceContent.h"
|
||||||
#include "Manager/HousingMgr.h"
|
|
||||||
#include "Territory/Land.h"
|
#include "Territory/Land.h"
|
||||||
|
|
||||||
#include "Network/GameConnection.h"
|
#include "Network/GameConnection.h"
|
||||||
|
@ -491,6 +492,9 @@ bool Sapphire::Entity::Player::exitInstance()
|
||||||
{
|
{
|
||||||
auto pTeriMgr = m_pFw->get< TerritoryMgr >();
|
auto pTeriMgr = m_pFw->get< TerritoryMgr >();
|
||||||
|
|
||||||
|
auto pZone = getCurrentZone();
|
||||||
|
auto pInstance = pZone->getAsInstanceContent();
|
||||||
|
|
||||||
// check if housing zone
|
// check if housing zone
|
||||||
if( pTeriMgr->isHousingTerritory( m_prevTerritoryTypeId ) )
|
if( pTeriMgr->isHousingTerritory( m_prevTerritoryTypeId ) )
|
||||||
{
|
{
|
||||||
|
@ -510,6 +514,8 @@ bool Sapphire::Entity::Player::exitInstance()
|
||||||
|
|
||||||
sendZonePackets();
|
sendZonePackets();
|
||||||
|
|
||||||
|
//m_queuedZoneing = std::make_shared< QueuedZoning >( m_territoryTypeId, m_pos, Util::getTimeMs(), m_rot );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -794,14 +794,14 @@ Sapphire::World::Manager::DebugCommandMgr::instance( char* data, Entity::Player&
|
||||||
|
|
||||||
if( subCommand == "create" || subCommand == "cr" )
|
if( subCommand == "create" || subCommand == "cr" )
|
||||||
{
|
{
|
||||||
uint32_t instanceContentId;
|
uint32_t contentFinderConditionId;
|
||||||
sscanf( params.c_str(), "%d", &instanceContentId );
|
sscanf( params.c_str(), "%d", &contentFinderConditionId );
|
||||||
|
|
||||||
auto instance = pTeriMgr->createInstanceContent( instanceContentId );
|
auto instance = pTeriMgr->createInstanceContent( contentFinderConditionId );
|
||||||
if( instance )
|
if( instance )
|
||||||
player.sendDebug( "Created instance with id#{0} -> {1}", instance->getGuId(), instance->getName() );
|
player.sendDebug( "Created instance with id#{0} -> {1}", instance->getGuId(), instance->getName() );
|
||||||
else
|
else
|
||||||
player.sendDebug( "Failed to create instance with id#{0}", instanceContentId );
|
player.sendDebug( "Failed to create instance with id#{0}", contentFinderConditionId );
|
||||||
}
|
}
|
||||||
else if( subCommand == "bind" )
|
else if( subCommand == "bind" )
|
||||||
{
|
{
|
||||||
|
|
|
@ -535,8 +535,8 @@ bool Sapphire::World::Manager::TerritoryMgr::movePlayer( ZonePtr pZone, Sapphire
|
||||||
// mark character as zoning in progress
|
// mark character as zoning in progress
|
||||||
pPlayer->setLoadingComplete( false );
|
pPlayer->setLoadingComplete( false );
|
||||||
|
|
||||||
//if( pPlayer->getLastPing() != 0 )
|
if( pPlayer->getLastPing() != 0 )
|
||||||
// pPlayer->getCurrentZone()->removeActor( pPlayer );
|
pPlayer->getCurrentZone()->removeActor( pPlayer );
|
||||||
|
|
||||||
pPlayer->setCurrentZone( pZone );
|
pPlayer->setCurrentZone( pZone );
|
||||||
pZone->pushActor( pPlayer );
|
pZone->pushActor( pPlayer );
|
||||||
|
|
|
@ -294,7 +294,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
|
||||||
}
|
}
|
||||||
case ClientTriggerType::RequestInstanceLeave:
|
case ClientTriggerType::RequestInstanceLeave:
|
||||||
{
|
{
|
||||||
// todo: apply cf penalty if applicable, make sure player isnt in combat
|
// todo: apply cf penalty if applicable, make sure player isn't in combat
|
||||||
player.exitInstance();
|
player.exitInstance();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,11 +89,8 @@ void Sapphire::InstanceContent::onLeaveTerritory( Entity::Player& player )
|
||||||
{
|
{
|
||||||
Logger::debug( "InstanceContent::onLeaveTerritory: Zone#{0}|{1}, Entity#{2}",
|
Logger::debug( "InstanceContent::onLeaveTerritory: Zone#{0}|{1}, Entity#{2}",
|
||||||
getGuId(), getTerritoryTypeId(), player.getId() );
|
getGuId(), getTerritoryTypeId(), player.getId() );
|
||||||
sendDirectorClear( player );
|
|
||||||
|
|
||||||
player.setDirectorInitialized( false );
|
clearDirector( player );
|
||||||
// remove "bound by duty" state
|
|
||||||
player.unsetStateFlag( PlayerStateFlag::BoundByDuty );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::InstanceContent::onUpdate( uint32_t currTime )
|
void Sapphire::InstanceContent::onUpdate( uint32_t currTime )
|
||||||
|
@ -450,3 +447,11 @@ void Sapphire::InstanceContent::unbindPlayer( uint32_t playerId )
|
||||||
if( it != m_playerMap.end() )
|
if( it != m_playerMap.end() )
|
||||||
it->second->exitInstance();
|
it->second->exitInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sapphire::InstanceContent::clearDirector( Entity::Player& player )
|
||||||
|
{
|
||||||
|
sendDirectorClear( player );
|
||||||
|
|
||||||
|
player.setDirectorInitialized( false );
|
||||||
|
// remove "bound by duty" state
|
||||||
|
player.unsetStateFlag( PlayerStateFlag::BoundByDuty );}
|
||||||
|
|
|
@ -64,6 +64,8 @@ public:
|
||||||
|
|
||||||
void endEventCutscene();
|
void endEventCutscene();
|
||||||
|
|
||||||
|
void clearDirector( Entity::Player& player );
|
||||||
|
|
||||||
/*! set the current bgm index (inside bgm.exd) */
|
/*! set the current bgm index (inside bgm.exd) */
|
||||||
void setCurrentBGM( uint16_t bgmId );
|
void setCurrentBGM( uint16_t bgmId );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue