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

Various cleanups and start of spawn system

This commit is contained in:
Mordred 2018-09-24 23:48:42 +02:00
parent 4d3988ed12
commit 84e334d9bb
18 changed files with 147 additions and 26 deletions

View file

@ -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/" )

View file

@ -1,5 +1,4 @@
#include "Framework.h"
#include <Logging/Logger.h>
#include "Logging/Logger.h"
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>

View file

@ -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

View file

@ -17,8 +17,7 @@
namespace Core {
namespace Network {
class GameConnection :
public Connection
class GameConnection : public Connection
{
private:

View file

@ -2,7 +2,7 @@
#define _ACTION_H_
#include <Common.h>
#include "../ForwardsZone.h"
#include "ForwardsZone.h"
namespace Core {
namespace Action {

View file

@ -1,7 +1,7 @@
#ifndef _ACTIONCAST_H_
#define _ACTIONCAST_H_
#include "../ForwardsZone.h"
#include "ForwardsZone.h"
#include "Action.h"
namespace Core {

View file

@ -1,7 +1,7 @@
#ifndef _ACTIONMOUNT_H_
#define _ACTIONMOUNT_H_
#include "Forwards.h"
#include "ForwardsZone.h"
#include "Action.h"
namespace Core {

View file

@ -1,7 +1,7 @@
#ifndef _ACTIONTELEPORT_H_
#define _ACTIONTELEPORT_H_
#include "Forwards.h"
#include "ForwardsZone.h"
#include "Action.h"
namespace Core {

View file

@ -3,7 +3,7 @@
#include <Common.h>
#include "Forwards.h"
#include "ForwardsZone.h"
#include "Action.h"
namespace Core {

View file

@ -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:

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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()

View file

@ -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,

View file

@ -25,8 +25,7 @@ enum ConnectionType :
None
};
class GameConnection :
public Connection
class GameConnection : public Connection
{
private:

View file

@ -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

View file

@ -1,7 +1,6 @@
#include <iostream>
#include "ServerZone.h"
#include <boost/algorithm/string.hpp>
#include <Framework.h>
#include <Logging/Logger.h>
#include <Exd/ExdDataGenerated.h>