From 0476eb8294ccba1383e088194e4ddd3465e4c551 Mon Sep 17 00:00:00 2001 From: Ayase <137056643@qq.com> Date: Sat, 28 Apr 2018 22:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99eluna=E6=A8=A1=E5=9D=97=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 4 ++++ cmake/after_ws_install.cmake | 15 +++++++++++++++ conf/mod_LuaEngine.conf.dist | 25 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 cmake/after_ws_install.cmake create mode 100644 conf/mod_LuaEngine.conf.dist 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"