From bfdf73257926726fd7ab539f9c142c4b5ab50271 Mon Sep 17 00:00:00 2001 From: Mordred Date: Sun, 30 Jan 2022 15:37:24 +0100 Subject: [PATCH] Removed old function for performZoning --- src/world/Actor/Player.cpp | 27 ------------------- src/world/Actor/Player.h | 3 --- .../Network/Handlers/GMCommandHandlers.cpp | 12 ++++++--- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 2efaad7c..730ce8df 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -477,33 +477,6 @@ void Sapphire::Entity::Player::forceZoneing( uint32_t zoneId ) warpMgr.requestMoveTerritory( *this, WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), getPos(), getRot() ); } -void Sapphire::Entity::Player::performZoning( uint16_t territoryTypeId, uint32_t territoryId, const Common::FFXIVARR_POSITION3& pos, float rotation ) -{ - m_pos = pos; - setRot( rotation ); - - auto& teriMgr = Common::Service< TerritoryMgr >::ref(); - setOnEnterEventDone( false ); - - TerritoryPtr pZone; - if( territoryId != 0 ) - pZone = teriMgr.getTerritoryByGuId( territoryId ); - else - pZone = teriMgr.getZoneByTerritoryTypeId( territoryTypeId ); - - if( !teriMgr.movePlayer( pZone, *this ) ) - { - // todo: this will require proper handling, for now just return the player to their previous area - m_pos = m_prevPos; - m_rot = m_prevRot; - m_territoryTypeId = m_prevTerritoryTypeId; - - auto pZone1 = teriMgr.getZoneByTerritoryTypeId( m_territoryTypeId ); - if( !teriMgr.movePlayer( pZone1, *this ) ) - return; - } -} - bool Sapphire::Entity::Player::exitInstance() { auto& teriMgr = Common::Service< TerritoryMgr >::ref(); diff --git a/src/world/Actor/Player.h b/src/world/Actor/Player.h index 99c262f8..2605b1c9 100644 --- a/src/world/Actor/Player.h +++ b/src/world/Actor/Player.h @@ -562,9 +562,6 @@ namespace Sapphire::Entity /*! set the loading complete bool */ void setLoadingComplete( bool bComplete ); - /*! mark this player for zoning, notify worldserver */ - void performZoning( uint16_t territoryTypeId, uint32_t territoryId, const Common::FFXIVARR_POSITION3& pos, float rotation ); - void sendZoneInPackets( uint32_t param1, bool pSetStatus ); void finishZoning(); diff --git a/src/world/Network/Handlers/GMCommandHandlers.cpp b/src/world/Network/Handlers/GMCommandHandlers.cpp index 56d197e6..06817399 100644 --- a/src/world/Network/Handlers/GMCommandHandlers.cpp +++ b/src/world/Network/Handlers/GMCommandHandlers.cpp @@ -195,7 +195,12 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR case GmCommand::Call: { if( targetPlayer->getTerritoryTypeId() != player.getTerritoryTypeId() ) - targetPlayer->performZoning( player.getTerritoryTypeId(), player.getTerritoryId(), { player.getPos().x, player.getPos().y, player.getPos().z }, player.getRot() ); + { + auto& warpMgr = Common::Service< WarpMgr >::ref(); + warpMgr.requestMoveTerritory( *targetPlayer, WarpType::WARP_TYPE_GM, + player.getTerritoryId(), { player.getPos().x, player.getPos().y, player.getPos().z }, + player.getRot() ); + } else targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() ); PlayerMgr::sendServerNotice( player, "Calling {0}", targetPlayer->getName() ); @@ -533,8 +538,9 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR } else { - targetPlayer->setPos( targetPlayer->getPos() ); - targetPlayer->performZoning( static_cast< uint16_t >( param1 ), targetPlayer->getTerritoryId(), targetPlayer->getPos(), 0 ); + auto& warpMgr = Common::Service< WarpMgr >::ref(); + warpMgr.requestMoveTerritory( *targetPlayer, WarpType::WARP_TYPE_GM, + targetPlayer->getTerritoryId(), targetPlayer->getPos(), 0 ); } PlayerMgr::sendServerNotice( player, "{0} was warped to zone {1}", targetPlayer->getName(), param1, pZone->getName() );