mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
A new server (dUgcServer, started by master with enable_ugc_server=1) that takes unprocessed ugc and ugc_modular_build rows from the database and makes what the client downloads with UGCUSE3DSERVICES: an optimized NIF (hidden faces removed, ambient occlusion baked into vertex colors) and a 128px DDS icon for player models, rendered by a software rasterizer from the client's LDD brick primitives, and icons for cars and rockets assembled from their modules per ModularBuildComponent/ModuleComponent. It serves them, with the models' LXFML, over HTTP in the client's UGCC<dc>/3DOPTIMIZED and IMAGE128DDS layout with .gz and .checksum files, and keeps its folder under a size cap. Processing state lives in ugc.is_optimized plus new processed_at, process_attempts and process_error columns (and the same on ugc_modular_build). ServiceType::UGC is appended. NifFile moves to dCommon and records named node transforms for the modules' attach points. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.5 KiB
CMake
41 lines
1.5 KiB
CMake
# The pure part of the UGC server (brick data, meshes, rendering, file formats, storage), shared with the tests
|
|
set(DUGC_SOURCES
|
|
"UgcBricks.cpp"
|
|
"UgcFormats.cpp"
|
|
"UgcJobs.cpp"
|
|
"UgcModel.cpp"
|
|
"UgcModular.cpp"
|
|
"UgcRender.cpp"
|
|
"UgcStorage.cpp"
|
|
)
|
|
|
|
add_library(dUgc STATIC ${DUGC_SOURCES})
|
|
target_include_directories(dUgc PUBLIC "." "${PROJECT_SOURCE_DIR}/thirdparty/MD5")
|
|
target_link_libraries(dUgc PUBLIC dCommon glm::glm tinyxml2 MD5)
|
|
|
|
add_executable(UgcServer "UgcServer.cpp" "UgcProcessor.cpp" "UgcCdClient.cpp")
|
|
|
|
target_include_directories(UgcServer PRIVATE
|
|
"${PROJECT_SOURCE_DIR}/dCommon"
|
|
"${PROJECT_SOURCE_DIR}/dCommon/dClient"
|
|
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables"
|
|
"${PROJECT_SOURCE_DIR}/dNet"
|
|
"${PROJECT_SOURCE_DIR}/dWeb"
|
|
"${PROJECT_SOURCE_DIR}/dServer"
|
|
"${PROJECT_SOURCE_DIR}/thirdparty"
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/nlohmann"
|
|
)
|
|
|
|
target_compile_definitions(UgcServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"")
|
|
target_link_libraries(UgcServer ${COMMON_LIBRARIES} dWeb dServer dUgc)
|
|
|
|
# Rendering is far too slow unoptimized (minutes a model instead of seconds), so it is optimized in every build type
|
|
if(NOT MSVC)
|
|
set_source_files_properties("UgcRender.cpp" "UgcModel.cpp" PROPERTIES COMPILE_OPTIONS "-O2")
|
|
endif()
|