mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 22:17:45 +00:00
building finally works 💦 💦 💦
This commit is contained in:
parent
6ff0e7d414
commit
c4e8a82df1
8 changed files with 30 additions and 28 deletions
|
@ -42,7 +42,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common/Version.cp
|
|||
|
||||
##########################################################################
|
||||
# Common include folders
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/external/ChaiScript-6.0.0/include/")
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/sapphire/datReader/")
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/sapphire/mysqlConnector/")
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(Sapphire_Script)
|
||||
|
||||
file(GLOB SCRIPT_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
|
||||
|
||||
file(GLOB_RECURSE SCRIPT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
|
||||
include_directories("../../src/servers/")
|
||||
include_directories("../../src/servers/Server_Zone/")
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/compiledscripts/")
|
||||
|
||||
foreach(_sourcefile "${SCRIPT_FILES}")
|
||||
get_filename_component(_file "${_sourcefile}" NAME_WE)
|
||||
add_library("${_file}" MODULE "${_sourcefile}" "${SCRIPT_INCLUDE_FILES}")
|
||||
|
||||
add_dependencies("${_file}" server_zone)
|
||||
target_link_libraries("${_file}" server_zone)
|
||||
|
||||
set_target_properties("${_file}" PROPERTIES
|
||||
CXX_STANDARD 14
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef SAPPHIRE_SCRIPTOBJECT_H
|
||||
#define SAPPHIRE_SCRIPTOBJECT_H
|
||||
|
||||
#include <Server_Zone/Script/NativeScriptApi.h>
|
||||
#include <Server_Zone/Actor/Actor.h>
|
||||
#include <Server_Zone/Actor/Player.h>
|
||||
#include <Script/NativeScriptApi.h>
|
||||
#include <Forwards.h>
|
||||
#include <Actor/Actor.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
|
||||
#endif //SAPPHIRE_SCRIPTOBJECT_H
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
#include <scripts/native/ScriptObject.h>
|
||||
#include "../ScriptObject.h"
|
||||
|
||||
class StatusEffect50 : StatusEffectScript
|
||||
{
|
||||
public:
|
||||
StatusEffect50() : StatusEffectScript( "StatusEffect50", 50 )
|
||||
{}
|
||||
StatusEffect50() : StatusEffectScript( "StatusEffect50", 50 )
|
||||
{}
|
||||
|
||||
virtual void onTick( Core::Entity::ActorPtr actor )
|
||||
{
|
||||
virtual void onTick( Core::Entity::ActorPtr actor )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EXPORT_STATUSEFFECTSCRIPT( StatusEffect50 )
|
||||
//extern "C" __declspec( dllexport ) __cdecl StatusEffectScript* getStatusEffectScript() { return static_cast< StatusEffectScript* >( new StatusEffect50 ); }
|
||||
|
||||
//EXPORT_STATUSEFFECTSCRIPT( StatusEffect50 )
|
|
@ -46,7 +46,6 @@ set_target_properties(server_zone PROPERTIES
|
|||
CXX_STANDARD 14
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS ON
|
||||
ENABLE_EXPORTS ON
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
#define NATIVE_SCRIPT_API
|
||||
|
||||
#include <string>
|
||||
#include <Server_Zone/Actor/Actor.h>
|
||||
#include <Server_Zone/Actor/Player.h>
|
||||
#include <Server_Zone/StatusEffect/StatusEffect.h>
|
||||
#include <Actor/Actor.h>
|
||||
#include <Actor/Player.h>
|
||||
#include <StatusEffect/StatusEffect.h>
|
||||
|
||||
#define EXPORT_SCRIPTOBJECT( type, base ) \
|
||||
extern "C" __declspec( dllexport ) __cdecl base* get##base() \
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <Server_Common/Logging/Logger.h>
|
||||
#include <Server_Common/Exd/ExdData.h>
|
||||
#include <chaiscript/chaiscript.hpp>
|
||||
|
||||
#include "NativeScript.h"
|
||||
|
||||
|
@ -44,14 +43,13 @@ void Core::Scripting::ScriptManager::loadDir( std::string dirname, std::set<std:
|
|||
boost::filesystem::recursive_directory_iterator iter( targetDir ), eod;
|
||||
|
||||
BOOST_FOREACH( boost::filesystem::path const& i, make_pair( iter, eod ) )
|
||||
{
|
||||
|
||||
if( is_regular_file( i ) && boost::filesystem::extension( i.string() ) == ".chai" ||
|
||||
boost::filesystem::extension( i.string() ) == ".inc" )
|
||||
{
|
||||
chaiFiles.insert( i.string() );
|
||||
}
|
||||
}
|
||||
{
|
||||
if( is_regular_file( i ) && boost::filesystem::extension( i.string() ) == ".chai" ||
|
||||
boost::filesystem::extension( i.string() ) == ".inc" )
|
||||
{
|
||||
chaiFiles.insert( i.string() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace Core
|
|||
int32_t init();
|
||||
void reload();
|
||||
|
||||
const boost::shared_ptr< chaiscript::ChaiScript >& getHandler() const;
|
||||
|
||||
void onPlayerFirstEnterWorld( Entity::Player& player );
|
||||
|
||||
static bool registerBnpcTemplate( std::string templateName, uint32_t bnpcBaseId, uint32_t bnpcNameId, uint32_t modelId, std::string aiName );
|
||||
|
|
Loading…
Add table
Reference in a new issue