1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 11:07:45 +00:00

fix the stupid mistake in CFHandler since it exists and actually allows one to join a dungeon, now with your "party members" as well.

This commit is contained in:
collett 2021-08-08 06:31:59 +09:00
parent 55b290e327
commit 01ce52fb14

View file

@ -76,11 +76,11 @@ void Sapphire::Network::GameConnection::cfRegisterDuty( const Packets::FFXIVARR_
packet->data().cancelReason = 890; packet->data().cancelReason = 890;
queueOutPacket( packet ); queueOutPacket( packet );
auto cfCondition = exdData.get< Sapphire::Data::ContentFinderCondition >( contentId ); /*auto cfCondition = exdData.get< Sapphire::Data::ContentFinderCondition >( contentId );
if( !cfCondition ) if( !cfCondition )
return; return;*/
auto instance = teriMgr.createInstanceContent( cfCondition->content ); auto instance = teriMgr.createInstanceContent( /*cfCondition->content*/ contentId );
if( !instance ) if( !instance )
return; return;
@ -89,7 +89,33 @@ void Sapphire::Network::GameConnection::cfRegisterDuty( const Packets::FFXIVARR_
player.sendDebug( "Created instance with id#", instance->getGuId() ); player.sendDebug( "Created instance with id#", instance->getGuId() );
auto sourceZoneGuId = player.getCurrentTerritory()->getGuId();
player.setInstance( instance ); player.setInstance( instance );
if( player.isPartyLeader() )
{
player.foreachPartyMember( [ &player, &pInstance, sourceZoneGuId ]( Entity::PlayerPtr m )
{
if( m->getId() == player.getId() )
return;
if( m->hasStateFlag( PlayerStateFlag::InNpcEvent ) )
{
player.sendUrgent( "Cannot teleport {} to the instance, target in event.", m->getName() );
m->sendUrgent( "Too busy to join instance created by {}.", player.getName() );
return;
}
if( m->getCurrentTerritory()->getGuId() != sourceZoneGuId )
{
player.sendUrgent( "Cannot teleport {} to the instance, target in different zone.", m->getName() );
m->sendUrgent( "Too far to join instance created by {}.", player.getName() );
return;
}
player.sendUrgent( "Teleporting {} to the instance...", m->getName() );
m->sendUrgent( "Joining instance created by {}.", player.getName() );
pInstance->bindPlayer( m->getId() );
m->setInstance( pInstance );
} );
}
} }
void Sapphire::Network::GameConnection::cfRegisterRoulette( const Packets::FFXIVARR_PACKET_RAW& inPacket, void Sapphire::Network::GameConnection::cfRegisterRoulette( const Packets::FFXIVARR_PACKET_RAW& inPacket,