diff --git a/src/servers/Server_Zone/Action/Action.cpp b/src/servers/Server_Zone/Action/Action.cpp index 21e09e0a..1405f45a 100644 --- a/src/servers/Server_Zone/Action/Action.cpp +++ b/src/servers/Server_Zone/Action/Action.cpp @@ -1,6 +1,6 @@ #include "Action.h" -#include +#include Core::Action::Action::Action() diff --git a/src/servers/Server_Zone/Action/Action.h b/src/servers/Server_Zone/Action/Action.h index 9e0e79b6..3c270180 100644 --- a/src/servers/Server_Zone/Action/Action.h +++ b/src/servers/Server_Zone/Action/Action.h @@ -1,8 +1,8 @@ #ifndef _ACTION_H_ #define _ACTION_H_ -#include -#include "src/servers/Server_Zone/Forwards.h" +#include +#include "../Forwards.h" namespace Core { namespace Action { @@ -57,4 +57,4 @@ namespace Core { namespace Action { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Action/ActionCast.cpp b/src/servers/Server_Zone/Action/ActionCast.cpp index d322bd29..7fc79ea3 100644 --- a/src/servers/Server_Zone/Action/ActionCast.cpp +++ b/src/servers/Server_Zone/Action/ActionCast.cpp @@ -1,16 +1,16 @@ #include "ActionCast.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Actor/Player.h" +#include "Script/ScriptManager.h" using namespace Core::Common; using namespace Core::Network; @@ -52,7 +52,8 @@ void Core::Action::ActionCast::onStart() castPacket.data().action_id = m_id; castPacket.data().skillType = Common::SkillType::Normal; castPacket.data().unknown_1 = m_id; - castPacket.data().cast_time = static_cast< float >( m_castTime / 1000 ); // This is used for the cast bar above the target bar of the caster. + // This is used for the cast bar above the target bar of the caster. + castPacket.data().cast_time = static_cast< float >( m_castTime / 1000 ); castPacket.data().target_id = m_pTarget->getId(); m_pSource->sendToInRangeSet( castPacket, true ); @@ -73,7 +74,7 @@ void Core::Action::ActionCast::onFinish() pPlayer->sendStateFlags(); /*auto control = ActorControlPacket143( m_pTarget->getId(), ActorControlType::Unk7, - 0x219, m_id, m_id, m_id, m_id ); + 0x219, m_id, m_id, m_id, m_id ); m_pSource->sendToInRangeSet( control, true );*/ g_scriptMgr.onCastFinish( *pPlayer, m_pTarget, m_id ); @@ -89,7 +90,7 @@ void Core::Action::ActionCast::onInterrupt() m_pSource->getAsPlayer()->sendStateFlags(); auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt, - 0x219, 1, m_id, 0 ); + 0x219, 1, m_id, 0 ); // Note: When cast interrupt from taking too much damage, set the last value to 1. This enables the cast interrupt effect. Example: // auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt, 0x219, 1, m_id, 0 ); diff --git a/src/servers/Server_Zone/Action/ActionCast.h b/src/servers/Server_Zone/Action/ActionCast.h index 897ad7c1..b656b391 100644 --- a/src/servers/Server_Zone/Action/ActionCast.h +++ b/src/servers/Server_Zone/Action/ActionCast.h @@ -1,10 +1,11 @@ #ifndef _ACTIONCAST_H_ #define _ACTIONCAST_H_ -#include "src/servers/Server_Zone/Forwards.h" +#include "../Forwards.h" #include "Action.h" -namespace Core { namespace Action { +namespace Core { +namespace Action { class ActionCast : public Action { @@ -25,4 +26,4 @@ namespace Core { namespace Action { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Action/ActionCollision.cpp b/src/servers/Server_Zone/Action/ActionCollision.cpp index bfae7a60..48b04aaa 100644 --- a/src/servers/Server_Zone/Action/ActionCollision.cpp +++ b/src/servers/Server_Zone/Action/ActionCollision.cpp @@ -1,10 +1,11 @@ -#include -#include -#include +#include +#include +#include #include "ActionCollision.h" -#include -#include +#include "Actor/Actor.h" +#include "Actor/Player.h" + #include #include @@ -137,4 +138,4 @@ bool ActionCollision::boxCollision( FFXIVARR_POSITION3 actorPosition, FFXIVARR_P actorPosition.x > aoePosition.x && actorPosition.y < aoePosition.y + height && actorPosition.y > aoePosition.y; -} \ No newline at end of file +} diff --git a/src/servers/Server_Zone/Action/ActionCollision.h b/src/servers/Server_Zone/Action/ActionCollision.h index 05ec923e..dda72d06 100644 --- a/src/servers/Server_Zone/Action/ActionCollision.h +++ b/src/servers/Server_Zone/Action/ActionCollision.h @@ -1,9 +1,9 @@ #ifndef _ACTIONCOLLISION_H #define _ACTIONCOLLISION_H -#include +#include -#include +#include "Actor/Actor.h" #include "Action.h" namespace Core { @@ -40,4 +40,4 @@ namespace Core { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Action/ActionMount.cpp b/src/servers/Server_Zone/Action/ActionMount.cpp index 26c7cddd..b45b460f 100644 --- a/src/servers/Server_Zone/Action/ActionMount.cpp +++ b/src/servers/Server_Zone/Action/ActionMount.cpp @@ -1,16 +1,16 @@ #include "ActionMount.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Actor/Player.h" +#include "Script/ScriptManager.h" using namespace Core::Common; using namespace Core::Network; @@ -23,7 +23,7 @@ extern Core::Scripting::ScriptManager g_scriptMgr; Core::Action::ActionMount::ActionMount() { - m_handleActionType = Common::HandleActionType::Event; + m_handleActionType = HandleActionType::Event; } Core::Action::ActionMount::ActionMount( Entity::ActorPtr pActor, uint16_t mountId ) @@ -75,19 +75,20 @@ void Core::Action::ActionMount::onFinish() pPlayer->unsetStateFlag( PlayerStateFlag::Casting ); pPlayer->sendStateFlags(); - ZoneChannelPacket< FFXIVIpcEffect > effectPacket(pPlayer->getId()); + ZoneChannelPacket< FFXIVIpcEffect > effectPacket( pPlayer->getId() ); effectPacket.data().targetId = pPlayer->getId(); effectPacket.data().actionAnimationId = m_id; - effectPacket.data().unknown_62 = 13; // Affects displaying action name next to number in floating text + // Affects displaying action name next to number in floating text + effectPacket.data().unknown_62 = 13; effectPacket.data().actionTextId = 4; effectPacket.data().numEffects = 1; - effectPacket.data().rotation = Math::Util::floatToUInt16Rot(pPlayer->getRotation()); + effectPacket.data().rotation = Math::Util::floatToUInt16Rot( pPlayer->getRotation() ); effectPacket.data().effectTarget = INVALID_GAME_OBJECT_ID; effectPacket.data().effects[0].effectType = ActionEffectType::Mount; effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::CritDamage; effectPacket.data().effects[0].value = m_id; - pPlayer->sendToInRangeSet(effectPacket, true); + pPlayer->sendToInRangeSet( effectPacket, true ); pPlayer->mount( m_id ); } diff --git a/src/servers/Server_Zone/Action/ActionMount.h b/src/servers/Server_Zone/Action/ActionMount.h index 6c970869..ba32817d 100644 --- a/src/servers/Server_Zone/Action/ActionMount.h +++ b/src/servers/Server_Zone/Action/ActionMount.h @@ -1,10 +1,11 @@ #ifndef _ACTIONMOUNT_H_ #define _ACTIONMOUNT_H_ -#include "src/servers/Server_Zone/Forwards.h" +#include "../Forwards.h" #include "Action.h" -namespace Core { namespace Action { +namespace Core { +namespace Action { class ActionMount : public Action { @@ -25,4 +26,4 @@ namespace Core { namespace Action { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Action/ActionTeleport.cpp b/src/servers/Server_Zone/Action/ActionTeleport.cpp index 37ebbfbd..c201b0cc 100644 --- a/src/servers/Server_Zone/Action/ActionTeleport.cpp +++ b/src/servers/Server_Zone/Action/ActionTeleport.cpp @@ -1,12 +1,12 @@ #include "ActionTeleport.h" -#include -#include -#include +#include +#include +#include -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Actor/Player.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Actor/Player.h" using namespace Core::Common; using namespace Core::Network; @@ -18,7 +18,7 @@ extern Core::Logger g_log; Core::Action::ActionTeleport::ActionTeleport() { - m_handleActionType = Common::HandleActionType::Event; + m_handleActionType = HandleActionType::Event; } Core::Action::ActionTeleport::ActionTeleport( Entity::ActorPtr pActor, uint16_t targetZone, uint16_t cost ) @@ -81,7 +81,7 @@ void Core::Action::ActionTeleport::onFinish() //auto control = Network::Packets::Server::ActorControlPacket142( m_pSource->getId(), Common::ActorControlType::TeleportDone ); //m_pSource->sendToInRangeSet( control, false ); - pPlayer->setZoningType( Common::ZoneingType::Teleport ); + pPlayer->setZoningType( ZoneingType::Teleport ); ZoneChannelPacket< FFXIVIpcEffect > effectPacket( pPlayer->getId() ); effectPacket.data().targetId = pPlayer->getId(); @@ -90,7 +90,7 @@ void Core::Action::ActionTeleport::onFinish() effectPacket.data().actionTextId = 5; effectPacket.data().unknown_5 = 1; effectPacket.data().numEffects = 1; - effectPacket.data().rotation = static_cast< uint16_t >( 0x8000 * ( (pPlayer->getRotation() + 3.1415926) ) / 3.1415926 ); + effectPacket.data().rotation = static_cast< uint16_t >( 0x8000 * ( ( pPlayer->getRotation() + 3.1415926 ) ) / 3.1415926 ); effectPacket.data().effectTarget = pPlayer->getId(); pPlayer->sendToInRangeSet( effectPacket, true ); diff --git a/src/servers/Server_Zone/Action/ActionTeleport.h b/src/servers/Server_Zone/Action/ActionTeleport.h index 8cb83ec1..480090eb 100644 --- a/src/servers/Server_Zone/Action/ActionTeleport.h +++ b/src/servers/Server_Zone/Action/ActionTeleport.h @@ -1,10 +1,11 @@ #ifndef _ACTIONTELEPORT_H_ #define _ACTIONTELEPORT_H_ -#include "src/servers/Server_Zone/Forwards.h" +#include "../Forwards.h" #include "Action.h" -namespace Core { namespace Action { +namespace Core { +namespace Action { class ActionTeleport : public Action { @@ -27,4 +28,4 @@ namespace Core { namespace Action { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Action/EventAction.cpp b/src/servers/Server_Zone/Action/EventAction.cpp index 00116ed4..5e6a9cf3 100644 --- a/src/servers/Server_Zone/Action/EventAction.cpp +++ b/src/servers/Server_Zone/Action/EventAction.cpp @@ -1,12 +1,12 @@ -#include -#include -#include +#include +#include +#include #include "EventAction.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Event/Event.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Server_Zone/Actor/Player.h" +#include "Server_Zone/Event/Event.h" extern Core::Logger g_log; extern Core::Data::ExdData g_exdData; @@ -18,7 +18,7 @@ using namespace Core::Network::Packets::Server; Core::Action::EventAction::EventAction() { - m_handleActionType = Common::HandleActionType::Event; + m_handleActionType = HandleActionType::Event; } Core::Action::EventAction::EventAction( Entity::ActorPtr pActor, uint32_t eventId, uint16_t action, @@ -75,7 +75,6 @@ void Core::Action::EventAction::onFinish() m_onActionFinishClb( *m_pSource->getAsPlayer(), m_eventId, m_additional ); auto control = ActorControlPacket142( m_pSource->getId(), Common::ActorControlType::CastStart, 0, m_id ); - if( !pEvent->hasPlayedScene() ) m_pSource->getAsPlayer()->eventFinish( m_eventId, 1 ); diff --git a/src/servers/Server_Zone/Action/EventAction.h b/src/servers/Server_Zone/Action/EventAction.h index 038d9c99..6f8e5614 100644 --- a/src/servers/Server_Zone/Action/EventAction.h +++ b/src/servers/Server_Zone/Action/EventAction.h @@ -1,12 +1,13 @@ #ifndef _EVENTACTION_H_ #define _EVENTACTION_H_ -#include +#include -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Action/Action.h" +#include "../Forwards.h" +#include "Action.h" -namespace Core { namespace Action { +namespace Core { +namespace Action { class EventAction : public Action { @@ -34,4 +35,4 @@ namespace Core { namespace Action { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Action/EventItemAction.cpp b/src/servers/Server_Zone/Action/EventItemAction.cpp index 567f689c..6c85b183 100644 --- a/src/servers/Server_Zone/Action/EventItemAction.cpp +++ b/src/servers/Server_Zone/Action/EventItemAction.cpp @@ -1,14 +1,14 @@ #include "EventItemAction.h" -#include -#include -#include +#include +#include +#include #include -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" +#include "Actor/Player.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" extern Core::Logger g_log; @@ -19,7 +19,7 @@ using namespace Core::Network::Packets::Server; Core::Action::EventItemAction::EventItemAction() { - m_handleActionType = Common::HandleActionType::Event; + m_handleActionType = HandleActionType::Event; } Core::Action::EventItemAction::EventItemAction( Entity::ActorPtr pActor, uint32_t eventId, uint16_t action, diff --git a/src/servers/Server_Zone/Action/EventItemAction.h b/src/servers/Server_Zone/Action/EventItemAction.h index 71bc5e89..bd9eee9d 100644 --- a/src/servers/Server_Zone/Action/EventItemAction.h +++ b/src/servers/Server_Zone/Action/EventItemAction.h @@ -1,10 +1,11 @@ #ifndef _EVENTITEMACTION_H_ #define _EVENTITEMACTION_H_ -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Action/Action.h" +#include "../Forwards.h" +#include "Action.h" -namespace Core { namespace Action { +namespace Core { +namespace Action { class EventItemAction : public Action { @@ -32,4 +33,4 @@ namespace Core { namespace Action { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Actor/Actor.cpp b/src/servers/Server_Zone/Actor/Actor.cpp index 6d3f87df..5e3022e1 100644 --- a/src/servers/Server_Zone/Actor/Actor.cpp +++ b/src/servers/Server_Zone/Actor/Actor.cpp @@ -1,25 +1,25 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Action/Action.h" +#include "Forwards.h" +#include "Action/Action.h" -#include "src/servers/Server_Zone/Zone/Zone.h" +#include "Zone/Zone.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/UpdateHpMpTpPacket.h" +#include "Network/GameConnection.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/UpdateHpMpTpPacket.h" -#include "src/servers/Server_Zone/StatusEffect/StatusEffect.h" -#include "src/servers/Server_Zone/Action/ActionCollision.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Math/CalcBattle.h" +#include "StatusEffect/StatusEffect.h" +#include "Action/ActionCollision.h" +#include "ServerZone.h" +#include "Session.h" +#include "Math/CalcBattle.h" #include "Actor.h" #include "Player.h" diff --git a/src/servers/Server_Zone/Actor/Actor.h b/src/servers/Server_Zone/Actor/Actor.h index 2ba456e5..77e89afa 100644 --- a/src/servers/Server_Zone/Actor/Actor.h +++ b/src/servers/Server_Zone/Actor/Actor.h @@ -4,7 +4,7 @@ #include #include -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" #include #include #include diff --git a/src/servers/Server_Zone/Actor/BattleNpc.cpp b/src/servers/Server_Zone/Actor/BattleNpc.cpp index f1781397..e76003d7 100644 --- a/src/servers/Server_Zone/Actor/BattleNpc.cpp +++ b/src/servers/Server_Zone/Actor/BattleNpc.cpp @@ -4,17 +4,17 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "Player.h" #include "BattleNpc.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/MoveActorPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/MoveActorPacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" using namespace Core::Common; using namespace Core::Network::Packets; @@ -87,7 +87,7 @@ Core::Entity::BattleNpc::BattleNpc( uint16_t modelId, uint16_t nameid, const Com } // spawn this player for pTarget -void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget ) +void Core::Entity::BattleNpc::spawn( PlayerPtr pTarget ) { //GamePacketNew< FFXIVIpcActorSpawn > spawnPacket( getId(), pTarget->getId() ); @@ -149,7 +149,7 @@ void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget ) } // despawn -void Core::Entity::BattleNpc::despawn( Core::Entity::ActorPtr pTarget ) +void Core::Entity::BattleNpc::despawn( ActorPtr pTarget ) { auto pPlayer = pTarget->getAsPlayer(); @@ -171,7 +171,7 @@ Core::Entity::StateMode Core::Entity::BattleNpc::getMode() const return m_mode; } -void Core::Entity::BattleNpc::setMode( Core::Entity::StateMode mode ) +void Core::Entity::BattleNpc::setMode( StateMode mode ) { m_mode = mode; } @@ -181,7 +181,7 @@ uint8_t Core::Entity::BattleNpc::getbehavior() const return m_behavior; } -void Core::Entity::BattleNpc::hateListAdd( Core::Entity::ActorPtr pActor, int32_t hateAmount ) +void Core::Entity::BattleNpc::hateListAdd( ActorPtr pActor, int32_t hateAmount ) { auto hateEntry = new HateListEntry(); hateEntry->m_hateAmount = hateAmount; @@ -211,7 +211,7 @@ Core::Entity::ActorPtr Core::Entity::BattleNpc::hateListGetHighest() return nullptr; } -void Core::Entity::BattleNpc::setOwner( Core::Entity::PlayerPtr pPlayer ) +void Core::Entity::BattleNpc::setOwner( PlayerPtr pPlayer ) { m_pOwner = pPlayer; @@ -278,7 +278,7 @@ bool Core::Entity::BattleNpc::moveTo( Common::FFXIVARR_POSITION3& pos ) } -void Core::Entity::BattleNpc::aggro( Core::Entity::ActorPtr pActor ) +void Core::Entity::BattleNpc::aggro( ActorPtr pActor ) { m_lastAttack = Util::getTimeMs(); @@ -296,7 +296,7 @@ void Core::Entity::BattleNpc::aggro( Core::Entity::ActorPtr pActor ) } } -void Core::Entity::BattleNpc::deaggro( Core::Entity::ActorPtr pActor ) +void Core::Entity::BattleNpc::deaggro( ActorPtr pActor ) { if( !hateListHasActor( pActor ) ) hateListRemove( pActor ); @@ -322,7 +322,7 @@ void Core::Entity::BattleNpc::hateListClear() } -void Core::Entity::BattleNpc::hateListRemove( Core::Entity::ActorPtr pActor ) +void Core::Entity::BattleNpc::hateListRemove( ActorPtr pActor ) { auto it = m_hateList.begin(); for( ; it != m_hateList.end(); ++it ) @@ -342,7 +342,7 @@ void Core::Entity::BattleNpc::hateListRemove( Core::Entity::ActorPtr pActor ) } } -bool Core::Entity::BattleNpc::hateListHasActor( Core::Entity::ActorPtr pActor ) +bool Core::Entity::BattleNpc::hateListHasActor( ActorPtr pActor ) { auto it = m_hateList.begin(); for( ; it != m_hateList.end(); ++it ) @@ -363,7 +363,7 @@ uint32_t Core::Entity::BattleNpc::getNameId() const return m_nameId; } -void Core::Entity::BattleNpc::hateListUpdate( Core::Entity::ActorPtr pActor, int32_t hateAmount ) +void Core::Entity::BattleNpc::hateListUpdate( ActorPtr pActor, int32_t hateAmount ) { auto it = m_hateList.begin(); @@ -452,7 +452,7 @@ void Core::Entity::BattleNpc::onDeath() hateListClear(); } -void Core::Entity::BattleNpc::onActionHostile( Core::Entity::ActorPtr pSource ) +void Core::Entity::BattleNpc::onActionHostile( ActorPtr pSource ) { if( hateListGetHighest() == nullptr ) diff --git a/src/servers/Server_Zone/Actor/BattleNpc.h b/src/servers/Server_Zone/Actor/BattleNpc.h index d6e92e85..6bc0b93e 100644 --- a/src/servers/Server_Zone/Actor/BattleNpc.h +++ b/src/servers/Server_Zone/Actor/BattleNpc.h @@ -4,7 +4,6 @@ #include "Actor.h" namespace Core { - namespace Entity { enum StateMode @@ -76,7 +75,7 @@ public: void onDeath() override; - void onActionHostile( Core::Entity::ActorPtr pSource ) override; + void onActionHostile( ActorPtr pSource ) override; ActorPtr getClaimer() const; @@ -113,4 +112,4 @@ private: } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index de5df165..0d12b440 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -1,46 +1,45 @@ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "src/servers/Server_Zone/Session.h" +#include "Session.h" #include "Player.h" #include "BattleNpc.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Zone/Zone.h" +#include "Zone/ZoneMgr.h" +#include "Zone/Zone.h" -#include "src/servers/Server_Zone/ServerZone.h" +#include "ServerZone.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Network/GameConnection.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ChatPacket.h" +#include "Network/PacketWrappers/ModelEquipPacket.h" +#include "Network/PacketWrappers/ActorSpawnPacket.h" +#include "Network/PacketWrappers/UpdateHpMpTpPacket.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "Network/PacketWrappers/PlayerSpawnPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ChatPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ModelEquipPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorSpawnPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/UpdateHpMpTpPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerSpawnPacket.h" +#include "Script/ScriptManager.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Inventory/Item.h" -#include "src/servers/Server_Zone/Inventory/Item.h" - -#include "src/servers/Server_Zone/Inventory/Inventory.h" -#include "src/servers/Server_Zone/Event/Event.h" -#include "src/servers/Server_Zone/Action/Action.h" -#include "src/servers/Server_Zone/Action/EventAction.h" -#include "src/servers/Server_Zone/Action/EventItemAction.h" -#include "src/servers/Server_Zone/Zone/ZonePosition.h" -#include "src/servers/Server_Zone/Math/CalcStats.h" -#include "src/servers/Server_Zone/Math/CalcBattle.h" +#include "Inventory/Inventory.h" +#include "Event/Event.h" +#include "Action/Action.h" +#include "Action/EventAction.h" +#include "Action/EventItemAction.h" +#include "Zone/ZonePosition.h" +#include "Math/CalcStats.h" +#include "Math/CalcBattle.h" #include extern Core::Logger g_log; @@ -743,7 +742,7 @@ uint8_t Core::Entity::Player::getLevel() const return static_cast< uint8_t >( m_classArray[classJobIndex] ); } -uint8_t Core::Entity::Player::getLevelForClass( Core::Common::ClassJob pClass ) const +uint8_t Core::Entity::Player::getLevelForClass( Common::ClassJob pClass ) const { uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( pClass )].exp_idx; return static_cast< uint8_t >( m_classArray[classJobIndex] ); @@ -772,7 +771,7 @@ void Core::Entity::Player::setInCombat( bool mode ) m_bInCombat = mode; } -void Core::Entity::Player::setClassJob( Core::Common::ClassJob classJob ) +void Core::Entity::Player::setClassJob( Common::ClassJob classJob ) { m_class = classJob; uint8_t level = getLevel(); @@ -801,7 +800,7 @@ void Core::Entity::Player::setLevel( uint8_t level ) m_classArray[classJobIndex] = level; } -void Core::Entity::Player::setLevelForClass( uint8_t level, Core::Common::ClassJob classjob ) +void Core::Entity::Player::setLevelForClass( uint8_t level, Common::ClassJob classjob ) { uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( classjob )].exp_idx; m_classArray[classJobIndex] = level; @@ -871,7 +870,7 @@ void Core::Entity::Player::setLookAt( uint8_t index, uint8_t value ) } // spawn this player for pTarget -void Core::Entity::Player::spawn( Core::Entity::PlayerPtr pTarget ) +void Core::Entity::Player::spawn( Entity::PlayerPtr pTarget ) { g_log.debug( "[" + std::to_string( pTarget->getId() ) + "] Spawning " + getName() + " for " + @@ -882,7 +881,7 @@ void Core::Entity::Player::spawn( Core::Entity::PlayerPtr pTarget ) } // despawn -void Core::Entity::Player::despawn( Core::Entity::ActorPtr pTarget ) +void Core::Entity::Player::despawn( Entity::ActorPtr pTarget ) { auto pPlayer = pTarget->getAsPlayer(); @@ -893,7 +892,7 @@ void Core::Entity::Player::despawn( Core::Entity::ActorPtr pTarget ) Core::Entity::ActorPtr Core::Entity::Player::lookupTargetById( uint64_t targetId ) { - Core::Entity::ActorPtr targetActor; + ActorPtr targetActor; auto inRange = getInRangeActors( true ); for( auto actor : inRange ) { @@ -957,7 +956,7 @@ bool Core::Entity::Player::actionHasCastTime( uint32_t actionId ) //TODO: Add lo } -bool Core::Entity::Player::hasStateFlag( Core::Common::PlayerStateFlag flag ) const +bool Core::Entity::Player::hasStateFlag( Common::PlayerStateFlag flag ) const { int32_t iFlag = static_cast< uint32_t >( flag ); @@ -968,7 +967,7 @@ bool Core::Entity::Player::hasStateFlag( Core::Common::PlayerStateFlag flag ) co return ( m_stateFlags[index] & value ) != 0; } -void Core::Entity::Player::setStateFlag( Core::Common::PlayerStateFlag flag ) +void Core::Entity::Player::setStateFlag( Common::PlayerStateFlag flag ) { int32_t iFlag = static_cast< uint32_t >( flag ); @@ -999,7 +998,7 @@ void Core::Entity::Player::sendStateFlags() queuePacket( PlayerStateFlagsPacket( *getAsPlayer() ) ); } -void Core::Entity::Player::unsetStateFlag( Core::Common::PlayerStateFlag flag ) +void Core::Entity::Player::unsetStateFlag( Common::PlayerStateFlag flag ) { if( !hasStateFlag( flag ) ) return; @@ -1209,7 +1208,7 @@ const uint8_t* Core::Entity::Player::getGcRankArray() const return m_gcRank; } -void Core::Entity::Player::queuePacket( Core::Network::Packets::GamePacketPtr pPacket ) +void Core::Entity::Player::queuePacket( Network::Packets::GamePacketPtr pPacket ) { auto pSession = g_serverZone.getSession( m_id ); @@ -1223,7 +1222,7 @@ void Core::Entity::Player::queuePacket( Core::Network::Packets::GamePacketPtr pP } -void Core::Entity::Player::queueChatPacket( Core::Network::Packets::GamePacketPtr pPacket ) +void Core::Entity::Player::queueChatPacket( Network::Packets::GamePacketPtr pPacket ) { auto pSession = g_serverZone.getSession( m_id ); @@ -1246,7 +1245,7 @@ void Core::Entity::Player::setLoadingComplete( bool bComplete ) m_bLoadingComplete = bComplete; } -void Core::Entity::Player::performZoning(uint16_t zoneId, const Common::FFXIVARR_POSITION3 &pos, float rotation) +void Core::Entity::Player::performZoning( uint16_t zoneId, const Common::FFXIVARR_POSITION3 &pos, float rotation ) { m_pos = pos; m_zoneId = zoneId; @@ -1319,14 +1318,14 @@ void Core::Entity::Player::updateHowtosSeen( uint32_t howToId ) } -void Core::Entity::Player::onMobAggro( Core::Entity::BattleNpcPtr pBNpc ) +void Core::Entity::Player::onMobAggro( BattleNpcPtr pBNpc ) { hateListAdd( pBNpc ); queuePacket( ActorControlPacket142( getId(), ToggleAggro, 1 ) ); } -void Core::Entity::Player::onMobDeaggro( Core::Entity::BattleNpcPtr pBNpc ) +void Core::Entity::Player::onMobDeaggro( BattleNpcPtr pBNpc ) { hateListRemove( pBNpc ); @@ -1334,7 +1333,7 @@ void Core::Entity::Player::onMobDeaggro( Core::Entity::BattleNpcPtr pBNpc ) queuePacket( ActorControlPacket142( getId(), ToggleAggro ) ); } -void Core::Entity::Player::hateListAdd( Core::Entity::BattleNpcPtr pBNpc ) +void Core::Entity::Player::hateListAdd( BattleNpcPtr pBNpc ) { if( m_freeHateSlotQueue.empty() ) @@ -1346,7 +1345,7 @@ void Core::Entity::Player::hateListAdd( Core::Entity::BattleNpcPtr pBNpc ) } -void Core::Entity::Player::hateListRemove( Core::Entity::BattleNpcPtr pBNpc ) +void Core::Entity::Player::hateListRemove( BattleNpcPtr pBNpc ) { auto it = m_actorIdTohateSlotMap.begin(); @@ -1364,7 +1363,7 @@ void Core::Entity::Player::hateListRemove( Core::Entity::BattleNpcPtr pBNpc ) } } -bool Core::Entity::Player::hateListHasMob( Core::Entity::BattleNpcPtr pBNpc ) +bool Core::Entity::Player::hateListHasMob( BattleNpcPtr pBNpc ) { auto it = m_actorIdTohateSlotMap.begin(); @@ -1406,7 +1405,7 @@ void Core::Entity::Player::setIsLogin( bool bIsLogin ) m_bIsLogin = bIsLogin; } -uint8_t * Core::Entity::Player::getTitleList() +uint8_t* Core::Entity::Player::getTitleList() { return m_titleList; } diff --git a/src/servers/Server_Zone/Actor/Player.h b/src/servers/Server_Zone/Actor/Player.h index 97d85638..a7b7400b 100644 --- a/src/servers/Server_Zone/Actor/Player.h +++ b/src/servers/Server_Zone/Actor/Player.h @@ -1,12 +1,12 @@ #ifndef _PLAYER_H #define _PLAYER_H -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" -#include +#include #include "Actor.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" +#include "Inventory/Inventory.h" #include #include @@ -242,7 +242,7 @@ public: /*! returns the level of the currently active class / job */ uint8_t getLevel() const override; /*! returns the level of the provided class / job */ - uint8_t getLevelForClass( Core::Common::ClassJob pClass ) const; + uint8_t getLevelForClass( Common::ClassJob pClass ) const; /*! returns the exp of the currently active class / job */ uint32_t getExp() const; /*! sets the exp of the currently active class / job */ @@ -254,9 +254,9 @@ public: /*! set level on the currently active class / job to given level */ void setLevel( uint8_t level ); /*! set level on the provided class / job to given level */ - void setLevelForClass( uint8_t level, Core::Common::ClassJob classjob ); + void setLevelForClass( uint8_t level, Common::ClassJob classjob ); /*! change class or job to given class / job */ - void setClassJob( Core::Common::ClassJob classJob ); + void setClassJob( Common::ClassJob classJob ); /*! returns a pointer to the class array */ uint16_t* getClassArray(); /*! returns a const pointer to the class array */ diff --git a/src/servers/Server_Zone/Actor/PlayerEvent.cpp b/src/servers/Server_Zone/Actor/PlayerEvent.cpp index 9c0a1b02..0f4b5aae 100644 --- a/src/servers/Server_Zone/Actor/PlayerEvent.cpp +++ b/src/servers/Server_Zone/Actor/PlayerEvent.cpp @@ -1,29 +1,29 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Player.h" -#include "src/servers/Server_Zone/Zone/Zone.h" +#include "Zone/Zone.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventStartPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventPlayPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventFinishPacket.h" +#include "Network/GameConnection.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/EventStartPacket.h" +#include "Network/PacketWrappers/EventPlayPacket.h" +#include "Network/PacketWrappers/EventFinishPacket.h" -#include "src/servers/Server_Zone/Action/EventAction.h" -#include "src/servers/Server_Zone/Action/EventItemAction.h" +#include "Action/EventAction.h" +#include "Action/EventItemAction.h" -#include "src/servers/Server_Zone/Event/Event.h" -#include "src/servers/Server_Zone/Event/Event.h" -#include "Server_Zone/ServerZone.h" +#include "Event/Event.h" +#include "Event/Event.h" +#include "ServerZone.h" extern Core::Logger g_log; extern Core::ServerZone g_serverZone; diff --git a/src/servers/Server_Zone/Actor/PlayerInventory.cpp b/src/servers/Server_Zone/Actor/PlayerInventory.cpp index b1d03721..c35fb10a 100644 --- a/src/servers/Server_Zone/Actor/PlayerInventory.cpp +++ b/src/servers/Server_Zone/Actor/PlayerInventory.cpp @@ -1,18 +1,18 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include "Player.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Zone/Zone.h" +#include "Zone/ZoneMgr.h" +#include "Zone/Zone.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" -#include "src/servers/Server_Zone/Inventory/Item.h" +#include "Inventory/Inventory.h" +#include "Inventory/Item.h" extern Core::Logger g_log; @@ -31,7 +31,7 @@ void Core::Entity::Player::sendItemLevel() } // TODO: This has to be redone and simplified -void Core::Entity::Player::equipWeapon( Core::ItemPtr pItem ) +void Core::Entity::Player::equipWeapon( ItemPtr pItem ) { ClassJob currentClass = static_cast< ClassJob >( getClass() ); @@ -86,7 +86,7 @@ void Core::Entity::Player::equipWeapon( Core::ItemPtr pItem ) } // equip an item -void Core::Entity::Player::equipItem( Inventory::EquipSlot equipSlotId, Core::ItemPtr pItem, bool sendUpdate ) +void Core::Entity::Player::equipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem, bool sendUpdate ) { //g_log.debug( "Equipping into slot " + std::to_string( equipSlotId ) ); diff --git a/src/servers/Server_Zone/Actor/PlayerQuest.cpp b/src/servers/Server_Zone/Actor/PlayerQuest.cpp index 3940954f..fa938d33 100644 --- a/src/servers/Server_Zone/Actor/PlayerQuest.cpp +++ b/src/servers/Server_Zone/Actor/PlayerQuest.cpp @@ -1,16 +1,16 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Network/GameConnection.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/QuestMessagePacket.h" +#include "Network/PacketWrappers/QuestMessagePacket.h" -#include "src/servers/Server_Zone/Session.h" +#include "Server_Zone/Session.h" #include "Player.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" +#include "Server_Zone/Inventory/Inventory.h" extern Core::Data::ExdData g_exdData; diff --git a/src/servers/Server_Zone/Actor/PlayerSql.cpp b/src/servers/Server_Zone/Actor/PlayerSql.cpp index 7e9cfd71..d0c23880 100644 --- a/src/servers/Server_Zone/Actor/PlayerSql.cpp +++ b/src/servers/Server_Zone/Actor/PlayerSql.cpp @@ -1,34 +1,32 @@ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include - -#include - #include "Player.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Zone/Zone.h" +#include "Zone/ZoneMgr.h" +#include "Zone/Zone.h" -#include "src/servers/Server_Zone/ServerZone.h" +#include "ServerZone.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" +#include "Network/GameConnection.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Inventory/Inventory.h" -#include extern Core::Logger g_log; extern Core::ServerZone g_serverZone; @@ -41,11 +39,11 @@ using namespace Core::Network::Packets; using namespace Core::Network::Packets::Server; // load player from the db -bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession ) +bool Core::Entity::Player::load( uint32_t charId, SessionPtr pSession ) { const std::string char_id_str = std::to_string( charId ); - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_SEL ); + auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_SEL ); stmt->setUInt( 1, charId ); auto res = g_charaDb.query( stmt ); @@ -220,7 +218,7 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession ) bool Core::Entity::Player::loadActiveQuests() { - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_QUEST_SEL ); + auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_QUEST_SEL ); stmt->setUInt( 1, m_id ); auto res = g_charaDb.query( stmt ); @@ -257,7 +255,7 @@ bool Core::Entity::Player::loadClassData() { // ClassIdx, Exp, Lvl - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_CLASS_SEL ); + auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_CLASS_SEL ); stmt->setUInt( 1, m_id ); auto res = g_charaDb.query( stmt ); @@ -276,7 +274,7 @@ bool Core::Entity::Player::loadClassData() bool Core::Entity::Player::loadSearchInfo() { - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_SEARCHINFO_SEL ); + auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_SEARCHINFO_SEL ); stmt->setUInt( 1, m_id ); auto res = g_charaDb.query( stmt ); @@ -304,7 +302,7 @@ void Core::Entity::Player::updateSql() "EquippedMannequin 44, ConfigFlags 45, QuestCompleteFlags 46, OpeningSequence 47, " "QuestTracking 48, GrandCompany 49, GrandCompanyRank 50, Discovery 51, GMRank 52, Unlocks 53, " "CFPenaltyUntil 54"*/ - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_UP ); + auto stmt = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_UP ); stmt->setInt( 1, getHp() ); stmt->setInt( 2, getMp() ); @@ -431,7 +429,7 @@ void Core::Entity::Player::updateDbClass() const uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( getClass() )].exp_idx; //Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ? - auto stmtS = g_charaDb.getPreparedStatement( Core::Db::CHARA_CLASS_UP ); + auto stmtS = g_charaDb.getPreparedStatement( Db::CHARA_CLASS_UP ); stmtS->setInt( 1, getExp() ); stmtS->setInt( 2, getLevel() ); stmtS->setInt( 3, m_id ); @@ -441,17 +439,17 @@ void Core::Entity::Player::updateDbClass() const void Core::Entity::Player::updateDbSearchInfo() const { - auto stmtS = g_charaDb.getPreparedStatement( Core::Db::CHARA_SEARCHINFO_UP_SELECTCLASS ); + auto stmtS = g_charaDb.getPreparedStatement( Db::CHARA_SEARCHINFO_UP_SELECTCLASS ); stmtS->setInt( 1, m_searchSelectClass ); stmtS->setInt( 2, m_id ); g_charaDb.execute( stmtS ); - auto stmtS1 = g_charaDb.getPreparedStatement( Core::Db::CHARA_SEARCHINFO_UP_SELECTREGION ); + auto stmtS1 = g_charaDb.getPreparedStatement( Db::CHARA_SEARCHINFO_UP_SELECTREGION ); stmtS1->setInt( 1, m_searchSelectRegion ); stmtS1->setInt( 2, m_id ); g_charaDb.execute( stmtS1 ); - auto stmtS2 = g_charaDb.getPreparedStatement( Core::Db::CHARA_SEARCHINFO_UP_SELECTREGION ); + auto stmtS2 = g_charaDb.getPreparedStatement( Db::CHARA_SEARCHINFO_UP_SELECTREGION ); stmtS2->setString( 1, string( m_searchMessage != nullptr ? m_searchMessage : "" ) ); stmtS2->setInt( 2, m_id ); g_charaDb.execute( stmtS2 ); @@ -465,7 +463,7 @@ void Core::Entity::Player::updateDbAllQuests() const if( !m_activeQuests[i] ) continue; - auto stmtS3 = g_charaDb.getPreparedStatement( Core::Db::CHARA_QUEST_UP ); + auto stmtS3 = g_charaDb.getPreparedStatement( Db::CHARA_QUEST_UP ); stmtS3->setInt( 1, m_activeQuests[i]->c.sequence ); stmtS3->setInt( 2, m_activeQuests[i]->c.flags ); stmtS3->setInt( 3, m_activeQuests[i]->c.UI8A ); @@ -484,7 +482,7 @@ void Core::Entity::Player::updateDbAllQuests() const void Core::Entity::Player::deleteQuest( uint16_t questId ) const { - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CHARA_QUEST_DEL ); + auto stmt = g_charaDb.getPreparedStatement( Db::CHARA_QUEST_DEL ); stmt->setInt( 1, m_id ); stmt->setInt( 2, questId ); g_charaDb.execute( stmt ); @@ -492,7 +490,7 @@ void Core::Entity::Player::deleteQuest( uint16_t questId ) const void Core::Entity::Player::insertQuest( uint16_t questId, uint8_t index, uint8_t seq ) const { - auto stmt = g_charaDb.getPreparedStatement( Core::Db::CHARA_QUEST_INS ); + auto stmt = g_charaDb.getPreparedStatement( Db::CHARA_QUEST_INS ); stmt->setInt( 1, m_id ); stmt->setInt( 2, index ); stmt->setInt( 3, questId ); diff --git a/src/servers/Server_Zone/CMakeLists.txt b/src/servers/Server_Zone/CMakeLists.txt index ddd78661..308f3ab7 100644 --- a/src/servers/Server_Zone/CMakeLists.txt +++ b/src/servers/Server_Zone/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_policy(SET CMP0015 NEW) cmake_policy(SET CMP0014 OLD) project(Sapphire_Zone) +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) file(GLOB SERVER_PUBLIC_INCLUDE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} /*.h diff --git a/src/servers/Server_Zone/DebugCommand/DebugCommand.h b/src/servers/Server_Zone/DebugCommand/DebugCommand.h index 36036349..c6131a75 100644 --- a/src/servers/Server_Zone/DebugCommand/DebugCommand.h +++ b/src/servers/Server_Zone/DebugCommand/DebugCommand.h @@ -1,10 +1,10 @@ #ifndef _GAMECOMMAND_H_ #define _GAMECOMMAND_H_ -#include +#include -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Actor/Player.h" +#include "Forwards.h" namespace Core { diff --git a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp index ebcef25d..55b63d1d 100644 --- a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp +++ b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp @@ -1,36 +1,36 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "DebugCommand.h" #include "DebugCommandHandler.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Network/GameConnection.h" +#include "Script/ScriptManager.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Actor/BattleNpc.h" +#include "Actor/Player.h" +#include "Actor/BattleNpc.h" -#include "src/servers/Server_Zone/Zone/Zone.h" +#include "Zone/Zone.h" -#include "src/servers/Server_Zone/ServerZone.h" +#include "ServerZone.h" -#include "src/servers/Server_Zone/StatusEffect/StatusEffect.h" -#include "src/servers/Server_Zone/Session.h" +#include "StatusEffect/StatusEffect.h" +#include "Session.h" #include -#include #include @@ -63,14 +63,14 @@ Core::DebugCommandHandler::~DebugCommandHandler() } // add a command set to the register map -void Core::DebugCommandHandler::registerCommand( const std::string& n, Core::DebugCommand::pFunc functionPtr, +void Core::DebugCommandHandler::registerCommand( const std::string& n, DebugCommand::pFunc functionPtr, const std::string& hText, uint8_t uLevel ) { m_commandMap[std::string( n )] = boost::make_shared< DebugCommand >( n, functionPtr, hText, uLevel ); } // try to retrieve the command in question, execute if found -void Core::DebugCommandHandler::execCommand( char * data, Core::Entity::Player& player ) +void Core::DebugCommandHandler::execCommand( char * data, Entity::Player& player ) { // define callback pointer @@ -117,14 +117,14 @@ void Core::DebugCommandHandler::execCommand( char * data, Core::Entity::Player& // Definition of the commands /////////////////////////////////////////////////////////////////////////////////////// -void Core::DebugCommandHandler::scriptReload( char * data, Core::Entity::Player& player, - boost::shared_ptr command ) +void Core::DebugCommandHandler::scriptReload( char * data, Entity::Player& player, + boost::shared_ptr< DebugCommand > command ) { g_scriptMgr.reload(); player.sendDebug( "Scripts reloaded." ); } -void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { player.sendDebug( "Registered debug commands:" ); for ( auto cmd : m_commandMap ) @@ -136,7 +136,7 @@ void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost: } } -void Core::DebugCommandHandler::set( char * data, Core::Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand = ""; std::string params = ""; @@ -240,13 +240,13 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::Player& player, sscanf( params.c_str(), "%d", &id ); - if( player.getLevelForClass( static_cast ( id ) ) == 0 ) + if( player.getLevelForClass( static_cast< Common::ClassJob > ( id ) ) == 0 ) { - player.setLevelForClass( 1, static_cast ( id ) ); - player.setClassJob( static_cast ( id ) ); + player.setLevelForClass( 1, static_cast< Common::ClassJob > ( id ) ); + player.setClassJob( static_cast< Common::ClassJob > ( id ) ); } else - player.setClassJob( static_cast ( id ) ); + player.setClassJob( static_cast< Common::ClassJob > ( id ) ); } else if ( subCommand == "cfpenalty" ) { @@ -269,7 +269,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::Player& player, uint32_t val; sscanf( params.c_str(), "%d %d", &slot, &val ); - player.setModelForSlot( static_cast( slot ), val ); + player.setModelForSlot( static_cast< Inventory::EquipSlot >( slot ), val ); player.sendModel(); player.sendDebug( "Model updated" ); } @@ -288,7 +288,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::Player& player, } -void Core::DebugCommandHandler::add( char * data, Core::Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::add( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand; std::string params = ""; @@ -328,7 +328,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::Player& player, player.addStatusEffect( effect ); } - else if ( subCommand == "title" ) + else if( subCommand == "title" ) { uint32_t titleId; sscanf( params.c_str(), "%u", &titleId ); @@ -390,7 +390,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::Player& player, Network::Packets::Server::ServerNoticePacket noticePacket( player, "Injecting ACTOR_CONTROL " + std::to_string( opcode ) ); - player.queuePacket(noticePacket); + player.queuePacket( noticePacket ); Network::Packets::Server::ActorControlPacket143 controlPacket( player, opcode, param1, param2, param3, param4, param5, param6, playerId ); @@ -405,7 +405,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::Player& player, } -void Core::DebugCommandHandler::get( char * data, Core::Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::get( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand; std::string params = ""; @@ -449,14 +449,14 @@ void Core::DebugCommandHandler::get( char * data, Core::Entity::Player& player, } -void Core::DebugCommandHandler::injectPacket( char * data, Core::Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::injectPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { auto pSession = g_serverZone.getSession( player.getId() ); if( pSession ) pSession->getZoneConnection()->injectPacket( data + 7, player ); } -void Core::DebugCommandHandler::injectChatPacket( char * data, Core::Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::injectChatPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { auto pSession = g_serverZone.getSession( player.getId() ); if( pSession ) @@ -510,14 +510,14 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, boos } } -void Core::DebugCommandHandler::serverInfo( char * data, Core::Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { player.sendDebug( "SapphireServer " + Version::VERSION + "\nRev: " + Version::GIT_HASH ); player.sendDebug( "Compiled: " __DATE__ " " __TIME__ ); player.sendDebug( "Sessions: " + std::to_string( g_serverZone.getSessionCount() ) ); } -void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< Core::DebugCommand > command ) +void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { player.unlock( ); } diff --git a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h index 0e17722e..fb30cc99 100644 --- a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h +++ b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h @@ -4,8 +4,8 @@ #include #include "DebugCommand.h" -#include -#include "src/servers/Server_Zone/Forwards.h" +#include +#include "Forwards.h" namespace Core { diff --git a/src/servers/Server_Zone/Event/Event.cpp b/src/servers/Server_Zone/Event/Event.cpp index 272084b3..ee1a3f6e 100644 --- a/src/servers/Server_Zone/Event/Event.cpp +++ b/src/servers/Server_Zone/Event/Event.cpp @@ -56,7 +56,7 @@ Core::Scripting::EventReturnCallback Core::Event::Event::getEventReturnCallback( return m_callback; } -void Core::Event::Event::setEventReturnCallback( Core::Scripting::EventReturnCallback callback ) +void Core::Event::Event::setEventReturnCallback( Scripting::EventReturnCallback callback ) { m_callback = callback; } diff --git a/src/servers/Server_Zone/Event/EventHelper.cpp b/src/servers/Server_Zone/Event/EventHelper.cpp index e59b322b..0ec74b98 100644 --- a/src/servers/Server_Zone/Event/EventHelper.cpp +++ b/src/servers/Server_Zone/Event/EventHelper.cpp @@ -1,8 +1,7 @@ #include "EventHelper.h" #include "Event.h" -#include - -#include +#include +#include extern Core::Data::ExdData g_exdData; diff --git a/src/servers/Server_Zone/Inventory/Inventory.cpp b/src/servers/Server_Zone/Inventory/Inventory.cpp index c03c9c00..ee982043 100644 --- a/src/servers/Server_Zone/Inventory/Inventory.cpp +++ b/src/servers/Server_Zone/Inventory/Inventory.cpp @@ -1,22 +1,22 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include "Inventory.h" -#include "src/servers/Server_Zone/Actor/Player.h" +#include "Actor/Player.h" #include "ItemContainer.h" #include "Item.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" #include #include -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" +#include "../Forwards.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" #include diff --git a/src/servers/Server_Zone/Inventory/Inventory.h b/src/servers/Server_Zone/Inventory/Inventory.h index b4663aa7..508c4733 100644 --- a/src/servers/Server_Zone/Inventory/Inventory.h +++ b/src/servers/Server_Zone/Inventory/Inventory.h @@ -1,8 +1,8 @@ #ifndef INVENTORY_H_ #define INVENTORY_H_ #include -#include -#include "src/servers/Server_Zone/Forwards.h" +#include +#include "../Forwards.h" namespace Core { diff --git a/src/servers/Server_Zone/Inventory/Item.cpp b/src/servers/Server_Zone/Inventory/Item.cpp index a5e8dd84..2844c73e 100644 --- a/src/servers/Server_Zone/Inventory/Item.cpp +++ b/src/servers/Server_Zone/Inventory/Item.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "Item.h" extern Core::Data::ExdData g_exdData; diff --git a/src/servers/Server_Zone/Inventory/Item.h b/src/servers/Server_Zone/Inventory/Item.h index 198607f5..fdb3e6a3 100644 --- a/src/servers/Server_Zone/Inventory/Item.h +++ b/src/servers/Server_Zone/Inventory/Item.h @@ -1,7 +1,7 @@ #ifndef _ITEM_H_ #define _ITEM_H_ -#include +#include namespace Core { @@ -81,4 +81,4 @@ protected: } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Inventory/ItemContainer.cpp b/src/servers/Server_Zone/Inventory/ItemContainer.cpp index e3a1f7ec..baa3da34 100644 --- a/src/servers/Server_Zone/Inventory/ItemContainer.cpp +++ b/src/servers/Server_Zone/Inventory/ItemContainer.cpp @@ -1,14 +1,14 @@ -#include "src/servers/Server_Zone/Forwards.h" +#include "../Forwards.h" #include "ItemContainer.h" -#include -#include +#include +#include +#include -#include "src/servers/Server_Zone/Actor/Player.h" +#include "Actor/Player.h" #include "Item.h" -#include extern Core::Logger g_log; @@ -86,7 +86,7 @@ Core::ItemPtr Core::ItemContainer::getItem( uint8_t slotId ) return m_itemMap[slotId]; } -void Core::ItemContainer::setItem( uint8_t slotId, Core::ItemPtr pItem ) +void Core::ItemContainer::setItem( uint8_t slotId, ItemPtr pItem ) { if( ( slotId > m_size ) ) return; diff --git a/src/servers/Server_Zone/Inventory/ItemContainer.h b/src/servers/Server_Zone/Inventory/ItemContainer.h index 745e8c7b..8147905d 100644 --- a/src/servers/Server_Zone/Inventory/ItemContainer.h +++ b/src/servers/Server_Zone/Inventory/ItemContainer.h @@ -1,10 +1,9 @@ -#pragma once #ifndef _ITEMCONTAINER_H_ #define _ITEMCONTAINER_H_ #include -#include +#include #include "../Forwards.h" @@ -17,7 +16,7 @@ namespace Core { public: - ItemContainer(uint16_t locationId); + ItemContainer( uint16_t locationId ); ~ItemContainer(); uint16_t getId() const; @@ -30,9 +29,9 @@ namespace Core const ItemMap& getItemMap() const; - ItemPtr getItem(uint8_t slotId); + ItemPtr getItem( uint8_t slotId ); - void setItem(uint8_t slotId, ItemPtr item); + void setItem( uint8_t slotId, ItemPtr item ); int16_t getFreeSlot(); @@ -45,4 +44,4 @@ namespace Core } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Math/CalcBattle.cpp b/src/servers/Server_Zone/Math/CalcBattle.cpp index bc2bc322..f68d1872 100644 --- a/src/servers/Server_Zone/Math/CalcBattle.cpp +++ b/src/servers/Server_Zone/Math/CalcBattle.cpp @@ -2,9 +2,8 @@ #include #include -#include -#include - +#include "Actor/Actor.h" +#include "Actor/Player.h" #include "CalcBattle.h" @@ -42,4 +41,4 @@ uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency ) // consider 3% variation return potency / 10; -} \ No newline at end of file +} diff --git a/src/servers/Server_Zone/Math/CalcBattle.h b/src/servers/Server_Zone/Math/CalcBattle.h index 59a4c421..b373ac99 100644 --- a/src/servers/Server_Zone/Math/CalcBattle.h +++ b/src/servers/Server_Zone/Math/CalcBattle.h @@ -2,7 +2,7 @@ #define _CALCBATTLE_H #include -#include +#include "Actor/Actor.h" using namespace Core::Entity; @@ -21,4 +21,4 @@ namespace Math { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Math/CalcStats.cpp b/src/servers/Server_Zone/Math/CalcStats.cpp index 4d6ae4d6..0e31d183 100644 --- a/src/servers/Server_Zone/Math/CalcStats.cpp +++ b/src/servers/Server_Zone/Math/CalcStats.cpp @@ -2,8 +2,8 @@ #include #include -#include -#include +#include "Actor/Actor.h" +#include "Actor/Player.h" #include "CalcStats.h" @@ -111,4 +111,4 @@ uint32_t CalcStats::calculateMaxMp( PlayerPtr pPlayer ) uint16_t result = static_cast< uint16_t >( floor( floor( piety - baseStat ) * ( pietyScalar / 100 ) + baseMp ) * jobModMp / 100 ); return result; -} \ No newline at end of file +} diff --git a/src/servers/Server_Zone/Math/CalcStats.h b/src/servers/Server_Zone/Math/CalcStats.h index 74762bb9..94a0a324 100644 --- a/src/servers/Server_Zone/Math/CalcStats.h +++ b/src/servers/Server_Zone/Math/CalcStats.h @@ -2,7 +2,7 @@ #define _CALCSTATS_H #include -#include +#include "Actor/Actor.h" using namespace Core::Entity; @@ -23,4 +23,4 @@ namespace Math { } } -#endif \ No newline at end of file +#endif diff --git a/src/servers/Server_Zone/Network/GameConnection.cpp b/src/servers/Server_Zone/Network/GameConnection.cpp index 1b5c3360..1a52c5f6 100644 --- a/src/servers/Server_Zone/Network/GameConnection.cpp +++ b/src/servers/Server_Zone/Network/GameConnection.cpp @@ -1,20 +1,20 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "GameConnection.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "ServerZone.h" +#include "Session.h" +#include "Zone/Zone.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "DebugCommand/DebugCommandHandler.h" +#include "Actor/Player.h" +#include "Forwards.h" extern Core::DebugCommandHandler g_gameCommandMgr; extern Core::Logger g_log; diff --git a/src/servers/Server_Zone/Network/GameConnection.h b/src/servers/Server_Zone/Network/GameConnection.h index f0136c3f..d4e2dfc2 100644 --- a/src/servers/Server_Zone/Network/GameConnection.h +++ b/src/servers/Server_Zone/Network/GameConnection.h @@ -1,16 +1,13 @@ - #ifndef GAMECONNECTION_H #define GAMECONNECTION_H -#include -#include -#include +#include +#include +#include +#include +#include -#include - -#include - -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" #define DECLARE_HANDLER( x ) void x( const Packets::GamePacket& inPacket, Entity::Player& player ) diff --git a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp index 0bfc6364..86404013 100644 --- a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp @@ -1,39 +1,39 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Network/GameConnection.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Zone/ZonePosition.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" +#include "Session.h" +#include "Zone/Zone.h" +#include "Zone/ZonePosition.h" +#include "ServerZone.h" +#include "Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PingPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/MoveActorPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ChatPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventStartPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventFinishPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Network/PacketWrappers/PingPacket.h" +#include "Network/PacketWrappers/MoveActorPacket.h" +#include "Network/PacketWrappers/ChatPacket.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/EventStartPacket.h" +#include "Network/PacketWrappers/EventFinishPacket.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Event/EventHelper.h" -#include "src/servers/Server_Zone/Action/Action.h" -#include "src/servers/Server_Zone/Action/ActionTeleport.h" +#include "DebugCommand/DebugCommandHandler.h" +#include "Actor/Player.h" +#include "Inventory/Inventory.h" +#include "Forwards.h" +#include "Event/EventHelper.h" +#include "Action/Action.h" +#include "Action/ActionTeleport.h" extern Core::Logger g_log; extern Core::ServerZone g_serverZone; diff --git a/src/servers/Server_Zone/Network/Handlers/CFHandlers.cpp b/src/servers/Server_Zone/Network/Handlers/CFHandlers.cpp index d70e7f81..b3df64e5 100644 --- a/src/servers/Server_Zone/Network/Handlers/CFHandlers.cpp +++ b/src/servers/Server_Zone/Network/Handlers/CFHandlers.cpp @@ -1,21 +1,19 @@ -#include -#include -#include -#include -#include - -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/Actor/Player.h" - -#include "src/servers/Server_Zone/Forwards.h" +#include +#include +#include +#include +#include +#include "Network/GameConnection.h" +#include "Session.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "Actor/Player.h" +#include "Forwards.h" extern Core::Logger g_log; diff --git a/src/servers/Server_Zone/Network/Handlers/EventHandlers.cpp b/src/servers/Server_Zone/Network/Handlers/EventHandlers.cpp index dad05a96..8a9f814b 100644 --- a/src/servers/Server_Zone/Network/Handlers/EventHandlers.cpp +++ b/src/servers/Server_Zone/Network/Handlers/EventHandlers.cpp @@ -1,24 +1,24 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventStartPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventFinishPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Event/EventHelper.h" +#include "Network/GameConnection.h" +#include "Session.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/EventStartPacket.h" +#include "Network/PacketWrappers/EventFinishPacket.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "Script/ScriptManager.h" +#include "Actor/Player.h" +#include "Forwards.h" +#include "Event/EventHelper.h" extern Core::Scripting::ScriptManager g_scriptMgr; diff --git a/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp b/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp index 6bd46b32..923b37b9 100644 --- a/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp +++ b/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp @@ -1,39 +1,39 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Network/GameConnection.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Zone/ZonePosition.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" +#include "Session.h" +#include "Zone/Zone.h" +#include "Zone/ZonePosition.h" +#include "ServerZone.h" +#include "Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PingPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/MoveActorPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ChatPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventStartPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventFinishPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Network/PacketWrappers/PingPacket.h" +#include "Network/PacketWrappers/MoveActorPacket.h" +#include "Network/PacketWrappers/ChatPacket.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/EventStartPacket.h" +#include "Network/PacketWrappers/EventFinishPacket.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Event/EventHelper.h" -#include "src/servers/Server_Zone/Action/Action.h" -#include "src/servers/Server_Zone/Action/ActionTeleport.h" +#include "DebugCommand/DebugCommandHandler.h" +#include "Actor/Player.h" +#include "Inventory/Inventory.h" +#include "Forwards.h" +#include "Event/EventHelper.h" +#include "Action/Action.h" +#include "Action/ActionTeleport.h" extern Core::Logger g_log; extern Core::ServerZone g_serverZone; diff --git a/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp b/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp index 2da36167..52aaaad3 100644 --- a/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp @@ -1,29 +1,29 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Network/GameConnection.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Zone/ZonePosition.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" +#include "Session.h" +#include "Zone/Zone.h" +#include "Zone/ZonePosition.h" +#include "ServerZone.h" +#include "Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "DebugCommand/DebugCommandHandler.h" +#include "Actor/Player.h" +#include "Inventory/Inventory.h" +#include "Forwards.h" extern Core::Logger g_log; extern Core::ServerZone g_serverZone; diff --git a/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp b/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp index 98c9df36..0f397f2a 100644 --- a/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp +++ b/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp @@ -1,43 +1,42 @@ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include "Network/GameConnection.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Session.h" +#include "Zone/Zone.h" +#include "Zone/ZonePosition.h" +#include "ServerZone.h" +#include "Zone/ZoneMgr.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Zone/ZonePosition.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Zone/ZoneMgr.h" +#include "Network/PacketWrappers/InitUIPacket.h" +#include "Network/PacketWrappers/PingPacket.h" +#include "Network/PacketWrappers/MoveActorPacket.h" +#include "Network/PacketWrappers/ChatPacket.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/EventStartPacket.h" +#include "Network/PacketWrappers/EventFinishPacket.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PingPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/MoveActorPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ChatPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventStartPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/EventFinishPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "DebugCommand/DebugCommandHandler.h" +#include "Actor/Player.h" +#include "Inventory/Inventory.h" +#include "Forwards.h" +#include "Event/EventHelper.h" +#include "Action/Action.h" +#include "Action/ActionTeleport.h" -#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Inventory/Inventory.h" -#include "src/servers/Server_Zone/Forwards.h" -#include "src/servers/Server_Zone/Event/EventHelper.h" -#include "src/servers/Server_Zone/Action/Action.h" -#include "src/servers/Server_Zone/Action/ActionTeleport.h" - -#include extern Core::Logger g_log; extern Core::ServerZone g_serverZone; diff --git a/src/servers/Server_Zone/Network/Handlers/SkillHandler.cpp b/src/servers/Server_Zone/Network/Handlers/SkillHandler.cpp index 01323053..eaaa1d2b 100644 --- a/src/servers/Server_Zone/Network/Handlers/SkillHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/SkillHandler.cpp @@ -1,34 +1,34 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include "Network/GameConnection.h" -#include "src/servers/Server_Zone/Session.h" +#include "Session.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Network/PacketWrappers/ActorControlPacket142.h" +#include "Network/PacketWrappers/ActorControlPacket143.h" +#include "Network/PacketWrappers/ActorControlPacket144.h" +#include "Network/PacketWrappers/MoveActorPacket.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/PlayerStateFlagsPacket.h" +#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" -#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h" +#include "DebugCommand/DebugCommandHandler.h" -#include "src/servers/Server_Zone/Actor/Player.h" +#include "Actor/Player.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" -#include "src/servers/Server_Zone/Action/Action.h" -#include "src/servers/Server_Zone/Action/ActionCast.h" -#include "src/servers/Server_Zone/Action/ActionMount.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" -#include "Server_Zone/Network/PacketWrappers/MoveActorPacket.h" +#include "Action/Action.h" +#include "Action/ActionCast.h" +#include "Action/ActionMount.h" +#include "Script/ScriptManager.h" extern Core::Scripting::ScriptManager g_scriptMgr; diff --git a/src/servers/Server_Zone/Script/ScriptManager.cpp b/src/servers/Server_Zone/Script/ScriptManager.cpp index 5972deaa..7ee72a52 100644 --- a/src/servers/Server_Zone/Script/ScriptManager.cpp +++ b/src/servers/Server_Zone/Script/ScriptManager.cpp @@ -1,18 +1,18 @@ -#include -#include +#include +#include #include -#include +#include -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Actor/BattleNpc.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Event/Event.h" -#include "src/servers/Server_Zone/Event/EventHelper.h" -#include "src/servers/Server_Zone/StatusEffect/StatusEffect.h" -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Zone/Zone.h" +#include "Actor/Player.h" +#include "Actor/BattleNpc.h" +#include "ServerZone.h" +#include "Event/Event.h" +#include "Event/EventHelper.h" +#include "StatusEffect/StatusEffect.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "Script/ScriptManager.h" #include #include @@ -55,7 +55,7 @@ void Core::Scripting::ScriptManager::loadDir( std::string dirname, std::set& Core::Scripting::ScriptManage } -bool Core::Scripting::ScriptManager::onTalk( Core::Entity::Player& player, uint64_t actorId, uint32_t eventId ) +bool Core::Scripting::ScriptManager::onTalk( Entity::Player& player, uint64_t actorId, uint32_t eventId ) { std::string eventName = "onTalk"; std::string objName = Event::getEventName( eventId ); player.sendDebug( "Actor: " + std::to_string( actorId ) + " -> " + - std::to_string( Core::Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ) ) + + std::to_string( Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ) ) + " \neventId: " + std::to_string( eventId ) + " (0x" + boost::str( boost::format( "%|08X|" ) @@ -135,7 +135,7 @@ bool Core::Scripting::ScriptManager::onTalk( Core::Entity::Player& player, uint6 return true; } -bool Core::Scripting::ScriptManager::onEnterTerritory( Core::Entity::Player& player, uint32_t eventId, +bool Core::Scripting::ScriptManager::onEnterTerritory( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) { std::string eventName = "onEnterTerritory"; @@ -222,7 +222,7 @@ bool Core::Scripting::ScriptManager::onOutsideRange( Entity::Player& player, uin return true; } -bool Core::Scripting::ScriptManager::onEmote( Core::Entity::Player& player, uint64_t actorId, +bool Core::Scripting::ScriptManager::onEmote( Entity::Player& player, uint64_t actorId, uint32_t eventId, uint8_t emoteId ) { std::string eventName = "onEmote"; @@ -260,7 +260,7 @@ bool Core::Scripting::ScriptManager::onEmote( Core::Entity::Player& player, uint return true; } -bool Core::Scripting::ScriptManager::onEventHandlerReturn( Core::Entity::Player& player, uint32_t eventId, +bool Core::Scripting::ScriptManager::onEventHandlerReturn( Entity::Player& player, uint32_t eventId, uint16_t subEvent, uint16_t param1, uint16_t param2, uint16_t param3 ) { @@ -304,7 +304,7 @@ bool Core::Scripting::ScriptManager::onEventHandlerReturn( Core::Entity::Player& return true; } -bool Core::Scripting::ScriptManager::onEventHandlerTradeReturn( Core::Entity::Player& player, uint32_t eventId, +bool Core::Scripting::ScriptManager::onEventHandlerTradeReturn( Entity::Player& player, uint32_t eventId, uint16_t subEvent, uint16_t param, uint32_t catalogId ) { std::string eventName = Event::getEventName( eventId ) + "_TRADE"; @@ -446,7 +446,7 @@ bool Core::Scripting::ScriptManager::onStatusTick( Entity::ActorPtr pActor, Core pActor->getAsPlayer()->sendDebug( "Calling: " + objName + "." + eventName ); auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, Entity::Actor&, - Core::StatusEffect::StatusEffect& ) > >( eventName ); + StatusEffect::StatusEffect& ) > >( eventName ); fn( obj, *pActor, effect ); } catch( std::exception& e ) diff --git a/src/servers/Server_Zone/Script/ScriptManager.h b/src/servers/Server_Zone/Script/ScriptManager.h index 42b5efb7..2e66f3cf 100644 --- a/src/servers/Server_Zone/Script/ScriptManager.h +++ b/src/servers/Server_Zone/Script/ScriptManager.h @@ -5,8 +5,8 @@ #include #include -#include -#include "../Forwards.h" +#include +#include "Forwards.h" namespace chaiscript diff --git a/src/servers/Server_Zone/Script/ScriptManagerInit.cpp b/src/servers/Server_Zone/Script/ScriptManagerInit.cpp index 71b891cc..dbf76194 100644 --- a/src/servers/Server_Zone/Script/ScriptManagerInit.cpp +++ b/src/servers/Server_Zone/Script/ScriptManagerInit.cpp @@ -4,18 +4,17 @@ #include #include -#include "src/servers/Server_Zone/ServerZone.h" +#include "ServerZone.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Script/ScriptManager.h" -#include "src/servers/Server_Zone/Zone/Zone.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Actor/BattleNpc.h" -#include "src/servers/Server_Zone/Event/Event.h" -#include "src/servers/Server_Zone/Event/EventHelper.h" - -#include "src/servers/Server_Zone/Network/PacketWrappers/ServerNoticePacket.h" -#include "src/servers/Server_Zone/StatusEffect/StatusEffect.h" +#include "Zone/Zone.h" +#include "Actor/Player.h" +#include "Actor/BattleNpc.h" +#include "Event/Event.h" +#include "Event/EventHelper.h" +#include "Network/PacketWrappers/ServerNoticePacket.h" +#include "StatusEffect/StatusEffect.h" #include diff --git a/src/servers/Server_Zone/ServerZone.cpp b/src/servers/Server_Zone/ServerZone.cpp index bf16a446..a863b06a 100644 --- a/src/servers/Server_Zone/ServerZone.cpp +++ b/src/servers/Server_Zone/ServerZone.cpp @@ -1,9 +1,9 @@ #include "ServerZone.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/servers/Server_Zone/ServerZone.h b/src/servers/Server_Zone/ServerZone.h index 33d6a329..724f031e 100644 --- a/src/servers/Server_Zone/ServerZone.h +++ b/src/servers/Server_Zone/ServerZone.h @@ -1,14 +1,14 @@ #ifndef __GAMESERVER_H #define __GAMESERVER_H -#include +#include #include #include #include #include "Forwards.h" -#include "src/servers/Server_Zone/Actor/BattleNpcTemplate.h" +#include "Actor/BattleNpcTemplate.h" namespace Core { diff --git a/src/servers/Server_Zone/Session.cpp b/src/servers/Server_Zone/Session.cpp index 9f5df569..03965da3 100644 --- a/src/servers/Server_Zone/Session.cpp +++ b/src/servers/Server_Zone/Session.cpp @@ -1,11 +1,11 @@ #include -#include -#include -#include "src/servers/Server_Zone/Network/GameConnection.h" +#include +#include +#include "Network/GameConnection.h" #include "Session.h" -#include "src/servers/Server_Zone/Actor/Player.h" +#include "Actor/Player.h" Core::Session::Session( uint32_t sessionId ) : m_sessionId( sessionId ) @@ -23,13 +23,13 @@ Core::Session::~Session() { } -void Core::Session::setZoneConnection( Core::Network::GameConnectionPtr pZoneCon ) +void Core::Session::setZoneConnection( Network::GameConnectionPtr pZoneCon ) { pZoneCon->m_conType = Network::ConnectionType::Zone; m_pZoneConnection = pZoneCon; } -void Core::Session::setChatConnection( Core::Network::GameConnectionPtr pChatCon ) +void Core::Session::setChatConnection( Network::GameConnectionPtr pChatCon ) { pChatCon->m_conType = Network::ConnectionType::Chat; m_pChatConnection = pChatCon; diff --git a/src/servers/Server_Zone/Zone/Cell.cpp b/src/servers/Server_Zone/Zone/Cell.cpp index 7a598ae7..9ee35e31 100644 --- a/src/servers/Server_Zone/Zone/Cell.cpp +++ b/src/servers/Server_Zone/Zone/Cell.cpp @@ -1,9 +1,8 @@ - #include "Cell.h" -#include "src/servers/Server_Zone/Actor/Actor.h" -#include "src/servers/Server_Zone/Actor/BattleNpc.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Actor/Actor.h" +#include "Actor/BattleNpc.h" +#include "Forwards.h" #include "Zone.h" diff --git a/src/servers/Server_Zone/Zone/Cell.h b/src/servers/Server_Zone/Zone/Cell.h index 2d85748a..ede57a6f 100644 --- a/src/servers/Server_Zone/Zone/Cell.h +++ b/src/servers/Server_Zone/Zone/Cell.h @@ -4,7 +4,7 @@ #include -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" #include namespace Core { diff --git a/src/servers/Server_Zone/Zone/Zone.cpp b/src/servers/Server_Zone/Zone/Zone.cpp index 2a8f290a..9da356eb 100644 --- a/src/servers/Server_Zone/Zone/Zone.cpp +++ b/src/servers/Server_Zone/Zone/Zone.cpp @@ -1,36 +1,35 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Zone.h" #include "ZoneMgr.h" -#include "src/servers/Server_Zone/Session.h" -#include "src/servers/Server_Zone/Actor/Actor.h" -#include "src/servers/Server_Zone/Actor/Player.h" -#include "src/servers/Server_Zone/Actor/BattleNpc.h" +#include "Session.h" +#include "Actor/Actor.h" +#include "Actor/Player.h" +#include "Actor/BattleNpc.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" -#include "src/servers/Server_Zone/Network/GameConnection.h" -#include "src/servers/Server_Zone/ServerZone.h" -#include "src/servers/Server_Zone/Script/ScriptManager.h" +#include "Network/GameConnection.h" +#include "ServerZone.h" +#include "Script/ScriptManager.h" #include "CellHandler.h" #include -#include - extern Core::Logger g_log; extern Core::ServerZone g_serverZone; extern Core::Data::ExdData g_exdData; @@ -180,16 +179,10 @@ void Zone::loadCellCache() pos.x = posX; pos.y = posY; pos.z = posZ; - Entity::BattleNpcPtr pBNpc( new Entity::BattleNpc( modelId, nameId, - pos, + Entity::BattleNpcPtr pBNpc( new Entity::BattleNpc( modelId, nameId, pos, sizeId, type, level, behaviour, mobType ) ); pBNpc->setRotation( static_cast< float >( rotation ) ); cache.push_back( pBNpc ); - - //pushActor( pBNpc ); - - //m_zonePositionMap[id] = ZonePositionPtr( new ZonePosition( id, targetZoneId, Position( posX, posY, posZ, posO ), radius ) ); - } @@ -290,9 +283,6 @@ void Zone::pushActor( Entity::ActorPtr pActor ) g_log.debug( "[Zone:" + m_zoneCode + "] Adding player [" + std::to_string( pActor->getId() ) + "]" ); auto pPlayer = pActor->getAsPlayer(); - // fire the onEnter Lua event - //LuaManager->onRegionEnter(this, pPlayer); - auto pSession = g_serverZone.getSession( pPlayer->getId() ); if( pSession ) m_sessionSet.insert( pSession ); @@ -343,7 +333,7 @@ void Zone::removeActor( Entity::ActorPtr pActor ) { Entity::ActorPtr pCurAct; - for( auto iter = pActor->m_inRangeActors.begin(); iter != pActor->m_inRangeActors.end();) + for( auto iter = pActor->m_inRangeActors.begin(); iter != pActor->m_inRangeActors.end(); ) { pCurAct = *iter; auto iter2 = iter++; @@ -368,7 +358,7 @@ void Zone::queueOutPacketForRange( Entity::Player& sourcePlayer, uint32_t range, if( ( distance < range ) && sourcePlayer.getId() != ( *it ).second->getId() ) { auto pSession = g_serverZone.getSession( ( *it ).second->getId() ); - pPacketEntry->setValAt( 0x08, ( *it ).second->getId() ); + pPacketEntry->setValAt< uint32_t >( 0x08, ( *it ).second->getId() ); if( pSession ) pSession->getZoneConnection()->queueOutPacket( pPacketEntry ); } diff --git a/src/servers/Server_Zone/Zone/Zone.h b/src/servers/Server_Zone/Zone/Zone.h index 37c0f7d1..fa318535 100644 --- a/src/servers/Server_Zone/Zone/Zone.h +++ b/src/servers/Server_Zone/Zone/Zone.h @@ -2,12 +2,12 @@ #define _ZONE_H #include -#include +#include #include "Cell.h" #include "CellHandler.h" -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" #include #include @@ -15,11 +15,10 @@ #include #include namespace Core { - namespace Entity { -class Actor; -class Player; + class Actor; + class Player; } class Session; @@ -39,8 +38,8 @@ protected: bool m_bPrivate; - std::unordered_map m_playerMap; - std::unordered_map m_BattleNpcMap; + std::unordered_map< int32_t, Entity::PlayerPtr > m_playerMap; + std::unordered_map< int32_t, Entity::BattleNpcPtr > m_BattleNpcMap; std::set< Entity::BattleNpcPtr > m_BattleNpcDeadMap; diff --git a/src/servers/Server_Zone/Zone/ZoneMgr.cpp b/src/servers/Server_Zone/Zone/ZoneMgr.cpp index 541955f3..100422f4 100644 --- a/src/servers/Server_Zone/Zone/ZoneMgr.cpp +++ b/src/servers/Server_Zone/Zone/ZoneMgr.cpp @@ -4,7 +4,6 @@ #include "ZoneMgr.h" #include "Zone.h" - #include "ZonePosition.h" #include @@ -65,51 +64,6 @@ namespace Core { m_zoneMap[info.id] = pZone; } - //do - //{ - // Db::Field *field = pQR->fetch(); - // uint16_t id = field[0].getUInt16(); - // std::string inName = field[1].getString(); - // std::string name = field[2].getString(); - // uint32_t layoutId = field[3].getUInt32(); - // bool isPrivate = field[4].getBool(); - - // if(!isPrivate) - // { - // g_log.Log(LoggingSeverity::info, std::to_string(id) + "\t" + inName + " - " + name); - - // ZonePtr pZone( new Zone( id, layoutId, name, inName, isPrivate ) ); - - // m_zoneMap[id] = pZone; - - // // start the region worker - // // ThreadPool->executeTask(pRegion); - // } - // else - // { - // //Console->outTime(" --> %s", inName.c_str()); - // //Console->outTime("\tCached private instance...", name.c_str()); - - // //// write the instance data into the instance cache for later use - // //InstanceCacheEntry * pICE = new InstanceCacheEntry(); - // //pICE->id = id; - // //pICE->inName = inName; - // //pICE->minX = minX; - // //pICE->maxX = maxX; - // //pICE->minY = minY; - // //pICE->maxY = maxY; - // //pICE->name = name; - // //pICE->layoutId = layoutId; - // //pICE->isPrivate = isPrivate; - - // //m_instanceCache[pICE->id] = pICE; - // //m_instanceCacheName[inName] = pICE; - - // //createInstance(pICE); - // } - - //} while(pQR->nextRow()); - return true; } diff --git a/src/servers/Server_Zone/Zone/ZoneMgr.h b/src/servers/Server_Zone/Zone/ZoneMgr.h index 5092bd33..bab6c23b 100644 --- a/src/servers/Server_Zone/Zone/ZoneMgr.h +++ b/src/servers/Server_Zone/Zone/ZoneMgr.h @@ -4,7 +4,7 @@ #include #include -#include "src/servers/Server_Zone/Forwards.h" +#include "Forwards.h" namespace Core { diff --git a/src/servers/Server_Zone/Zone/ZonePosition.cpp b/src/servers/Server_Zone/Zone/ZonePosition.cpp index a5eb7c08..2e80e6c5 100644 --- a/src/servers/Server_Zone/Zone/ZonePosition.cpp +++ b/src/servers/Server_Zone/Zone/ZonePosition.cpp @@ -7,7 +7,7 @@ Core::ZonePosition::ZonePosition() { } -Core::ZonePosition::ZonePosition( uint32_t id, uint32_t targetZoneId, const Core::Common::FFXIVARR_POSITION3& targetPosition, uint32_t radius, float rotation ) +Core::ZonePosition::ZonePosition( uint32_t id, uint32_t targetZoneId, const Common::FFXIVARR_POSITION3& targetPosition, uint32_t radius, float rotation ) { m_id = id; m_targetZoneId = targetZoneId; diff --git a/src/servers/Server_Zone/Zone/ZonePosition.h b/src/servers/Server_Zone/Zone/ZonePosition.h index 73efeb63..0b4cad7c 100644 --- a/src/servers/Server_Zone/Zone/ZonePosition.h +++ b/src/servers/Server_Zone/Zone/ZonePosition.h @@ -1,7 +1,7 @@ #ifndef _ZONELINE_H #define _ZONELINE_H -#include +#include namespace Core {