1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-01 08:27:46 +00:00

remove more boost

This commit is contained in:
NotAdam 2018-10-25 12:44:51 +11:00
parent 4b013b5b0b
commit 4e3edbbcd2
37 changed files with 189 additions and 192 deletions

View file

@ -50,7 +50,7 @@ bool Core::Network::SapphireAPI::login( const std::string& username, const std::
} }
// create session for the new sessionid and store to sessionlist // create session for the new sessionid and store to sessionlist
auto pSession = boost::make_shared< Session >(); auto pSession = std::make_shared< Session >();
pSession->setAccountId( accountId ); pSession->setAccountId( accountId );
pSession->setSessionId( sid ); pSession->setSessionId( sid );
@ -75,7 +75,7 @@ bool Core::Network::SapphireAPI::login( const std::string& username, const std::
bool Core::Network::SapphireAPI::insertSession( const uint32_t& accountId, std::string& sId ) bool Core::Network::SapphireAPI::insertSession( const uint32_t& accountId, std::string& sId )
{ {
// create session for the new sessionid and store to sessionlist // create session for the new sessionid and store to sessionlist
auto pSession = boost::make_shared< Session >(); auto pSession = std::make_shared< Session >();
pSession->setAccountId( accountId ); pSession->setAccountId( accountId );
pSession->setSessionId( ( uint8_t* ) sId.c_str() ); pSession->setSessionId( ( uint8_t* ) sId.c_str() );

View file

@ -20,7 +20,7 @@ public:
~SapphireAPI(); ~SapphireAPI();
using SessionMap = std::map< std::string, boost::shared_ptr< Session > >; using SessionMap = std::map< std::string, std::shared_ptr< Session > >;
bool login( const std::string& username, const std::string& pass, std::string& sId ); bool login( const std::string& username, const std::string& pass, std::string& sId );

View file

@ -74,7 +74,7 @@ void Core::Action::ActionMount::onFinish()
pPlayer->unsetStateFlag( PlayerStateFlag::Casting ); pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
auto effectPacket = boost::make_shared< Server::EffectPacket >( getId(), pPlayer->getId(), 4 ); auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pPlayer->getId(), 4 );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( pPlayer->getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( pPlayer->getRot() ) );
Server::EffectEntry effectEntry{}; Server::EffectEntry effectEntry{};

View file

@ -86,7 +86,7 @@ void Core::Action::ActionTeleport::onFinish()
pPlayer->setZoningType( ZoneingType::Teleport ); pPlayer->setZoningType( ZoneingType::Teleport );
auto effectPacket = boost::make_shared< Server::EffectPacket >( getId(), pPlayer->getId(), 5 ); auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pPlayer->getId(), 5 );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( pPlayer->getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( pPlayer->getRot() ) );

View file

@ -71,7 +71,7 @@ void Core::Action::EventItemAction::onFinish()
try try
{ {
auto effectPacket = boost::make_shared< Server::EffectPacket >( m_pSource->getId(), m_additional, m_id ); auto effectPacket = std::make_shared< Server::EffectPacket >( m_pSource->getId(), m_additional, m_id );
effectPacket->setAnimationId( 1 ); effectPacket->setAnimationId( 1 );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( m_pSource->getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( m_pSource->getRot() ) );

View file

@ -136,7 +136,7 @@ Core::Entity::CharaPtr Core::Entity::Actor::getAsChara()
{ {
if( !isChara() ) if( !isChara() )
return nullptr; return nullptr;
return boost::dynamic_pointer_cast< Entity::Chara, Entity::Actor >( shared_from_this() ); return std::dynamic_pointer_cast< Entity::Chara, Entity::Actor >( shared_from_this() );
} }
/*! \return pointer to this instance as PlayerPtr */ /*! \return pointer to this instance as PlayerPtr */
@ -144,7 +144,7 @@ Core::Entity::PlayerPtr Core::Entity::Actor::getAsPlayer()
{ {
if( !isPlayer() ) if( !isPlayer() )
return nullptr; return nullptr;
return boost::dynamic_pointer_cast< Entity::Player, Entity::Actor >( shared_from_this() ); return std::dynamic_pointer_cast< Entity::Player, Entity::Actor >( shared_from_this() );
} }
/*! \return pointer to this instance as EventObjPtr */ /*! \return pointer to this instance as EventObjPtr */
@ -152,7 +152,7 @@ Core::Entity::EventObjectPtr Core::Entity::Actor::getAsEventObj()
{ {
if( !isEventObj() ) if( !isEventObj() )
return nullptr; return nullptr;
return boost::dynamic_pointer_cast< Entity::EventObject, Entity::Actor >( shared_from_this() ); return std::dynamic_pointer_cast< Entity::EventObject, Entity::Actor >( shared_from_this() );
} }
/*! \return pointer to this instance as BNpcPtr */ /*! \return pointer to this instance as BNpcPtr */
@ -160,7 +160,7 @@ Core::Entity::BNpcPtr Core::Entity::Actor::getAsBNpc()
{ {
if( !isBattleNpc() ) if( !isBattleNpc() )
return nullptr; return nullptr;
return boost::dynamic_pointer_cast< Entity::BNpc, Entity::Actor >( shared_from_this() ); return std::dynamic_pointer_cast< Entity::BNpc, Entity::Actor >( shared_from_this() );
} }
/*! /*!

View file

@ -2,7 +2,7 @@
#define _GAME_OBJECT_H_ #define _GAME_OBJECT_H_
#include <Common.h> #include <Common.h>
#include <boost/enable_shared_from_this.hpp> #include <memory>
#include "ForwardsZone.h" #include "ForwardsZone.h"
#include <set> #include <set>
@ -17,7 +17,7 @@ namespace Entity {
\brief Base class for all actor/objects \brief Base class for all actor/objects
*/ */
class Actor : public boost::enable_shared_from_this< Actor > class Actor : public std::enable_shared_from_this< Actor >
{ {
protected: protected:

View file

@ -117,5 +117,5 @@ uint32_t Core::Entity::BNpc::getBNpcNameId() const
void Core::Entity::BNpc::spawn( PlayerPtr pTarget ) void Core::Entity::BNpc::spawn( PlayerPtr pTarget )
{ {
pTarget->queuePacket( boost::make_shared< NpcSpawnPacket >( *getAsBNpc(), *pTarget ) ); pTarget->queuePacket( std::make_shared< NpcSpawnPacket >( *getAsBNpc(), *pTarget ) );
} }

View file

@ -363,7 +363,7 @@ so players can have their own version and we can abolish the param.
*/ */
void Core::Entity::Chara::sendStatusUpdate( bool toSelf ) void Core::Entity::Chara::sendStatusUpdate( bool toSelf )
{ {
FFXIVPacketBasePtr packet = boost::make_shared< UpdateHpMpTpPacket >( *this ); FFXIVPacketBasePtr packet = std::make_shared< UpdateHpMpTpPacket >( *this );
sendToInRangeSet( packet ); sendToInRangeSet( packet );
} }
@ -402,7 +402,7 @@ void Core::Entity::Chara::autoAttack( CharaPtr pTarget )
uint16_t damage = static_cast< uint16_t >( 10 + rand() % 12 ); uint16_t damage = static_cast< uint16_t >( 10 + rand() % 12 );
uint32_t variation = static_cast< uint32_t >( 0 + rand() % 4 ); uint32_t variation = static_cast< uint32_t >( 0 + rand() % 4 );
auto effectPacket = boost::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 0x336 ); auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 0x336 );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) );
Server::EffectEntry effectEntry{}; Server::EffectEntry effectEntry{};
@ -442,7 +442,7 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
// Todo: Effect packet generator. 90% of this is basically setting params and it's basically unreadable. // Todo: Effect packet generator. 90% of this is basically setting params and it's basically unreadable.
// Prepare packet. This is seemingly common for all packets in the action handler. // Prepare packet. This is seemingly common for all packets in the action handler.
auto effectPacket = boost::make_shared< Server::EffectPacket >( getId(), target.getId(), actionId ); auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), target.getId(), actionId );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) );
// Todo: for each actor, calculate how much damage the calculated value should deal to them - 2-step damage calc. we only have 1-step // Todo: for each actor, calculate how much damage the calculated value should deal to them - 2-step damage calc. we only have 1-step

View file

