diff --git a/CMakeLists.txt b/CMakeLists.txt index db2bff1..04f922d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ if( ELUNA ) + CU_SET_PATH("CMAKE_MOD_ELUNA_ENGINE_DIR" "${CMAKE_CURRENT_LIST_DIR}") add_subdirectory(lualib) add_subdirectory(LuaEngine) + + CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/cmake/after_ws_install.cmake") + install(FILES "${CMAKE_MOD_ELUNA_ENGINE_DIR}/conf/mod_LuaEngine.conf.dist" DESTINATION ${CONF_DIR}) endif() diff --git a/cmake/after_ws_install.cmake b/cmake/after_ws_install.cmake new file mode 100644 index 0000000..06387bd --- /dev/null +++ b/cmake/after_ws_install.cmake @@ -0,0 +1,15 @@ +if( WIN32 ) + if ( MSVC ) + add_custom_command(TARGET worldserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_ELUNA_ENGINE_DIR}/conf/mod_LuaEngine.conf.dist" ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ + ) + elseif ( MINGW ) + add_custom_command(TARGET worldserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_ELUNA_ENGINE_DIR}/conf/mod_LuaEngine.conf.dist" ${CMAKE_BINARY_DIR}/bin/ + ) + endif() +endif() + +install(FILES "${CMAKE_MOD_ELUNA_ENGINE_DIR}/conf/mod_LuaEngine.conf.dist" DESTINATION ${CONF_DIR}) \ No newline at end of file diff --git a/conf/mod_LuaEngine.conf.dist b/conf/mod_LuaEngine.conf.dist new file mode 100644 index 0000000..d3490f0 --- /dev/null +++ b/conf/mod_LuaEngine.conf.dist @@ -0,0 +1,25 @@ +[worldserver] + +################################################################################################### +# ELUNA SETTINGS +# +# Eluna.Enabled +# Description: Enable or disable Eluna LuaEngine +# Default: true - (enabled) +# false - (disabled) +# +# Eluna.TraceBack +# Description: Sets whether to use debug.traceback function on a lua error or not. +# Notice that you can redefine the function. +# Default: false - (use default error output) +# true - (use debug.traceback function) +# +# Eluna.ScriptPath +# Description: Sets the location of the script folder to load scripts from +# The path can be relative or absolute. +# Default: "lua_scripts" +# + +Eluna.Enabled = true +Eluna.TraceBack = false +Eluna.ScriptPath = "lua_scripts"