mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-08 03:37:45 +00:00
Various cleanups and start of spawn system
This commit is contained in:
parent
4d3988ed12
commit
84e334d9bb
18 changed files with 147 additions and 26 deletions
|
@ -15,7 +15,6 @@ file(GLOB UTILS_SOURCE_FILES
|
||||||
|
|
||||||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||||
|
|
||||||
|
|
||||||
add_library( common ${UTILS_PUBLIC_INCLUDE_FILES} ${UTILS_SOURCE_FILES} )
|
add_library( common ${UTILS_PUBLIC_INCLUDE_FILES} ${UTILS_SOURCE_FILES} )
|
||||||
|
|
||||||
set_target_properties( common PROPERTIES
|
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_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/"
|
||||||
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${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 ${Boost_LIBRARIES} )
|
||||||
target_link_libraries( common PUBLIC xivdat )
|
target_link_libraries( common PUBLIC xivdat )
|
||||||
|
|
||||||
target_link_libraries( common PUBLIC mysqlConnector )
|
target_link_libraries( common PUBLIC mysqlConnector )
|
||||||
if( UNIX )
|
if( UNIX )
|
||||||
|
|
||||||
target_link_libraries( common PUBLIC mysqlclient )
|
target_link_libraries( common PUBLIC mysqlclient )
|
||||||
target_link_libraries( common PUBLIC pthread )
|
target_link_libraries( common PUBLIC pthread )
|
||||||
|
|
||||||
else()
|
else()
|
||||||
target_link_libraries( common PUBLIC libmysql )
|
target_link_libraries( common
|
||||||
|
PUBLIC
|
||||||
|
libmysql )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories( common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/" )
|
target_include_directories( common
|
||||||
target_include_directories( common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/external/")
|
PUBLIC
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/"
|
||||||
|
PRIVATE
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/external/" )
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include "Framework.h"
|
#include "Framework.h"
|
||||||
|
#include "Logging/Logger.h"
|
||||||
#include <Logging/Logger.h>
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
|
|
@ -39,7 +39,7 @@ foreach(_scriptDir ${children})
|
||||||
target_link_libraries( "script_${_name}" sapphire_zone )
|
target_link_libraries( "script_${_name}" sapphire_zone )
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_libraries( "script_${_name}" ${Boost_LIBRARIES})
|
#target_link_libraries( "script_${_name}" ${Boost_LIBRARIES})
|
||||||
set_target_properties( "script_${_name}" PROPERTIES
|
set_target_properties( "script_${_name}" PROPERTIES
|
||||||
CXX_STANDARD 14
|
CXX_STANDARD 14
|
||||||
CXX_STANDARD_REQUIRED ON
|
CXX_STANDARD_REQUIRED ON
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Network {
|
namespace Network {
|
||||||
|
|
||||||
class GameConnection :
|
class GameConnection : public Connection
|
||||||
public Connection
|
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define _ACTION_H_
|
#define _ACTION_H_
|
||||||
|
|
||||||
#include <Common.h>
|
#include <Common.h>
|
||||||
#include "../ForwardsZone.h"
|
#include "ForwardsZone.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Action {
|
namespace Action {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef _ACTIONCAST_H_
|
#ifndef _ACTIONCAST_H_
|
||||||
#define _ACTIONCAST_H_
|
#define _ACTIONCAST_H_
|
||||||
|
|
||||||
#include "../ForwardsZone.h"
|
#include "ForwardsZone.h"
|
||||||
#include "Action.h"
|
#include "Action.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef _ACTIONMOUNT_H_
|
#ifndef _ACTIONMOUNT_H_
|
||||||
#define _ACTIONMOUNT_H_
|
#define _ACTIONMOUNT_H_
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "ForwardsZone.h"
|
||||||
#include "Action.h"
|
#include "Action.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef _ACTIONTELEPORT_H_
|
#ifndef _ACTIONTELEPORT_H_
|
||||||
#define _ACTIONTELEPORT_H_
|
#define _ACTIONTELEPORT_H_
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "ForwardsZone.h"
|
||||||
#include "Action.h"
|
#include "Action.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <Common.h>
|
#include <Common.h>
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "ForwardsZone.h"
|
||||||
#include "Action.h"
|
#include "Action.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
#ifndef _EVENTITEMACTION_H_
|
#ifndef _EVENTITEMACTION_H_
|
||||||
#define _EVENTITEMACTION_H_
|
#define _EVENTITEMACTION_H_
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "ForwardsZone.h"
|
||||||
#include "Action.h"
|
#include "Action.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Action {
|
namespace Action {
|
||||||
|
|
||||||
class EventItemAction :
|
class EventItemAction : public Action
|
||||||
public Action
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
28
src/servers/sapphire_zone/Actor/SpawnGroup.h
Normal file
28
src/servers/sapphire_zone/Actor/SpawnGroup.h
Normal 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
|
51
src/servers/sapphire_zone/Actor/SpawnPoint.cpp
Normal file
51
src/servers/sapphire_zone/Actor/SpawnPoint.cpp
Normal 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;
|
||||||
|
}
|
41
src/servers/sapphire_zone/Actor/SpawnPoint.h
Normal file
41
src/servers/sapphire_zone/Actor/SpawnPoint.h
Normal 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
|
|
@ -39,6 +39,7 @@ target_link_libraries( sapphire_zone PUBLIC common )
|
||||||
|
|
||||||
target_include_directories( sapphire_zone PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" )
|
target_include_directories( sapphire_zone PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||||
|
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
cotire( sapphire_zone )
|
cotire( sapphire_zone )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -18,8 +18,7 @@ struct SceneResult
|
||||||
class EventHandler
|
class EventHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum EventType :
|
enum EventType : uint8_t
|
||||||
uint8_t
|
|
||||||
{
|
{
|
||||||
Talk = 1,
|
Talk = 1,
|
||||||
Emote = 2,
|
Emote = 2,
|
||||||
|
@ -45,8 +44,7 @@ public:
|
||||||
TableGame = 24,
|
TableGame = 24,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EventHandlerType :
|
enum EventHandlerType : uint16_t
|
||||||
uint16_t
|
|
||||||
{
|
{
|
||||||
Quest = 0x0001,
|
Quest = 0x0001,
|
||||||
Warp = 0x0002,
|
Warp = 0x0002,
|
||||||
|
|
|
@ -25,8 +25,7 @@ enum ConnectionType :
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameConnection :
|
class GameConnection : public Connection
|
||||||
public Connection
|
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -9,8 +9,7 @@ namespace Core {
|
||||||
namespace Data {
|
namespace Data {
|
||||||
struct InstanceContent;
|
struct InstanceContent;
|
||||||
}
|
}
|
||||||
class InstanceContent :
|
class InstanceContent : public Event::Director, public Zone
|
||||||
public Event::Director, public Zone
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum InstanceContentState
|
enum InstanceContentState
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "ServerZone.h"
|
#include "ServerZone.h"
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
#include <Framework.h>
|
#include <Framework.h>
|
||||||
#include <Logging/Logger.h>
|
#include <Logging/Logger.h>
|
||||||
#include <Exd/ExdDataGenerated.h>
|
#include <Exd/ExdDataGenerated.h>
|
||||||
|
|
Loading…
Add table
Reference in a new issue