@ -369,14 +369,14 @@ void Core::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
setZoningType( Common::ZoneingType::Return ); setZoningType( Common::ZoneingType::Return );
} }
m_queuedZoneing = boost::make_shared< QueuedZoning >( data->territory, pos, Util::getTimeMs(), rot ); m_queuedZoneing = std::make_shared< QueuedZoning >( data->territory, pos, Util::getTimeMs(), rot );
} }
void Core::Entity::Player::forceZoneing( uint32_t zoneId ) void Core::Entity::Player::forceZoneing( uint32_t zoneId )
{ {
m_queuedZoneing = boost::make_shared< QueuedZoning >( zoneId, getPos(), Util::getTimeMs(), 0.f ); m_queuedZoneing = std::make_shared< QueuedZoning >( zoneId, getPos(), Util::getTimeMs(), 0.f );
//performZoning( zoneId, Common::ZoneingType::None, getPos() ); //performZoning( zoneId, Common::ZoneingType::None, getPos() );
} }
@ -571,7 +571,7 @@ void Core::Entity::Player::changePosition( float x, float y, float z, float o )
pos.x = x; pos.x = x;
pos.y = y; pos.y = y;
pos.z = z; pos.z = z;
m_queuedZoneing = boost::make_shared< QueuedZoning >( getZoneId(), pos, Util::getTimeMs(), o ); m_queuedZoneing = std::make_shared< QueuedZoning >( getZoneId(), pos, Util::getTimeMs(), o );
} }
void Core::Entity::Player::learnAction( uint16_t actionId ) void Core::Entity::Player::learnAction( uint16_t actionId )
@ -683,7 +683,7 @@ void Core::Entity::Player::gainLevel()
void Core::Entity::Player::sendStatusUpdate( bool toSelf ) void Core::Entity::Player::sendStatusUpdate( bool toSelf )
{ {
sendToInRangeSet( boost::make_shared< UpdateHpMpTpPacket >( *this ), true ); sendToInRangeSet( std::make_shared< UpdateHpMpTpPacket >( *this ), true );
} }
uint8_t Core::Entity::Player::getLevel() const uint8_t Core::Entity::Player::getLevel() const
@ -775,7 +775,7 @@ void Core::Entity::Player::setLevelForClass( uint8_t level, Common::ClassJob cla
void Core::Entity::Player::sendModel() void Core::Entity::Player::sendModel()
{ {
sendToInRangeSet( boost::make_shared< ModelEquipPacket >( *getAsPlayer() ), true ); sendToInRangeSet( std::make_shared< ModelEquipPacket >( *getAsPlayer() ), true );
} }
uint32_t Core::Entity::Player::getModelForSlot( Common::GearModelSlot slot ) uint32_t Core::Entity::Player::getModelForSlot( Common::GearModelSlot slot )
@ -838,7 +838,7 @@ void Core::Entity::Player::spawn( Entity::PlayerPtr pTarget )
getName() + " for " + getName() + " for " +
pTarget->getName() ); pTarget->getName() );
pTarget->queuePacket( boost::make_shared< PlayerSpawnPacket >( *getAsPlayer(), *pTarget ) ); pTarget->queuePacket( std::make_shared< PlayerSpawnPacket >( *getAsPlayer(), *pTarget ) );
} }
// despawn // despawn
@ -961,7 +961,7 @@ void Core::Entity::Player::setStateFlags( std::vector< Common::PlayerStateFlag >
void Core::Entity::Player::sendStateFlags() void Core::Entity::Player::sendStateFlags()
{ {
queuePacket( boost::make_shared< PlayerStateFlagsPacket >( *getAsPlayer() ) ); queuePacket( std::make_shared< PlayerStateFlagsPacket >( *getAsPlayer() ) );
} }
void Core::Entity::Player::unsetStateFlag( Common::PlayerStateFlag flag ) void Core::Entity::Player::unsetStateFlag( Common::PlayerStateFlag flag )
@ -1259,17 +1259,17 @@ uint8_t Core::Entity::Player::getSearchSelectClass() const
void Core::Entity::Player::sendNotice( const std::string& message ) //Purple Text void Core::Entity::Player::sendNotice( const std::string& message ) //Purple Text
{ {
queuePacket( boost::make_shared< ServerNoticePacket >( getId(), message ) ); queuePacket( std::make_shared< ServerNoticePacket >( getId(), message ) );
} }
void Core::Entity::Player::sendUrgent( const std::string& message ) //Red Text void Core::Entity::Player::sendUrgent( const std::string& message ) //Red Text
{ {
queuePacket( boost::make_shared< ChatPacket >( *getAsPlayer(), ChatType::ServerUrgent, message ) ); queuePacket( std::make_shared< ChatPacket >( *getAsPlayer(), ChatType::ServerUrgent, message ) );
} }
void Core::Entity::Player::sendDebug( const std::string& message ) //Grey Text void Core::Entity::Player::sendDebug( const std::string& message ) //Grey Text
{ {
queuePacket( boost::make_shared< ChatPacket >( *getAsPlayer(), ChatType::ServerDebug, message ) ); queuePacket( std::make_shared< ChatPacket >( *getAsPlayer(), ChatType::ServerDebug, message ) );
} }
void Core::Entity::Player::updateHowtosSeen( uint32_t howToId ) void Core::Entity::Player::updateHowtosSeen( uint32_t howToId )
@ -1412,7 +1412,7 @@ void Core::Entity::Player::autoAttack( CharaPtr pTarget )
if( getClass() == ClassJob::Machinist || getClass() == ClassJob::Bard || getClass() == ClassJob::Archer ) if( getClass() == ClassJob::Machinist || getClass() == ClassJob::Bard || getClass() == ClassJob::Archer )
{ {
auto effectPacket = boost::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 8 ); auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 8 );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) );
Server::EffectEntry entry; Server::EffectEntry entry;
@ -1426,7 +1426,7 @@ void Core::Entity::Player::autoAttack( CharaPtr pTarget )
} }
else else
{ {
auto effectPacket = boost::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 7 ); auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 7 );
effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) ); effectPacket->setRotation( Math::Util::floatToUInt16Rot( getRot() ) );
Server::EffectEntry entry; Server::EffectEntry entry;
@ -1546,7 +1546,7 @@ void Core::Entity::Player::sendZonePackets()
} }
queuePacket( contentFinderList ); queuePacket( contentFinderList );
queuePacket( boost::make_shared< InitUIPacket >( *this ) ); queuePacket( std::make_shared< InitUIPacket >( *this ) );
auto classInfoPacket = makeZonePacket< FFXIVIpcPlayerClassInfo >( getId() ); auto classInfoPacket = makeZonePacket< FFXIVIpcPlayerClassInfo >( getId() );
classInfoPacket->data().classId = static_cast< uint8_t >( getClass() ); classInfoPacket->data().classId = static_cast< uint8_t >( getClass() );

View file

@ -200,7 +200,7 @@ public:
bool giveQuestRewards( uint32_t questId, uint32_t optionalChoice ); bool giveQuestRewards( uint32_t questId, uint32_t optionalChoice );
boost::shared_ptr< Common::QuestActive > getQuestActive( uint16_t index ); std::shared_ptr< Common::QuestActive > getQuestActive( uint16_t index );
uint8_t getQuestUI8A( uint16_t questId ); uint8_t getQuestUI8A( uint16_t questId );
@ -984,7 +984,7 @@ private:
std::map< uint32_t, uint8_t > m_questIdToQuestIdx; // quest mapping, quest id to quest container index std::map< uint32_t, uint8_t > m_questIdToQuestIdx; // quest mapping, quest id to quest container index
std::map< uint8_t, uint32_t > m_questIdxToQuestId; // quest mapping, quest container index to questId std::map< uint8_t, uint32_t > m_questIdxToQuestId; // quest mapping, quest container index to questId
boost::shared_ptr< Common::QuestActive > m_activeQuests[30]; std::shared_ptr< Common::QuestActive > m_activeQuests[30];
int16_t m_questTracking[5]; int16_t m_questTracking[5];
uint8_t m_stateFlags[12]; uint8_t m_stateFlags[12];
@ -1003,7 +1003,7 @@ private:
bool m_bMarkedForZoning; bool m_bMarkedForZoning;
bool m_bNewAdventurer; bool m_bNewAdventurer;
uint64_t m_onlineStatus; uint64_t m_onlineStatus;
boost::shared_ptr< QueuedZoning > m_queuedZoneing; std::shared_ptr< QueuedZoning > m_queuedZoneing;
// search info // search info
char m_searchMessage[193]; // searchmessage to show in profile char m_searchMessage[193]; // searchmessage to show in profile

