diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 15ff5104..940e2e2d 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -15,7 +15,6 @@ file(GLOB UTILS_SOURCE_FILES set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) - add_library( common ${UTILS_PUBLIC_INCLUDE_FILES} ${UTILS_SOURCE_FILES} ) set_target_properties( common PROPERTIES @@ -27,16 +26,25 @@ set_target_properties( common PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/" RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/" ) + target_link_libraries( common PUBLIC ${Boost_LIBRARIES} ) target_link_libraries( common PUBLIC xivdat ) target_link_libraries( common PUBLIC mysqlConnector ) if( UNIX ) + target_link_libraries( common PUBLIC mysqlclient ) target_link_libraries( common PUBLIC pthread ) + else() - target_link_libraries( common PUBLIC libmysql ) + target_link_libraries( common + PUBLIC + libmysql ) endif() -target_include_directories( common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/" ) -target_include_directories( common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/external/") +target_include_directories( common + PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}/" + PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/external/" ) + diff --git a/src/common/Framework.cpp b/src/common/Framework.cpp index 9951e8a2..e66463c0 100644 --- a/src/common/Framework.cpp +++ b/src/common/Framework.cpp @@ -1,5 +1,4 @@ #include "Framework.h" - -#include +#include "Logging/Logger.h" #include #include diff --git a/src/servers/Scripts/CMakeLists.txt b/src/servers/Scripts/CMakeLists.txt index 3d03ca0d..4d2f9fa1 100644 --- a/src/servers/Scripts/CMakeLists.txt +++ b/src/servers/Scripts/CMakeLists.txt @@ -39,7 +39,7 @@ foreach(_scriptDir ${children}) target_link_libraries( "script_${_name}" sapphire_zone ) if(MSVC) - target_link_libraries( "script_${_name}" ${Boost_LIBRARIES}) + #target_link_libraries( "script_${_name}" ${Boost_LIBRARIES}) set_target_properties( "script_${_name}" PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON diff --git a/src/servers/sapphire_lobby/GameConnection.h b/src/servers/sapphire_lobby/GameConnection.h index 5090637b..e8a69752 100644 --- a/src/servers/sapphire_lobby/GameConnection.h +++ b/src/servers/sapphire_lobby/GameConnection.h @@ -17,8 +17,7 @@ namespace Core { namespace Network { -class GameConnection : - public Connection +class GameConnection : public Connection { private: diff --git a/src/servers/sapphire_zone/Action/Action.h b/src/servers/sapphire_zone/Action/Action.h index 445d4048..436d3d48 100644 --- a/src/servers/sapphire_zone/Action/Action.h +++ b/src/servers/sapphire_zone/Action/Action.h @@ -2,7 +2,7 @@ #define _ACTION_H_ #include -#include "../ForwardsZone.h" +#include "ForwardsZone.h" namespace Core { namespace Action { diff --git a/src/servers/sapphire_zone/Action/ActionCast.h b/src/servers/sapphire_zone/Action/ActionCast.h index a296a57b..4bb8cb54 100644 --- a/src/servers/sapphire_zone/Action/ActionCast.h +++ b/src/servers/sapphire_zone/Action/ActionCast.h @@ -1,7 +1,7 @@ #ifndef _ACTIONCAST_H_ #define _ACTIONCAST_H_ -#include "../ForwardsZone.h" +#include "ForwardsZone.h" #include "Action.h" namespace Core { diff --git a/src/servers/sapphire_zone/Action/ActionMount.h b/src/servers/sapphire_zone/Action/ActionMount.h index a1a73754..0c08eb61 100644 --- a/src/servers/sapphire_zone/Action/ActionMount.h +++ b/src/servers/sapphire_zone/Action/ActionMount.h @@ -1,7 +1,7 @@ #ifndef _ACTIONMOUNT_H_ #define _ACTIONMOUNT_H_ -#include "Forwards.h" +#include "ForwardsZone.h" #include "Action.h" namespace Core { diff --git a/src/servers/sapphire_zone/Action/ActionTeleport.h b/src/servers/sapphire_zone/Action/ActionTeleport.h index 8fa4e134..7ec04265 100644 --- a/src/servers/sapphire_zone/Action/ActionTeleport.h +++ b/src/servers/sapphire_zone/Action/ActionTeleport.h @@ -1,7 +1,7 @@ #ifndef _ACTIONTELEPORT_H_ #define _ACTIONTELEPORT_H_ -#include "Forwards.h" +#include "ForwardsZone.h" #include "Action.h" namespace Core { diff --git a/src/servers/sapphire_zone/Action/EventAction.h b/src/servers/sapphire_zone/Action/EventAction.h index 62b02c03..f7822d27 100644 --- a/src/servers/sapphire_zone/Action/EventAction.h +++ b/src/servers/sapphire_zone/Action/EventAction.h @@ -3,7 +3,7 @@ #include -#include "Forwards.h" +#include "ForwardsZone.h" #include "Action.h" namespace Core { diff --git a/src/servers/sapphire_zone/Action/EventItemAction.h b/src/servers/sapphire_zone/Action/EventItemAction.h index dbaf9cf3..faf01ac3 100644 --- a/src/servers/sapphire_zone/Action/EventItemAction.h +++ b/src/servers/sapphire_zone/Action/EventItemAction.h @@ -1,14 +1,13 @@ #ifndef _EVENTITEMACTION_H_ #define _EVENTITEMACTION_H_ -#include "Forwards.h" +#include "ForwardsZone.h" #include "Action.h" namespace Core { namespace Action { -class EventItemAction : - public Action +class EventItemAction : public Action { public: diff --git a/src/servers/sapphire_zone/Actor/SpawnGroup.h b/src/servers/sapphire_zone/Actor/SpawnGroup.h new file mode 100644 index 00000000..decfdf9f --- /dev/null +++ b/src/servers/sapphire_zone/Actor/SpawnGroup.h @@ -0,0 +1,28 @@ +#ifndef SAPPHIRE_SPAWNGROUP_H +#define SAPPHIRE_SPAWNGROUP_H + +#include "ForwardsZone.h" + +namespace Core { +namespace Entity { + +class SpawnGroup +{ +private: + BNpcTemplatePtr m_bNpcTemplate; + + uint32_t m_level; + uint32_t m_spawnCount; + + std::vector< SpawnPointPtr > m_spawnPoints; + +public: + SpawnGroup(); + +}; + +} +} + + +#endif //SAPPHIRE_SPAWNGROUP_H diff --git a/src/servers/sapphire_zone/Actor/SpawnPoint.cpp b/src/servers/sapphire_zone/Actor/SpawnPoint.cpp new file mode 100644 index 00000000..1a349474 --- /dev/null +++ b/src/servers/sapphire_zone/Actor/SpawnPoint.cpp @@ -0,0 +1,51 @@ +#include "SpawnPoint.h" +#include "BNpc.h" + +Core::Entity::SpawnPoint::SpawnPoint() +{ + +} + +Core::Entity::SpawnPoint::SpawnPoint( float x, float y, float z, float rot, uint32_t gimmickId ) : + m_posX( x ), + m_posY( y ), + m_posZ( z ), + m_rotation( rot ), + m_gimmickId( gimmickId ) +{ +} + +float Core::Entity::SpawnPoint::getPosX() const +{ + return m_posX; +} + +float Core::Entity::SpawnPoint::getPosY() const +{ + return m_posY; +} + +float Core::Entity::SpawnPoint::getPosZ() const +{ + return m_posZ; +} + +float Core::Entity::SpawnPoint::getRotation() const +{ + return m_rotation; +} + +uint32_t Core::Entity::SpawnPoint::getGimmickId() const +{ + return m_gimmickId; +} + +Core::Entity::BNpcPtr Core::Entity::SpawnPoint::getLinkedBNpc() +{ + return m_pLinkedBnpc; +} + +void Core::Entity::SpawnPoint::setLinkedBNpc( BNpcPtr pBnpc ) +{ + m_pLinkedBnpc = pBnpc; +} \ No newline at end of file diff --git a/src/servers/sapphire_zone/Actor/SpawnPoint.h b/src/servers/sapphire_zone/Actor/SpawnPoint.h new file mode 100644 index 00000000..baf619c0 --- /dev/null +++ b/src/servers/sapphire_zone/Actor/SpawnPoint.h @@ -0,0 +1,41 @@ +#ifndef SAPPHIRE_SPAWNPOINT_H +#define SAPPHIRE_SPAWNPOINT_H + +#include "ForwardsZone.h" + +namespace Core { +namespace Entity { + +class SpawnPoint +{ +private: + float m_posX; + float m_posY; + float m_posZ; + float m_rotation; + uint32_t m_gimmickId; + + uint32_t m_lastSpawn; + BNpcPtr m_pLinkedBnpc; + +public: + SpawnPoint(); + SpawnPoint( float x, float y, float z, float rot, uint32_t gimmickId ); + + float getPosX() const; + float getPosY() const; + float getPosZ() const; + float getRotation() const; + + uint32_t getGimmickId() const; + + BNpcPtr getLinkedBNpc(); + void setLinkedBNpc( BNpcPtr pBnpc ); + +}; + +} +} + + +#endif //SAPPHIRE_SPAWNPOINT_H diff --git a/src/servers/sapphire_zone/CMakeLists.txt b/src/servers/sapphire_zone/CMakeLists.txt index 248715dc..292ffcc3 100644 --- a/src/servers/sapphire_zone/CMakeLists.txt +++ b/src/servers/sapphire_zone/CMakeLists.txt @@ -39,6 +39,7 @@ target_link_libraries( sapphire_zone PUBLIC common ) target_include_directories( sapphire_zone PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" ) + if (UNIX) cotire( sapphire_zone ) endif() diff --git a/src/servers/sapphire_zone/Event/EventHandler.h b/src/servers/sapphire_zone/Event/EventHandler.h index 9fa1303e..219142e3 100644 --- a/src/servers/sapphire_zone/Event/EventHandler.h +++ b/src/servers/sapphire_zone/Event/EventHandler.h @@ -18,8 +18,7 @@ struct SceneResult class EventHandler { public: - enum EventType : - uint8_t + enum EventType : uint8_t { Talk = 1, Emote = 2, @@ -45,8 +44,7 @@ public: TableGame = 24, }; - enum EventHandlerType : - uint16_t + enum EventHandlerType : uint16_t { Quest = 0x0001, Warp = 0x0002, diff --git a/src/servers/sapphire_zone/Network/GameConnection.h b/src/servers/sapphire_zone/Network/GameConnection.h index 75658b5c..e493ee96 100644 --- a/src/servers/sapphire_zone/Network/GameConnection.h +++ b/src/servers/sapphire_zone/Network/GameConnection.h @@ -25,8 +25,7 @@ enum ConnectionType : None }; -class GameConnection : - public Connection +class GameConnection : public Connection { private: diff --git a/src/servers/sapphire_zone/Zone/InstanceContent.h b/src/servers/sapphire_zone/Zone/InstanceContent.h index 7d4bc945..eb97e553 100644 --- a/src/servers/sapphire_zone/Zone/InstanceContent.h +++ b/src/servers/sapphire_zone/Zone/InstanceContent.h @@ -9,8 +9,7 @@ namespace Core { namespace Data { struct InstanceContent; } -class InstanceContent : - public Event::Director, public Zone +class InstanceContent : public Event::Director, public Zone { public: enum InstanceContentState diff --git a/src/servers/sapphire_zone/mainGameServer.cpp b/src/servers/sapphire_zone/mainGameServer.cpp index 7daed207..5637307f 100644 --- a/src/servers/sapphire_zone/mainGameServer.cpp +++ b/src/servers/sapphire_zone/mainGameServer.cpp @@ -1,7 +1,6 @@ #include #include "ServerZone.h" -#include #include #include #include