mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Merge branch 'develop' into instancescripting
This commit is contained in:
commit
5b08bca9d8
6 changed files with 99 additions and 11 deletions
|
@ -739,7 +739,7 @@ void defaultGet( shared_ptr<HttpServer::Response> response, shared_ptr<HttpServe
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
g_log.setLogPath( "log\\SapphireAPI" );
|
g_log.setLogPath( "log/SapphireAPI" );
|
||||||
g_log.init();
|
g_log.init();
|
||||||
|
|
||||||
g_log.info( "===========================================================" );
|
g_log.info( "===========================================================" );
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Core {
|
||||||
|
|
||||||
void ServerLobby::run( int32_t argc, char* argv[] )
|
void ServerLobby::run( int32_t argc, char* argv[] )
|
||||||
{
|
{
|
||||||
g_log.setLogPath( "log\\SapphireLobby" );
|
g_log.setLogPath( "log/SapphireLobby" );
|
||||||
g_log.init();
|
g_log.init();
|
||||||
|
|
||||||
g_log.info( "===========================================================" );
|
g_log.info( "===========================================================" );
|
||||||
|
|
7
src/servers/sapphire_zone/Actor/GameObject.cpp
Normal file
7
src/servers/sapphire_zone/Actor/GameObject.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include "GameObject.h"
|
||||||
|
|
||||||
|
Core::Entity::GameObject::GameObject( ObjKind type ) :
|
||||||
|
m_objKind( type )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
78
src/servers/sapphire_zone/Actor/GameObject.h
Normal file
78
src/servers/sapphire_zone/Actor/GameObject.h
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
#ifndef _GAME_OBJECT_H_
|
||||||
|
#define _GAME_OBJECT_H_
|
||||||
|
|
||||||
|
#include <common/Common.h>
|
||||||
|
#include <boost/enable_shared_from_this.hpp>
|
||||||
|
|
||||||
|
#include "Forwards.h"
|
||||||
|
#include <set>
|
||||||
|
#include <map>
|
||||||
|
#include <queue>
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
namespace Entity {
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class GameObject
|
||||||
|
\brief Base class for all actor/objects
|
||||||
|
|
||||||
|
*/
|
||||||
|
class GameObject : public boost::enable_shared_from_this< GameObject >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum ObjKind : uint8_t
|
||||||
|
{
|
||||||
|
None = 0x00,
|
||||||
|
Player = 0x01,
|
||||||
|
BattleNpc = 0x02,
|
||||||
|
EventNpc = 0x03,
|
||||||
|
Treasure = 0x04,
|
||||||
|
Aetheryte = 0x05,
|
||||||
|
GatheringPoint = 0x06,
|
||||||
|
EventObj = 0x07,
|
||||||
|
Mount = 0x08,
|
||||||
|
Companion = 0x09,
|
||||||
|
Retainer = 0x0A,
|
||||||
|
Area = 0x0B,
|
||||||
|
Housing = 0x0C,
|
||||||
|
Cutscene = 0x0D,
|
||||||
|
CardStand = 0x0E,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/*! Position of the object */
|
||||||
|
Common::FFXIVARR_POSITION3 m_pos;
|
||||||
|
/*! Rotation of the object */
|
||||||
|
float m_rot;
|
||||||
|
/*! Id of the actor */
|
||||||
|
uint32_t m_id;
|
||||||
|
/*! Type of the actor */
|
||||||
|
ObjKind m_objKind;
|
||||||
|
|
||||||
|
public:
|
||||||
|
GameObject( ObjKind type );
|
||||||
|
virtual ~GameObject() {};
|
||||||
|
|
||||||
|
uint32_t getId() const;
|
||||||
|
|
||||||
|
ObjKind getObjKind() const;
|
||||||
|
|
||||||
|
Common::FFXIVARR_POSITION3& getPos();
|
||||||
|
void setPos( const Common::FFXIVARR_POSITION3& pos );
|
||||||
|
void setPos( float x, float y, float z );
|
||||||
|
|
||||||
|
float getRot() const;
|
||||||
|
void setRot( float rot );
|
||||||
|
|
||||||
|
bool isPlayer() const;
|
||||||
|
bool isBNpc() const;
|
||||||
|
bool isENpc() const;
|
||||||
|
|
||||||
|
PlayerPtr getAsPlayer();
|
||||||
|
BattleNpcPtr getAsBNpc();
|
||||||
|
EventNpcPtr getAsENpc();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -21,7 +21,8 @@ foreach(_scriptDir ${children})
|
||||||
if(IS_DIRECTORY ${_scriptDir} AND NOT ${_name} MATCHES "CMakeFiles")
|
if(IS_DIRECTORY ${_scriptDir} AND NOT ${_name} MATCHES "CMakeFiles")
|
||||||
message("discovered plugin lib: ${_scriptDir} (${_name})")
|
message("discovered plugin lib: ${_scriptDir} (${_name})")
|
||||||
|
|
||||||
file(GLOB_RECURSE SCRIPT_FILES "${_scriptDir}/*.cpp")
|
file(GLOB_RECURSE SCRIPT_BUILD_FILES "${_scriptDir}/*.cpp")
|
||||||
|
file(GLOB_RECURSE SCRIPT_FILES RELATIVE "${_scriptDir}" "${_name}/*.cpp")
|
||||||
|
|
||||||
# build file list
|
# build file list
|
||||||
foreach(_script ${SCRIPT_FILES})
|
foreach(_script ${SCRIPT_FILES})
|
||||||
|
@ -38,8 +39,8 @@ foreach(_scriptDir ${children})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_library("script_${_name}" MODULE "${SCRIPT_FILES}" "${SCRIPT_INCLUDE_FILES}" "${_scriptDir}/ScriptLoader.cpp")
|
add_library("script_${_name}" MODULE "${SCRIPT_BUILD_FILES}" "${SCRIPT_INCLUDE_FILES}" "${_scriptDir}/ScriptLoader.cpp")
|
||||||
target_link_libraries("script_${_name}" sapphire_zone ${Boost_LIBRARIES})
|
target_link_libraries("script_${_name}" sapphire_zone)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set_target_properties("script_${_name}" PROPERTIES
|
set_target_properties("script_${_name}" PROPERTIES
|
||||||
|
@ -55,11 +56,13 @@ foreach(_scriptDir ${children})
|
||||||
|
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in" "${_scriptDir}/ScriptLoader.cpp")
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in" "${_scriptDir}/ScriptLoader.cpp")
|
||||||
|
|
||||||
add_custom_command(TARGET "script_${_name}" POST_BUILD
|
if(MSVC)
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.exp"
|
add_custom_command(TARGET "script_${_name}" POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.lib"
|
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.exp"
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.ilk"
|
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.lib"
|
||||||
)
|
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.ilk"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
unset(ScriptIncludes)
|
unset(ScriptIncludes)
|
||||||
unset(ScriptNames)
|
unset(ScriptNames)
|
||||||
|
|
|
@ -193,7 +193,7 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
|
||||||
void Core::ServerZone::run( int32_t argc, char* argv[] )
|
void Core::ServerZone::run( int32_t argc, char* argv[] )
|
||||||
{
|
{
|
||||||
// TODO: add more error checks for the entire initialisation
|
// TODO: add more error checks for the entire initialisation
|
||||||
g_log.setLogPath( "log\\SapphireZone_" );
|
g_log.setLogPath( "log/SapphireZone_" );
|
||||||
g_log.init();
|
g_log.init();
|
||||||
|
|
||||||
printBanner();
|
printBanner();
|
||||||
|
|
Loading…
Add table
Reference in a new issue