View file

@ -84,7 +84,7 @@ void Core::Entity::Player::directorPlayScene( uint32_t eventId, uint32_t scene,
pEvent->setPlayedScene( true ); pEvent->setPlayedScene( true );
pEvent->setEventReturnCallback( nullptr ); pEvent->setEventReturnCallback( nullptr );
auto eventPlay = boost::make_shared< DirectorPlayScenePacket >( getId(), getId(), pEvent->getId(), auto eventPlay = std::make_shared< DirectorPlayScenePacket >( getId(), getId(), pEvent->getId(),
scene, flags, eventParam3, eventParam4, eventParam5 ); scene, flags, eventParam3, eventParam4, eventParam5 );
queuePacket( eventPlay ); queuePacket( eventPlay );
@ -101,7 +101,7 @@ void Core::Entity::Player::eventStart( uint64_t actorId, uint32_t eventId,
setStateFlag( PlayerStateFlag::InNpcEvent ); setStateFlag( PlayerStateFlag::InNpcEvent );
auto eventStart = boost::make_shared< EventStartPacket >( getId(), actorId, eventId, auto eventStart = std::make_shared< EventStartPacket >( getId(), actorId, eventId,
eventType, eventParam1, eventParam2 ); eventType, eventParam1, eventParam2 );
queuePacket( eventStart ); queuePacket( eventStart );
@ -188,7 +188,7 @@ void Core::Entity::Player::playScene( uint32_t eventId, uint32_t scene,
pEvent->setPlayedScene( true ); pEvent->setPlayedScene( true );
pEvent->setEventReturnCallback( eventCallback ); pEvent->setEventReturnCallback( eventCallback );
pEvent->setSceneChainCallback( nullptr ); pEvent->setSceneChainCallback( nullptr );
auto eventPlay = boost::make_shared< EventPlayPacket >( getId(), pEvent->getActorId(), pEvent->getId(), auto eventPlay = std::make_shared< EventPlayPacket >( getId(), pEvent->getActorId(), pEvent->getId(),
scene, flags, eventParam2, eventParam3, eventParam4 ); scene, flags, eventParam2, eventParam3, eventParam4 );
queuePacket( eventPlay ); queuePacket( eventPlay );
@ -205,7 +205,7 @@ void Core::Entity::Player::playSceneChain( uint32_t eventId, uint32_t scene, uin
pEvent->setPlayedScene( true ); pEvent->setPlayedScene( true );
pEvent->setSceneChainCallback( sceneChainCallback ); pEvent->setSceneChainCallback( sceneChainCallback );
pEvent->setEventReturnCallback( nullptr ); pEvent->setEventReturnCallback( nullptr );
auto eventPlay = boost::make_shared< EventPlayPacket >( getId(), pEvent->getActorId(), pEvent->getId(), auto eventPlay = std::make_shared< EventPlayPacket >( getId(), pEvent->getActorId(), pEvent->getId(),
scene, flags, eventParam2, eventParam3, eventParam4 ); scene, flags, eventParam2, eventParam3, eventParam4 );
queuePacket( eventPlay ); queuePacket( eventPlay );
@ -245,7 +245,7 @@ void Core::Entity::Player::eventFinish( uint32_t eventId, uint32_t freePlayer )
{ {
case Event::EventHandler::Nest: case Event::EventHandler::Nest:
{ {
queuePacket( boost::make_shared< EventFinishPacket >( getId(), pEvent->getId(), queuePacket( std::make_shared< EventFinishPacket >( getId(), pEvent->getId(),
pEvent->getEventType(), pEvent->getEventParam() ) ); pEvent->getEventType(), pEvent->getEventParam() ) );
removeEvent( pEvent->getId() ); removeEvent( pEvent->getId() );
@ -257,7 +257,7 @@ void Core::Entity::Player::eventFinish( uint32_t eventId, uint32_t freePlayer )
if( it.second->hasPlayedScene() == false ) if( it.second->hasPlayedScene() == false )
{ {
// TODO: not happy with this, this is also prone to break wit more than one remaining event in there // TODO: not happy with this, this is also prone to break wit more than one remaining event in there
queuePacket( boost::make_shared< EventFinishPacket >( getId(), it.second->getId(), queuePacket( std::make_shared< EventFinishPacket >( getId(), it.second->getId(),
it.second->getEventType(), it.second->getEventType(),
it.second->getEventParam() ) ); it.second->getEventParam() ) );
removeEvent( it.second->getId() ); removeEvent( it.second->getId() );
@ -268,7 +268,7 @@ void Core::Entity::Player::eventFinish( uint32_t eventId, uint32_t freePlayer )
} }
default: default:
{ {
queuePacket( boost::make_shared< EventFinishPacket >( getId(), pEvent->getId(), queuePacket( std::make_shared< EventFinishPacket >( getId(), pEvent->getId(),
pEvent->getEventType(), pEvent->getEventParam() ) ); pEvent->getEventType(), pEvent->getEventParam() ) );
break; break;
} }

View file

@ -276,7 +276,7 @@ void Core::Entity::Player::addCurrency( CurrencyType type, uint32_t amount )
updateContainer( Currency, slot, currItem ); updateContainer( Currency, slot, currItem );
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(), auto invUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(),
static_cast< uint8_t >( type ) - 1, static_cast< uint8_t >( type ) - 1,
Common::InventoryType::Currency, Common::InventoryType::Currency,
*currItem ); *currItem );
@ -298,7 +298,7 @@ void Core::Entity::Player::removeCurrency( Common::CurrencyType type, uint32_t a
currItem->setStackSize( currentAmount - amount ); currItem->setStackSize( currentAmount - amount );
writeItem( currItem ); writeItem( currItem );
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(), auto invUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(),
static_cast< uint8_t >( type ) - 1, static_cast< uint8_t >( type ) - 1,
Common::InventoryType::Currency, Common::InventoryType::Currency,
*currItem ); *currItem );
@ -326,7 +326,7 @@ void Core::Entity::Player::addCrystal( Common::CrystalType type, uint32_t amount
writeInventory( Crystal ); writeInventory( Crystal );
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(), auto invUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(),
static_cast< uint8_t >( type ) - 1, static_cast< uint8_t >( type ) - 1,
Common::InventoryType::Crystal, Common::InventoryType::Crystal,
*currItem ); *currItem );
@ -349,7 +349,7 @@ void Core::Entity::Player::removeCrystal( Common::CrystalType type, uint32_t amo
writeItem( currItem ); writeItem( currItem );
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(), auto invUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(),
static_cast< uint8_t >( type ) - 1, static_cast< uint8_t >( type ) - 1,
Common::InventoryType::Crystal, Common::InventoryType::Crystal,
*currItem ); *currItem );
@ -595,7 +595,7 @@ Core::ItemPtr Core::Entity::Player::addItem( uint32_t catalogId, uint32_t quanti
item->setStackSize( newStackSize ); item->setStackSize( newStackSize );
writeItem( item ); writeItem( item );
auto slotUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(), slot, bag, *item ); auto slotUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(), slot, bag, *item );
queuePacket( slotUpdate ); queuePacket( slotUpdate );
// return existing stack if we have no overflow - items fit into a preexisting stack // return existing stack if we have no overflow - items fit into a preexisting stack
@ -629,7 +629,7 @@ Core::ItemPtr Core::Entity::Player::addItem( uint32_t catalogId, uint32_t quanti
if( !silent ) if( !silent )
{ {
auto invUpdate = boost::make_shared< UpdateInventorySlotPacket >( getId(), freeBagSlot.second, freeBagSlot.first, auto invUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(), freeBagSlot.second, freeBagSlot.first,
*item ); *item );
queuePacket( invUpdate ); queuePacket( invUpdate );

View file

@ -59,7 +59,7 @@ void Core::Entity::Player::removeQuest( uint16_t questId )
m_questTracking[ ii ] = -1; m_questTracking[ ii ] = -1;
} }
boost::shared_ptr< QuestActive > pQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pQuest = m_activeQuests[ idx ];
m_activeQuests[ idx ].reset(); m_activeQuests[ idx ].reset();
m_questIdToQuestIdx.erase( questId ); m_questIdToQuestIdx.erase( questId );
@ -92,7 +92,7 @@ bool Core::Entity::Player::getQuestBitFlag8( uint16_t questId, uint8_t index )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->a.BitFlag8 & ( 1 << index ); return pNewQuest->a.BitFlag8 & ( 1 << index );
} }
@ -105,7 +105,7 @@ bool Core::Entity::Player::getQuestBitFlag16( uint16_t questId, uint8_t index )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->a.BitFlag16 & ( 1 << index ); return pNewQuest->a.BitFlag16 & ( 1 << index );
} }
@ -118,7 +118,7 @@ bool Core::Entity::Player::getQuestBitFlag24( uint16_t questId, uint8_t index )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->a.BitFlag24 & ( 1 << index ); return pNewQuest->a.BitFlag24 & ( 1 << index );
} }
@ -131,7 +131,7 @@ bool Core::Entity::Player::getQuestBitFlag32( uint16_t questId, uint8_t index )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->a.BitFlag32 & ( 1 << index ); return pNewQuest->a.BitFlag32 & ( 1 << index );
} }
@ -144,7 +144,7 @@ bool Core::Entity::Player::getQuestBitFlag40( uint16_t questId, uint8_t index )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->a.BitFlag40 & ( 1 << index ); return pNewQuest->a.BitFlag40 & ( 1 << index );
} }
@ -157,7 +157,7 @@ bool Core::Entity::Player::getQuestBitFlag48( uint16_t questId, uint8_t index )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->a.BitFlag48 & ( 1 << index ); return pNewQuest->a.BitFlag48 & ( 1 << index );
} }
@ -170,7 +170,7 @@ uint8_t Core::Entity::Player::getQuestUI8A( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->c.UI8A; value = pNewQuest->c.UI8A;
} }
@ -183,7 +183,7 @@ uint8_t Core::Entity::Player::getQuestUI8B( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->c.UI8B; value = pNewQuest->c.UI8B;
} }
@ -196,7 +196,7 @@ uint8_t Core::Entity::Player::getQuestUI8C( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->c.UI8C; value = pNewQuest->c.UI8C;
} }
@ -209,7 +209,7 @@ uint8_t Core::Entity::Player::getQuestUI8D( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->c.UI8D; value = pNewQuest->c.UI8D;
} }
@ -222,7 +222,7 @@ uint8_t Core::Entity::Player::getQuestUI8E( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->c.UI8E; value = pNewQuest->c.UI8E;
} }
@ -235,7 +235,7 @@ uint8_t Core::Entity::Player::getQuestUI8F( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->c.UI8F; value = pNewQuest->c.UI8F;
} }
@ -248,7 +248,7 @@ uint8_t Core::Entity::Player::getQuestUI8AH( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8AH; value = pNewQuest->b.UI8AH;
} }
@ -261,7 +261,7 @@ uint8_t Core::Entity::Player::getQuestUI8BH( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8BH; value = pNewQuest->b.UI8BH;
} }
@ -274,7 +274,7 @@ uint8_t Core::Entity::Player::getQuestUI8CH( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8CH; value = pNewQuest->b.UI8CH;
} }
@ -287,7 +287,7 @@ uint8_t Core::Entity::Player::getQuestUI8DH( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8DH; value = pNewQuest->b.UI8DH;
} }
@ -300,7 +300,7 @@ uint8_t Core::Entity::Player::getQuestUI8EH( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8EH; value = pNewQuest->b.UI8EH;
} }
@ -313,7 +313,7 @@ uint8_t Core::Entity::Player::getQuestUI8FH( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8FH; value = pNewQuest->b.UI8FH;
} }
@ -326,7 +326,7 @@ uint8_t Core::Entity::Player::getQuestUI8AL( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8AL; value = pNewQuest->b.UI8AL;
} }
@ -339,7 +339,7 @@ uint8_t Core::Entity::Player::getQuestUI8BL( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8BL; value = pNewQuest->b.UI8BL;
} }
@ -352,7 +352,7 @@ uint8_t Core::Entity::Player::getQuestUI8CL( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8CL; value = pNewQuest->b.UI8CL;
} }
@ -365,7 +365,7 @@ uint8_t Core::Entity::Player::getQuestUI8DL( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8DL; value = pNewQuest->b.UI8DL;
} }
@ -378,7 +378,7 @@ uint8_t Core::Entity::Player::getQuestUI8EL( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8EL; value = pNewQuest->b.UI8EL;
} }
@ -391,7 +391,7 @@ uint8_t Core::Entity::Player::getQuestUI8FL( uint16_t questId )
uint8_t value = 0; uint8_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
value = pNewQuest->b.UI8FL; value = pNewQuest->b.UI8FL;
} }
@ -404,7 +404,7 @@ uint16_t Core::Entity::Player::getQuestUI16A( uint16_t questId )
uint16_t value = 0; uint16_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// value = pNewQuest->d.UI16A; // value = pNewQuest->d.UI16A;
} }
@ -417,7 +417,7 @@ uint16_t Core::Entity::Player::getQuestUI16B( uint16_t questId )
uint16_t value = 0; uint16_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// value = pNewQuest->d.UI16B; // value = pNewQuest->d.UI16B;
} }
@ -430,7 +430,7 @@ uint16_t Core::Entity::Player::getQuestUI16C( uint16_t questId )
uint16_t value = 0; uint16_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// value = pNewQuest->d.UI16C; // value = pNewQuest->d.UI16C;
} }
@ -443,7 +443,7 @@ uint32_t Core::Entity::Player::getQuestUI32A( uint16_t questId )
uint32_t value = 0; uint32_t value = 0;
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// value = pNewQuest->e.UI32A; // value = pNewQuest->e.UI32A;
} }
@ -456,7 +456,7 @@ void Core::Entity::Player::setQuestUI8A( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->c.UI8A = val; pNewQuest->c.UI8A = val;
@ -470,7 +470,7 @@ void Core::Entity::Player::setQuestUI8B( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->c.UI8B = val; pNewQuest->c.UI8B = val;
@ -484,7 +484,7 @@ void Core::Entity::Player::setQuestUI8C( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->c.UI8C = val; pNewQuest->c.UI8C = val;
@ -498,7 +498,7 @@ void Core::Entity::Player::setQuestUI8D( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->c.UI8D = val; pNewQuest->c.UI8D = val;
@ -512,7 +512,7 @@ void Core::Entity::Player::setQuestUI8E( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->c.UI8E = val; pNewQuest->c.UI8E = val;
@ -526,7 +526,7 @@ void Core::Entity::Player::setQuestUI8F( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->c.UI8F = val; pNewQuest->c.UI8F = val;
@ -540,7 +540,7 @@ void Core::Entity::Player::setQuestUI8AH( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8AH = val; pNewQuest->b.UI8AH = val;
@ -554,7 +554,7 @@ void Core::Entity::Player::setQuestUI8BH( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8BH = val; pNewQuest->b.UI8BH = val;
@ -568,7 +568,7 @@ void Core::Entity::Player::setQuestUI8CH( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8CH = val; pNewQuest->b.UI8CH = val;
@ -582,7 +582,7 @@ void Core::Entity::Player::setQuestUI8DH( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8DH = val; pNewQuest->b.UI8DH = val;
@ -596,7 +596,7 @@ void Core::Entity::Player::setQuestUI8EH( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8EH = val; pNewQuest->b.UI8EH = val;
@ -610,7 +610,7 @@ void Core::Entity::Player::setQuestUI8FH( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8FH = val; pNewQuest->b.UI8FH = val;
@ -624,7 +624,7 @@ void Core::Entity::Player::setQuestUI8AL( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8AL = val; pNewQuest->b.UI8AL = val;
@ -638,7 +638,7 @@ void Core::Entity::Player::setQuestUI8BL( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8BL = val; pNewQuest->b.UI8BL = val;
@ -652,7 +652,7 @@ void Core::Entity::Player::setQuestUI8CL( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8CL = val; pNewQuest->b.UI8CL = val;
@ -666,7 +666,7 @@ void Core::Entity::Player::setQuestUI8DL( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8DL = val; pNewQuest->b.UI8DL = val;
@ -680,7 +680,7 @@ void Core::Entity::Player::setQuestUI8EL( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8EL = val; pNewQuest->b.UI8EL = val;
@ -694,7 +694,7 @@ void Core::Entity::Player::setQuestUI8FL( uint16_t questId, uint8_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
pNewQuest->b.UI8FL = val; pNewQuest->b.UI8FL = val;
@ -708,7 +708,7 @@ void Core::Entity::Player::setQuestUI16A( uint16_t questId, uint16_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// pNewQuest->d.UI16A = val; // pNewQuest->d.UI16A = val;
@ -722,7 +722,7 @@ void Core::Entity::Player::setQuestUI16B( uint16_t questId, uint16_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// pNewQuest->d.UI16B = val; // pNewQuest->d.UI16B = val;
@ -736,7 +736,7 @@ void Core::Entity::Player::setQuestUI16C( uint16_t questId, uint16_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// pNewQuest->d.UI16C = val; // pNewQuest->d.UI16C = val;
@ -750,7 +750,7 @@ void Core::Entity::Player::setQuestUI32A( uint16_t questId, uint32_t val )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
// pNewQuest->e.UI32A = val; // pNewQuest->e.UI32A = val;
@ -764,7 +764,7 @@ void Core::Entity::Player::setQuestBitFlag8( uint16_t questId, uint8_t index, bo
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
if( val ) if( val )
pNewQuest->a.BitFlag8 |= ( 1 << index ); pNewQuest->a.BitFlag8 |= ( 1 << index );
@ -781,7 +781,7 @@ void Core::Entity::Player::setQuestBitFlag16( uint16_t questId, uint8_t index, b
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
if( val ) if( val )
pNewQuest->a.BitFlag16 |= ( 1 << index ); pNewQuest->a.BitFlag16 |= ( 1 << index );
@ -798,7 +798,7 @@ void Core::Entity::Player::setQuestBitFlag24( uint16_t questId, uint8_t index, b
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
if( val ) if( val )
pNewQuest->a.BitFlag24 |= ( 1 << index ); pNewQuest->a.BitFlag24 |= ( 1 << index );
@ -815,7 +815,7 @@ void Core::Entity::Player::setQuestBitFlag32( uint16_t questId, uint8_t index, b
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
if( val ) if( val )
pNewQuest->a.BitFlag32 |= ( 1 << index ); pNewQuest->a.BitFlag32 |= ( 1 << index );
@ -832,7 +832,7 @@ void Core::Entity::Player::setQuestBitFlag40( uint16_t questId, uint8_t index, b
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
if( val ) if( val )
pNewQuest->a.BitFlag40 |= ( 1 << index ); pNewQuest->a.BitFlag40 |= ( 1 << index );
@ -849,7 +849,7 @@ void Core::Entity::Player::setQuestBitFlag48( uint16_t questId, uint8_t index, b
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
if( val ) if( val )
pNewQuest->a.BitFlag48 |= ( 1 << index ); pNewQuest->a.BitFlag48 |= ( 1 << index );
@ -867,7 +867,7 @@ uint8_t Core::Entity::Player::getQuestSeq( uint16_t questId )
if( idx != -1 ) if( idx != -1 )
{ {
boost::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ]; std::shared_ptr< QuestActive > pNewQuest = m_activeQuests[ idx ];
return pNewQuest->c.sequence; return pNewQuest->c.sequence;
} }
return 0; return 0;
@ -902,7 +902,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint8_t sequence )
if( !hasFreeSlot ) if( !hasFreeSlot )
return; return;
boost::shared_ptr< QuestActive > pNewQuest( new QuestActive() ); std::shared_ptr< QuestActive > pNewQuest( new QuestActive() );
pNewQuest->c.questId = questId; pNewQuest->c.questId = questId;
pNewQuest->c.sequence = sequence; pNewQuest->c.sequence = sequence;
pNewQuest->c.padding = 0; pNewQuest->c.padding = 0;
@ -1003,7 +1003,7 @@ void Core::Entity::Player::sendQuestInfo()
void void
Core::Entity::Player::sendQuestMessage( uint32_t questId, int8_t msgId, uint8_t type, uint32_t var1, uint32_t var2 ) Core::Entity::Player::sendQuestMessage( uint32_t questId, int8_t msgId, uint8_t type, uint32_t var1, uint32_t var2 )
{ {
queuePacket( boost::make_shared< QuestMessagePacket >( getAsPlayer(), questId, msgId, type, var1, var2 ) ); queuePacket( std::make_shared< QuestMessagePacket >( getAsPlayer(), questId, msgId, type, var1, var2 ) );
} }
@ -1076,7 +1076,7 @@ bool Core::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t optional
return true; return true;
} }
boost::shared_ptr< QuestActive > Core::Entity::Player::getQuestActive( uint16_t index ) std::shared_ptr< QuestActive > Core::Entity::Player::getQuestActive( uint16_t index )
{ {
return m_activeQuests[ index ]; return m_activeQuests[ index ];
} }

View file

@ -254,7 +254,7 @@ bool Core::Entity::Player::loadActiveQuests()
auto slotId = res->getUInt8( 2 ); auto slotId = res->getUInt8( 2 );
boost::shared_ptr< QuestActive > pActiveQuest( new QuestActive() ); std::shared_ptr< QuestActive > pActiveQuest( new QuestActive() );
pActiveQuest->c.questId = res->getUInt16( 3 ); pActiveQuest->c.questId = res->getUInt16( 3 );
pActiveQuest->c.sequence = res->getUInt8( 4 ); pActiveQuest->c.sequence = res->getUInt8( 4 );
pActiveQuest->c.flags = res->getUInt8( 5 ); pActiveQuest->c.flags = res->getUInt8( 5 );

View file

@ -13,7 +13,7 @@ class DebugCommand
{ {
public: public:
using pFunc = void ( DebugCommandHandler::* )( char*, Entity::Player&, boost::shared_ptr< DebugCommand > ); using pFunc = void ( DebugCommandHandler::* )( char*, Entity::Player&, std::shared_ptr< DebugCommand > );
// String for the command // String for the command
std::string m_commandName; std::string m_commandName;

View file

@ -71,7 +71,7 @@ Core::DebugCommandHandler::~DebugCommandHandler()
void Core::DebugCommandHandler::registerCommand( const std::string& n, DebugCommand::pFunc functionPtr, void Core::DebugCommandHandler::registerCommand( const std::string& n, DebugCommand::pFunc functionPtr,
const std::string& hText, uint8_t uLevel ) const std::string& hText, uint8_t uLevel )
{ {
m_commandMap[ std::string( n ) ] = boost::make_shared< DebugCommand >( n, functionPtr, hText, uLevel ); m_commandMap[ std::string( n ) ] = std::make_shared< DebugCommand >( n, functionPtr, hText, uLevel );
} }
// try to retrieve the command in question, execute if found // try to retrieve the command in question, execute if found
@ -79,7 +79,7 @@ void Core::DebugCommandHandler::execCommand( char* data, Entity::Player& player
{ {
// define callback pointer // define callback pointer
void ( DebugCommandHandler::*pf )( char*, Entity::Player&, boost::shared_ptr< DebugCommand > ); void ( DebugCommandHandler::*pf )( char*, Entity::Player&, std::shared_ptr< DebugCommand > );
std::string commandString; std::string commandString;
@ -122,7 +122,7 @@ void Core::DebugCommandHandler::execCommand( char* data, Entity::Player& player
// Definition of the commands // Definition of the commands
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::help( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
player.sendDebug( "Registered debug commands:" ); player.sendDebug( "Registered debug commands:" );
for( auto cmd : m_commandMap ) for( auto cmd : m_commandMap )
@ -134,7 +134,7 @@ void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost:
} }
} }
void Core::DebugCommandHandler::set( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::set( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pLog = g_fw.get< Logger >(); auto pLog = g_fw.get< Logger >();
auto pTerriMgr = g_fw.get< TerritoryMgr >(); auto pTerriMgr = g_fw.get< TerritoryMgr >();
@ -232,7 +232,7 @@ void Core::DebugCommandHandler::set( char* data, Entity::Player& player, boost::
else if( subCommand == "discovery_reset" ) else if( subCommand == "discovery_reset" )
{ {
player.resetDiscovery(); player.resetDiscovery();
player.queuePacket( boost::make_shared< InitUIPacket >( player ) ); player.queuePacket( std::make_shared< InitUIPacket >( player ) );
} }
else if( subCommand == "classjob" ) else if( subCommand == "classjob" )
{ {
@ -373,7 +373,7 @@ void Core::DebugCommandHandler::set( char* data, Entity::Player& player, boost::
} }
void Core::DebugCommandHandler::add( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::add( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pLog = g_fw.get< Logger >(); auto pLog = g_fw.get< Logger >();
std::string subCommand; std::string subCommand;
@ -428,7 +428,7 @@ void Core::DebugCommandHandler::add( char* data, Entity::Player& player, boost::
if( !bNpcTemplate ) if( !bNpcTemplate )
player.sendNotice( "Template " + params + " not found in cache!" ); player.sendNotice( "Template " + params + " not found in cache!" );
auto pBNpc = boost::make_shared< Entity::BNpc >( bNpcTemplate, auto pBNpc = std::make_shared< Entity::BNpc >( bNpcTemplate,
player.getPos().x, player.getPos().x,
player.getPos().y, player.getPos().y,
player.getPos().z, 1 ); player.getPos().z, 1 );
@ -507,7 +507,7 @@ void Core::DebugCommandHandler::add( char* data, Entity::Player& player, boost::
} }
void Core::DebugCommandHandler::get( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::get( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pLog = g_fw.get< Logger >(); auto pLog = g_fw.get< Logger >();
auto pExdData = g_fw.get< Data::ExdDataGenerated >(); auto pExdData = g_fw.get< Data::ExdDataGenerated >();
@ -554,7 +554,7 @@ void Core::DebugCommandHandler::get( char* data, Entity::Player& player, boost::
} }
void void
Core::DebugCommandHandler::injectPacket( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) Core::DebugCommandHandler::injectPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pServerZone = g_fw.get< ServerZone >(); auto pServerZone = g_fw.get< ServerZone >();
auto pSession = pServerZone->getSession( player.getId() ); auto pSession = pServerZone->getSession( player.getId() );
@ -563,7 +563,7 @@ Core::DebugCommandHandler::injectPacket( char* data, Entity::Player& player, boo
} }
void Core::DebugCommandHandler::injectChatPacket( char* data, Entity::Player& player, void Core::DebugCommandHandler::injectChatPacket( char* data, Entity::Player& player,
boost::shared_ptr< DebugCommand > command ) std::shared_ptr< DebugCommand > command )
{ {
auto pServerZone = g_fw.get< ServerZone >(); auto pServerZone = g_fw.get< ServerZone >();
auto pSession = pServerZone->getSession( player.getId() ); auto pSession = pServerZone->getSession( player.getId() );
@ -571,7 +571,7 @@ void Core::DebugCommandHandler::injectChatPacket( char* data, Entity::Player& pl
pSession->getChatConnection()->injectPacket( data + 8, player ); pSession->getChatConnection()->injectPacket( data + 8, player );
} }
void Core::DebugCommandHandler::replay( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::replay( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pLog = g_fw.get< Logger >(); auto pLog = g_fw.get< Logger >();
auto pServerZone = g_fw.get< ServerZone >(); auto pServerZone = g_fw.get< ServerZone >();
@ -623,7 +623,7 @@ void Core::DebugCommandHandler::replay( char* data, Entity::Player& player, boos
} }
void Core::DebugCommandHandler::nudge( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::nudge( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
std::string subCommand; std::string subCommand;
@ -670,7 +670,7 @@ void Core::DebugCommandHandler::nudge( char* data, Entity::Player& player, boost
} }
void void
Core::DebugCommandHandler::serverInfo( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) Core::DebugCommandHandler::serverInfo( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pServerZone = g_fw.get< ServerZone >(); auto pServerZone = g_fw.get< ServerZone >();
player.sendDebug( "SapphireZone " + Version::VERSION + "\nRev: " + Version::GIT_HASH ); player.sendDebug( "SapphireZone " + Version::VERSION + "\nRev: " + Version::GIT_HASH );
@ -678,7 +678,7 @@ Core::DebugCommandHandler::serverInfo( char* data, Entity::Player& player, boost
player.sendDebug( "Sessions: " + std::to_string( pServerZone->getSessionCount() ) ); player.sendDebug( "Sessions: " + std::to_string( pServerZone->getSessionCount() ) );
} }
void Core::DebugCommandHandler::script( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) void Core::DebugCommandHandler::script( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pLog = g_fw.get< Logger >(); auto pLog = g_fw.get< Logger >();
auto pScriptMgr = g_fw.get< Scripting::ScriptMgr >(); auto pScriptMgr = g_fw.get< Scripting::ScriptMgr >();
@ -768,7 +768,7 @@ void Core::DebugCommandHandler::script( char* data, Entity::Player& player, boos
} }
void void
Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) Core::DebugCommandHandler::instance( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
{ {
auto pTeriMgr = g_fw.get< TerritoryMgr >(); auto pTeriMgr = g_fw.get< TerritoryMgr >();
std::string cmd( data ), params, subCommand; std::string cmd( data ), params, subCommand;
@ -875,7 +875,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
sscanf( params.c_str(), "%d %d", &index, &value ); sscanf( params.c_str(), "%d %d", &index, &value );
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -888,7 +888,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
sscanf( params.c_str(), "%s %hhu", objName, &state ); sscanf( params.c_str(), "%s %hhu", objName, &state );
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -906,7 +906,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
sscanf( params.c_str(), "%s %i %i", objName, &state1, &state2 ); sscanf( params.c_str(), "%s %i %i", objName, &state1, &state2 );
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -925,7 +925,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
sscanf( params.c_str(), "%hhu", &seq ); sscanf( params.c_str(), "%hhu", &seq );
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -937,7 +937,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
sscanf( params.c_str(), "%hhu", &branch ); sscanf( params.c_str(), "%hhu", &branch );
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -945,7 +945,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
} }
else if( subCommand == "qte_start" ) else if( subCommand == "qte_start" )
{ {
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -954,7 +954,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
} }
else if( subCommand == "event_start" ) else if( subCommand == "event_start" )
{ {
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;
@ -963,7 +963,7 @@ Core::DebugCommandHandler::instance( char* data, Entity::Player& player, boost::
} }
else if( subCommand == "event_end" ) else if( subCommand == "event_end" )
{ {
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() ); auto instance = std::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
if( !instance ) if( !instance )
return; return;

View file

@ -15,7 +15,7 @@ class DebugCommandHandler
{ {
private: private:
// container mapping command string to command object // container mapping command string to command object
std::map< std::string, boost::shared_ptr< DebugCommand > > m_commandMap; std::map< std::string, std::shared_ptr< DebugCommand > > m_commandMap;
public: public:
DebugCommandHandler(); DebugCommandHandler();
@ -29,31 +29,31 @@ public:
void execCommand( char* data, Entity::Player& player ); void execCommand( char* data, Entity::Player& player );
// help command // help command
void help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void help( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
// command handler callbacks // command handler callbacks
void set( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void set( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void get( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void get( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void add( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void add( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
//void debug( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); //void debug( char * data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void injectPacket( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void injectPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void injectChatPacket( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void injectChatPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void replay( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void replay( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void nudge( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void nudge( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void serverInfo( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void serverInfo( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void unlockCharacter( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void instance( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void instance( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
void script( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ); void script( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
}; };

View file

@ -2,19 +2,17 @@
#define _FORWARDS_H #define _FORWARDS_H
#include <utility> #include <utility>
#include <boost/shared_ptr.hpp>
#include <memory> #include <memory>
#include <boost/make_shared.hpp>
#include <vector> #include <vector>
#include "Common.h" #include "Common.h"
#define TYPE_FORWARD( x ) \ #define TYPE_FORWARD( x ) \
class x; \ class x; \
typedef boost::shared_ptr< x > x ## Ptr; \ typedef std::shared_ptr< x > x ## Ptr; \
typedef std::unique_ptr< x > x ## UPtr; \ typedef std::unique_ptr< x > x ## UPtr; \
template< typename...Args > \ template< typename...Args > \
x ## Ptr make_ ## x( Args &&...args ) { \ x ## Ptr make_ ## x( Args &&...args ) { \
return boost::make_shared< x >( std::forward< Args >( args ) ... ); }\ return std::make_shared< x >( std::forward< Args >( args ) ... ); }\
typedef std::vector< x > x ## PtrList; typedef std::vector< x > x ## PtrList;
namespace Core { namespace Core {

View file

@ -53,7 +53,7 @@ bool Core::LinkshellMgr::loadLinkshells()
invitesBin = res->getBlobVector( 6 ); invitesBin = res->getBlobVector( 6 );
func( members, invitesBin ); func( members, invitesBin );
auto lsPtr = boost::make_shared< Linkshell >( linkshellId, name, masterId, members, leaders, invites ); auto lsPtr = std::make_shared< Linkshell >( linkshellId, name, masterId, members, leaders, invites );
m_linkshellIdMap[ linkshellId ] = lsPtr; m_linkshellIdMap[ linkshellId ] = lsPtr;
m_linkshellNameMap[ name ] = lsPtr; m_linkshellNameMap[ name ] = lsPtr;

View file

@ -1,13 +1,13 @@
#ifndef CORE_LINKSHELLMGR_H #ifndef CORE_LINKSHELLMGR_H
#define CORE_LINKSHELLMGR_H #define CORE_LINKSHELLMGR_H
#include <boost/shared_ptr.hpp> #include <memory>
#include <map> #include <map>
namespace Core { namespace Core {
class Linkshell; class Linkshell;
using LinkshellPtr = boost::shared_ptr< Linkshell >; using LinkshellPtr = std::shared_ptr< Linkshell >;
class LinkshellMgr class LinkshellMgr
{ {

View file

@ -402,7 +402,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
{ {
char* id = ( char* ) &( inPacket.data[ 4 ] ); char* id = ( char* ) &( inPacket.data[ 4 ] );
uint32_t playerId = std::stoi( id ); uint32_t playerId = std::stoi( id );
auto pCon = boost::static_pointer_cast< GameConnection, Connection >( shared_from_this() ); auto pCon = std::static_pointer_cast< GameConnection, Connection >( shared_from_this() );
// try to retrieve the session for this id // try to retrieve the session for this id
auto session = pServerZone->getSession( playerId ); auto session = pServerZone->getSession( playerId );
@ -430,7 +430,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
if( !m_pSession && session ) if( !m_pSession && session )
m_pSession = session; m_pSession = session;
auto pe = boost::make_shared< FFXIVRawPacket >( 0x07, 0x18, 0, 0 ); auto pe = std::make_shared< FFXIVRawPacket >( 0x07, 0x18, 0, 0 );
*( unsigned int* ) ( &pe->data()[ 0 ] ) = 0xE0037603; *( unsigned int* ) ( &pe->data()[ 0 ] ) = 0xE0037603;
*( unsigned int* ) ( &pe->data()[ 4 ] ) = static_cast< uint32_t >( time( nullptr ) ); *( unsigned int* ) ( &pe->data()[ 4 ] ) = static_cast< uint32_t >( time( nullptr ) );
sendSinglePacket( pe ); sendSinglePacket( pe );
@ -438,7 +438,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
// main connection, assinging it to the session // main connection, assinging it to the session
if( ipcHeader.connectionType == ConnectionType::Zone ) if( ipcHeader.connectionType == ConnectionType::Zone )
{ {
auto pe1 = boost::make_shared< FFXIVRawPacket >( 0x02, 0x38, 0, 0 ); auto pe1 = std::make_shared< FFXIVRawPacket >( 0x02, 0x38, 0, 0 );
*( unsigned int* ) ( &pe1->data()[ 0 ] ) = playerId; *( unsigned int* ) ( &pe1->data()[ 0 ] ) = playerId;
sendSinglePacket( pe1 ); sendSinglePacket( pe1 );
pLog->info( "[" + std::string( id ) + "] Setting session for zone connection" ); pLog->info( "[" + std::string( id ) + "] Setting session for zone connection" );
@ -447,11 +447,11 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
// chat connection, assinging it to the session // chat connection, assinging it to the session
else if( ipcHeader.connectionType == ConnectionType::Chat ) else if( ipcHeader.connectionType == ConnectionType::Chat )
{ {
auto pe2 = boost::make_shared< FFXIVRawPacket >( 0x02, 0x38, 0, 0 ); auto pe2 = std::make_shared< FFXIVRawPacket >( 0x02, 0x38, 0, 0 );
*( unsigned int* ) ( &pe2->data()[ 0 ] ) = playerId; *( unsigned int* ) ( &pe2->data()[ 0 ] ) = playerId;
sendSinglePacket( pe2 ); sendSinglePacket( pe2 );
auto pe3 = boost::make_shared< FFXIVRawPacket >( 0x03, 0x28, playerId, playerId ); auto pe3 = std::make_shared< FFXIVRawPacket >( 0x03, 0x28, playerId, playerId );
*( unsigned short* ) ( &pe3->data()[ 2 ] ) = 0x02; *( unsigned short* ) ( &pe3->data()[ 2 ] ) = 0x02;
sendSinglePacket( pe3 ); sendSinglePacket( pe3 );
@ -472,7 +472,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
uint32_t id = *( uint32_t* ) &inPacket.data[ 0 ]; uint32_t id = *( uint32_t* ) &inPacket.data[ 0 ];
uint32_t timeStamp = *( uint32_t* ) &inPacket.data[ 4 ]; uint32_t timeStamp = *( uint32_t* ) &inPacket.data[ 4 ];
auto pe4 = boost::make_shared< FFXIVRawPacket >( 0x08, 0x18, 0, 0 ); auto pe4 = std::make_shared< FFXIVRawPacket >( 0x08, 0x18, 0, 0 );
*( unsigned int* ) ( &pe4->data()[ 0 ] ) = id; *( unsigned int* ) ( &pe4->data()[ 0 ] ) = id;
*( unsigned int* ) ( &pe4->data()[ 4 ] ) = timeStamp; *( unsigned int* ) ( &pe4->data()[ 4 ] ) = timeStamp;
sendSinglePacket( pe4 ); sendSinglePacket( pe4 );

View file

@ -59,7 +59,7 @@ void examineHandler( Core::Entity::Player& player, uint32_t targetId )
} }
else else
{ {
player.queuePacket( boost::make_shared< ExaminePacket >( player, pTarget ) ); player.queuePacket( std::make_shared< ExaminePacket >( player, pTarget ) );
} }
} }
} }

View file

@ -421,7 +421,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::FFXIVARR_PACKET_R
case GmCommand::Wireframe: case GmCommand::Wireframe:
{ {
player.queuePacket( player.queuePacket(
boost::make_shared< ActorControlPacket143 >( player.getId(), ActorControlType::ToggleWireframeRendering ) ); std::make_shared< ActorControlPacket143 >( player.getId(), ActorControlType::ToggleWireframeRendering ) );
player.sendNotice( "Wireframe Rendering for " + player.getName() + " was toggled" ); player.sendNotice( "Wireframe Rendering for " + player.getName() + " was toggled" );
break; break;
} }

View file

@ -297,7 +297,7 @@ void Core::Network::GameConnection::updatePositionHandler( const Core::Network::
player.m_lastMoveTime = currentTime; player.m_lastMoveTime = currentTime;
player.m_lastMoveflag = moveState; player.m_lastMoveflag = moveState;
auto movePacket = boost::make_shared< MoveActorPacket >( player, unk1, unk2, moveState, unk4 ); auto movePacket = std::make_shared< MoveActorPacket >( player, unk1, unk2, moveState, unk4 );
player.sendToInRangeSet( movePacket ); player.sendToInRangeSet( movePacket );
} }
@ -426,7 +426,7 @@ void Core::Network::GameConnection::pingHandler( const Core::Network::Packets::F
{ {
const auto packet = ZoneChannelPacket< Client::FFXIVIpcPingHandler >( inPacket ); const auto packet = ZoneChannelPacket< Client::FFXIVIpcPingHandler >( inPacket );
queueOutPacket( boost::make_shared< Server::PingPacket >( player, packet.data().timestamp ) ); queueOutPacket( std::make_shared< Server::PingPacket >( player, packet.data().timestamp ) );
player.setLastPing( static_cast< uint32_t >( time( nullptr ) ) ); player.setLastPing( static_cast< uint32_t >( time( nullptr ) ) );
} }
@ -529,7 +529,7 @@ void Core::Network::GameConnection::chatHandler( const Core::Network::Packets::F
auto chatType = packet.data().chatType; auto chatType = packet.data().chatType;
//ToDo, need to implement sending GM chat types. //ToDo, need to implement sending GM chat types.
auto chatPacket = boost::make_shared< Server::ChatPacket >( player, chatType, packet.data().message ); auto chatPacket = std::make_shared< Server::ChatPacket >( player, chatType, packet.data().message );
switch( chatType ) switch( chatType )
{ {

View file

@ -42,9 +42,9 @@ private:
}; };
template< typename... Args > template< typename... Args >
boost::shared_ptr< ActorControlPacket142 > makeActorControl142( Args... args ) std::shared_ptr< ActorControlPacket142 > makeActorControl142( Args... args )
{ {
return boost::make_shared< ActorControlPacket142 >( args... ); return std::make_shared< ActorControlPacket142 >( args... );
} }
} }

View file

@ -46,9 +46,9 @@ private:
}; };
template< typename... Args > template< typename... Args >
boost::shared_ptr< ActorControlPacket143 > makeActorControl143( Args... args ) std::shared_ptr< ActorControlPacket143 > makeActorControl143( Args... args )
{ {
return boost::make_shared< ActorControlPacket143 >( args... ); return std::make_shared< ActorControlPacket143 >( args... );
} }
} }

View file

@ -44,9 +44,9 @@ private:
}; };
template< typename... Args > template< typename... Args >
boost::shared_ptr< ActorControlPacket144 > makeActorControl144( Args... args ) std::shared_ptr< ActorControlPacket144 > makeActorControl144( Args... args )
{ {
return boost::make_shared< ActorControlPacket144 >( args... ); return std::make_shared< ActorControlPacket144 >( args... );
} }
} }

View file

@ -118,9 +118,9 @@ bool NativeScriptMgr::isModuleLoaded( const std::string& name )
} }
boost::shared_ptr< NativeScriptMgr > createNativeScriptMgr() std::shared_ptr< NativeScriptMgr > createNativeScriptMgr()
{ {
return boost::make_shared< NativeScriptMgr >(); return std::make_shared< NativeScriptMgr >();
} }
} }
} }

View file

@ -127,7 +127,7 @@ public:
* *
* @return a boost::shared_ptr to NativeScriptMgr * @return a boost::shared_ptr to NativeScriptMgr
*/ */
boost::shared_ptr< NativeScriptMgr > createNativeScriptMgr(); std::shared_ptr< NativeScriptMgr > createNativeScriptMgr();
} }
} }

View file

@ -1,7 +1,7 @@
#ifndef _ScriptMgr_H_ #ifndef _ScriptMgr_H_
#define _ScriptMgr_H_ #define _ScriptMgr_H_
#include <boost/shared_ptr.hpp> #include <memory>
#include <mutex> #include <mutex>
#include <set> #include <set>
@ -17,7 +17,7 @@ private:
/*! /*!
* @brief A shared ptr to NativeScriptMgr, used for accessing and managing the native script system. * @brief A shared ptr to NativeScriptMgr, used for accessing and managing the native script system.
*/ */
boost::shared_ptr< NativeScriptMgr > m_nativeScriptMgr; std::shared_ptr< NativeScriptMgr > m_nativeScriptMgr;
std::function< std::string( Entity::Player & ) > m_onFirstEnterWorld; std::function< std::string( Entity::Player & ) > m_onFirstEnterWorld;

View file

@ -308,7 +308,7 @@ bool Core::ServerZone::createSession( uint32_t sessionId )
pLog->info( "[" + session_id_str + "] Creating new session" ); pLog->info( "[" + session_id_str + "] Creating new session" );
boost::shared_ptr< Session > newSession( new Session( sessionId ) ); std::shared_ptr< Session > newSession( new Session( sessionId ) );
m_sessionMapById[ sessionId ] = newSession; m_sessionMapById[ sessionId ] = newSession;
if( !newSession->loadPlayer() ) if( !newSession->loadPlayer() )
@ -393,7 +393,7 @@ void Core::ServerZone::loadBNpcTemplates()
auto look = res->getBlobVector( 12 ); auto look = res->getBlobVector( 12 );
auto models = res->getBlobVector( 13 ); auto models = res->getBlobVector( 13 );
auto bnpcTemplate = boost::make_shared< Entity::BNpcTemplate >( auto bnpcTemplate = std::make_shared< Entity::BNpcTemplate >(
id, bNPCBaseId, bNPCNameId, mainWeaponModel, secWeaponModel, id, bNPCBaseId, bNPCNameId, mainWeaponModel, secWeaponModel,
aggressionMode, enemyType, 0, pose, modelChara, displayFlags, aggressionMode, enemyType, 0, pose, modelChara, displayFlags,
reinterpret_cast< uint32_t* >( &models[ 0 ] ), reinterpret_cast< uint32_t* >( &models[ 0 ] ),

View file

@ -1,15 +1,14 @@
#ifndef _SESSION_H_ #ifndef _SESSION_H_
#define _SESSION_H_ #define _SESSION_H_
#include <boost/enable_shared_from_this.hpp> #include <memory>
#include <boost/shared_ptr.hpp>
#include "ForwardsZone.h" #include "ForwardsZone.h"
namespace Core { namespace Core {
class Session : class Session :
public boost::enable_shared_from_this< Session > public std::enable_shared_from_this< Session >
{ {
public: public:
Session( uint32_t sessionId ); Session( uint32_t sessionId );

View file

@ -267,7 +267,7 @@ bool Core::TerritoryMgr::removeTerritoryInstance( uint32_t instanceId )
if( isInstanceContentTerritory( pZone->getTerritoryId() ) ) if( isInstanceContentTerritory( pZone->getTerritoryId() ) )
{ {
auto instance = boost::dynamic_pointer_cast< InstanceContent >( pZone ); auto instance = std::dynamic_pointer_cast< InstanceContent >( pZone );
m_instanceContentToInstanceMap[ instance->getInstanceContentId() ].erase( pZone->getGuId() ); m_instanceContentToInstanceMap[ instance->getInstanceContentId() ].erase( pZone->getGuId() );
} }
else else

View file

@ -719,7 +719,7 @@ Core::Entity::EventObjectPtr Core::Zone::getEObj( uint32_t objId )
Core::InstanceContentPtr Core::Zone::getAsInstanceContent() Core::InstanceContentPtr Core::Zone::getAsInstanceContent()
{ {
return boost::dynamic_pointer_cast< InstanceContent, Zone >( shared_from_this() ); return std::dynamic_pointer_cast< InstanceContent, Zone >( shared_from_this() );
} }
uint32_t Core::Zone::getNextEObjId() uint32_t Core::Zone::getNextEObjId()

View file

@ -11,7 +11,7 @@
#include <set> #include <set>
#include <map> #include <map>
#include <boost/enable_shared_from_this.hpp> #include <memory>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -31,7 +31,7 @@ struct TerritoryType;
} }
class Zone : class Zone :
public CellHandler< Cell >, public boost::enable_shared_from_this< Zone > public CellHandler< Cell >, public std::enable_shared_from_this< Zone >
{ {
protected: protected:
uint32_t m_territoryId; uint32_t m_territoryId;

View file

@ -19,15 +19,15 @@ using namespace Core;
bool setupFramework() bool setupFramework()
{ {
auto pServer = boost::make_shared< ServerZone >( "zone.ini" ); auto pServer = std::make_shared< ServerZone >( "zone.ini" );
auto pLogger = boost::make_shared< Logger >(); auto pLogger = std::make_shared< Logger >();
auto pExdData = boost::make_shared< Data::ExdDataGenerated >(); auto pExdData = std::make_shared< Data::ExdDataGenerated >();
auto pScript = boost::make_shared< Scripting::ScriptMgr >(); auto pScript = std::make_shared< Scripting::ScriptMgr >();
auto pDb = boost::make_shared< Db::DbWorkerPool< Db::ZoneDbConnection > >(); auto pDb = std::make_shared< Db::DbWorkerPool< Db::ZoneDbConnection > >();
auto pLsMgr = boost::make_shared< LinkshellMgr >(); auto pLsMgr = std::make_shared< LinkshellMgr >();
auto pTeriMgr = boost::make_shared< TerritoryMgr >(); auto pTeriMgr = std::make_shared< TerritoryMgr >();
auto pDebugCom = boost::make_shared< DebugCommandHandler >(); auto pDebugCom = std::make_shared< DebugCommandHandler >();
auto pConfig = boost::make_shared< ConfigMgr >(); auto pConfig = std::make_shared< ConfigMgr >();
pLogger->setLogPath( "log/SapphireZone_" ); pLogger->setLogPath( "log/SapphireZone_" );
pLogger->init(); pLogger->init();