mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-29 23:47:02 +00:00
fix: server failing from localization changes + abrupt wine crash on exit
This commit is contained in:
parent
7d05b6a9d6
commit
190f9eff2c
|
|
@ -13,12 +13,24 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|||
message(FATAL_ERROR "Use a 64-bit generator/toolchain (x64).")
|
||||
endif()
|
||||
|
||||
set(LCE_XWIN_CROSS_DEBUG_COMPAT OFF)
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(LCE_XWIN_CROSS_DEBUG_COMPAT ON)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES
|
||||
"Debug"
|
||||
"Release"
|
||||
CACHE STRING "" FORCE
|
||||
)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
|
||||
else()
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(configure_compiler_target target)
|
||||
# MSVC and compatible compilers (like Clang-cl)
|
||||
|
|
@ -31,9 +43,13 @@ function(configure_compiler_target target)
|
|||
$<$<COMPILE_LANGUAGE:C,CXX>:/GS>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/EHsc>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/GR>
|
||||
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:/Z7>
|
||||
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:/Od>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/O2 /Oi /GT /GF>
|
||||
)
|
||||
target_link_options(${target} PRIVATE
|
||||
$<$<CONFIG:Debug>:/DEBUG:FULL /INCREMENTAL:NO>
|
||||
)
|
||||
endif()
|
||||
|
||||
# MSVC
|
||||
|
|
@ -65,7 +81,9 @@ endfunction()
|
|||
set(MINECRAFT_SHARED_DEFINES
|
||||
_LARGE_WORLDS
|
||||
_DEBUG_MENUS_ENABLED
|
||||
$<$<CONFIG:Debug>:_DEBUG>
|
||||
$<$<AND:$<CONFIG:Debug>,$<NOT:$<BOOL:${LCE_XWIN_CROSS_DEBUG_COMPAT}>>>:_DEBUG>
|
||||
$<$<AND:$<CONFIG:Debug>,$<BOOL:${LCE_XWIN_CROSS_DEBUG_COMPAT}>>:_ITERATOR_DEBUG_LEVEL=0>
|
||||
$<$<AND:$<CONFIG:Debug>,$<BOOL:${LCE_XWIN_CROSS_DEBUG_COMPAT}>>:_HAS_ITERATOR_DEBUGGING=0>
|
||||
_CRT_NON_CONFORMING_SWPRINTFS
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
_HAS_STD_BYTE=0
|
||||
|
|
|
|||
|
|
@ -70,30 +70,50 @@ set_source_files_properties(compat_shims.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS
|
|||
|
||||
configure_compiler_target(Minecraft.Client)
|
||||
|
||||
set(MINECRAFT_CLIENT_USE_4J_DEBUG_LIBS TRUE)
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(MINECRAFT_CLIENT_USE_4J_DEBUG_LIBS FALSE)
|
||||
endif()
|
||||
|
||||
set_target_properties(Minecraft.Client PROPERTIES
|
||||
OUTPUT_NAME "Minecraft.Client"
|
||||
VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:Minecraft.Client>"
|
||||
)
|
||||
|
||||
target_link_libraries(Minecraft.Client PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
dxgi
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>: # Debug 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
|
||||
if(MINECRAFT_CLIENT_USE_4J_DEBUG_LIBS)
|
||||
target_link_libraries(Minecraft.Client PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
dxgi
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>:
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>:
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
else()
|
||||
target_link_libraries(Minecraft.Client PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
dxgi
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
)
|
||||
endif()
|
||||
|
||||
# Iggy libs
|
||||
foreach(lib IN LISTS IGGY_LIBS)
|
||||
|
|
|
|||
|
|
@ -133,11 +133,11 @@ do_install() {
|
|||
[[ -e "$BUILD_DIR/Minecraft.Client/$asset" ]] && \
|
||||
cp -r "$BUILD_DIR/Minecraft.Client/$asset" "$INSTALL_DIR/client/" || true
|
||||
done
|
||||
for asset in iggy_w64.dll Common Windows64; do
|
||||
[[ -e "$BUILD_DIR/Minecraft.Server/$asset" ]] && \
|
||||
cp -r "$BUILD_DIR/Minecraft.Server/$asset" "$INSTALL_DIR/server/" || true
|
||||
for asset in iggy_w64.dll Common Windows64 Windows64Media; do
|
||||
[[ -e "$BUILD_DIR/Minecraft.Server/$BUILD_TYPE/$asset" ]] && \
|
||||
cp -r "$BUILD_DIR/Minecraft.Server/$BUILD_TYPE/$asset" "$INSTALL_DIR/server/" || true
|
||||
done
|
||||
for asset in iggy_w64.dll Common Windows64 plugins runtime; do
|
||||
for asset in iggy_w64.dll Common Windows64 Windows64Media plugins runtime; do
|
||||
[[ -e "$BUILD_DIR/Minecraft.Server.FourKit/$BUILD_TYPE/$asset" ]] && \
|
||||
cp -r "$BUILD_DIR/Minecraft.Server.FourKit/$BUILD_TYPE/$asset" "$INSTALL_DIR/fourkit/" || true
|
||||
done
|
||||
|
|
@ -186,7 +186,8 @@ SERVER_BIND_IP="\${MC_BIND:-0.0.0.0}"
|
|||
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/minecraft-lce-server}"
|
||||
export WINEARCH=win64
|
||||
export WINEPREFIX="\${WINEPREFIX:-\$HOME/.local/share/minecraft-lce-server-prefix}"
|
||||
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
|
||||
export WINEDLLOVERRIDES="winemenubuilder.exe=d;winedbg.exe=d"
|
||||
export WINEDEBUG="-all"
|
||||
export WINEESYNC=1
|
||||
export WINEFSYNC=1
|
||||
mkdir -p "\$PERSIST_DIR" "\$WINEPREFIX"
|
||||
|
|
@ -211,7 +212,8 @@ if [[ -z "\${DISPLAY:-}" ]]; then
|
|||
trap 'kill \$XVFB_PID 2>/dev/null || true; rm -rf "\$WORK_DIR"' EXIT
|
||||
sleep 1
|
||||
fi
|
||||
exec wine "\$WORK_DIR/Minecraft.Server.exe" -port "\$SERVER_PORT" -bind "\$SERVER_BIND_IP" "\$@"
|
||||
exec wine "\$WORK_DIR/Minecraft.Server.exe" -port "\$SERVER_PORT" -bind "\$SERVER_BIND_IP" "\$@" \
|
||||
2> >(grep --line-buffered -vE '^(wine:|[0-9A-Fa-f]{4}:(fixme|err|warn|trace):|Unhandled exception:|Backtrace:|Modules:|Threads:|Registers:|Stack dump:)' >&2)
|
||||
LAUNCHER
|
||||
chmod +x "$INSTALL_DIR/minecraft-lce-server"
|
||||
}
|
||||
|
|
@ -227,7 +229,8 @@ SERVER_BIND_IP="\${MC_BIND:-0.0.0.0}"
|
|||
PERSIST_DIR="\${MC_DATA_DIR:-\$HOME/.local/share/minecraft-lce-fourkit}"
|
||||
export WINEARCH=win64
|
||||
export WINEPREFIX="\${WINEPREFIX:-\$HOME/.local/share/minecraft-lce-fourkit-prefix}"
|
||||
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
|
||||
export WINEDLLOVERRIDES="winemenubuilder.exe=d;winedbg.exe=d"
|
||||
export WINEDEBUG="-all"
|
||||
export WINEESYNC=1
|
||||
export WINEFSYNC=1
|
||||
mkdir -p "\$PERSIST_DIR" "\$WINEPREFIX"
|
||||
|
|
@ -250,7 +253,8 @@ if [[ -z "\${DISPLAY:-}" ]]; then
|
|||
trap 'kill \$XVFB_PID 2>/dev/null || true; rm -rf "\$WORK_DIR"' EXIT
|
||||
sleep 1
|
||||
fi
|
||||
exec wine "\$WORK_DIR/Minecraft.Server.exe" -port "\$SERVER_PORT" -bind "\$SERVER_BIND_IP" "\$@"
|
||||
exec wine "\$WORK_DIR/Minecraft.Server.exe" -port "\$SERVER_PORT" -bind "\$SERVER_BIND_IP" "\$@" \
|
||||
2> >(grep --line-buffered -vE '^(wine:|[0-9A-Fa-f]{4}:(fixme|err|warn|trace):|Unhandled exception:|Backtrace:|Modules:|Threads:|Registers:|Stack dump:)' >&2)
|
||||
LAUNCHER
|
||||
chmod +x "$INSTALL_DIR/minecraft-lce-fourkit"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ function(configure_lce_server_target target)
|
|||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/Common/Media/MediaWindows64" "Common/Media/MediaWindows64"
|
||||
)
|
||||
|
||||
set(_use_debug_4j_libs TRUE)
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(_use_debug_4j_libs FALSE)
|
||||
endif()
|
||||
|
||||
target_include_directories(${target} PRIVATE
|
||||
"${CMAKE_BINARY_DIR}/generated/" # Generated BuildVer.h
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/"
|
||||
|
|
@ -70,25 +75,40 @@ function(configure_lce_server_target target)
|
|||
VS_DEBUGGER_COMMAND_ARGUMENTS "-port 25565 -bind 0.0.0.0 -name DedicatedServer"
|
||||
)
|
||||
|
||||
target_link_libraries(${target} PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
dxgi
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>:
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>:
|
||||
if(_use_debug_4j_libs)
|
||||
target_link_libraries(${target} PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
dxgi
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>:
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>:
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
dxgi
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(lib IN LISTS IGGY_LIBS)
|
||||
target_link_libraries(${target} PRIVATE "${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/Iggy/lib/${lib}")
|
||||
|
|
@ -99,6 +119,20 @@ function(configure_lce_server_target target)
|
|||
# server flavour has its own set in the VS Solution Explorer.
|
||||
setup_asset_folder_copy(${target} "${_asset_folder_pairs}")
|
||||
setup_asset_file_copy(${target} "${_asset_files_pairs}")
|
||||
|
||||
if(PLATFORM_NAME STREQUAL "Windows64")
|
||||
add_custom_target(AssetLocalizationCopy_${target} ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DCOPY_SOURCE=${CMAKE_SOURCE_DIR}/Minecraft.Client/Windows64Media/loc"
|
||||
"-DCOPY_DEST=$<TARGET_FILE_DIR:${target}>/Windows64Media/loc"
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/CopyFolderScript.cmake"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_dependencies(${target} AssetLocalizationCopy_${target})
|
||||
set_property(TARGET AssetLocalizationCopy_${target} PROPERTY FOLDER "Build")
|
||||
endif()
|
||||
|
||||
add_copyredist_target(${target})
|
||||
if(PLATFORM_NAME STREQUAL "Windows64")
|
||||
add_gamehdd_target(${target})
|
||||
|
|
|
|||
Loading…
Reference in a new issue