diff --git a/.gitmodules b/.gitmodules index 15911c0..09ab9b4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,16 +1,24 @@ -[submodule "vendor/modules/wxl-modern-assets"] - path = vendor/modules/wxl-modern-assets - url = https://github.com/WarcraftXL/wxl-modern-assets.git - branch = main -[submodule "vendor/modules/wxl-modern-render"] - path = vendor/modules/wxl-modern-render - url = https://github.com/WarcraftXL/wxl-modern-render.git - branch = main [submodule "vendor/modules/wxl-unit-outline"] path = vendor/modules/wxl-unit-outline url = https://github.com/WarcraftXL/wxl-unit-outline.git - branch = main + branch = v1.1 [submodule "vendor/modules/wxl-modern-adt"] path = vendor/modules/wxl-modern-adt url = https://github.com/WarcraftXL/wxl-modern-adt.git branch = main +[submodule "vendor/warcraftxl"] + path = vendor/warcraftxl + url = https://github.com/WarcraftXL/wxl-core.git + branch = v1.1 +[submodule "vendor/modules/wxl-db2"] + path = vendor/modules/wxl-db2 + url = https://github.com/WarcraftXL/wxl-db2.git +[submodule "vendor/modules/wxl-modern-m2"] + path = vendor/modules/wxl-modern-m2 + url = https://github.com/WarcraftXL/wxl-modern-m2.git +[submodule "vendor/modules/wxl-modern-wmo"] + path = vendor/modules/wxl-modern-wmo + url = https://github.com/WarcraftXL/wxl-modern-wmo.git +[submodule "vendor/modules/wxl-grasswind"] + path = vendor/modules/wxl-grasswind + url = https://github.com/WarcraftXL/wxl-grasswind.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 66927ee..9db3ea6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,67 +1,77 @@ cmake_minimum_required(VERSION 3.20) project(MoonWellWarcraftXL LANGUAGES CXX) -# WarcraftXL remains an upstream submodule. MoonWell modules are attached to -# its aggregate DLL target here, so updating the framework does not mix our -# client-specific offsets and policy into the upstream checkout. +# WarcraftXL is an untouched upstream v1.1 submodule. Every project-specific +# feature below is built as a separately loaded Extensions//.dll. add_subdirectory(vendor/warcraftxl) +set(WXL_CORE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/warcraftxl") set(WXL_EXTERNAL_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/modules") +set(WXL_LOCAL_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules") -function(wxl_collect_sources output) - file(GLOB_RECURSE collected CONFIGURE_DEPENDS ${ARGN}) - set(${output} "${collected}" PARENT_SCOPE) +function(wxl_add_external_extension extension_name extension_dir) + if(NOT CMAKE_SIZEOF_VOID_P EQUAL 4) + return() + endif() + + file(GLOB_RECURSE extension_sources CONFIGURE_DEPENDS "${extension_dir}/src/*.cpp") + if(NOT extension_sources) + message(FATAL_ERROR "WarcraftXL extension '${extension_name}' has no sources in ${extension_dir}/src") + endif() + + set(extension_shared_sources "") + if(extension_name STREQUAL "wxl-modern-m2") + file(GLOB_RECURSE extension_shared_sources CONFIGURE_DEPENDS + "${WXL_CORE_DIR}/src/engine/assets/shared/models/m2/*.cpp") + elseif(extension_name STREQUAL "wxl-modern-blp") + file(GLOB_RECURSE extension_shared_sources CONFIGURE_DEPENDS + "${WXL_CORE_DIR}/src/engine/assets/shared/textures/blp/*.cpp") + endif() + + file(GLOB wxl_sdk_sources CONFIGURE_DEPENDS "${WXL_CORE_DIR}/src/game/*.cpp") + add_library(${extension_name} SHARED + ${extension_sources} + ${extension_shared_sources} + ${wxl_sdk_sources}) + set_target_properties(${extension_name} PROPERTIES + OUTPUT_NAME "${extension_name}" + PREFIX "") + target_include_directories(${extension_name} PRIVATE + "${extension_dir}/src" + "${WXL_CORE_DIR}/include" + "${WXL_CORE_DIR}/src") + target_compile_features(${extension_name} PRIVATE cxx_std_20) + target_compile_definitions(${extension_name} PRIVATE + WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS WXL_EXTENSION) + + if(CLIENT_PATH) + add_custom_command(TARGET ${extension_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory + "${CLIENT_PATH}/Extensions/${extension_name}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" + "${CLIENT_PATH}/Extensions/${extension_name}/${extension_name}.dll" + COMMENT "Deploy ${extension_name}.dll -> Extensions/${extension_name}") + endif() endfunction() -if(TARGET WarcraftXL) - wxl_collect_sources(WXL_MODERN_ASSETS_RUNTIME - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-assets/src/*.cpp" - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-assets/shared/*.cpp") - if(WXL_MODERN_ASSETS_EXCLUDE_REGEX) - list(FILTER WXL_MODERN_ASSETS_RUNTIME EXCLUDE REGEX - "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") - endif() - wxl_collect_sources(WXL_MODERN_RENDER_RUNTIME - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-render/src/*.cpp") - wxl_collect_sources(WXL_UNIT_OUTLINE_RUNTIME - "${WXL_EXTERNAL_MODULES_DIR}/wxl-unit-outline/src/*.cpp") - wxl_collect_sources(WXL_MODERN_ADT_RUNTIME - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-adt/src/*.cpp" - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-adt/shared/*.cpp") +# Official WarcraftXL 1.1 extensions. +wxl_add_external_extension(wxl-db2 "${WXL_EXTERNAL_MODULES_DIR}/wxl-db2") +wxl_add_external_extension(wxl-modern-adt "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-adt") +wxl_add_external_extension(wxl-modern-blp "${WXL_LOCAL_MODULES_DIR}/wxl-modern-blp") +wxl_add_external_extension(wxl-modern-m2 "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-m2") +wxl_add_external_extension(wxl-modern-wmo "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-wmo") +wxl_add_external_extension(wxl-grasswind "${WXL_EXTERNAL_MODULES_DIR}/wxl-grasswind") +wxl_add_external_extension(wxl-unit-outline "${WXL_EXTERNAL_MODULES_DIR}/wxl-unit-outline") - target_sources(WarcraftXL PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}/modules/moonwell/src/MoonWell.cpp" - ${WXL_MODERN_ASSETS_RUNTIME} - ${WXL_MODERN_RENDER_RUNTIME} - ${WXL_UNIT_OUTLINE_RUNTIME} - ${WXL_MODERN_ADT_RUNTIME}) +# MoonWell-owned extensions. wxl-fdid-moonwell sorts after wxl-db2 and before +# the modern asset extensions, so it can layer custom CSV mappings over wxl.fdid. +wxl_add_external_extension(MoonWell "${WXL_LOCAL_MODULES_DIR}/moonwell") +wxl_add_external_extension(wxl-fdid-moonwell "${WXL_LOCAL_MODULES_DIR}/moonwell-fdid") +wxl_add_external_extension(wxl-moonwell-storage-fallback + "${WXL_LOCAL_MODULES_DIR}/moonwell-storage-fallback") - # wxl-modern-render needs its module-root includes and D3D12 import library. - include("${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-render/module.cmake") -endif() - -if(TARGET WarcraftXLHost) - wxl_collect_sources(WXL_MOONWELL_HOST - "${CMAKE_CURRENT_SOURCE_DIR}/modules/moonwell/host/*.cpp") - wxl_collect_sources(WXL_MODERN_ASSETS_HOST - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-assets/host/*.cpp" - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-assets/shared/*.cpp") - if(WXL_MODERN_ASSETS_EXCLUDE_REGEX) - list(FILTER WXL_MODERN_ASSETS_HOST EXCLUDE REGEX - "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") - endif() - wxl_collect_sources(WXL_MODERN_ADT_HOST - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-adt/host/*.cpp" - "${WXL_EXTERNAL_MODULES_DIR}/wxl-modern-adt/shared/*.cpp") - - target_sources(WarcraftXLHost PRIVATE - ${WXL_MOONWELL_HOST} - ${WXL_MODERN_ASSETS_HOST} - ${WXL_MODERN_ADT_HOST}) -endif() - -# Minimal native-D3D9 proxy retained as a recovery renderer. The regular -# package uses WarcraftXL's D3D9On12 proxy required by wxl-modern-render. +# Recovery loader retained for existing -NativeRenderer workflows. WarcraftXL +# 1.1 already ships a native D3D9 forwarding proxy as its standard renderer. if(CMAKE_SIZEOF_VOID_P EQUAL 4) add_library(MoonWellLoader SHARED "${CMAKE_CURRENT_SOURCE_DIR}/loader/d3d9.cpp" diff --git a/README.md b/README.md index 3055a40..62ce41d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Исходники клиентских изменений MoonWell для World of Warcraft 3.3.5a (build 12340). -Клиент переведён на [WarcraftXL](https://github.com/WarcraftXL): `Wow.exe` больше не содержит +Клиент переведён на [WarcraftXL](https://github.com/WarcraftXL/wxl-core) **1.1.220**: `Wow.exe` больше не содержит MoonWell-патчей. Неподписанный оригинальный executable загружается как обычно, локальный `d3d9.dll` proxy подхватывает `WarcraftXL.dll`, а модуль MoonWell применяет проверенные изменения только к памяти запущенного процесса. @@ -14,25 +14,25 @@ MoonWell-патчей. Неподписанный оригинальный execu - одиннадцатое значение `GetCharacterInfo` — `charFlags`, включая флаг предателя `0x40000000`; - загрузка WarcraftXL без import-table patch и без отдельного injector. -Large Address Aware намеренно не включён: Windows читает этот PE-флаг до загрузки DLL, поэтому -сохранить его и одновременно оставить файл байт-в-байт оригинальным невозможно. Это означает -стандартный 2-ГБ лимит адресного пространства для 32-битного клиента. +При установке сборщик включает Large Address Aware в копии `Wow.exe`; исходный +`Wow_Original.exe` остаётся неизменным и используется как проверенный шаблон. ## Структура ```text -modules/moonwell/ MoonWell runtime-модуль WarcraftXL +modules/ отдельные MoonWell extensions для WarcraftXL 1.1 vendor/warcraftxl/ закреплённый upstream git submodule vendor/modules/ закреплённые модули WarcraftXL src/Data/ исходники MPQ-патчей tool/ сборщик MPQ -build-warcraftxl.ps1 сборка Win32 runtime/proxy и x64 asset host +build-warcraftxl.ps1 сборка Win32 runtime, proxy и extensions run.ps1 полная сборка, установка и запуск клиента Wow_Original.exe локальный оригинал build 12340 (не хранится в Git) ``` -Подключены модули `wxl-modern-assets`, `wxl-modern-render`, `wxl-unit-outline` и -`wxl-modern-adt`. Их точные ревизии вместе с ревизией ядра закреплены git submodule. +Подключены совместимые с 1.1 extensions: `wxl-db2`, `wxl-modern-adt`, `wxl-modern-m2`, +`wxl-modern-wmo`, `wxl-grasswind` и `wxl-unit-outline`. BLP-адаптер и MoonWell-изменения +собираются как отдельные DLL; исходники upstream core не изменяются. Для обновления всех зависимостей WarcraftXL: ```powershell @@ -44,7 +44,7 @@ git submodule update --remote vendor/warcraftxl vendor/modules/* ## Требования -- Visual Studio 2022 с C++ toolchain для Win32 и x64; +- Visual Studio 2022 с C++ toolchain для Win32; - CMake 3.20+; - Rust/Cargo для существующего MPQ-сборщика; - локальный оригинальный `Wow_Original.exe` с SHA-256 @@ -64,7 +64,7 @@ git submodule update --init --recursive .\deploy.ps1 ``` -Скрипт инициализирует зависимости, собирает MPQ-патчи, Win32 runtime, D3D9 proxy и x64 Host, +Скрипт инициализирует зависимости, собирает MPQ-патчи, Win32 runtime, native D3D9 proxy и extensions, обновляет `dist`, устанавливает комплект в клиент и формирует `manifest.json`. Путь берётся из `WOW_HOME`/`.env`, а при их отсутствии используется `C:\Program Files (x86)\World of Warcraft`. @@ -77,8 +77,6 @@ git submodule update --init --recursive # Быстро обновить только WarcraftXL без пересборки MPQ .\deploy.ps1 -SkipDataBuild -# Аварийный native D3D9 вместо D3D9On12 -.\deploy.ps1 -NativeRenderer ``` Без установки в клиент: @@ -99,18 +97,8 @@ git submodule update --init --recursive 1. проверяет хеш `Wow_Original.exe`; 2. сохраняет прежний модифицированный клиент как `Wow.moonwell-patched.backup.exe`; 3. восстанавливает оригинальный `Wow.exe`; -4. устанавливает `WarcraftXL.dll`, D3D9On12 proxy и `Utils\WarcraftXLHost.exe`; -5. монтирует шейдеры modern ADT как loose patch `Data\Patch-WXL.MPQ`; -6. при `-PackagePath` кладёт полный runtime-комплект в `dist` для launcher/S3. - -Основной proxy использует D3D9On12, необходимый `wxl-modern-render`. Эффекты постобработки в самом -модуле по умолчанию выключены. Для диагностики или несовместимой видеосистемы можно собрать и -установить native-переходник без modern-render: - -```powershell -.\build-warcraftxl.ps1 -Configuration Release -NativeRenderer ` - -ClientPath 'C:\Program Files (x86)\World of Warcraft' -Deploy -``` +4. устанавливает `WarcraftXL.dll`, native D3D9 proxy и DLL в `Extensions\`; +5. при `-PackagePath` кладёт полный runtime-комплект в `dist` для launcher/S3. Резервная DLL всегда также сохраняется как `Utils\d3d9-native.dll`. @@ -121,8 +109,7 @@ $env:WOW_HOME = 'C:\Program Files (x86)\World of Warcraft' .\run.ps1 ``` -Диагностика запуска находится в `Logs\wxl-core.log`, `Logs\d3d9proxy.log` и -`Utils\WarcraftXLHost.log` внутри клиента. +Диагностика запуска находится в `Logs\wxl-core.log` и `Logs\d3d9proxy.log` внутри клиента. ## MPQ-пакеты @@ -138,6 +125,6 @@ WarcraftXL не требуется и в объектное хранилище ## Лицензирование -WarcraftXL распространяется по GPL-3.0 и подключён как отдельный upstream submodule. MoonWell-модуль, -скомпонованный в `WarcraftXL.dll`, должен распространяться с соблюдением GPL-3.0 и доступным -соответствующим исходным кодом. Репозиторий не должен публиковать Blizzard assets или `Wow.exe`. +WarcraftXL распространяется по GPL-3.0 и подключён как отдельный неизменённый upstream submodule. +MoonWell extensions распространяются с доступным соответствующим исходным кодом. Репозиторий не +должен публиковать Blizzard assets или `Wow.exe`. diff --git a/build-warcraftxl.ps1 b/build-warcraftxl.ps1 index ef9172b..d47e2c7 100644 --- a/build-warcraftxl.ps1 +++ b/build-warcraftxl.ps1 @@ -88,7 +88,6 @@ if (-not (Test-Path -LiteralPath $cmake)) { if ($LASTEXITCODE -ne 0) { throw 'Failed to initialize WarcraftXL submodules.' } $win32BuildDir = Join-Path $repoRoot 'build\warcraftxl-win32' -$hostBuildDir = Join-Path $repoRoot 'build\warcraftxl-host-x64' $stockExe = Join-Path $repoRoot 'Wow_Original.exe' if ($Deploy -or -not [string]::IsNullOrWhiteSpace($PackagePath)) { @@ -104,22 +103,29 @@ if ($Deploy -or -not [string]::IsNullOrWhiteSpace($PackagePath)) { & $cmake -S $repoRoot -B $win32BuildDir -A Win32 '-DCLIENT_PATH=' if ($LASTEXITCODE -ne 0) { throw 'WarcraftXL Win32 configure failed.' } -& $cmake --build $win32BuildDir --config $Configuration --target WarcraftXL d3d9 MoonWellLoader +& $cmake --build $win32BuildDir --config $Configuration --parallel 4 if ($LASTEXITCODE -ne 0) { throw 'WarcraftXL Win32 build failed.' } -& $cmake -S $repoRoot -B $hostBuildDir -A x64 '-DWXL_BUILD_HOST=ON' '-DCLIENT_PATH=' -if ($LASTEXITCODE -ne 0) { throw 'WarcraftXL Host configure failed.' } -& $cmake --build $hostBuildDir --config $Configuration --target WarcraftXLHost -if ($LASTEXITCODE -ne 0) { throw 'WarcraftXL Host build failed.' } - $win32ArtifactDir = Join-Path $win32BuildDir "vendor\warcraftxl\$Configuration" -$hostArtifactDir = Join-Path $hostBuildDir "vendor\warcraftxl\$Configuration" $warcraftXL = Join-Path $win32ArtifactDir 'WarcraftXL.dll' -$modernProxy = Join-Path $win32ArtifactDir 'd3d9.dll' -$nativeProxy = Join-Path $win32BuildDir "artifacts\$Configuration\d3d9-native.dll" -$hostExe = Join-Path $hostArtifactDir 'WarcraftXLHost.exe' -$selectedProxy = if ($NativeRenderer) { $nativeProxy } else { $modernProxy } -$adtResources = Join-Path $repoRoot 'vendor\modules\wxl-modern-adt\_resources' +$selectedProxy = Join-Path $win32ArtifactDir 'd3d9.dll' +$recoveryProxy = Join-Path $win32BuildDir "artifacts\$Configuration\d3d9-native.dll" +$extensionNames = @( + 'MoonWell', + 'wxl-db2', + 'wxl-fdid-moonwell', + 'wxl-grasswind', + 'wxl-modern-adt', + 'wxl-modern-blp', + 'wxl-modern-m2', + 'wxl-modern-wmo', + 'wxl-moonwell-storage-fallback', + 'wxl-unit-outline' +) + +if ($NativeRenderer) { + Write-Warning '-NativeRenderer is no longer needed: WarcraftXL 1.1 uses native D3D9 by default.' +} function Install-WarcraftXLArtifacts { param( @@ -128,14 +134,18 @@ function Install-WarcraftXLArtifacts { ) $utils = Join-Path $Destination 'Utils' - $loosePatch = Join-Path $Destination 'Data\Patch-WXL.MPQ' - New-Item ` -ItemType Directory ` - -Path $Destination, $utils, $loosePatch ` + -Path $Destination, $utils ` -Force | Out-Null + $legacyHost = Join-Path $utils 'WarcraftXLHost.exe' + if (Test-Path -LiteralPath $legacyHost -PathType Leaf) { + Remove-Item -LiteralPath $legacyHost -Force + Write-Host "Removed obsolete WarcraftXL 1.0 host: $legacyHost" + } + $destinationExe = Join-Path $Destination 'Wow.exe' Copy-Item ` @@ -156,20 +166,17 @@ function Install-WarcraftXLArtifacts { -Force Copy-Item ` - -LiteralPath $nativeProxy ` + -LiteralPath $recoveryProxy ` -Destination (Join-Path $utils 'd3d9-native.dll') ` -Force - Copy-Item ` - -LiteralPath $hostExe ` - -Destination (Join-Path $utils 'WarcraftXLHost.exe') ` - -Force - - Get-ChildItem -LiteralPath $adtResources | ForEach-Object { + foreach ($extensionName in $extensionNames) { + $extensionSource = Join-Path $win32BuildDir "$Configuration\$extensionName.dll" + $extensionDestination = Join-Path $Destination "Extensions\$extensionName" + New-Item -ItemType Directory -Path $extensionDestination -Force | Out-Null Copy-Item ` - -LiteralPath $_.FullName ` - -Destination $loosePatch ` - -Recurse ` + -LiteralPath $extensionSource ` + -Destination (Join-Path $extensionDestination "$extensionName.dll") ` -Force } } @@ -196,7 +203,7 @@ if ($Deploy) { } Install-WarcraftXLArtifacts -Destination $ClientPath - Write-Host "Installed WarcraftXL runtime, host and modules in $ClientPath" + Write-Host "Installed WarcraftXL 1.1 runtime and extensions in $ClientPath" } if (-not [string]::IsNullOrWhiteSpace($PackagePath)) { @@ -205,5 +212,4 @@ if (-not [string]::IsNullOrWhiteSpace($PackagePath)) { Write-Host "Packaged stock Wow.exe and WarcraftXL artifacts in $PackagePath" } -$renderer = if ($NativeRenderer) { 'native D3D9 recovery proxy' } else { 'WarcraftXL D3D9On12 proxy' } -Write-Host "WarcraftXL build complete ($renderer): $win32ArtifactDir" +Write-Host "WarcraftXL 1.1 build complete (native D3D9 proxy): $win32ArtifactDir" diff --git a/deploy.ps1 b/deploy.ps1 index 151d756..c98b7bc 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -58,9 +58,6 @@ if ($runningClients.Count) { Write-Host 'Stopping the running WoW client...' $runningClients | Stop-Process -Force Start-Sleep -Seconds 2 - Get-Process WarcraftXLHost -ErrorAction SilentlyContinue | Where-Object { - $_.Path -and $_.Path.StartsWith($ClientPath, [System.StringComparison]::OrdinalIgnoreCase) - } | Stop-Process -Force } $env:WOW_HOME = $ClientPath @@ -120,12 +117,12 @@ if (-not $SkipManifest) { } $wowHash = (Get-FileHash -LiteralPath (Join-Path $ClientPath 'Wow.exe') -Algorithm SHA256).Hash -$renderer = if ($NativeRenderer) { 'native D3D9 recovery proxy' } else { 'WarcraftXL D3D9On12' } +$renderer = 'WarcraftXL 1.1 native D3D9 proxy' Write-Host '' Write-Host 'Deployment complete.' Write-Host " Renderer: $renderer" Write-Host " Wow.exe SHA-256: $wowHash" -Write-Host " Host: $(Join-Path $ClientPath 'Utils\WarcraftXLHost.exe')" +Write-Host " Extensions: $(Join-Path $ClientPath 'Extensions')" if ($Launch) { Write-Host 'Launching Wow.exe...' diff --git a/loader/d3d9.cpp b/loader/d3d9.cpp index f29a1aa..58337d5 100644 --- a/loader/d3d9.cpp +++ b/loader/d3d9.cpp @@ -50,9 +50,8 @@ extern "C" HRESULT WINAPI Direct3DCreate9Ex(UINT sdkVersion, IDirect3D9Ex** outp return E_NOINTERFACE; } -// Compatibility exports referenced by the current WarcraftXL core. MoonWell -// does not enable its D3D9On12 backend, so these intentionally report no D3D12 -// device and a neutral supersampling factor. +// Legacy compatibility exports retained for the recovery proxy. WarcraftXL 1.1 +// uses native D3D9 and ignores the former D3D9On12 bridge. extern "C" void* WxlD3D12Device() { return nullptr; } extern "C" void* WxlD3D12Queue() { return nullptr; } extern "C" void WxlD3D12DrainDebug() {} diff --git a/modules/moonwell-fdid/src/FdidOverlay.cpp b/modules/moonwell-fdid/src/FdidOverlay.cpp new file mode 100644 index 0000000..cd658a9 --- /dev/null +++ b/modules/moonwell-fdid/src/FdidOverlay.cpp @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// FileDataID overlay for selected retail assets shipped in MoonWell patches. + +#include "game/Io.hpp" +#include "wxl/FdidApi.h" +#include "wxl/PluginApi.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace moonwell::fdid +{ + namespace + { + constexpr std::string_view kFileDataMap = "WXLFileData.csv"; + + std::once_flag g_loadOnce; + std::unordered_map g_paths; + const WXL_Api* g_api = nullptr; + const char*(__cdecl* g_resolveTexture)(uint32_t) = nullptr; + const char*(__cdecl* g_resolveModel)(uint32_t) = nullptr; + + bool ReadAll(const char* path, std::vector& out) + { + void* handle = nullptr; + if (!wxl::game::io::FileOpen(path, wxl::game::io::kOpenWholeFile, &handle) || !handle) + return false; + uint32_t high = 0; + const uint32_t size = wxl::game::io::FileSize(handle, &high); + if (high != 0) + { + wxl::game::io::FileClose(handle); + return false; + } + out.resize(size); + uint32_t read = 0; + const bool ok = (size == 0 || wxl::game::io::FileRead(handle, out.data(), size, &read)) + && read == size; + wxl::game::io::FileClose(handle); + if (!ok) out.clear(); + return ok; + } + + std::string_view Trim(std::string_view value) + { + while (!value.empty() && (value.front() == ' ' || value.front() == '\t' || + value.front() == '\r' || value.front() == '\n')) + value.remove_prefix(1); + while (!value.empty() && (value.back() == ' ' || value.back() == '\t' || + value.back() == '\r' || value.back() == '\n')) + value.remove_suffix(1); + return value; + } + + void Load() + { + std::vector bytes; + if (!ReadAll(kFileDataMap.data(), bytes)) + { + if (g_api && g_api->Log) + g_api->Log(WXL_LOG_WARN, "MoonWellFdid", "FileDataID map '%s' was not found", + kFileDataMap.data()); + return; + } + + const std::string_view text(reinterpret_cast(bytes.data()), bytes.size()); + size_t lineStart = 0; + while (lineStart < text.size()) + { + size_t lineEnd = text.find('\n', lineStart); + if (lineEnd == std::string_view::npos) lineEnd = text.size(); + std::string_view line = Trim(text.substr(lineStart, lineEnd - lineStart)); + lineStart = lineEnd + 1; + + if (line.empty() || line.front() == '#') continue; + const size_t comma = line.find(','); + if (comma == std::string_view::npos) continue; + + const std::string_view idText = Trim(line.substr(0, comma)); + std::string_view pathText = Trim(line.substr(comma + 1)); + uint32_t fileDataId = 0; + const auto parsed = std::from_chars(idText.data(), idText.data() + idText.size(), fileDataId); + if (parsed.ec != std::errc{} || parsed.ptr != idText.data() + idText.size() || + fileDataId == 0 || pathText.empty()) + continue; + + std::string path(pathText); + for (char& c : path) if (c == '/') c = '\\'; + g_paths[fileDataId] = std::move(path); + } + + if (g_api && g_api->Log) + g_api->Log(WXL_LOG_INFO, "MoonWellFdid", "loaded %zu custom FileDataID path(s)", + g_paths.size()); + } + + const char* ResolveCustom(uint32_t fileDataId) + { + std::call_once(g_loadOnce, &Load); + const auto found = g_paths.find(fileDataId); + return found == g_paths.end() ? nullptr : found->second.c_str(); + } + + const char* __cdecl ResolveTexture(uint32_t fileDataId) + { + if (const char* custom = ResolveCustom(fileDataId)) return custom; + return g_resolveTexture ? g_resolveTexture(fileDataId) : nullptr; + } + + const char* __cdecl ResolveModel(uint32_t fileDataId) + { + if (const char* custom = ResolveCustom(fileDataId)) return custom; + return g_resolveModel ? g_resolveModel(fileDataId) : nullptr; + } + + bool PatchResolver(WXL_FdidApi* fdid) + { + if (!fdid || fdid->apiVersion != WXL_FDID_API_VERSION) return false; + g_resolveTexture = fdid->ResolveTexture; + g_resolveModel = fdid->ResolveModel; + + DWORD oldProtection = 0; + if (!VirtualProtect(fdid, sizeof(*fdid), PAGE_READWRITE, &oldProtection)) return false; + fdid->ResolveTexture = &ResolveTexture; + fdid->ResolveModel = &ResolveModel; + DWORD ignored = 0; + VirtualProtect(fdid, sizeof(*fdid), oldProtection, &ignored); + return true; + } + } +} + +const WXL_PluginInfo* __cdecl WXL_Query(void) +{ + static const WXL_PluginInfo info = { + sizeof(WXL_PluginInfo), WXL_API_VERSION, "MoonWellFdid", 1, WXL_CLIENT_BUILD, + }; + return &info; +} + +int __cdecl WXL_Load(const WXL_Api* api) +{ + if (!api || api->apiVersion != WXL_API_VERSION) return 0; + moonwell::fdid::g_api = api; + auto* fdid = static_cast(api->GetInterface("wxl.fdid", WXL_FDID_API_VERSION)); + if (!moonwell::fdid::PatchResolver(fdid)) + { + api->Log(WXL_LOG_ERROR, "MoonWellFdid", "wxl.fdid v1 is unavailable"); + return 0; + } + api->Log(WXL_LOG_INFO, "MoonWellFdid", "custom FileDataID overlay installed"); + return 1; +} diff --git a/modules/moonwell-storage-fallback/src/StorageFallback.cpp b/modules/moonwell-storage-fallback/src/StorageFallback.cpp new file mode 100644 index 0000000..46733f0 --- /dev/null +++ b/modules/moonwell-storage-fallback/src/StorageFallback.cpp @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// MoonWell's specific-archive fallback, kept outside the WarcraftXL core. + +#include "wxl/PluginApi.h" + +#include +#include + +namespace +{ + const WXL_Api* g_api = nullptr; + using FileOpenFn = int(__stdcall*)(void* archive, const char* name, uint32_t flags, void** out); + FileOpenFn g_nextOpen = nullptr; + std::atomic g_logCount{0}; + + int __stdcall FileOpenHook(void* archive, const char* name, uint32_t flags, void** out) + { + if (!g_nextOpen) return 0; + + const int nativeResult = g_nextOpen(archive, name, flags, out); + if (nativeResult || archive == nullptr || !name || !*name) return nativeResult; + + // A dependency requested through one concrete MPQ may live in a higher-priority loose + // Patch-*.MPQ directory. Retry only after that exact archive misses, using the client's + // normal global search path. This is the MoonWell-only behavior that used to patch core. + if (out) *out = nullptr; + const int fallbackResult = g_nextOpen(nullptr, name, flags, out); + if (fallbackResult && g_api && g_api->Log) + { + const uint32_t index = g_logCount.fetch_add(1, std::memory_order_relaxed); + if (index < 32) + g_api->Log(WXL_LOG_INFO, "MoonWellStorageFallback", + "specific archive miss resolved globally: '%s'", name); + } + return fallbackResult; + } +} + +const WXL_PluginInfo* __cdecl WXL_Query(void) +{ + static const WXL_PluginInfo info = { + sizeof(WXL_PluginInfo), WXL_API_VERSION, "MoonWellStorageFallback", 1, + WXL_CLIENT_BUILD, + }; + return &info; +} + +int __cdecl WXL_Load(const WXL_Api* api) +{ + if (!api || api->apiVersion != WXL_API_VERSION || !api->HookAttachByName) return 0; + g_api = api; + const int installed = api->HookAttachByName( + "Io.FileOpen", reinterpret_cast(&FileOpenHook), + reinterpret_cast(&g_nextOpen), WXL_HOOK_DEFAULT_PRIORITY); + api->Log(installed ? WXL_LOG_INFO : WXL_LOG_ERROR, "MoonWellStorageFallback", "%s", + installed ? "specific-archive fallback installed" : "Io.FileOpen hook failed"); + return installed; +} diff --git a/modules/moonwell/host/FileDataResolver.cpp b/modules/moonwell/host/FileDataResolver.cpp deleted file mode 100644 index 96d43e8..0000000 --- a/modules/moonwell/host/FileDataResolver.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// FileDataID resolver for selected retail assets shipped in MoonWell patches. - -#include "Host.hpp" -#include "core/Logger.hpp" -#include "mpq/MpqStore.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace moonwell::host -{ - namespace - { - constexpr std::string_view kFileDataMap = "WXLFileData.csv"; - - std::once_flag g_loadOnce; - std::unordered_map g_paths; - - std::string_view Trim(std::string_view value) - { - while (!value.empty() && (value.front() == ' ' || value.front() == '\t' || - value.front() == '\r' || value.front() == '\n')) - value.remove_prefix(1); - while (!value.empty() && (value.back() == ' ' || value.back() == '\t' || - value.back() == '\r' || value.back() == '\n')) - value.remove_suffix(1); - return value; - } - - void Load() - { - const std::string root = wxl::host::ClientRoot(); - wxl::host::mpq::MpqStore store; - std::vector bytes; - if (root.empty() || !store.Mount(root) || !store.ReadAll(kFileDataMap, bytes)) - { - WLOG_WARN("moonwell: FileDataID map '%.*s' was not found", - int(kFileDataMap.size()), kFileDataMap.data()); - return; - } - - const std::string_view text(reinterpret_cast(bytes.data()), bytes.size()); - size_t lineStart = 0; - while (lineStart < text.size()) - { - size_t lineEnd = text.find('\n', lineStart); - if (lineEnd == std::string_view::npos) lineEnd = text.size(); - std::string_view line = Trim(text.substr(lineStart, lineEnd - lineStart)); - lineStart = lineEnd + 1; - - if (line.empty() || line.front() == '#') continue; - const size_t comma = line.find(','); - if (comma == std::string_view::npos) continue; - - const std::string_view idText = Trim(line.substr(0, comma)); - std::string_view pathText = Trim(line.substr(comma + 1)); - uint32_t fileDataId = 0; - const auto parsed = std::from_chars(idText.data(), idText.data() + idText.size(), fileDataId); - if (parsed.ec != std::errc{} || parsed.ptr != idText.data() + idText.size() || - fileDataId == 0 || pathText.empty()) - continue; - - std::string path(pathText); - for (char& c : path) if (c == '/') c = '\\'; - g_paths[fileDataId] = std::move(path); - } - - WLOG_INFO("moonwell: loaded %zu FileDataID path(s) from %.*s", - g_paths.size(), int(kFileDataMap.size()), kFileDataMap.data()); - } - - bool Resolve(uint32_t fileDataId, std::string& outPath) - { - std::call_once(g_loadOnce, &Load); - const auto found = g_paths.find(fileDataId); - if (found == g_paths.end()) return false; - outPath = found->second; - return true; - } - - struct Registrar - { - Registrar() { wxl::host::RegisterResolver("moonwell-filedata", &Resolve); } - }; - - Registrar g_registrar; - } -} diff --git a/modules/moonwell/src/MoonWell.cpp b/modules/moonwell/src/MoonWell.cpp index 1f63f0d..1abbcaa 100644 --- a/modules/moonwell/src/MoonWell.cpp +++ b/modules/moonwell/src/MoonWell.cpp @@ -5,28 +5,71 @@ // changes are verified and applied to the process image during WarcraftXL's // boot phase, before GlueXML is loaded. -#include "core/Logger.hpp" -#include "core/Hook.hpp" -#include "core/Mem.hpp" -#include "runtime/LuaBindings.hpp" -#include "runtime/ModuleInstall.hpp" -#include "offsets/engine/Gx.hpp" +#include "game/Script.hpp" +#include "wxl/PluginApi.h" +#include "SpellOverrides.hpp" #include #include #include #include +#include #include +#include namespace moonwell { namespace { + const WXL_Api* g_api = nullptr; + + void Log(int level, const char* format, ...) + { + if (!g_api || !g_api->Log) return; + char message[1024]{}; + va_list args; + va_start(args, format); + vsnprintf_s(message, sizeof(message), _TRUNCATE, format, args); + va_end(args); + g_api->Log(level, "MoonWell", "%s", message); + } + +#define WLOG_INFO(...) Log(WXL_LOG_INFO, __VA_ARGS__) +#define WLOG_ERROR(...) Log(WXL_LOG_ERROR, __VA_ARGS__) + + bool PatchMemory(void* destination, const void* source, size_t size) + { + DWORD oldProtection = 0; + if (!VirtualProtect(destination, size, PAGE_EXECUTE_READWRITE, &oldProtection)) + return false; + std::memcpy(destination, source, size); + FlushInstructionCache(GetCurrentProcess(), destination, size); + DWORD ignored = 0; + VirtualProtect(destination, size, oldProtection, &ignored); + return true; + } + + template + bool Hook(const char* name, uintptr_t address, Fn* detour, Fn** original) + { + return g_api && g_api->HookAttach && g_api->HookAttach( + name, address, reinterpret_cast(detour), + reinterpret_cast(original), WXL_HOOK_DEFAULT_PRIORITY) != 0; + } + + template + bool HookByName(const char* point, Fn* detour, Fn** original) + { + return g_api && g_api->HookAttachByName && g_api->HookAttachByName( + point, reinterpret_cast(detour), reinterpret_cast(original), + WXL_HOOK_DEFAULT_PRIORITY) != 0; + } + constexpr uint32_t kTraitorFlag = 0x40000000u; bool g_loginCharacterIsTraitor = false; - using GxSetProjectionFn = wxl::offsets::engine::gx::GxSetProjectionFn; + using GxSetProjectionFn = void(__fastcall*)(void* self, void* edx, const void* projection); GxSetProjectionFn g_nextSetProjection = nullptr; // FrameXML's stock SetCreature only accepts a creature entry and waits @@ -64,10 +107,10 @@ namespace moonwell int __cdecl SetCreatureDisplayInfoHook(void* state) { const int result = g_nextSetCreature ? g_nextSetCreature(state) : 0; - if (!state || !wxl::runtime::lua::IsNumber(state, 3)) + if (!state || !wxl::game::script::IsNumber(state, 3)) return result; - const double requestedDisplayInfo = wxl::runtime::lua::ToNumber(state, 3); + const double requestedDisplayInfo = wxl::game::script::ToNumber(state, 3); if (requestedDisplayInfo <= 0.0 || requestedDisplayInfo > 4294967295.0) return result; @@ -102,8 +145,8 @@ namespace moonwell void InstallEncounterJournalModelPreview() { - if (!wxl::core::hook::Install("MoonWellSetCreatureDisplayInfo", kSetCreature, - &SetCreatureDisplayInfoHook, &g_nextSetCreature)) + if (!Hook("MoonWellSetCreatureDisplayInfo", kSetCreature, + &SetCreatureDisplayInfoHook, &g_nextSetCreature)) { WLOG_ERROR("moonwell: encounter journal model hook installation failed"); return; @@ -151,14 +194,14 @@ namespace moonwell int __cdecl SetCharacterCreateCamera(void* state) { - const bool enabled = state && wxl::runtime::lua::IsNumber(state, 1) - && wxl::runtime::lua::ToNumber(state, 1) != 0.0; - const float faceZoom = state && wxl::runtime::lua::IsNumber(state, 2) - ? static_cast(wxl::runtime::lua::ToNumber(state, 2)) : 2.0f; - const float faceVerticalOffset = state && wxl::runtime::lua::IsNumber(state, 3) - ? static_cast(wxl::runtime::lua::ToNumber(state, 3)) : -0.65f; - double requestedDuration = state && wxl::runtime::lua::IsNumber(state, 4) - ? wxl::runtime::lua::ToNumber(state, 4) : 500.0; + const bool enabled = state && wxl::game::script::IsNumber(state, 1) + && wxl::game::script::ToNumber(state, 1) != 0.0; + const float faceZoom = state && wxl::game::script::IsNumber(state, 2) + ? static_cast(wxl::game::script::ToNumber(state, 2)) : 2.0f; + const float faceVerticalOffset = state && wxl::game::script::IsNumber(state, 3) + ? static_cast(wxl::game::script::ToNumber(state, 3)) : -0.65f; + double requestedDuration = state && wxl::game::script::IsNumber(state, 4) + ? wxl::game::script::ToNumber(state, 4) : 500.0; if (requestedDuration < 0.0) requestedDuration = 0.0; if (requestedDuration > 2000.0) requestedDuration = 2000.0; @@ -202,15 +245,16 @@ namespace moonwell void InstallCharacterCreateCamera() { - namespace gx = wxl::offsets::engine::gx; - void** vtable = reinterpret_cast(gx::kGxDeviceVTable); - void** slot = &vtable[gx::kGxSetProjectionSlot]; + constexpr uintptr_t kGxDeviceVTable = 0x00A2E718; + constexpr unsigned kGxSetProjectionSlot = 0xA0 / 4; + void** vtable = reinterpret_cast(kGxDeviceVTable); + void** slot = &vtable[kGxSetProjectionSlot]; if (*slot == reinterpret_cast(&CharacterCreateProjectionHook)) return; g_nextSetProjection = reinterpret_cast(*slot); void* replacement = reinterpret_cast(&CharacterCreateProjectionHook); - if (!g_nextSetProjection || !wxl::core::mem::Patch(slot, &replacement, sizeof(replacement))) + if (!g_nextSetProjection || !PatchMemory(slot, &replacement, sizeof(replacement))) { g_nextSetProjection = nullptr; WLOG_ERROR("moonwell: character-create projection hook installation failed"); @@ -222,17 +266,17 @@ namespace moonwell int __cdecl SetLoginCharacterFlags(void* state) { uint32_t flags = 0; - if (state && wxl::runtime::lua::IsNumber(state, 1)) - flags = static_cast(wxl::runtime::lua::ToNumber(state, 1)); + if (state && wxl::game::script::IsNumber(state, 1)) + flags = static_cast(wxl::game::script::ToNumber(state, 1)); g_loginCharacterIsTraitor = (flags & kTraitorFlag) != 0; - wxl::runtime::lua::PushBoolean(state, g_loginCharacterIsTraitor ? 1 : 0); + wxl::game::script::PushBoolean(state, g_loginCharacterIsTraitor); return 1; } int __cdecl IsTraitor(void* state) { - wxl::runtime::lua::PushBoolean(state, g_loginCharacterIsTraitor ? 1 : 0); + wxl::game::script::PushBoolean(state, g_loginCharacterIsTraitor); return 1; } @@ -259,7 +303,7 @@ namespace moonwell name, reinterpret_cast(address)); return false; } - if (!wxl::core::mem::Patch(reinterpret_cast(address), replacement.data(), N)) + if (!PatchMemory(reinterpret_cast(address), replacement.data(), N)) { WLOG_ERROR("moonwell: '%s' patch failed at %p", name, reinterpret_cast(address)); @@ -371,7 +415,7 @@ namespace moonwell const auto caveRel = static_cast(reinterpret_cast(cave) - (patchAddress + jump.size())); std::memcpy(jump.data() + 1, &caveRel, sizeof(caveRel)); - if (!wxl::core::mem::Patch(reinterpret_cast(patchAddress), jump.data(), jump.size())) + if (!PatchMemory(reinterpret_cast(patchAddress), jump.data(), jump.size())) { VirtualFree(cave, 0, MEM_RELEASE); WLOG_ERROR("moonwell: GetCharacterInfo jump patch failed"); @@ -390,40 +434,84 @@ namespace moonwell WLOG_ERROR("moonwell: compatibility module incomplete; see mismatches above"); else WLOG_INFO("moonwell: compatibility module ready (stock Wow.exe remains untouched)"); - wxl::core::log::Flush(); } - DWORD WINAPI FlushRuntimeLog(LPVOID) + using RegisterFunctionFn = void(__cdecl*)(const char*, wxl::game::script::Function); + using ValidateCallbackFn = void(__cdecl*)(uintptr_t); + using GetContextFn = void*(__cdecl*)(); + RegisterFunctionFn g_nextRegisterFunction = nullptr; + ValidateCallbackFn g_nextValidateCallback = nullptr; + void* g_registeredState = nullptr; + bool g_registeringMoonWell = false; + + bool IsMoonWellCallback(uintptr_t callback) { - // Let the remainder of RunAll() and the core-ready line reach the - // shared buffered logger, then make startup diagnostics durable. - Sleep(1000); - wxl::core::log::Flush(); - return 0; + return callback == reinterpret_cast(&SetLoginCharacterFlags) + || callback == reinterpret_cast(&IsTraitor) + || callback == reinterpret_cast(&SetCharacterCreateCamera); } - void InstallRuntimeLogFlush() + void __cdecl ValidateCallbackHook(uintptr_t callback) { - HANDLE thread = CreateThread(nullptr, 0, &FlushRuntimeLog, nullptr, 0, nullptr); - if (thread) CloseHandle(thread); + if (!IsMoonWellCallback(callback) && g_nextValidateCallback) + g_nextValidateCallback(callback); } - struct Registration + void RegisterLuaFunctionsForCurrentState() { - Registration() - { - wxl::runtime::lua::RegisterFunction( - "MoonWellSetLoginCharacterFlags", &SetLoginCharacterFlags); - wxl::runtime::lua::RegisterFunction("MoonWellIsTraitor", &IsTraitor); - wxl::runtime::lua::RegisterFunction( - "MoonWellSetCharacterCreateCamera", &SetCharacterCreateCamera); - wxl::runtime::modules::RegisterBoot("moonwell", &InstallBoot); - wxl::runtime::modules::Register( - "moonwell-character-create-camera", &InstallCharacterCreateCamera); - wxl::runtime::modules::Register( - "moonwell-encounter-journal-models", &InstallEncounterJournalModelPreview); - wxl::runtime::modules::Register("moonwell-log-flush", &InstallRuntimeLogFlush); - } - } g_registration; + if (!g_nextRegisterFunction || g_registeringMoonWell) return; + constexpr uintptr_t kGetContext = 0x00817DB0; + void* state = reinterpret_cast(kGetContext)(); + if (!state || state == g_registeredState) return; + + g_registeringMoonWell = true; + g_nextRegisterFunction("MoonWellSetLoginCharacterFlags", &SetLoginCharacterFlags); + g_nextRegisterFunction("MoonWellIsTraitor", &IsTraitor); + g_nextRegisterFunction("MoonWellSetCharacterCreateCamera", &SetCharacterCreateCamera); + g_registeringMoonWell = false; + g_registeredState = state; + WLOG_INFO("moonwell: Lua functions registered for state %p", state); + } + + void __cdecl RegisterFunctionHook(const char* name, wxl::game::script::Function function) + { + if (g_nextRegisterFunction) g_nextRegisterFunction(name, function); + RegisterLuaFunctionsForCurrentState(); + } + + bool InstallLuaBridge() + { + const bool validator = HookByName("Lua.ValidateFunctionPointer", &ValidateCallbackHook, + &g_nextValidateCallback); + const bool registrar = HookByName("Lua.RegisterFunction", &RegisterFunctionHook, + &g_nextRegisterFunction); + if (!validator || !registrar) + WLOG_ERROR("moonwell: Lua bridge hook installation failed"); + return validator && registrar; + } } } + +const WXL_PluginInfo* __cdecl WXL_Query(void) +{ + static const WXL_PluginInfo info = { + sizeof(WXL_PluginInfo), WXL_API_VERSION, "MoonWell", 1, WXL_CLIENT_BUILD, + }; + return &info; +} + +int __cdecl WXL_Load(const WXL_Api* api) +{ + if (!api || api->apiVersion != WXL_API_VERSION) return 0; + moonwell::g_api = api; + + moonwell::InstallBoot(); + const bool lua = moonwell::InstallLuaBridge(); + moonwell::InstallCharacterCreateCamera(); + moonwell::InstallEncounterJournalModelPreview(); + const bool spells = moonwell::spells::Install(api); + const bool ready = lua && spells; + api->Log(ready ? WXL_LOG_INFO : WXL_LOG_ERROR, "MoonWell", "%s", + ready ? "MoonWell extension loaded" : "MoonWell extension loaded with errors"); + return ready ? 1 : 0; +} diff --git a/modules/moonwell/host/CustomSpellProvider.cpp b/modules/moonwell/src/SpellOverrides.cpp similarity index 76% rename from modules/moonwell/host/CustomSpellProvider.cpp rename to modules/moonwell/src/SpellOverrides.cpp index dc78ba1..cbc01af 100644 --- a/modules/moonwell/host/CustomSpellProvider.cpp +++ b/modules/moonwell/src/SpellOverrides.cpp @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later -// Appends compact MoonWell spell overrides to the stock 3.3.5 DBCs at open time. +// Appends compact MoonWell spell overrides to stock 3.3.5 DBC bytes. -#include "Host.hpp" -#include "core/Logger.hpp" -#include "mpq/MpqStore.hpp" +#include "game/Io.hpp" +#include "wxl/PluginApi.h" +#include "wxl/StorageApi.h" #include #include @@ -15,7 +15,7 @@ #include #include -namespace moonwell::host +namespace moonwell::spells { namespace { @@ -38,8 +38,34 @@ namespace moonwell::host std::once_flag g_loadOnce; bool g_ready = false; - std::vector g_spellDbc; - std::vector g_skillDbc; + const WXL_Api* g_api = nullptr; + std::vector g_overrides; + + void Log(int level, const char* message) + { + if (g_api && g_api->Log) g_api->Log(level, "MoonWellSpells", "%s", message); + } + + bool ReadAll(const char* path, std::vector& out) + { + void* handle = nullptr; + if (!wxl::game::io::FileOpen(path, wxl::game::io::kOpenWholeFile, &handle) || !handle) + return false; + uint32_t high = 0; + const uint32_t size = wxl::game::io::FileSize(handle, &high); + if (high != 0) + { + wxl::game::io::FileClose(handle); + return false; + } + out.resize(size); + uint32_t read = 0; + const bool ok = (size == 0 || wxl::game::io::FileRead(handle, out.data(), size, &read)) + && read == size; + wxl::game::io::FileClose(handle); + if (!ok) out.clear(); + return ok; + } uint32_t ReadU32(const uint8_t* data) { @@ -226,39 +252,59 @@ namespace moonwell::host void Load() { - const std::string root = wxl::host::ClientRoot(); - wxl::host::mpq::MpqStore store; - std::vector overrideBytes, spellBase, skillBase; - if (root.empty() || !store.Mount(root) || !store.ReadAll(kOverridesPath, overrideBytes)) + std::vector overrideBytes; + if (!ReadAll(kOverridesPath.data(), overrideBytes)) return; - std::vector overrides; - if (!ParseOverrides(overrideBytes, overrides) || - !store.ReadAll(kSpellPath, spellBase) || !store.ReadAll(kSkillPath, skillBase) || - !BuildSpellDbc(spellBase, overrides, g_spellDbc) || - !BuildSkillDbc(skillBase, overrides, g_skillDbc)) + if (!ParseOverrides(overrideBytes, g_overrides)) { - WLOG_ERROR("moonwell-spells: failed to build custom companion DBCs"); + Log(WXL_LOG_ERROR, "failed to parse WXLSpellOverrides.tsv"); return; } g_ready = true; - WLOG_INFO("moonwell-spells: appended %zu companion spell(s)", overrides.size()); + if (g_api && g_api->Log) + g_api->Log(WXL_LOG_INFO, "MoonWellSpells", "loaded %zu companion spell override(s)", + g_overrides.size()); } - bool Provide(std::string_view name, std::vector& out) + int __cdecl Transform(const char* rawName, const uint8_t* raw, uint32_t rawLen, + const WXL_ByteSink* sink) { + if (!rawName || !raw || !sink || !sink->Write) return 0; + const std::string_view name(rawName); if (!SamePath(name, kSpellPath) && !SamePath(name, kSkillPath)) return false; std::call_once(g_loadOnce, &Load); if (!g_ready) return false; - out = SamePath(name, kSpellPath) ? g_spellDbc : g_skillDbc; - return true; + + const std::vector base(raw, raw + rawLen); + std::vector out; + const bool built = SamePath(name, kSpellPath) + ? BuildSpellDbc(base, g_overrides, out) + : BuildSkillDbc(base, g_overrides, out); + if (!built) + { + Log(WXL_LOG_ERROR, "failed to build custom companion DBC"); + return 0; + } + sink->Write(sink->ctx, out.data(), static_cast(out.size())); + return 1; } + } - struct Registrar + bool Install(const WXL_Api* api) + { + g_api = api; + if (!api || !api->GetInterface) return false; + auto* storage = static_cast( + api->GetInterface("wxl.storage", WXL_STORAGE_API_VERSION)); + if (!storage || storage->apiVersion != WXL_STORAGE_API_VERSION || + !storage->RegisterClientTransform) { - Registrar() { wxl::host::RegisterProvider("moonwell-companion-spells", &Provide); } - }; - - Registrar g_registrar; + Log(WXL_LOG_ERROR, "wxl.storage v1 is unavailable"); + return false; + } + storage->RegisterClientTransform(".dbc", &Transform); + Log(WXL_LOG_INFO, "DBC override transform registered"); + return true; } } diff --git a/modules/moonwell/src/SpellOverrides.hpp b/modules/moonwell/src/SpellOverrides.hpp new file mode 100644 index 0000000..5b44ae8 --- /dev/null +++ b/modules/moonwell/src/SpellOverrides.hpp @@ -0,0 +1,8 @@ +#pragma once + +struct WXL_Api; + +namespace moonwell::spells +{ + bool Install(const WXL_Api* api); +} diff --git a/modules/wxl-modern-blp/shared.cmake b/modules/wxl-modern-blp/shared.cmake new file mode 100644 index 0000000..b5be978 --- /dev/null +++ b/modules/wxl-modern-blp/shared.cmake @@ -0,0 +1,2 @@ +file(GLOB_RECURSE WXL_EXT_SHARED_SRC CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/src/engine/assets/shared/textures/blp/*.cpp") diff --git a/modules/wxl-modern-blp/src/Module.cpp b/modules/wxl-modern-blp/src/Module.cpp new file mode 100644 index 0000000..25973e1 --- /dev/null +++ b/modules/wxl-modern-blp/src/Module.cpp @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// WarcraftXL 1.1 BLP transform extension. + +#include "engine/assets/shared/textures/blp/BlpTranscode.hpp" +#include "wxl/ModernBlpApi.h" +#include "wxl/PluginApi.h" +#include "wxl/StorageApi.h" + +#include +#include +#include +#include + +namespace +{ + const WXL_Api* g_api = nullptr; + constexpr uint32_t kMaxTextureEdge = 1024; + + int __cdecl Transcode(const char* name, const uint8_t* raw, uint32_t rawLen, + const WXL_ByteSink* sink) + { + if (!raw || !sink || !sink->Write) return 0; + namespace blp = wxl::modern::assets::textures::blp; + + const std::span input(raw, rawLen); + std::vector capped; + const bool didCap = blp::CapBlpMips(input, capped, kMaxTextureEdge); + const std::span source = didCap + ? std::span(capped.data(), capped.size()) : input; + + std::vector transcoded; + if (blp::TranscodeBlp(source, transcoded)) + { + sink->Write(sink->ctx, transcoded.data(), static_cast(transcoded.size())); + if (g_api && g_api->Log) + g_api->Log(WXL_LOG_DEBUG, "wxl-modern-blp", "%s%s BGRA->DXT5", + name ? name : "?", didCap ? " capped" : ""); + return 1; + } + if (!didCap) return 0; + + sink->Write(sink->ctx, capped.data(), static_cast(capped.size())); + return 1; + } + + const WXL_ModernBlpApi g_blpApi = { + sizeof(WXL_ModernBlpApi), WXL_MODERN_BLP_API_VERSION, &Transcode, + }; +} + +const WXL_PluginInfo* __cdecl WXL_Query(void) +{ + static const WXL_PluginInfo info = { + sizeof(WXL_PluginInfo), WXL_API_VERSION, "wxl-modern-blp", 1, WXL_CLIENT_BUILD, + }; + return &info; +} + +int __cdecl WXL_Load(const WXL_Api* api) +{ + if (!api || api->apiVersion != WXL_API_VERSION) return 0; + g_api = api; + auto* storage = static_cast( + api->GetInterface("wxl.storage", WXL_STORAGE_API_VERSION)); + if (!storage || storage->apiVersion != WXL_STORAGE_API_VERSION || + !storage->RegisterClientTransform) + { + api->Log(WXL_LOG_ERROR, "wxl-modern-blp", "wxl.storage v1 is unavailable"); + return 0; + } + + storage->RegisterClientTransform(".blp", &Transcode); + api->PublishInterface("wxl.modern-blp", WXL_MODERN_BLP_API_VERSION, + const_cast(&g_blpApi)); + api->Log(WXL_LOG_INFO, "wxl-modern-blp", "BLP transcode and mip cap active"); + return 1; +} diff --git a/run.ps1 b/run.ps1 index 0182c92..f24551d 100644 --- a/run.ps1 +++ b/run.ps1 @@ -84,7 +84,7 @@ function Stop-WowRuntime { param([Parameter(Mandatory=$true)][string]$ClientPath) $clientRoot = [System.IO.Path]::GetFullPath($ClientPath).TrimEnd('\') + '\' - $runtimeProcesses = @(Get-Process -Name "Wow", "WarcraftXLHost" -ErrorAction SilentlyContinue | Where-Object { + $runtimeProcesses = @(Get-Process -Name "Wow" -ErrorAction SilentlyContinue | Where-Object { try { $_.Path -and $_.Path.StartsWith($clientRoot, [System.StringComparison]::OrdinalIgnoreCase) } catch { @@ -96,7 +96,7 @@ function Stop-WowRuntime { return } - Write-Host "Stopping the running WoW client and WarcraftXL host..." + Write-Host "Stopping the running WoW client..." $runtimeProcesses | Stop-Process -Force try { diff --git a/vendor/modules/wxl-db2 b/vendor/modules/wxl-db2 new file mode 160000 index 0000000..b3b4e31 --- /dev/null +++ b/vendor/modules/wxl-db2 @@ -0,0 +1 @@ +Subproject commit b3b4e31cc43218faf47745facc4d7e4d65dfbbf1 diff --git a/vendor/modules/wxl-grasswind b/vendor/modules/wxl-grasswind new file mode 160000 index 0000000..b4a52b0 --- /dev/null +++ b/vendor/modules/wxl-grasswind @@ -0,0 +1 @@ +Subproject commit b4a52b0e334ade8829421bdde7af42781f8930e4 diff --git a/vendor/modules/wxl-modern-adt b/vendor/modules/wxl-modern-adt index 0412b69..18221f6 160000 --- a/vendor/modules/wxl-modern-adt +++ b/vendor/modules/wxl-modern-adt @@ -1 +1 @@ -Subproject commit 0412b690c04e0efc92b0078989dd9dbd182f131a +Subproject commit 18221f643960a71ae023a309384a2e650b493863 diff --git a/vendor/modules/wxl-modern-assets b/vendor/modules/wxl-modern-assets deleted file mode 160000 index eb7c7c6..0000000 --- a/vendor/modules/wxl-modern-assets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eb7c7c66461bda2941c549943e6a8884a006f436 diff --git a/vendor/modules/wxl-modern-m2 b/vendor/modules/wxl-modern-m2 new file mode 160000 index 0000000..ca841be --- /dev/null +++ b/vendor/modules/wxl-modern-m2 @@ -0,0 +1 @@ +Subproject commit ca841be8a928b2f717b088c0b5efd670daf640df diff --git a/vendor/modules/wxl-modern-render b/vendor/modules/wxl-modern-render deleted file mode 160000 index 3f246a5..0000000 --- a/vendor/modules/wxl-modern-render +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f246a5e207a3c9b805c4d88d64076c8ef1f3504 diff --git a/vendor/modules/wxl-modern-wmo b/vendor/modules/wxl-modern-wmo new file mode 160000 index 0000000..e56fa7c --- /dev/null +++ b/vendor/modules/wxl-modern-wmo @@ -0,0 +1 @@ +Subproject commit e56fa7c93adb4d2a7494c5a37738cdd9a357e752 diff --git a/vendor/modules/wxl-unit-outline b/vendor/modules/wxl-unit-outline index 29e5e29..4e8123e 160000 --- a/vendor/modules/wxl-unit-outline +++ b/vendor/modules/wxl-unit-outline @@ -1 +1 @@ -Subproject commit 29e5e29fa97e0ef356ebc9ae865d5db6f6841a4e +Subproject commit 4e8123ec5d0e89cf1641eaeb27c487d72e29405d diff --git a/vendor/warcraftxl b/vendor/warcraftxl new file mode 160000 index 0000000..4895cef --- /dev/null +++ b/vendor/warcraftxl @@ -0,0 +1 @@ +Subproject commit 4895cef6f41ade7fc89946d21009fed9f4fcfbe0 diff --git a/vendor/warcraftxl/.gitignore b/vendor/warcraftxl/.gitignore deleted file mode 100644 index b2262d0..0000000 --- a/vendor/warcraftxl/.gitignore +++ /dev/null @@ -1,69 +0,0 @@ -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Linker files -*.ilk - -# Debugger Files -*.pdb - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll -*.so.* - - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -# Build directories -build/ -Build/ -build-*/ - -# CMake generated files -CMakeFiles/ -CMakeCache.txt -cmake_install.cmake -Makefile -install_manifest.txt -compile_commands.json - -# Temporary files -*.tmp -*.log -*.bak -*.swp - -# vcpkg -vcpkg_installed/ - -# debug information files -*.dwo - -# test output & cache -Testing/ -.cache/ \ No newline at end of file diff --git a/vendor/warcraftxl/CMakeLists.txt b/vendor/warcraftxl/CMakeLists.txt deleted file mode 100644 index 58683e2..0000000 --- a/vendor/warcraftxl/CMakeLists.txt +++ /dev/null @@ -1,205 +0,0 @@ -# WarcraftXL. Two artifact families share this tree and cannot share one toolchain platform, so the file -# is platform-aware: configure -A Win32 for the injected DLL + patcher + proxy (32-bit), and -A x64 with -# -DWXL_BUILD_HOST=ON for the asset host (64-bit). build.ps1 drives both. -# Copyright (C) 2026 WarcraftXL. GPLv3 (see source headers). - -cmake_minimum_required(VERSION 3.20) -project(WarcraftXL LANGUAGES CXX) - -# Static CRT everywhere: the DLLs load inside the player's Wow.exe and the host runs standalone on -# machines that have no reason to carry the toolset's brand-new VC++ redistributable. A dynamic CRT -# turns a missing/stale redist into a loader failure at process start (0xc0000142) with no log at all. -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -# The 64-bit asset host (WarcraftXLHost.exe) is opt-in: OFF by default so a contributor who only wants the -# DLL needs no x64 toolchain and pays no build/deploy cost. build.ps1 -Host flips it on in an x64 configure. -option(WXL_BUILD_HOST "Build WarcraftXLHost.exe (64-bit asset host)" OFF) - -# wxl-modern-assets per-format toggles: exclude an entire format pipeline (source down-convert, both its -# DLL and host halves) at configure time, without touching source. common/ and textures/dds stay in -# unconditionally (shared infrastructure, not format-specific). ADT gets WXL_MODERN_ADT here once it -# migrates into wxl-modern-assets. -option(WXL_MODERN_M2 "Build wxl-modern-assets M2 support" ON) -option(WXL_MODERN_M3 "Build wxl-modern-assets M3 support" ON) -option(WXL_MODERN_WMO "Build wxl-modern-assets WMO support" ON) -option(WXL_MODERN_BLP "Build wxl-modern-assets BLP/texture support" ON) - -set(WXL_MODERN_ASSETS_EXCLUDE_REGEX "") -if(NOT WXL_MODERN_M2) - string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/models/m2/") -endif() -if(NOT WXL_MODERN_M3) - string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/models/m3/") -endif() -if(NOT WXL_MODERN_WMO) - string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/models/wmo/") -endif() -if(NOT WXL_MODERN_BLP) - string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/textures/blp/") -endif() -string(REGEX REPLACE "^\\|" "" WXL_MODERN_ASSETS_EXCLUDE_REGEX "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # feeds the IDE the real C++20 flags - -set(WXL_DEFS WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS) - -# Client directory to deploy the built artifacts into. Passed by build.ps1 (-DCLIENT_PATH=...) and cached. -set(CLIENT_PATH "" CACHE PATH "Client folder the built artifacts are copied into after each build") - -# ============================================================================= -# 32-bit family (injected into the client): WarcraftXL.dll + wxl-patcher.exe + d3d9.dll -# ============================================================================= -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - # --- Automatic, recursive source discovery (no hand-written paths) ----------------------------- - # CONFIGURE_DEPENDS re-globs at build time, so dropping a file (or a whole script) needs no edit here. - # The DLL excludes the patcher/host/gpu trees; the host (64-bit) takes its own slice in the EQUAL 8 block. - file(GLOB_RECURSE WXL_CORE_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") - list(FILTER WXL_CORE_SRC EXCLUDE REGEX "/src/(patcher|host|gpu)/") - - # ========================================================================= - # Target 1: WarcraftXL.dll (32-bit, injected) = SDK + runtime scripts - # runtime scripts live in scripts/*/src/*.cpp; the cross-target byte-transform a module shares with - # the host lives in scripts/*/shared/*.cpp. Both compile straight into the DLL (self-registering). - # ========================================================================= - file(GLOB_RECURSE WXL_RUNTIME_SCRIPT CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/src/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/shared/*.cpp") - if(WXL_MODERN_ASSETS_EXCLUDE_REGEX) - list(FILTER WXL_RUNTIME_SCRIPT EXCLUDE REGEX "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") - endif() - - # Vendored ImGui (core + dx9/win32 backends). Compiled in but DORMANT until a script wires it up. - file(GLOB WXL_IMGUI CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/deps/imgui/*.cpp") - - # FlatBuffers runtime (flexbuffers string utils) for the host IPC client (runtime/storage). - set(WXL_FLATBUFFERS "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/src/util.cpp") - - add_library(WarcraftXL SHARED ${WXL_CORE_SRC} ${WXL_RUNTIME_SCRIPT} ${WXL_IMGUI} ${WXL_FLATBUFFERS}) - set_target_properties(WarcraftXL PROPERTIES OUTPUT_NAME "WarcraftXL" PREFIX "") - target_include_directories(WarcraftXL PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}/src" - "${CMAKE_CURRENT_SOURCE_DIR}/deps/minhook/include" - "${CMAKE_CURRENT_SOURCE_DIR}/deps/imgui" - "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/include") - - add_subdirectory(deps/minhook) - target_link_libraries(WarcraftXL PRIVATE minhook d3d9 d3dcompiler shell32 delayimp) - # D3D12 and the shader compiler are feature-path dependencies (post-fx, grass capture, liquid - # shaders), not boot dependencies. Delay-loading keeps the DLL loadable on machines without them; - # every call site resolves or guards availability before touching those paths. - target_link_options(WarcraftXL PRIVATE "/DELAYLOAD:d3d12.dll" "/DELAYLOAD:d3dcompiler_47.dll") - target_compile_definitions(WarcraftXL PRIVATE ${WXL_DEFS}) - - source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${WXL_CORE_SRC} ${WXL_RUNTIME_SCRIPT}) - - # Deploy: copy the freshly linked DLL into the client folder after every build. - if(CLIENT_PATH) - add_custom_command(TARGET WarcraftXL POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${CLIENT_PATH}/WarcraftXL.dll" - COMMENT "Deploy WarcraftXL.dll -> ${CLIENT_PATH}") - endif() - - # Per-module CMake hook: a module may ship scripts//module.cmake to extend the WarcraftXL target - # (add a vendored library, extra include dirs, link libraries). The file runs with the target defined - # and ${CMAKE_CURRENT_LIST_DIR} pointing at the module folder. Optional; most modules need none. - file(GLOB WXL_MODULE_CMAKES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/module.cmake") - foreach(_wxl_module ${WXL_MODULE_CMAKES}) - include("${_wxl_module}") - endforeach() - - # ========================================================================= - # Target 2: wxl-patcher.exe = the offline PE patcher + patcher scripts - # ========================================================================= - file(GLOB WXL_PATCHER_CORE CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/patcher/*.cpp") - file(GLOB_RECURSE WXL_PATCHER_SCRIPT CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/patcher/*.cpp") - - # src/common/ compiles into every binary (leveled logger, env config, shared helpers): the - # patcher and proxy do not link core, and the host is another architecture, so the shared - # infrastructure is object-level, not a link dependency. - file(GLOB WXL_COMMON_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.cpp") - - add_executable(wxl-patcher ${WXL_PATCHER_CORE} ${WXL_PATCHER_SCRIPT} ${WXL_COMMON_SRC}) - set_target_properties(wxl-patcher PROPERTIES OUTPUT_NAME "wxl-patcher") - target_include_directories(wxl-patcher PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") - target_compile_definitions(wxl-patcher PRIVATE ${WXL_DEFS}) - - # ========================================================================= - # Target 3: d3d9.dll = the D3D9On12 proxy - # ========================================================================= - file(GLOB WXL_GPU_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/*.cpp") - - add_library(d3d9 SHARED ${WXL_GPU_SRC} ${WXL_COMMON_SRC}) - set_target_properties(d3d9 PROPERTIES OUTPUT_NAME "d3d9" PREFIX "") - target_include_directories(d3d9 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") - target_link_libraries(d3d9 PRIVATE d3d12 dxgi dcomp d3dcompiler delayimp) - # The proxy must load on every machine Wow.exe runs on -- it shadows a static import of the exe, so - # a hard dependency of the proxy is a hard dependency of the game (loader failure 0xc0000142 on - # machines without D3D12). All On12/D3D12 machinery is delay-loaded; EnsureDevice() checks that - # d3d12.dll is actually present before the first delay-loaded call, else the proxy runs as a pure - # native pass-through. - target_link_options(d3d9 PRIVATE "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/Proxy.def" - "/DELAYLOAD:d3d12.dll" "/DELAYLOAD:dxgi.dll" "/DELAYLOAD:dcomp.dll" "/DELAYLOAD:d3dcompiler_47.dll") - target_compile_definitions(d3d9 PRIVATE ${WXL_DEFS}) - - # Deploy: copy the freshly linked proxy into the client folder after every build. - if(CLIENT_PATH) - add_custom_command(TARGET d3d9 POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${CLIENT_PATH}/d3d9.dll" - COMMENT "Deploy d3d9.dll -> ${CLIENT_PATH}") - endif() -endif() - -# ============================================================================= -# 64-bit family (opt-in): WarcraftXLHost.exe = archive owner + IPC transport. -# Format-blind: src/host/ + the modules' scripts/*/host/ handlers + their scripts/*/shared/ transforms. -# StormLib + FlatBuffers (deps/). Requires an x64 toolchain. -# ============================================================================= -if(WXL_BUILD_HOST AND CMAKE_SIZEOF_VOID_P EQUAL 8) - # StormLib (vendored) supplies MPQ reading. Static, read-only use; no install/tests. - set(STORM_SKIP_INSTALL ON CACHE BOOL "" FORCE) - set(STORM_BUILD_TESTS OFF CACHE BOOL "" FORCE) - set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) - add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/deps/stormlib" "${CMAKE_BINARY_DIR}/stormlib") - - file(GLOB_RECURSE WXL_HOST_CORE CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/host/*.cpp") - file(GLOB_RECURSE WXL_HOST_SCRIPT CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/host/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/shared/*.cpp") - if(WXL_MODERN_ASSETS_EXCLUDE_REGEX) - list(FILTER WXL_HOST_SCRIPT EXCLUDE REGEX "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") - endif() - - # The shared infrastructure (leveled logger, env config) compiles straight into the host too. - file(GLOB WXL_COMMON_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.cpp") - - add_executable(WarcraftXLHost - ${WXL_HOST_CORE} - ${WXL_HOST_SCRIPT} - ${WXL_COMMON_SRC} - "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/src/util.cpp") - set_target_properties(WarcraftXLHost PROPERTIES OUTPUT_NAME "WarcraftXLHost") - target_include_directories(WarcraftXLHost PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}/src" - "${CMAKE_CURRENT_SOURCE_DIR}/src/host" - "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/include" - "${CMAKE_CURRENT_SOURCE_DIR}/deps/stormlib/src") - target_link_libraries(WarcraftXLHost PRIVATE storm) - target_compile_definitions(WarcraftXLHost PRIVATE ${WXL_DEFS} WXL_HOST=1) - - source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${WXL_HOST_CORE} ${WXL_HOST_SCRIPT}) - - # Deploy the host into the client's Utils folder after build. - if(CLIENT_PATH) - add_custom_command(TARGET WarcraftXLHost POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${CLIENT_PATH}/Utils" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${CLIENT_PATH}/Utils/WarcraftXLHost.exe" - COMMENT "Deploy WarcraftXLHost.exe -> ${CLIENT_PATH}/Utils") - endif() -endif() - -# A 64-bit configure that did not ask for the host builds nothing; nudge toward the right flags. -if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WXL_BUILD_HOST) - message(WARNING "x64 configure without -DWXL_BUILD_HOST=ON builds nothing; the 32-bit family needs -A Win32.") -endif() diff --git a/vendor/warcraftxl/COPYING b/vendor/warcraftxl/COPYING deleted file mode 100644 index f288702..0000000 --- a/vendor/warcraftxl/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/warcraftxl/LICENSE b/vendor/warcraftxl/LICENSE deleted file mode 100644 index f288702..0000000 --- a/vendor/warcraftxl/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/warcraftxl/README.md b/vendor/warcraftxl/README.md deleted file mode 100644 index dc7788a..0000000 --- a/vendor/warcraftxl/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# WarcraftXL - -**A modding framework for the World of Warcraft 3.3.5a (build 12340) client.** - -WarcraftXL loads into the running client and gives mods a clean, typed way to talk to the engine - -the same idea as RED4ext for Cyberpunk 2077 or SKSE for Skyrim. The framework owns the hard, -repetitive parts (getting into the process, the hook engine, client offsets, engine bindings, an -event bus, file-format contracts); your mods - here called **modules / scripts** - own the actual features. - -> **Core principle.** If something is needed everywhere and always works the same way, it belongs in -> the core. Anything that is a *feature* - a decision, an effect, an editor - is a module. The core -> stays small and reusable; the modules stay free to do whatever they want. - -## How it works - -`WarcraftXL.dll` is the framework. It boots inside the client, brings up the hook engine, and raises -a set of events. Each module is a small self-contained unit under `scripts/` that subscribes to those -events and uses the core's bindings to read and drive the game. Drop a module in, rebuild, and it is -live - no separate injector, no patched data files. - -The core is organised as four pillars, so a module never touches a raw address itself: - -| Pillar | Namespace | What it gives a module | -|---|---|---| -| **Offsets** | `wxl::offsets` | The curated client addresses and struct layouts. Internal - modules never include these directly. | -| **Bindings** | `wxl::game` | Typed, zero-overhead calls into engine functions (`Native(addr)(args...)`) plus an enumerable catalog of `{name, address, signature}`. | -| **Events** | `wxl::events` | A POD-dispatch event bus. A module subclasses `EventScript` and binds member functions with `on<&Self::OnEndScene>(Event::OnEndScene)`. | -| **Assets** | `wxl::asset` | In-memory contracts for the client's file formats (ADT, WMO, M2, WDT, WDL) so modules read structured data, not byte soup. | - -A module looks like this - bind in the constructor, react in the handler: - -```cpp -class MyModule final : public wxl::events::EventScript { -public: - MyModule() { on<&MyModule::OnEndScene>(wxl::events::Event::OnEndScene); } - void OnEndScene(const wxl::events::EndSceneArgs& a) { /* draw, read world, edit... */ } -}; -MyModule g_myModule; // file-scope instance self-registers at load -``` - -## Layout - -``` -src/ -├── core/ Hook · Logger · Mem · Main process bring-up, hook engine, entry point -├── offsets/ engine/ · game/ client addresses + struct layouts (internal) -├── game/ camera · doodad · world · ui typed engine bindings (the wxl::game pillar) -│ m2 · wmo · adt · unit · gx · -│ io · mem ... -├── events/ Event · EventScript the event bus + the module base class -├── asset/ adt · wmo · m2 · wdt · wdl file-format contracts -├── services/ asset higher-level services over the pillars -└── runtime/ RenderHooks per-frame / device hooks the events ride on - -scripts/ the modules (each builds into WarcraftXL.dll) -├── wxl-mini-noggit an in-client map editor (ImGui + 3D gizmo): pick a doodad, move/rotate/scale it -├── wxl-unit-outline a unit outline / highlight effect -└── wxl-glue-unlock glue-screen unlock - -deps/ vendored: MinHook, Dear ImGui + ImGuizmo, StormLib, FlatBuffers -``` - -Every address the bindings rely on lives in `src/offsets/`, named and annotated. The reasoning behind -each one is kept in the project's RE documentation - the code follows it. - -## Building - -The target client is a 32-bit process, so everything builds **Win32**. - -**Requirements** -- CMake ≥ 3.25 -- A Win32 C++17 toolchain (Visual Studio 2022 recommended) -- A legally-obtained 3.3.5a (12340) client - -```sh -cmake -B build -cmake --build build --config Release --target WarcraftXL -``` - -Output: `WarcraftXL.dll`. Vendored dependencies build with the project. - -## Install - -1. Place `WarcraftXL.dll` next to `Wow.exe` and load it into the client (import-table entry / loader). -2. Launch. The framework writes a startup log on bootstrap - check it to confirm modules came up. - -Each client process launches its own `WarcraftXLHost.exe` session (IPC named objects are scoped by -the Wow.exe PID), so multiple concurrent clients do not share a mailbox. - -> Modifying a client binary is on you: work on a **copy**, keep an untouched backup, and only point -> this at a client and server you are permitted to modify and connect to. - -## Contributors - -Thanks to everyone who has helped shape WarcraftXL, with code, reverse-engineering, ideas, or feedback: - -- [Furioz](https://github.com/Furioz420) -- [Tester](https://github.com/TesterWoWDev) -- [Duskhaven](https://git.duskhaven.net/Duskhaven) - -## Support - -**WarcraftXL is free, and it always will be - forever.** Nothing here is gated, and nothing ever -will be. Sponsoring is completely optional - just a way to support the project and the time behind -it, if you want to and can. - -

- Sponsor iThorgrim -

- -## Legal - -WarcraftXL is an **interoperability project**. It distributes no Blizzard code and no game assets, and -runs only against a client you supply and own, reading that client's own files at runtime. -Reverse-engineering is limited to what is necessary for interoperability. - -World of Warcraft and Wrath of the Lich King are trademarks of Blizzard Entertainment. This project is -not affiliated with or endorsed by Blizzard. - -## License - -Released under the **GNU General Public License v3.0** - see [LICENSE](LICENSE). - -Bundles [MinHook](https://github.com/TsudaKageyu/minhook) (© Tsuda Kageyu, BSD 2-Clause), -[Dear ImGui](https://github.com/ocornut/imgui) + [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo), -and [StormLib](https://github.com/ladislav-zezula/StormLib) under `deps/`, with their licenses retained. diff --git a/vendor/warcraftxl/build.ps1 b/vendor/warcraftxl/build.ps1 deleted file mode 100644 index 66ce14b..0000000 --- a/vendor/warcraftxl/build.ps1 +++ /dev/null @@ -1,135 +0,0 @@ -#requires -Version 5.1 -<# -.SYNOPSIS - Build + deploy WarcraftXL: WarcraftXL.dll (injected), d3d9.dll (proxy) and wxl-patcher.exe (32-bit). - -.PARAMETER Config - Build configuration. Default: Release. - -.PARAMETER ClientPath - Client directory to deploy into. Optional once it has been cached by a first run. - -.PARAMETER Clean - Delete the build directory before configuring (forces a from-scratch build). - -.PARAMETER AutoPatch - After the build, run wxl-patcher on the client's Wow.exe. The patcher is idempotent - (it skips an already-patched exe and backs the original up to Wow.exe.orig on first run). - -.EXAMPLE - .\build.ps1 -.EXAMPLE - .\build.ps1 -ClientPath "D:\Path\To\Client" -Clean -.EXAMPLE - .\build.ps1 -AutoPatch -#> -param( - [string]$Config = "Release", - [string]$ClientPath, - [switch]$Clean, - [switch]$AutoPatch = true, - [switch]$BuildHost -) - -$ErrorActionPreference = "Stop" - -$root = $PSScriptRoot -$buildDir = Join-Path $root "build\dll" -$buildHostDir = Join-Path $root "build\host" - -if (-not (Test-Path (Join-Path $root "CMakeLists.txt"))) { - throw "CMakeLists.txt is missing from '$root'. Place build.ps1 in the project root directory (next to CMakeLists.txt)." -} - -function Get-CachedClientPath([string]$cacheDir) { - $cache = Join-Path $cacheDir "CMakeCache.txt" - if (Test-Path $cache) { - $hit = Select-String -Path $cache -Pattern '^CLIENT_PATH:PATH=(.+)$' | Select-Object -First 1 - if ($hit) { return $hit.Matches[0].Groups[1].Value.Trim() } - } - return $null -} - -if (-not $ClientPath) { - $ClientPath = Get-CachedClientPath $buildDir -} -if (-not $ClientPath) { - throw "No client path is known. Run the command once with -ClientPath '' (it will be stored in the CMake cache)." -} -if (-not (Test-Path $ClientPath)) { - throw "Client path not found: $ClientPath" -} - -Write-Host "Project : $root" -Write-Host "Client : $ClientPath" -Write-Host "Config : $Config" -Write-Host "" - -function Invoke-Native([string]$exe, [string[]]$cmdArgs) { - Write-Host ">> $exe $($cmdArgs -join ' ')" -ForegroundColor Cyan - $prev = $ErrorActionPreference - $ErrorActionPreference = "Continue" - try { & $exe @cmdArgs } finally { $ErrorActionPreference = $prev } - if ($LASTEXITCODE -ne 0) { throw "Failure ($LASTEXITCODE): $exe $($cmdArgs -join ' ')" } -} - -function Build-Dll { - Write-Host "=== WarcraftXL.dll (32-bit) ===" -ForegroundColor Green - - if ($Clean -and (Test-Path $buildDir)) { - Write-Host "Clean $buildDir" -ForegroundColor Yellow - Remove-Item -Recurse -Force $buildDir - } - - $needConfigure = $Clean ` - -or $PSBoundParameters.ContainsKey('ClientPath') ` - -or (-not (Test-Path (Join-Path $buildDir "CMakeCache.txt"))) - if ($needConfigure) { - Invoke-Native "cmake" @("-S", $root, "-B", $buildDir, "-A", "Win32", "-DCLIENT_PATH=$ClientPath") - } - - Invoke-Native "cmake" @("--build", $buildDir, "--config", $Config, "--parallel") - Write-Host "" -} - -function Build-Host { - Write-Host "=== WarcraftXLHost.exe (64-bit) ===" -ForegroundColor Green - - if ($Clean -and (Test-Path $buildHostDir)) { - Write-Host "Clean $buildHostDir" -ForegroundColor Yellow - Remove-Item -Recurse -Force $buildHostDir - } - - $needConfigure = $Clean ` - -or $PSBoundParameters.ContainsKey('ClientPath') ` - -or (-not (Test-Path (Join-Path $buildHostDir "CMakeCache.txt"))) - if ($needConfigure) { - Invoke-Native "cmake" @("-S", $root, "-B", $buildHostDir, "-A", "x64", "-DWXL_BUILD_HOST=ON", "-DCLIENT_PATH=$ClientPath") - } - - Invoke-Native "cmake" @("--build", $buildHostDir, "--config", $Config, "--parallel") - Write-Host "" -} - -function Invoke-AutoPatch { - $patcher = Join-Path $buildDir "$Config\wxl-patcher.exe" - if (-not (Test-Path $patcher)) { $patcher = Join-Path $ClientPath "wxl-patcher.exe" } - if (-not (Test-Path $patcher)) { - throw "wxl-patcher.exe not found. Build first (.\build.ps1)." - } - $wow = Join-Path $ClientPath "Wow.exe" - if (-not (Test-Path $wow)) { throw "Wow.exe not found: $wow" } - - Write-Host "=== AutoPatch ===" -ForegroundColor Green - Invoke-Native $patcher @($wow) - Write-Host "" -} - -$sw = [System.Diagnostics.Stopwatch]::StartNew() - -Build-Dll -if ($BuildHost) { Build-Host } -if ($AutoPatch) { Invoke-AutoPatch } - -$sw.Stop() -Write-Host "OK - build + deploy in $([int]$sw.Elapsed.TotalSeconds)s -> $ClientPath" -ForegroundColor Green diff --git a/vendor/warcraftxl/deps/README b/vendor/warcraftxl/deps/README deleted file mode 100644 index 69d8db0..0000000 --- a/vendor/warcraftxl/deps/README +++ /dev/null @@ -1,9 +0,0 @@ -Vendored third-party dependencies (self-contained). - -Contents: - stormlib/ - MPQ archive access. Used by: host (MpqStore). Built via add_subdirectory. - flatbuffers/ - FlexBuffers payloads for the IPC contract. Used by: host + DLL (ipc/). - Header-only for our use plus src/util.cpp compiled into the host. - minhook/ - inline detour engine. Used by: DLL only (core/Hook). Wired with the DLL target. - -These are the only external dependencies. \ No newline at end of file diff --git a/vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml b/vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml deleted file mode 100644 index 7c07ba6..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -buildifier: latest -matrix: - bazel: - - 7.x - - 8.x -tasks: - verify_ubuntu2004: - platform: ubuntu2004 - bazel: ${{ bazel }} - environment: - CC: clang - SWIFT_VERSION: "5.10" - SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" - PATH: "$PATH:$SWIFT_HOME/usr/bin" - shell_commands: - - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" - - "mkdir $SWIFT_HOME" - - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" - build_targets: - - "//..." - test_targets: - - "//..." - verify_ubuntu2204: - platform: ubuntu2204 - bazel: ${{ bazel }} - environment: - CC: clang - SWIFT_VERSION: "5.10" - SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" - PATH: "$PATH:$SWIFT_HOME/usr/bin" - shell_commands: - - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" - - "mkdir $SWIFT_HOME" - - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" - build_targets: - - "//..." - test_targets: - - "//..." - test_module_cpp: - platform: ubuntu2204 - bazel: ${{ bazel }} - working_directory: tests/bazel_repository_test_dir - build_targets: - - "//..." - test_module_ts: - platform: ubuntu2204 - bazel: ${{ bazel }} - working_directory: tests/ts/bazel_repository_test_dir - test_targets: - - "//..." - verify_macos: - platform: macos - bazel: ${{ bazel }} - xcode_version: "15.2" - build_targets: - - "//:flatbuffers" - - "//:flatc" - test_targets: - - "//tests:flatbuffers_test" diff --git a/vendor/warcraftxl/deps/flatbuffers/.bazelignore b/vendor/warcraftxl/deps/flatbuffers/.bazelignore deleted file mode 100644 index 874adf9..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.bazelignore +++ /dev/null @@ -1,5 +0,0 @@ -ts/node_modules - -# Test workspaces -tests/bazel_repository_test_dir -tests/ts/bazel_repository_test_dir diff --git a/vendor/warcraftxl/deps/flatbuffers/.bazelrc b/vendor/warcraftxl/deps/flatbuffers/.bazelrc deleted file mode 100644 index a02667e..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.bazelrc +++ /dev/null @@ -1,18 +0,0 @@ -# We cannot use "common" here because the "version" command doesn't support -# --deleted_packages. We need to specify it for both build and query instead. -build --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir -query --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir -# Point tools such as coursier (used in rules_jvm_external) to Bazel's internal JDK -# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445 -common --repo_env=JAVA_HOME=../bazel_tools/jdk -common --action_env=JAVA_HOME=../bazel_tools/jdk -# Workaround "Error: need --enable_runfiles on Windows for to support rules_js" -common:windows --enable_runfiles -# Swift is not required on Windows -common:windows --deleted_packages=swift -# Ignore warnings in external dependencies -build --per_file_copt=external/.*@-Wno-everything --host_per_file_copt=external/.*@-Wno-everything -# Honor the setting of `skipLibCheck` in the tsconfig.json file. -common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig -# Use "tsc" as the transpiler when ts_project has no `transpiler` set. -common --@aspect_rules_ts//ts:default_to_tsc_transpiler diff --git a/vendor/warcraftxl/deps/flatbuffers/.clang-format b/vendor/warcraftxl/deps/flatbuffers/.clang-format deleted file mode 100644 index bb2e344..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.clang-format +++ /dev/null @@ -1,5 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: Google -... - diff --git a/vendor/warcraftxl/deps/flatbuffers/.clang-tidy b/vendor/warcraftxl/deps/flatbuffers/.clang-tidy deleted file mode 100644 index 7e9c1b7..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.clang-tidy +++ /dev/null @@ -1,347 +0,0 @@ ---- -FormatStyle: "file" -WarningsAsErrors: "*" -HeaderFilterRegex: ".*" -Checks: "google-build-explicit-make-pair, - google-build-namespaces, - google-build-using-namespace, - google-default-arguments, - google-explicit-constructor, - google-global-names-in-headers, - google-objc-avoid-nsobject-new, - google-objc-avoid-throwing-exception, - google-objc-function-naming, - google-objc-global-variable-declaration, - google-readability-avoid-underscore-in-googletest-name, - google-readability-braces-around-statements, - google-readability-casting, - google-readability-function-size, - google-readability-namespace-comments, - google-runtime-int, - google-runtime-operator, - google-upgrade-googletest-case, - clang-analyzer-apiModeling.StdCLibraryFunctions, - clang-analyzer-apiModeling.TrustNonnull, - clang-analyzer-apiModeling.google.GTest, - clang-analyzer-apiModeling.llvm.CastValue, - clang-analyzer-apiModeling.llvm.ReturnValue, - clang-analyzer-core.CallAndMessage, - clang-analyzer-core.CallAndMessageModeling, - clang-analyzer-core.DivideZero, - clang-analyzer-core.DynamicTypePropagation, - clang-analyzer-core.NonNullParamChecker, - clang-analyzer-core.NonnilStringConstants, - clang-analyzer-core.NullDereference, - clang-analyzer-core.StackAddrEscapeBase, - clang-analyzer-core.StackAddressEscape, - clang-analyzer-core.UndefinedBinaryOperatorResult, - clang-analyzer-core.VLASize, - clang-analyzer-core.builtin.BuiltinFunctions, - clang-analyzer-core.builtin.NoReturnFunctions, - clang-analyzer-core.uninitialized.ArraySubscript, - clang-analyzer-core.uninitialized.Assign, - clang-analyzer-core.uninitialized.Branch, - clang-analyzer-core.uninitialized.CapturedBlockVariable, - clang-analyzer-core.uninitialized.UndefReturn, - clang-analyzer-cplusplus.InnerPointer, - clang-analyzer-cplusplus.Move, - clang-analyzer-cplusplus.NewDelete, - clang-analyzer-cplusplus.NewDeleteLeaks, - clang-analyzer-cplusplus.PlacementNew, - clang-analyzer-cplusplus.PureVirtualCall, - clang-analyzer-cplusplus.SelfAssignment, - clang-analyzer-cplusplus.SmartPtrModeling, - clang-analyzer-cplusplus.StringChecker, - clang-analyzer-cplusplus.VirtualCallModeling, - clang-analyzer-deadcode.DeadStores, - clang-analyzer-fuchsia.HandleChecker, - clang-analyzer-nullability.NullPassedToNonnull, - clang-analyzer-nullability.NullReturnedFromNonnull, - clang-analyzer-nullability.NullabilityBase, - clang-analyzer-nullability.NullableDereferenced, - clang-analyzer-nullability.NullablePassedToNonnull, - clang-analyzer-nullability.NullableReturnedFromNonnull, - clang-analyzer-optin.cplusplus.UninitializedObject, - clang-analyzer-optin.cplusplus.VirtualCall, - clang-analyzer-optin.mpi.MPI-Checker, - clang-analyzer-optin.osx.OSObjectCStyleCast, - clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker, - clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker, - clang-analyzer-optin.performance.GCDAntipattern, - clang-analyzer-optin.performance.Padding, - clang-analyzer-optin.portability.UnixAPI, - clang-analyzer-osx.API, - clang-analyzer-osx.MIG, - clang-analyzer-osx.NSOrCFErrorDerefChecker, - clang-analyzer-osx.NumberObjectConversion, - clang-analyzer-osx.OSObjectRetainCount, - clang-analyzer-osx.ObjCProperty, - clang-analyzer-osx.SecKeychainAPI, - clang-analyzer-osx.cocoa.AtSync, - clang-analyzer-osx.cocoa.AutoreleaseWrite, - clang-analyzer-osx.cocoa.ClassRelease, - clang-analyzer-osx.cocoa.Dealloc, - clang-analyzer-osx.cocoa.IncompatibleMethodTypes, - clang-analyzer-osx.cocoa.Loops, - clang-analyzer-osx.cocoa.MissingSuperCall, - clang-analyzer-osx.cocoa.NSAutoreleasePool, - clang-analyzer-osx.cocoa.NSError, - clang-analyzer-osx.cocoa.NilArg, - clang-analyzer-osx.cocoa.NonNilReturnValue, - clang-analyzer-osx.cocoa.ObjCGenerics, - clang-analyzer-osx.cocoa.RetainCount, - clang-analyzer-osx.cocoa.RetainCountBase, - clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak, - clang-analyzer-osx.cocoa.SelfInit, - clang-analyzer-osx.cocoa.SuperDealloc, - clang-analyzer-osx.cocoa.UnusedIvars, - clang-analyzer-osx.cocoa.VariadicMethodTypes, - clang-analyzer-osx.coreFoundation.CFError, - clang-analyzer-osx.coreFoundation.CFNumber, - clang-analyzer-osx.coreFoundation.CFRetainRelease, - clang-analyzer-osx.coreFoundation.containers.OutOfBounds, - clang-analyzer-osx.coreFoundation.containers.PointerSizedValues, - clang-analyzer-security.FloatLoopCounter, - clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, - clang-analyzer-security.insecureAPI.SecuritySyntaxChecker, - clang-analyzer-security.insecureAPI.UncheckedReturn, - clang-analyzer-security.insecureAPI.bcmp, - clang-analyzer-security.insecureAPI.bcopy, - clang-analyzer-security.insecureAPI.bzero, - clang-analyzer-security.insecureAPI.decodeValueOfObjCType, - clang-analyzer-security.insecureAPI.getpw, - clang-analyzer-security.insecureAPI.gets, - clang-analyzer-security.insecureAPI.mkstemp, - clang-analyzer-security.insecureAPI.mktemp, - clang-analyzer-security.insecureAPI.rand, - clang-analyzer-security.insecureAPI.strcpy, - clang-analyzer-security.insecureAPI.vfork, - clang-analyzer-unix.API, - clang-analyzer-unix.DynamicMemoryModeling, - clang-analyzer-unix.Malloc, - clang-analyzer-unix.MallocSizeof, - clang-analyzer-unix.MismatchedDeallocator, - clang-analyzer-unix.Vfork, - clang-analyzer-unix.cstring.BadSizeArg, - clang-analyzer-unix.cstring.CStringModeling, - clang-analyzer-unix.cstring.NullArg, - clang-analyzer-valist.CopyToSelf, - clang-analyzer-valist.Uninitialized, - clang-analyzer-valist.Unterminated, - clang-analyzer-valist.ValistBase, - clang-analyzer-webkit.NoUncountedMemberChecker, - clang-analyzer-webkit.RefCntblBaseVirtualDtor, - clang-analyzer-webkit.UncountedLambdaCapturesChecker, - -################################################ Optional checks ################################################ - - #google-readability-todo, - #bugprone-argument-comment, - #bugprone-assert-side-effect, - #bugprone-bad-signal-to-kill-thread, - #bugprone-bool-pointer-implicit-conversion, - #bugprone-branch-clone, - #bugprone-copy-constructor-init, - #bugprone-dangling-handle, - #bugprone-dynamic-static-initializers, - #bugprone-easily-swappable-parameters, - #bugprone-exception-escape, - #bugprone-fold-init-type, - #bugprone-forward-declaration-namespace, - #bugprone-forwarding-reference-overload, - #bugprone-implicit-widening-of-multiplication-result, - #bugprone-inaccurate-erase, - #bugprone-incorrect-roundings, - #bugprone-infinite-loop, - #bugprone-integer-division, - #bugprone-lambda-function-name, - #bugprone-macro-parentheses, - #bugprone-macro-repeated-side-effects, - #bugprone-misplaced-operator-in-strlen-in-alloc, - #bugprone-misplaced-pointer-arithmetic-in-alloc, - #bugprone-misplaced-widening-cast, - #bugprone-move-forwarding-reference, - #bugprone-multiple-statement-macro, - #bugprone-narrowing-conversions, - #bugprone-no-escape, - #bugprone-not-null-terminated-result, - #bugprone-parent-virtual-call, - #bugprone-posix-return, - #bugprone-redundant-branch-condition, - #bugprone-reserved-identifier, - #bugprone-signal-handler, - #bugprone-signed-char-misuse, - #bugprone-sizeof-container, - #bugprone-sizeof-expression, - #bugprone-spuriously-wake-up-functions, - #bugprone-string-constructor, - #bugprone-string-integer-assignment, - #bugprone-string-literal-with-embedded-nul, - #bugprone-stringview-nullptr, - #bugprone-suspicious-enum-usage, - #bugprone-suspicious-include, - #bugprone-suspicious-memory-comparison, - #bugprone-suspicious-memset-usage, - #bugprone-suspicious-missing-comma, - #bugprone-suspicious-semicolon, - #bugprone-suspicious-string-compare, - #bugprone-swapped-arguments, - #bugprone-terminating-continue, - #bugprone-throw-keyword-missing, - #bugprone-too-small-loop-variable, - #bugprone-undefined-memory-manipulation, - #bugprone-undelegated-constructor, - #bugprone-unhandled-exception-at-new, - #bugprone-unhandled-self-assignment, - #bugprone-unused-raii, - #bugprone-unused-return-value, - #bugprone-use-after-move, - #bugprone-virtual-near-miss, - #cppcoreguidelines-avoid-c-arrays, - #cppcoreguidelines-avoid-goto, - #cppcoreguidelines-avoid-magic-numbers, - #cppcoreguidelines-avoid-non-const-global-variables, - #cppcoreguidelines-c-copy-assignment-signature, - #cppcoreguidelines-explicit-virtual-functions, - #cppcoreguidelines-init-variables, - #cppcoreguidelines-interfaces-global-init, - #cppcoreguidelines-macro-usage, - #cppcoreguidelines-narrowing-conversions, - #cppcoreguidelines-no-malloc, - #cppcoreguidelines-non-private-member-variables-in-classes, - #cppcoreguidelines-owning-memory, - #cppcoreguidelines-prefer-member-initializer, - #cppcoreguidelines-pro-bounds-array-to-pointer-decay, - #cppcoreguidelines-pro-bounds-constant-array-index, - #cppcoreguidelines-pro-bounds-pointer-arithmetic, - #cppcoreguidelines-pro-type-const-cast, - #cppcoreguidelines-pro-type-cstyle-cast, - #cppcoreguidelines-pro-type-member-init, - #cppcoreguidelines-pro-type-reinterpret-cast, - #cppcoreguidelines-pro-type-static-cast-downcast, - #cppcoreguidelines-pro-type-union-access, - #cppcoreguidelines-pro-type-vararg, - #cppcoreguidelines-slicing, - #cppcoreguidelines-special-member-functions, - #cppcoreguidelines-virtual-class-destructor, - #hicpp-avoid-c-arrays, - #hicpp-avoid-goto, - #hicpp-braces-around-statements, - #hicpp-deprecated-headers, - #hicpp-exception-baseclass, - #hicpp-explicit-conversions, - #hicpp-function-size, - #hicpp-invalid-access-moved, - #hicpp-member-init, - #hicpp-move-const-arg, - #hicpp-multiway-paths-covered, - #hicpp-named-parameter, - #hicpp-new-delete-operators, - #hicpp-no-array-decay, - #hicpp-no-assembler, - #hicpp-no-malloc, - #hicpp-noexcept-move, - #hicpp-signed-bitwise, - #hicpp-special-member-functions, - #hicpp-static-assert, - #hicpp-undelegated-constructor, - #hicpp-uppercase-literal-suffix, - #hicpp-use-auto, - #hicpp-use-emplace, - #hicpp-use-equals-default, - #hicpp-use-equals-delete, - #hicpp-use-noexcept, - #hicpp-use-nullptr, - #hicpp-use-override, - #hicpp-vararg, - #modernize-avoid-bind, - #modernize-avoid-c-arrays, - #modernize-concat-nested-namespaces, - #modernize-deprecated-headers, - #modernize-deprecated-ios-base-aliases, - #modernize-loop-convert, - #modernize-make-shared, - #modernize-make-unique, - #modernize-pass-by-value, - #modernize-raw-string-literal, - #modernize-redundant-void-arg, - #modernize-replace-auto-ptr, - #modernize-replace-disallow-copy-and-assign-macro, - #modernize-replace-random-shuffle, - #modernize-return-braced-init-list, - #modernize-shrink-to-fit, - #modernize-unary-static-assert, - #modernize-use-auto, - #modernize-use-bool-literals, - #modernize-use-default-member-init, - #modernize-use-emplace, - #modernize-use-equals-default, - #modernize-use-equals-delete, - #modernize-use-nodiscard, - #modernize-use-noexcept, - #modernize-use-nullptr, - #modernize-use-override, - #modernize-use-trailing-return-type, - #modernize-use-transparent-functors, - #modernize-use-uncaught-exceptions, - #modernize-use-using, - #performance-faster-string-find, - #performance-for-range-copy, - #performance-implicit-conversion-in-loop, - #performance-inefficient-algorithm, - #performance-inefficient-string-concatenation, - #performance-inefficient-vector-operation, - #performance-move-const-arg, - #performance-move-constructor-init, - #performance-no-automatic-move, - #performance-no-int-to-ptr, - #performance-noexcept-move-constructor, - #performance-trivially-destructible, - #performance-type-promotion-in-math-fn, - #performance-unnecessary-copy-initialization, - #performance-unnecessary-value-param, - #portability-restrict-system-includes, - #portability-simd-intrinsics, - #readability-avoid-const-params-in-decls, - #readability-braces-around-statements, - #readability-const-return-type, - #readability-container-contains, - #readability-container-data-pointer, - #readability-container-size-empty, - #readability-convert-member-functions-to-static, - #readability-delete-null-pointer, - #readability-duplicate-include, - #readability-else-after-return, - #readability-function-cognitive-complexity, - #readability-function-size, - #readability-identifier-length, - #readability-identifier-naming, - #readability-implicit-bool-conversion, - #readability-inconsistent-declaration-parameter-name, - #readability-isolate-declaration, - #readability-magic-numbers, - #readability-make-member-function-const, - #readability-misleading-indentation, - #readability-misplaced-array-index, - #readability-named-parameter, - #readability-non-const-parameter, - #readability-qualified-auto, - #readability-redundant-access-specifiers, - #readability-redundant-control-flow, - #readability-redundant-declaration, - #readability-redundant-function-ptr-dereference, - #readability-redundant-member-init, - #readability-redundant-preprocessor, - #readability-redundant-smartptr-get, - #readability-redundant-string-cstr, - #readability-redundant-string-init, - #readability-simplify-boolean-expr, - #readability-simplify-subscript-expr, - #readability-static-accessed-through-instance, - #readability-static-definition-in-anonymous-namespace, - #readability-string-compare, - #readability-suspicious-call-argument, - #readability-uniqueptr-delete-release, - #readability-uppercase-literal-suffix, - #readability-use-anyofallof - " diff --git a/vendor/warcraftxl/deps/flatbuffers/.editorconfig b/vendor/warcraftxl/deps/flatbuffers/.editorconfig deleted file mode 100644 index 6689bab..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -root = true -# Don't set line endings to avoid conflict with core.autocrlf flag. -# Line endings on checkout/checkin are controlled by .gitattributes file. -[*] -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/warcraftxl/deps/flatbuffers/.gitattributes b/vendor/warcraftxl/deps/flatbuffers/.gitattributes deleted file mode 100644 index 4cab1f4..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Set the default behavior, in case people don't have core.autocrlf set. -* text=auto diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS b/vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS deleted file mode 100644 index d84592d..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Default owner -* @dbaileychess derekbailey@google.com - -# Prevent modification of this file -.github/CODEOWNERS @dbaileychess derekbailey@google.com diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md b/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index a053fe4..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -Thank you for submitting an issue! - -Please make sure you include the names of the affected language(s), compiler version(s), operating system version(s), and FlatBuffers version(s) in your issue title. - -This helps us get the correct maintainers to look at your issue. Here are examples of good titles: - -- Crash when accessing FlatBuffer [C++, gcc 4.8, OS X, master] -- Flatc converts a protobuf 'bytes' field to 'string' in fbs schema file [all languages, FlatBuffers 1.4] - -Include other details as appropriate. - -Thanks! diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md b/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md deleted file mode 100644 index c394d38..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: 404 Doc -about: To fix broken documentation links -title: "[Doc 404]" -labels: documentation -assignees: dbaileychess - ---- - -Target URL: -[Optional] Source Site: diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md b/vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b8cc0ce..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,19 +0,0 @@ -Thank you for submitting a PR! - -Please delete this standard text once you've created your own description. - -If you make changes to any of the code generators (`src/idl_gen*`) be sure to -[build](https://google.github.io/flatbuffers/flatbuffers_guide_building.html) your project, as it will generate code based on the changes. If necessary -the code generation script can be directly run (`scripts/generate_code.py`), -requires Python3. This allows us to better see the effect of the PR. - -If your PR includes C++ code, please adhere to the -[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html), -and don't forget we try to support older compilers (e.g. VS2010, GCC 4.6.3), -so only some C++11 support is available. - -For any C++ changes, please make sure to run `sh scripts/clang-format-git.sh` - -Include other details as appropriate. - -Thanks! diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml b/vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml deleted file mode 100644 index 5ace460..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml b/vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml deleted file mode 100644 index ccc9757..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml +++ /dev/null @@ -1,137 +0,0 @@ -# Configuration for Auto Labeler during pull request -# -# See https://github.com/actions/labeler for file format -# and https://github.com/google/flatbuffers/labels for a list of valid labels -# -# See .github/workflows/label.yml for Github Action workflow script - -"c#": - - changed-files: - - any-glob-to-any-file: - - '**/*.cs' - - 'net/**/*' - - 'tests/FlatBuffers.Test/**/*' - - 'tests/FlatBuffers.Benchmarks/**/*' - - 'src/idl_gen_csharp.cpp' - -swift: - - changed-files: - - any-glob-to-any-file: - - '**/*.swift' - - 'swift/**/*' - - 'tests/swift/**' - - 'src/idl_gen_swift.cpp' - -nim: - - changed-files: - - any-glob-to-any-file: - - '**/*.nim' - - 'nim/**/*' - - 'src/idl_gen_nim.cpp' - - 'src/bfbs_gen_nim.cpp' - -javascript: - - changed-files: - - any-glob-to-any-file: - - '**/*.js' - - 'src/idl_gen_ts.cpp' - -typescript: - - changed-files: - - any-glob-to-any-file: - - '**/*.ts' - - 'src/idl_gen_ts.cpp' - - 'grpc/flatbuffers-js-grpc/**/*.ts' - -golang: - - changed-files: - - any-glob-to-any-file: - - '**/*.go' - - 'src/idl_gen_go.cpp' - -python: - - changed-files: - - any-glob-to-any-file: - - '**/*.py' - - 'src/idl_gen_python.cpp' - -java: - - changed-files: - - any-glob-to-any-file: - - '**/*.java' - - 'src/idl_gen_java.cpp' - -kotlin: - - changed-files: - - any-glob-to-any-file: - - '**/*.kt' - - 'src/idl_gen_kotlin.cpp' - - 'src/idl_gen_kotlin_kmp.cpp' - -lua: - - changed-files: - - any-glob-to-any-file: - - '**/*.lua' - - 'lua/**/*' - - 'src/bfbs_gen_lua.cpp' - -lobster: - - changed-files: - - any-glob-to-any-file: - - '**/*.lobster' - - 'src/idl_gen_lobster.cpp' - -php: - - changed-files: - - any-glob-to-any-file: - - '**/*.php' - - 'src/idl_gen_php.cpp' - -rust: - - changed-files: - - any-glob-to-any-file: - - '**/*.rs' - - 'rust/**/*' - - 'src/idl_gen_rust.cpp' - -dart: - - changed-files: - - any-glob-to-any-file: - - '**/*.dart' - - 'src/idl_gen_dart.cpp' - -"c++": - - changed-files: - - any-glob-to-any-file: - - '**/*.cc' - - '**/*.cpp' - - '**/*.h' - -json: - - changed-files: - - any-glob-to-any-file: - - '**/*.json' - - 'src/idl_gen_json_schema.cpp' - -codegen: - - changed-files: - - any-glob-to-any-file: - - 'src/**/*' - -documentation: - - changed-files: - - any-glob-to-any-file: - - 'docs/**/*' - - '**/*.md' - -CI: - - changed-files: - - any-glob-to-any-file: - - '.github/**/*' - - '.bazelci/**/*' - -grpc: - - changed-files: - - any-glob-to-any-file: - - 'grpc/**/*' - - 'src/idl_gen_grpc.cpp' diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml deleted file mode 100644 index 810d515..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml +++ /dev/null @@ -1,643 +0,0 @@ -name: CI -permissions: read-all - -on: - # For manual tests. - workflow_dispatch: - push: - tags: - - "*" # new tag version, like `0.8.4` or else - branches: - - master - pull_request: - branches: - - master - schedule: - # Run daily at 4:45 A.M. to catch dependencies that break us. - - cron: '45 4 * * *' - -jobs: - build-linux: - permissions: - contents: write - outputs: - digests-gcc: ${{ steps.hash-gcc.outputs.hashes }} - digests-clang: ${{ steps.hash-clang.outputs.hashes }} - name: Build Linux - runs-on: ubuntu-24.04 - strategy: - matrix: - cxx: [g++-13, clang++-18] - fail-fast: false - steps: - - uses: actions/checkout@v6 - - name: cmake - run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_STATIC_FLATC=ON . - - name: build - run: make -j - - name: test - run: ./flattests - - name: make flatc executable - run: | - chmod +x flatc - ./flatc --version - - name: upload build artifacts - uses: actions/upload-artifact@v7 - with: - name: Linux flatc binary ${{ matrix.cxx }} - path: flatc - # Below if only for release. - - name: Zip file - if: startsWith(github.ref, 'refs/tags/') - run: zip Linux.flatc.binary.${{ matrix.cxx }}.zip flatc - - name: Release zip file - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: Linux.flatc.binary.${{ matrix.cxx }}.zip - - name: Generate SLSA subjects - clang - if: matrix.cxx == 'clang++-18' && startsWith(github.ref, 'refs/tags/') - id: hash-clang - run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT - - name: Generate SLSA subjects - gcc - if: matrix.cxx == 'g++-13' && startsWith(github.ref, 'refs/tags/') - id: hash-gcc - run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT - - build-linux-no-file-tests: - name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: cmake - run: CXX=clang++-18 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" . - - name: build - run: make -j - - name: test - run: ./flattests - - build-linux-out-of-source: - name: Build Linux with out-of-source build location - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: make build directory - run: mkdir build - - name: cmake - working-directory: build - run: > - CXX=clang++-18 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON - -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17 - - name: build - working-directory: build - run: make -j - - name: test - working-directory: build - run: pwd && ./flattests - - name: test C++17 - working-directory: build - run: ./flattests_cpp17 - - build-linux-cpp-std: - name: Build Linux C++ - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - std: [11, 14, 17, 20, 23] - cxx: [g++-13, clang++-18] - exclude: - # Clang++15 10.3.0 stdlibc++ doesn't fully support std 23 - - cxx: clang++-18 - std: 23 - - steps: - - uses: actions/checkout@v6 - - name: cmake - run: > - CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" - -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON - -DFLATBUFFERS_CPP_STD=${{ matrix.std }} - -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}} - - name: build - run: make -j - - name: test - run: ./flattests - - name: test C++17 - if: matrix.std >= 17 - run: ./flattests_cpp17 - - build-cpp-std: - name: Build Windows C++ - runs-on: windows-2022 - strategy: - matrix: - std: [11, 14, 17, 20, 23] - fail-fast: false - steps: - - uses: actions/checkout@v6 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - name: cmake - run: > - cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release - -DFLATBUFFERS_STRICT_MODE=ON - -DFLATBUFFERS_CPP_STD=${{ matrix.std }} - -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}} - - name: build - run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 - - name: test - run: Release\flattests.exe - - name: test C++17 - if: matrix.std >= 17 - run: Release\flattests_cpp17.exe - - build-windows: - permissions: - contents: write - outputs: - digests: ${{ steps.hash.outputs.hashes }} - name: Build Windows 2022 - runs-on: windows-2022 - steps: - - uses: actions/checkout@v6 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - name: cmake - run: cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON . - - name: build - run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 - - name: test - run: Release\flattests.exe - - name: upload build artifacts - uses: actions/upload-artifact@v7 - with: - name: Windows flatc binary - path: Release\flatc.exe - # Below if only for release. - - name: Zip file - if: startsWith(github.ref, 'refs/tags/') - run: move Release/flatc.exe . && Compress-Archive flatc.exe Windows.flatc.binary.zip - - name: Release binary - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: Windows.flatc.binary.zip - - name: Generate SLSA subjects - if: startsWith(github.ref, 'refs/tags/') - id: hash - shell: bash - run: echo "hashes=$(sha256sum Windows.flatc.binary.zip | base64 -w0)" >> $GITHUB_OUTPUT - - build-dotnet-windows: - name: Build .NET Windows - runs-on: windows-2022 - strategy: - matrix: - configuration: [ - '', - '-p:UnsafeByteBuffer=true', - '-p:EnableSpanT=true,UnsafeByteBuffer=true' - ] - steps: - - uses: actions/checkout@v6 - - name: Setup .NET Core SDK - uses: actions/setup-dotnet@v5 - with: - dotnet-version: '8.0.x' - - name: Build - run: | - cd tests\FlatBuffers.Test - dotnet new sln --force --name FlatBuffers.Test --format sln - dotnet sln FlatBuffers.Test.sln add FlatBuffers.Test.csproj - dotnet build -c Release ${{matrix.configuration}} FlatBuffers.Test.sln - - name: Run net6.0 - run: | - cd tests\FlatBuffers.Test\bin\Release\net6.0 - dir - .\FlatBuffers.Test.exe - - name: Run net8.0 - run: | - cd tests\FlatBuffers.Test\bin\Release\net8.0 - .\FlatBuffers.Test.exe - - build-mac-intel: - permissions: - contents: write - outputs: - digests: ${{ steps.hash.outputs.hashes }} - name: Build Mac (for Intel) - runs-on: macos-15-intel - steps: - - uses: actions/checkout@v6 - - name: cmake - run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . - - name: build - run: xcodebuild -toolchain clang -configuration Release -target flattests - - name: check that the binary is x86_64 - run: | - info=$(file Release/flatc) - echo $info - echo $info | grep "Mach-O 64-bit executable x86_64" - - name: test - run: Release/flattests - - name: make flatc executable - run: | - chmod +x Release/flatc - Release/flatc --version - - name: upload build artifacts - uses: actions/upload-artifact@v7 - with: - name: Mac flatc binary Intel - path: Release/flatc - # Below if only for release. - - name: Zip file - if: startsWith(github.ref, 'refs/tags/') - run: mv Release/flatc . && zip MacIntel.flatc.binary.zip flatc - - name: Release binary - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: MacIntel.flatc.binary.zip - - name: Generate SLSA subjects - if: startsWith(github.ref, 'refs/tags/') - id: hash - run: echo "hashes=$(shasum -a 256 MacIntel.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT - - build-mac-universal: - permissions: - contents: write - outputs: - digests: ${{ steps.hash.outputs.hashes }} - name: Build Mac (universal build) - runs-on: macos-latest - steps: - - uses: actions/checkout@v6 - - name: cmake - run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . - - name: build - run: xcodebuild -toolchain clang -configuration Release -target flattests - - name: check that the binary is "universal" - run: | - info=$(file Release/flatc) - echo $info - echo $info | grep "Mach-O universal binary with 2 architectures" - - name: test - run: Release/flattests - - name: make flatc executable - run: | - chmod +x Release/flatc - Release/flatc --version - - name: upload build artifacts - uses: actions/upload-artifact@v7 - with: - name: Mac flatc binary Universal - path: Release/flatc - # Below if only for release. - - name: Zip file - if: startsWith(github.ref, 'refs/tags/') - run: mv Release/flatc . && zip Mac.flatc.binary.zip flatc - - name: Release binary - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: Mac.flatc.binary.zip - - name: Generate SLSA subjects - if: startsWith(github.ref, 'refs/tags/') - id: hash - run: echo "hashes=$(shasum -a 256 Mac.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT - - build-android: - name: Build Android (on Linux) - if: false #disabled due to continual failure - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: set up Java - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 17 - - name: set up Gradle - uses: gradle/actions/setup-gradle@v5 - - name: set up flatc - run: | - cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . - make -j - echo "${PWD}" >> $GITHUB_PATH - - name: build - working-directory: android - run: gradle clean build - - build-generator: - name: Check Generated Code - runs-on: ubuntu-24.04 - strategy: - matrix: - cxx: [g++-13, clang++-18] - steps: - - uses: actions/checkout@v6 - - name: cmake - run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j - - name: Generate - run: scripts/check_generate_code.py - - name: Generate gRPC - run: scripts/check-grpc-generated-code.py - - build-generator-windows: - name: Check Generated Code on Windows - runs-on: windows-2022 - steps: - - uses: actions/checkout@v6 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - name: cmake - run: cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON . - - name: build - run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 - - name: Generate - run: python3 scripts/check_generate_code.py --flatc Release\flatc.exe - - name: Generate gRPC - run: python3 scripts/check-grpc-generated-code.py --flatc Release\flatc.exe - - build-benchmarks: - name: Build Benchmarks (on Linux) - runs-on: ubuntu-24.04 - strategy: - matrix: - cxx: [g++-13] - steps: - - uses: actions/checkout@v6 - - name: cmake - run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j - - name: Run benchmarks - run: ./flatbenchmark --benchmark_repetitions=5 --benchmark_display_aggregates_only=true --benchmark_out_format=console --benchmark_out=benchmarks/results_${{matrix.cxx}} - - name: Upload benchmarks results - uses: actions/upload-artifact@v7 - with: - name: Linux flatbenchmark results ${{matrix.cxx}} - path: benchmarks/results_${{matrix.cxx}} - - build-java: - name: Build Java - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: test - working-directory: java - run: mvn test - - build-kotlin-macos: - name: Build Kotlin MacOS - runs-on: macos-15 - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: set up Java - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 17 - - name: set up Gradle - uses: gradle/actions/setup-gradle@v5 - - name: Build flatc - run: | - cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . - make -j - echo "${PWD}" >> $GITHUB_PATH - - name: Build - working-directory: kotlin - run: ./gradlew clean iosSimulatorArm64Test macosX64Test macosArm64Test - - build-kotlin-linux: - name: Build Kotlin Linux - if: false #disabled due to continual failure - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: set up Java - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 17 - - name: set up Gradle - uses: gradle/actions/setup-gradle@v5 - - name: Build flatc - run: | - cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . - make -j - echo "${PWD}" >> $GITHUB_PATH - - name: Build - working-directory: kotlin - # we are using docker's version of gradle - # so no need for wrapper validation or user - # gradlew - run: gradle jvmMainClasses jvmTest jsTest jsBrowserTest - - build-rust-linux: - name: Build Rust Linux - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: test - working-directory: tests - run: bash RustTest.sh - - build-rust-windows: - name: Build Rust Windows - runs-on: windows-2022 - steps: - - uses: actions/checkout@v6 - - name: test - working-directory: tests - run: ./RustTest.bat - - build-python: - name: Build Python - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: flatc - # FIXME: make test script not rely on flatc - run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - - name: test - working-directory: tests - run: bash PythonTest.sh - - build-go: - name: Build Go - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: flatc - # FIXME: make test script not rely on flatc - run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - - name: test - working-directory: tests - run: bash GoTest.sh - - build-php: - name: Build PHP - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: flatc - # FIXME: make test script not rely on flatc - run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - - name: test - working-directory: tests - run: | - php phpTest.php - sh phpUnionVectorTest.sh - - build-swift: - name: Test Swift Linux - strategy: - matrix: - swift: ["6.0", "6.1", "6.2"] - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - uses: swift-actions/setup-swift@v2 - with: - swift-version: ${{ matrix.swift }} - - name: Get swift version - run: swift --version - - name: test - run: swift test - - build-swift-windows: - name: Test swift windows - runs-on: windows-latest - steps: - - uses: actions/checkout@v6 - - uses: SwiftyLab/setup-swift@latest - with: - swift-version: '6.1' - - run: swift build - - run: swift test - - build-swift-wasm: - name: Test Swift Wasm - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - uses: swift-actions/setup-swift@v2 - with: - swift-version: 6.2.1 - - uses: bytecodealliance/actions/wasmtime/setup@v1 - - name: Install Swift SDK - run: swift sdk install https://download.swift.org/swift-6.2.1-release/wasm-sdk/swift-6.2.1-RELEASE/swift-6.2.1-RELEASE_wasm.artifactbundle.tar.gz --checksum 482b9f95462b87bedfafca94a092cf9ec4496671ca13b43745097122d20f18af - - name: Test - working-directory: tests/swift/Wasm.tests - run: | - swift sdk list - swift build --build-tests --swift-sdk swift-6.2.1-RELEASE_wasm - wasmtime --dir . .build/wasm32-unknown-wasip1/debug/FlatBuffers.Test.Swift.WasmPackageTests.xctest --testing-library swift-testing - - build-ts: - name: Build TS - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: flatc - # FIXME: make test script not rely on flatc - run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j - - name: pnpm - run: npm install -g pnpm - - name: deps - run: pnpm i - - name: compile - run: pnpm compile - - name: test - working-directory: tests/ts - run: | - python3 TypeScriptTest.py - - build-dart: - name: Build Dart - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - uses: dart-lang/setup-dart@v1 - with: - sdk: stable - - name: flatc - # FIXME: make test script not rely on flatc - run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - - name: test - working-directory: tests - run: bash DartTest.sh - - build-nim: - name: Build Nim - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - name: flatc - # FIXME: make test script not rely on flatc - run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j - - uses: jiro4989/setup-nim-action@v2 - - name: install library - working-directory: nim - run: nimble -y develop && nimble install - - name: test - working-directory: tests/nim - run: python3 testnim.py - - bazel: - name: Bazel - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - # Explicitly use 8.5.1 until we can update or https://github.com/actions/runner-images/issues/13564 is fixed. - - name: Set env - run: > - echo "USE_BAZEL_VERSION=8.5.1" >> $GITHUB_ENV - - name: bazel build - run: > - bazel build - //:flatc - //:flatbuffers - //tests:flatbuffers_test - - name: bazel test - run: > - bazel test - //tests:flatbuffers_test - - release-digests: - if: startsWith(github.ref, 'refs/tags/') - needs: [build-linux, build-windows, build-mac-intel, build-mac-universal] - outputs: - digests: ${{ steps.hash.outputs.digests }} - runs-on: ubuntu-24.04 - steps: - - name: Merge results - id: hash - env: - LINUXGCC_DIGESTS: "${{ needs.build-linux.outputs.digests-gcc }}" - LINUXCLANG_DIGESTS: "${{ needs.build-linux.outputs.digests-clang }}" - MAC_DIGESTS: "${{ needs.build-mac-universal.outputs.digests }}" - MACINTEL_DIGESTS: "${{ needs.build-mac-intel.outputs.digests }}" - WINDOWS_DIGESTS: "${{ needs.build-windows.outputs.digests }}" - run: | - set -euo pipefail - echo "$LINUXGCC_DIGESTS" | base64 -d > checksums.txt - echo "$LINUXCLANG_DIGESTS" | base64 -d >> checksums.txt - echo "$MAC_DIGESTS" | base64 -d >> checksums.txt - echo "$MACINTEL_DIGESTS" | base64 -d >> checksums.txt - echo "$WINDOWS_DIGESTS" | base64 -d >> checksums.txt - echo "digests=$(cat checksums.txt | base64 -w0)" >> $GITHUB_OUTPUT - - provenance: - if: startsWith(github.ref, 'refs/tags/') - needs: [release-digests] - permissions: - actions: read # To read the workflow path. - id-token: write # To sign the provenance. - contents: write # To add assets to a release. - uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0 - with: - base64-subjects: "${{ needs.release-digests.outputs.digests }}" - upload-assets: true # Optional: Upload to a new release diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml deleted file mode 100644 index d92859c..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: docs -on: - # For manual pushes. - workflow_dispatch: - - # Pushes to main that touch the documentation directory. - push: - branches: - - master - paths: - - 'docs/**' - -permissions: - contents: write -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Configure Git Credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v6 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v5 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install mkdocs-material - - run: pip install mkdocs-redirects - - run: mkdocs gh-deploy --force -f docs/mkdocs.yml diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml deleted file mode 100644 index d01947b..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler - -name: Labeler -permissions: read-all - -on: [pull_request_target] - -jobs: - label: - permissions: - contents: read - pull-requests: write - - runs-on: ubuntu-latest - - steps: - - uses: actions/labeler@v6 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml deleted file mode 100644 index eb08715..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: OSS-Fuzz -permissions: read-all - -on: - pull_request: - branches: - - master - paths: - - include/** - - src/** - - tests/**.cpp - - tests/**.h -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'flatbuffers' - language: c++ - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'flatbuffers' - language: c++ - fuzz-seconds: 60 - - name: Upload Crash - uses: actions/upload-artifact@v7 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml deleted file mode 100644 index 5463e5b..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml +++ /dev/null @@ -1,152 +0,0 @@ -name: Release -permissions: read-all - -on: - # For manual tests. - workflow_dispatch: - release: - types: [published] - -jobs: - publish-npm: - name: Publish NPM - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' - - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - publish-pypi: - name: Publish PyPi - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./python - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: '3.10' - - - name: Install Dependencies - run: | - python3 -m pip install --upgrade pip - python3 -m pip install build twine - - - name: Build - run: | - python3 -m build . - - - name: Upload to PyPi - run: | - python3 -m twine upload dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }} - - publish-nuget: - name: Publish NuGet - runs-on: windows-latest - defaults: - run: - working-directory: ./net/flatbuffers - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-dotnet@v5 - with: - dotnet-version: '8.0.x' - - name: Build - run: | - dotnet build Google.FlatBuffers.csproj -c Release - - - name: Pack - run: | - dotnet pack Google.FlatBuffers.csproj -c Release - - - name: Upload to NuGet - run: | - dotnet nuget push .\bin\Release\Google.FlatBuffers.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json - - publish-maven: - name: Publish Maven - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./java - steps: - - uses: actions/checkout@v6 - - - name: Set up Maven Central Repository - uses: actions/setup-java@v5 - with: - java-version: '11' - distribution: 'adopt' - cache: 'maven' - server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var - - - name: Publish Maven - run: mvn --batch-mode clean deploy - env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USER_V2 }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN_V2 }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - publish-maven-kotlin: - name: Publish Maven - Kotlin - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./kotlin - steps: - - uses: actions/checkout@v6 - - name: Set up Maven Central Repository - uses: actions/setup-java@v5 - with: - java-version: '11' - distribution: 'adopt' - cache: 'maven' - server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var - - - name: Publish Kotlin Library on Maven - run: ./gradlew publishAllPublicationsToSonatypeRepository - env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USER_V2 }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN_V2 }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - - publish-crates: - name: Publish crates.io - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Publish Flatbuffers - uses: katyo/publish-crates@v2 - with: - path: ./rust/flatbuffers - registry-token: ${{ secrets.CARGO_TOKEN }} - - - name: Publish Flexbuffers - uses: katyo/publish-crates@v2 - with: - path: ./rust/flexbuffers - registry-token: ${{ secrets.CARGO_TOKEN }} diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml deleted file mode 100644 index 1d35cd4..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Mark stale issues and pull requests -permissions: - issues: write - pull-requests: write - -on: - # For manual tests. - workflow_dispatch: - schedule: - - cron: "30 20 * * *" - -jobs: - stale: - - runs-on: ubuntu-latest - - steps: - - uses: actions/stale@v10 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - operations-per-run: 500 - exempt-all-milestones: true - remove-stale-when-updated: true - - stale-issue-message: 'This issue is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.' - close-issue-message: 'This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.' - days-before-issue-stale: 182 # 6 months - days-before-issue-close: 14 # 2 weeks - exempt-issue-labels: not-stale - - stale-pr-message: 'This pull request is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.' - close-pr-message: 'This pull request was automatically closed due to no activity for 6 months plus the 14 day notice period.' - days-before-pr-stale: 182 # 6 months - days-before-pr-close: 14 # 2 week - exempt-pr-labels: not-stale - exempt-draft-pr: false - diff --git a/vendor/warcraftxl/deps/flatbuffers/.gitignore b/vendor/warcraftxl/deps/flatbuffers/.gitignore deleted file mode 100644 index f27c9b4..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.gitignore +++ /dev/null @@ -1,162 +0,0 @@ -*_wire.txt -*_wire.bin -.DS_Store -**/.build -build -**/Packages -/*.xcodeproj -**/xcuserdata/ -**/xcshareddata/ -**/.swiftpm/ -*.o -*.o.d -*.class -*.a -*.swp -*~ -*.vcxproj -*.vcxproj.filters -*.vcxproj.user -*.sln -*.suo -*.opendb -*.keystore -**/.vs/** -**/bin/** -!tests/rust_usage_test/bin/** -**/gen/** -**/libs/** -**/obj/** -**/*.dir/** -**/CMakeFiles/** -**/cmake_install.cmake -**/install_manifest.txt -**/CMakeCache.txt -**/CMakeTestfile.cmake -**/CPackConfig.cmake -**/CPackSourceConfig.cmake -**/compile_commands.json -**/Debug/** -**/Release/** -**/RelWithDebInfo/** -**/x64/ #build artifacts from VS -build.xml -local.properties -project.properties -proguard-project.txt -linklint_results -Makefile -flatbenchmark -flatbenchmark.exe -flatc -flatc.exe -flathash -flathash.exe -flattests -flattests.exe -flattests_cpp17 -flattests_cpp17.exe -flatsamplebinary -flatsamplebinary.exe -flatsampletext -flatsampletext.exe -flatsamplebfbs -flatsamplebfbs.exe -grpctest -grpctest.exe -snapshot.sh -tags -tests/dart_gen -tests/go_gen -tests/monsterdata_java_wire.mon -tests/monsterdata_java_wire_sp.mon -tests/monsterdata_go_wire.mon -tests/monsterdata_javascript_wire.mon -tests/monsterdata_lobster_wire.mon -tests/monsterdata_rust_wire.mon -tests/php/ -CMakeLists.txt.user -CMakeScripts/** -CTestTestfile.cmake -flatbuffers-config-version.cmake -FlatBuffers.cbp -build/Xcode/FlatBuffers.xcodeproj/project.xcworkspace/** -build/Xcode/FlatBuffers.xcodeproj/xcuserdata/** -FlatBuffers.xcodeproj/ -java/.idea -java/*.iml -.idea -*.iml -target -java/target -**/*.pyc -build/VS2010/FlatBuffers.sdf -build/VS2010/FlatBuffers.opensdf -build/VS2010/ipch/**/*.ipch -*.so -Testing/Temporary -.cproject -.settings/ -.project -net/**/obj -node_modules/ -android/.externalNativeBuild/ -android/.gradle/ -android/build/ -samples/android/.externalNativeBuild/ -samples/android/.gradle/ -samples/android/build/ -js/**/*.js -js/**/*.d.ts -mjs/**/*.js -mjs/**/*.d.ts -/bazel-bin -/bazel-flatbuffers -/bazel-genfiles -/bazel-out -/bazel-testlogs -.ninja_deps -.ninja_log -build.ninja -rules.ninja -.vscode -dart/.pub/ -dart/.packages -dart/pubspec.lock -dart/.dart_tool/ -dart/build/ -dart/doc/api/ -Cargo.lock -.corpus** -.seed** -.crash** -grpc/google/ -**/Package.resolved -.clangd/** -package-lock.json -/*.ilk -/*.pdb -.clwb -yarn-error.log -.cache/ -/flatbuffers.lib -.cmake/ -**/dist -**/vendor -**/go.sum -flatbuffers.pc -**/FlatBuffers.Test.Swift.xcodeproj -**/html/** -**/latex/** -# https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_BASE_DIR -cmake-build-debug/ -_deps/ -**/.gradle/** -kotlin/**/generated -MODULE.bazel.lock - -# Ignore the generated docs -docs/site - -# Ignore generated files -*.fbs.h diff --git a/vendor/warcraftxl/deps/flatbuffers/.npmrc b/vendor/warcraftxl/deps/flatbuffers/.npmrc deleted file mode 100644 index 84ff079..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/.npmrc +++ /dev/null @@ -1 +0,0 @@ -hoist=false diff --git a/vendor/warcraftxl/deps/flatbuffers/LICENSE b/vendor/warcraftxl/deps/flatbuffers/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel b/vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel deleted file mode 100644 index 196181b..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") - -package( - default_visibility = ["//visibility:private"], -) - -filegroup( - name = "distribution", - srcs = [ - "BUILD.bazel", - ] + glob([ - "*.cc", - "*.h", - ]), - visibility = ["//visibility:public"], -) - -cc_library( - name = "namer", - hdrs = [ - "idl_namer.h", - "namer.h", - ], - strip_include_prefix = "/include", - visibility = ["//:__subpackages__"], - deps = ["//:runtime_cc"], -) - -cc_library( - name = "python", - srcs = ["python.cc"], - hdrs = ["python.h"], - strip_include_prefix = "/include", - visibility = [ - "//grpc:__subpackages__", - "//src:__subpackages__", - ], - deps = [":namer"], -) diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h b/vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h deleted file mode 100644 index 2aa716e..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef FLATBUFFERS_INCLUDE_CODEGEN_IDL_NAMER_H_ -#define FLATBUFFERS_INCLUDE_CODEGEN_IDL_NAMER_H_ - -#include "codegen/namer.h" -#include "flatbuffers/idl.h" - -namespace flatbuffers { - -// Provides Namer capabilities to types defined in the flatbuffers IDL. -class IdlNamer : public Namer { - public: - explicit IdlNamer(Config config, std::set keywords) - : Namer(config, std::move(keywords)) {} - - using Namer::Constant; - using Namer::Directories; - using Namer::Field; - using Namer::File; - using Namer::Function; - using Namer::Method; - using Namer::Namespace; - using Namer::NamespacedType; - using Namer::ObjectType; - using Namer::Type; - using Namer::Variable; - using Namer::Variant; - - std::string Constant(const FieldDef& d) const { return Constant(d.name); } - - // Types are always structs or enums so we can only expose these two - // overloads. - std::string Type(const StructDef& d) const { return Type(d.name); } - std::string Type(const EnumDef& d) const { return Type(d.name); } - - std::string Function(const Definition& s) const { return Function(s.name); } - std::string Function(const std::string& prefix, const Definition& s) const { - return Function(prefix + s.name); - } - - std::string Field(const FieldDef& s) const { return Field(s.name); } - std::string Field(const FieldDef& d, const std::string& s) const { - return Field(d.name + "_" + s); - } - - std::string Variable(const FieldDef& s) const { return Variable(s.name); } - - std::string Variable(const StructDef& s) const { return Variable(s.name); } - - std::string Variant(const EnumVal& s) const { return Variant(s.name); } - - std::string EnumVariant(const EnumDef& e, const EnumVal& v) const { - return Type(e) + config_.enum_variant_seperator + Variant(v); - } - - std::string ObjectType(const StructDef& d) const { - return ObjectType(d.name); - } - std::string ObjectType(const EnumDef& d) const { return ObjectType(d.name); } - - std::string Method(const FieldDef& d, const std::string& suffix) const { - return Method(d.name, suffix); - } - std::string Method(const std::string& prefix, const StructDef& d) const { - return Method(prefix, d.name); - } - std::string Method(const std::string& prefix, const FieldDef& d) const { - return Method(prefix, d.name); - } - std::string Method(const std::string& prefix, const FieldDef& d, - const std::string& suffix) const { - return Method(prefix, d.name, suffix); - } - - std::string Namespace(const struct Namespace& ns) const { - return Namespace(ns.components); - } - - std::string NamespacedEnumVariant(const EnumDef& e, const EnumVal& v) const { - return NamespacedString(e.defined_namespace, EnumVariant(e, v)); - } - - std::string NamespacedType(const Definition& def) const { - return NamespacedString(def.defined_namespace, Type(def.name)); - } - - std::string NamespacedObjectType(const Definition& def) const { - return NamespacedString(def.defined_namespace, ObjectType(def.name)); - } - - std::string Directories(const struct Namespace& ns, - SkipDir skips = SkipDir::None, - Case input_case = Case::kUpperCamel) const { - return Directories(ns.components, skips, input_case); - } - - // Legacy fields do not really follow the usual config and should be - // considered for deprecation. - - std::string LegacyRustNativeVariant(const EnumVal& v) const { - return ConvertCase(EscapeKeyword(v.name), Case::kUpperCamel); - } - - std::string LegacyRustFieldOffsetName(const FieldDef& field) const { - return "VT_" + ConvertCase(EscapeKeyword(field.name), Case::kAllUpper); - } - std::string LegacyRustUnionTypeOffsetName(const FieldDef& field) const { - return "VT_" + - ConvertCase(EscapeKeyword(field.name + "_type"), Case::kAllUpper); - } - - std::string LegacySwiftVariant(const EnumVal& ev) const { - auto name = ev.name; - if (isupper(name.front())) { - std::transform(name.begin(), name.end(), name.begin(), CharToLower); - } - return EscapeKeyword(ConvertCase(name, Case::kLowerCamel)); - } - - // Also used by Kotlin, lol. - std::string LegacyJavaMethod2(const std::string& prefix, const StructDef& sd, - const std::string& suffix) const { - return prefix + sd.name + suffix; - } - - std::string LegacyKotlinVariant(EnumVal& ev) const { - // Namer assumes the input case is snake case which is wrong... - return ConvertCase(EscapeKeyword(ev.name), Case::kLowerCamel); - } - // Kotlin methods escapes keywords after case conversion but before - // prefixing and suffixing. - std::string LegacyKotlinMethod(const std::string& prefix, const FieldDef& d, - const std::string& suffix) const { - return prefix + ConvertCase(EscapeKeyword(d.name), Case::kUpperCamel) + - suffix; - } - std::string LegacyKotlinMethod(const std::string& prefix, const StructDef& d, - const std::string& suffix) const { - return prefix + ConvertCase(EscapeKeyword(d.name), Case::kUpperCamel) + - suffix; - } - - // This is a mix of snake case and keep casing, when Ts should be using - // lower camel case. - std::string LegacyTsMutateMethod(const FieldDef& d) { - return "mutate_" + d.name; - } - - std::string LegacyRustUnionTypeMethod(const FieldDef& d) { - // assert d is a union - // d should convert case but not escape keywords due to historical reasons - return ConvertCase(d.name, config_.fields, Case::kLowerCamel) + "_type"; - } - - private: - std::string NamespacedString(const struct Namespace* ns, - const std::string& str) const { - std::string ret; - if (ns != nullptr) { - ret += Namespace(ns->components); - } - if (!ret.empty()) ret += config_.namespace_seperator; - return ret + str; - } -}; - -// This is a temporary helper function for code generators to call until all -// flag-overriding logic into flatc.cpp -inline Namer::Config WithFlagOptions(const Namer::Config& input, - const IDLOptions& opts, - const std::string& path) { - Namer::Config result = input; - result.object_prefix = opts.object_prefix; - result.object_suffix = opts.object_suffix; - result.output_path = path; - result.filename_suffix = opts.filename_suffix; - return result; -} - -} // namespace flatbuffers - -#endif // FLATBUFFERS_INCLUDE_CODEGEN_IDL_NAMER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h b/vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h deleted file mode 100644 index d447b56..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h +++ /dev/null @@ -1,286 +0,0 @@ -#ifndef FLATBUFFERS_INCLUDE_CODEGEN_NAMER_H_ -#define FLATBUFFERS_INCLUDE_CODEGEN_NAMER_H_ - -#include "flatbuffers/util.h" - -namespace flatbuffers { - -// Options for Namer::File. -enum class SkipFile { - None = 0, - Suffix = 1, - Extension = 2, - SuffixAndExtension = 3, -}; -inline SkipFile operator&(SkipFile a, SkipFile b) { - return static_cast(static_cast(a) & static_cast(b)); -} -// Options for Namer::Directories -enum class SkipDir { - None = 0, - // Skip prefixing the -o $output_path. - OutputPath = 1, - // Skip trailing path seperator. - TrailingPathSeperator = 2, - OutputPathAndTrailingPathSeparator = 3, -}; -inline SkipDir operator&(SkipDir a, SkipDir b) { - return static_cast(static_cast(a) & static_cast(b)); -} - -// `Namer` applies style configuration to symbols in generated code. It manages -// casing, escapes keywords, and object API naming. -// TODO: Refactor all code generators to use this. -class Namer { - public: - struct Config { - // Symbols in code. - - // Case style for flatbuffers-defined types. - // e.g. `class TableA {}` - Case types; - // Case style for flatbuffers-defined constants. - // e.g. `uint64_t ENUM_A_MAX`; - Case constants; - // Case style for flatbuffers-defined methods. - // e.g. `class TableA { int field_a(); }` - Case methods; - // Case style for flatbuffers-defined functions. - // e.g. `TableA* get_table_a_root()`; - Case functions; - // Case style for flatbuffers-defined fields. - // e.g. `struct Struct { int my_field; }` - Case fields; - // Case style for flatbuffers-defined variables. - // e.g. `int my_variable = 2` - Case variables; - // Case style for flatbuffers-defined variants. - // e.g. `enum class Enum { MyVariant, }` - Case variants; - // Seperator for qualified enum names. - // e.g. `Enum::MyVariant` uses `::`. - std::string enum_variant_seperator; - - // Configures, when formatting code, whether symbols are checked against - // keywords and escaped before or after case conversion. It does not make - // sense to do so before, but its legacy behavior. :shrug: - // TODO(caspern): Deprecate. - enum class Escape { - BeforeConvertingCase, - AfterConvertingCase, - }; - Escape escape_keywords; - - // Namespaces - - // e.g. `namespace my_namespace {}` - Case namespaces; - // The seperator between namespaces in a namespace path. - std::string namespace_seperator; - - // Object API. - // Native versions flatbuffers types have this prefix. - // e.g. "" (it's usually empty string) - std::string object_prefix; - // Native versions flatbuffers types have this suffix. - // e.g. "T" - std::string object_suffix; - - // Keywords. - // Prefix used to escape keywords. It is usually empty string. - std::string keyword_prefix; - // Suffix used to escape keywords. It is usually "_". - std::string keyword_suffix; - // The casing used for keywords when escaping. For most languages, keywords - // are case sensitive. PHP is an instance where some keywords are case - // insensitive. - enum class KeywordsCasing { - CaseSensitive, - CaseInsensitive, - }; - KeywordsCasing keywords_casing; - - // Files. - - // Case style for filenames. e.g. `foo_bar_generated.rs` - Case filenames; - // Case style for directories, e.g. `output_files/foo_bar/baz/` - Case directories; - // The directory within which we will generate files. - std::string output_path; - // Suffix for generated file names, e.g. "_generated". - std::string filename_suffix; - // Extension for generated files, e.g. ".cpp" or ".rs". - std::string filename_extension; - }; - Namer(Config config, std::set keywords) - : config_(config), keywords_(std::move(keywords)) {} - - virtual ~Namer() {} - - template - std::string Method(const T& s) const { - return Method(s.name); - } - - virtual std::string Method(const std::string& pre, const std::string& mid, - const std::string& suf) const { - return Format(pre + "_" + mid + "_" + suf, config_.methods); - } - virtual std::string Method(const std::string& pre, - const std::string& suf) const { - return Format(pre + "_" + suf, config_.methods); - } - virtual std::string Method(const std::string& s) const { - return Format(s, config_.methods); - } - - virtual std::string Constant(const std::string& s) const { - return Format(s, config_.constants); - } - - virtual std::string Function(const std::string& s) const { - return Format(s, config_.functions); - } - - virtual std::string Variable(const std::string& s) const { - return Format(s, config_.variables); - } - - template - std::string Variable(const std::string& p, const T& s) const { - return Format(p + "_" + s.name, config_.variables); - } - virtual std::string Variable(const std::string& p, - const std::string& s) const { - return Format(p + "_" + s, config_.variables); - } - - virtual std::string Namespace(const std::string& s) const { - return Format(s, config_.namespaces); - } - - virtual std::string Namespace(const std::vector& ns) const { - std::string result; - for (auto it = ns.begin(); it != ns.end(); it++) { - if (it != ns.begin()) result += config_.namespace_seperator; - result += Namespace(*it); - } - return result; - } - - virtual std::string NamespacedType(const std::vector& ns, - const std::string& s) const { - return (ns.empty() ? "" : (Namespace(ns) + config_.namespace_seperator)) + - Type(s); - } - - // Returns `filename` with the right casing, suffix, and extension. - virtual std::string File(const std::string& filename, - SkipFile skips = SkipFile::None) const { - const bool skip_suffix = (skips & SkipFile::Suffix) != SkipFile::None; - const bool skip_ext = (skips & SkipFile::Extension) != SkipFile::None; - return ConvertCase(filename, config_.filenames, Case::kUpperCamel) + - (skip_suffix ? "" : config_.filename_suffix) + - (skip_ext ? "" : config_.filename_extension); - } - template - std::string File(const T& f, SkipFile skips = SkipFile::None) const { - return File(f.name, skips); - } - - // Formats `directories` prefixed with the output_path and joined with the - // right seperator. Output path prefixing and the trailing separator may be - // skiped using `skips`. - // Callers may want to use `EnsureDirExists` with the result. - // input_case is used to tell how to modify namespace. e.g. kUpperCamel will - // add a underscode between case changes, so MyGame turns into My_Game - // (depending also on the output_case). - virtual std::string Directories(const std::vector& directories, - SkipDir skips = SkipDir::None, - Case input_case = Case::kUpperCamel) const { - const bool skip_output_path = - (skips & SkipDir::OutputPath) != SkipDir::None; - const bool skip_trailing_seperator = - (skips & SkipDir::TrailingPathSeperator) != SkipDir::None; - std::string result = skip_output_path ? "" : config_.output_path; - for (auto d = directories.begin(); d != directories.end(); d++) { - result += ConvertCase(*d, config_.directories, input_case); - result.push_back(kPathSeparator); - } - if (skip_trailing_seperator && !result.empty()) result.pop_back(); - return result; - } - - virtual std::string NormalizeKeywordCase(const std::string& name) const { - if (config_.keywords_casing == Config::KeywordsCasing::CaseInsensitive) { - return ConvertCase(name, Case::kAllLower); - } else { - return name; - } - } - - virtual std::string EscapeKeyword(const std::string& name) const { - if (keywords_.find(NormalizeKeywordCase(name)) == keywords_.end()) { - return name; - } else { - return config_.keyword_prefix + name + config_.keyword_suffix; - } - } - - virtual std::string Type(const std::string& s) const { - return Format(s, config_.types); - } - virtual std::string Type(const std::string& t, const std::string& s) const { - return Format(t + "_" + s, config_.types); - } - - virtual std::string ObjectType(const std::string& s) const { - return config_.object_prefix + Type(s) + config_.object_suffix; - } - - virtual std::string Field(const std::string& s) const { - return Format(s, config_.fields); - } - - virtual std::string Variant(const std::string& s) const { - return Format(s, config_.variants); - } - - virtual std::string Format(const std::string& s, Case casing) const { - if (config_.escape_keywords == Config::Escape::BeforeConvertingCase) { - return ConvertCase(EscapeKeyword(s), casing, Case::kLowerCamel); - } else { - return EscapeKeyword(ConvertCase(s, casing, Case::kLowerCamel)); - } - } - - // Denamespaces a string (e.g. The.Quick.Brown.Fox) by returning the last part - // after the `delimiter` (Fox) and placing the rest in `namespace_prefix` - // (The.Quick.Brown). - virtual std::string Denamespace(const std::string& s, - std::string& namespace_prefix, - const char delimiter = '.') const { - const size_t pos = s.find_last_of(delimiter); - if (pos == std::string::npos) { - namespace_prefix = ""; - return s; - } - namespace_prefix = s.substr(0, pos); - return s.substr(pos + 1); - } - - // Same as above, but disregards the prefix. - virtual std::string Denamespace(const std::string& s, - const char delimiter = '.') const { - std::string prefix; - return Denamespace(s, prefix, delimiter); - } - - const Config config_; - const std::set keywords_; -}; - -} // namespace flatbuffers - -#endif // FLATBUFFERS_INCLUDE_CODEGEN_NAMER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc b/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc deleted file mode 100644 index 3225371..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc +++ /dev/null @@ -1,79 +0,0 @@ -#include "codegen/python.h" - -#include -#include -#include -#include - -namespace flatbuffers { -namespace python { -Version::Version(const std::string& version) { - std::stringstream ss(version); - char dot; - ss >> major >> dot >> minor >> dot >> micro; -} - -bool Version::IsValid() const { - return (major == 0 || major == 2 || major == 3) && minor >= 0 && micro >= 0; -} - -std::set Keywords(const Version& version) { - switch (version.major) { - case 2: - // https://docs.python.org/2/reference/lexical_analysis.html#keywords - return { - "and", "as", "assert", "break", "class", "continue", "def", - "del", "elif", "else", "except", "exec", "finally", "for", - "from", "global", "if", "import", "in", "is", "lambda", - "not", "or", "pass", "print", "raise", "return", "try", - "while", "with", "yield", - }; - case 0: - case 3: - // https://docs.python.org/3/reference/lexical_analysis.html#keywords - return { - "and", "as", "assert", "async", "await", "break", - "class", "continue", "def", "del", "elif", "else", - "except", "False", "finally", "for", "from", "global", - "if", "import", "in", "is", "lambda", "None", - "nonlocal", "not", "or", "pass", "raise", "return", - "True", "try", "while", "with", "yield", - }; - default: - return {}; - } -} - -const python::Import& python::Imports::Import(const std::string& module) { - python::Import import; - import.module = module; - imports.push_back(std::move(import)); - return imports.back(); -} - -const python::Import& python::Imports::Import(const std::string& module, - const std::string& name) { - python::Import import; - import.module = module; - import.name = name; - imports.push_back(std::move(import)); - return imports.back(); -} - -const python::Import& python::Imports::Export(const std::string& module) { - python::Import import; - import.module = module; - exports.push_back(std::move(import)); - return exports.back(); -} - -const python::Import& python::Imports::Export(const std::string& module, - const std::string& name) { - python::Import import; - import.module = module; - import.name = name; - exports.push_back(std::move(import)); - return exports.back(); -} -} // namespace python -} // namespace flatbuffers diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h b/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h deleted file mode 100644 index a0a1ba8..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef FLATBUFFERS_INCLUDE_CODEGEN_PYTHON_H_ -#define FLATBUFFERS_INCLUDE_CODEGEN_PYTHON_H_ - -#include -#include -#include -#include - -#include "codegen/namer.h" - -namespace flatbuffers { -namespace python { -static const Namer::Config kConfig = { - /*types=*/Case::kKeep, - /*constants=*/Case::kScreamingSnake, - /*methods=*/Case::kUpperCamel, - /*functions=*/Case::kUpperCamel, - /*fields=*/Case::kLowerCamel, - /*variable=*/Case::kLowerCamel, - /*variants=*/Case::kKeep, - /*enum_variant_seperator=*/".", - /*escape_keywords=*/Namer::Config::Escape::AfterConvertingCase, - /*namespaces=*/Case::kKeep, // Packages in python. - /*namespace_seperator=*/".", - /*object_prefix=*/"", - /*object_suffix=*/"T", - /*keyword_prefix=*/"", - /*keyword_suffix=*/"_", - /*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive, - /*filenames=*/Case::kKeep, - /*directories=*/Case::kKeep, - /*output_path=*/"", - /*filename_suffix=*/"", - /*filename_extension=*/".py", -}; - -static const Namer::Config kStubConfig = { - /*types=*/Case::kKeep, - /*constants=*/Case::kScreamingSnake, - /*methods=*/Case::kUpperCamel, - /*functions=*/Case::kUpperCamel, - /*fields=*/Case::kLowerCamel, - /*variables=*/Case::kLowerCamel, - /*variants=*/Case::kKeep, - /*enum_variant_seperator=*/".", - /*escape_keywords=*/Namer::Config::Escape::AfterConvertingCase, - /*namespaces=*/Case::kKeep, // Packages in python. - /*namespace_seperator=*/".", - /*object_prefix=*/"", - /*object_suffix=*/"T", - /*keyword_prefix=*/"", - /*keyword_suffix=*/"_", - /*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive, - /*filenames=*/Case::kKeep, - /*directories=*/Case::kKeep, - /*output_path=*/"", - /*filename_suffix=*/"", - /*filename_extension=*/".pyi", -}; - -// `Version` represent a Python version. -// -// The zero value (i.e. `Version{}`) represents both Python2 and Python3. -// -// https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work -struct Version { - explicit Version(const std::string& version); - - bool IsValid() const; - - int16_t major = 0; - int16_t minor = 0; - int16_t micro = 0; -}; - -std::set Keywords(const Version& version); - -struct Import { - bool IsLocal() const { return module == "."; } - - std::string module; - std::string name; -}; - -struct Imports { - const python::Import& Import(const std::string& module); - const python::Import& Import(const std::string& module, - const std::string& name); - - const python::Import& Export(const std::string& module); - const python::Import& Export(const std::string& module, - const std::string& name); - - std::vector imports; - std::vector exports; -}; -} // namespace python -} // namespace flatbuffers - -#endif // FLATBUFFERS_INCLUDE_CODEGEN_PYTHON_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h deleted file mode 100644 index d451818..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_ALLOCATOR_H_ -#define FLATBUFFERS_ALLOCATOR_H_ - -#include "flatbuffers/base.h" - -namespace flatbuffers { - -// Allocator interface. This is flatbuffers-specific and meant only for -// `vector_downward` usage. -class Allocator { - public: - virtual ~Allocator() {} - - // Allocate `size` bytes of memory. - virtual uint8_t* allocate(size_t size) = 0; - - // Deallocate `size` bytes of memory at `p` allocated by this allocator. - virtual void deallocate(uint8_t* p, size_t size) = 0; - - // Reallocate `new_size` bytes of memory, replacing the old region of size - // `old_size` at `p`. In contrast to a normal realloc, this grows downwards, - // and is intended specifcally for `vector_downward` use. - // `in_use_back` and `in_use_front` indicate how much of `old_size` is - // actually in use at each end, and needs to be copied. - virtual uint8_t* reallocate_downward(uint8_t* old_p, size_t old_size, - size_t new_size, size_t in_use_back, - size_t in_use_front) { - FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows - uint8_t* new_p = allocate(new_size); - memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, - in_use_front); - deallocate(old_p, old_size); - return new_p; - } - - protected: - // Called by `reallocate_downward` to copy memory from `old_p` of `old_size` - // to `new_p` of `new_size`. Only memory of size `in_use_front` and - // `in_use_back` will be copied from the front and back of the old memory - // allocation. - void memcpy_downward(uint8_t* old_p, size_t old_size, uint8_t* new_p, - size_t new_size, size_t in_use_back, - size_t in_use_front) { - memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back, - in_use_back); - memcpy(new_p, old_p, in_use_front); - } -}; - -} // namespace flatbuffers - -#endif // FLATBUFFERS_ALLOCATOR_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h deleted file mode 100644 index 163d8c3..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_ARRAY_H_ -#define FLATBUFFERS_ARRAY_H_ - -#include -#include - -#include "flatbuffers/base.h" -#include "flatbuffers/stl_emulation.h" -#include "flatbuffers/vector.h" - -namespace flatbuffers { - -// This is used as a helper type for accessing arrays. -template -class Array { - // Array can carry only POD data types (scalars or structs). - typedef typename flatbuffers::bool_constant::value> - scalar_tag; - - public: - typedef uint16_t size_type; - typedef typename IndirectHelper::return_type return_type; - typedef VectorConstIterator const_iterator; - typedef VectorReverseIterator const_reverse_iterator; - - // If T is a non-pointer and a LE-scalar or a struct (!scalar_tag::value). - static FLATBUFFERS_CONSTEXPR bool is_span_observable = - !std::is_pointer::value && - ((scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1)) || - !scalar_tag::value); - - FLATBUFFERS_CONSTEXPR uint16_t size() const { return length; } - - return_type Get(uoffset_t i) const { - FLATBUFFERS_ASSERT(i < size()); - return IndirectHelper::Read(Data(), i); - } - - return_type operator[](uoffset_t i) const { return Get(i); } - - // If this is a Vector of enums, T will be its storage type, not the enum - // type. This function makes it convenient to retrieve value with enum - // type E. - template - E GetEnum(uoffset_t i) const { - return static_cast(Get(i)); - } - - const_iterator begin() const { return const_iterator(Data(), 0); } - const_iterator end() const { return const_iterator(Data(), size()); } - - const_reverse_iterator rbegin() const { - return const_reverse_iterator(end()); - } - const_reverse_iterator rend() const { - return const_reverse_iterator(begin()); - } - - const_iterator cbegin() const { return begin(); } - const_iterator cend() const { return end(); } - - const_reverse_iterator crbegin() const { return rbegin(); } - const_reverse_iterator crend() const { return rend(); } - - // Get a mutable pointer to elements inside this array. - // This method used to mutate arrays of structs followed by a @p Mutate - // operation. For primitive types use @p Mutate directly. - // @warning Assignments and reads to/from the dereferenced pointer are not - // automatically converted to the correct endianness. - typename flatbuffers::conditional::type - GetMutablePointer(uoffset_t i) const { - FLATBUFFERS_ASSERT(i < size()); - return const_cast(&data()[i]); - } - - // Change elements if you have a non-const pointer to this object. - void Mutate(uoffset_t i, const T& val) { MutateImpl(scalar_tag(), i, val); } - - // The raw data in little endian format. Use with care. - const uint8_t* Data() const { return data_; } - - uint8_t* Data() { return data_; } - - // Similarly, but typed, much like std::vector::data - const T* data() const { return reinterpret_cast(Data()); } - T* data() { return reinterpret_cast(Data()); } - - // Copy data from a span with endian conversion. - // If this Array and the span overlap, the behavior is undefined. - void CopyFromSpan(flatbuffers::span src) { - const auto p1 = reinterpret_cast(src.data()); - const auto p2 = Data(); - FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) && - !(p2 >= p1 && p2 < (p1 + length))); - (void)p1; - (void)p2; - CopyFromSpanImpl(flatbuffers::bool_constant(), src); - } - - protected: - void MutateImpl(flatbuffers::true_type, uoffset_t i, const T& val) { - FLATBUFFERS_ASSERT(i < size()); - WriteScalar(data() + i, val); - } - - void MutateImpl(flatbuffers::false_type, uoffset_t i, const T& val) { - *(GetMutablePointer(i)) = val; - } - - void CopyFromSpanImpl(flatbuffers::true_type, - flatbuffers::span src) { - // Use std::memcpy() instead of std::copy() to avoid performance degradation - // due to aliasing if T is char or unsigned char. - // The size is known at compile time, so memcpy would be inlined. - std::memcpy(data(), src.data(), length * sizeof(T)); - } - - // Copy data from flatbuffers::span with endian conversion. - void CopyFromSpanImpl(flatbuffers::false_type, - flatbuffers::span src) { - for (size_type k = 0; k < length; k++) { - Mutate(k, src[k]); - } - } - - // This class is only used to access pre-existing data. Don't ever - // try to construct these manually. - // 'constexpr' allows us to use 'size()' at compile time. - // @note Must not use 'FLATBUFFERS_CONSTEXPR' here, as const is not allowed on - // a constructor. -#if defined(__cpp_constexpr) - constexpr Array(); -#else - Array(); -#endif - - uint8_t data_[length * sizeof(T)]; - - private: - // This class is a pointer. Copying will therefore create an invalid object. - // Private and unimplemented copy constructor. - Array(const Array&); - Array& operator=(const Array&); -}; - -// Specialization for Array[struct] with access using Offset pointer. -// This specialization used by idl_gen_text.cpp. -template class OffsetT> -class Array, length> { - static_assert(flatbuffers::is_same::value, "unexpected type T"); - - public: - typedef const void* return_type; - typedef uint16_t size_type; - - const uint8_t* Data() const { return data_; } - - // Make idl_gen_text.cpp::PrintContainer happy. - return_type operator[](uoffset_t) const { - FLATBUFFERS_ASSERT(false); - return nullptr; - } - - private: - // This class is only used to access pre-existing data. - Array(); - Array(const Array&); - Array& operator=(const Array&); - - uint8_t data_[1]; -}; - -template -FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span(Array& arr) - FLATBUFFERS_NOEXCEPT { - static_assert( - Array::is_span_observable, - "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); - return span(arr.data(), N); -} - -template -FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span( - const Array& arr) FLATBUFFERS_NOEXCEPT { - static_assert( - Array::is_span_observable, - "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); - return span(arr.data(), N); -} - -template -FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span -make_bytes_span(Array& arr) FLATBUFFERS_NOEXCEPT { - static_assert(Array::is_span_observable, - "internal error, Array might hold only scalars or structs"); - return span(arr.Data(), sizeof(U) * N); -} - -template -FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span -make_bytes_span(const Array& arr) FLATBUFFERS_NOEXCEPT { - static_assert(Array::is_span_observable, - "internal error, Array might hold only scalars or structs"); - return span(arr.Data(), sizeof(U) * N); -} - -// Cast a raw T[length] to a raw flatbuffers::Array -// without endian conversion. Use with care. -// TODO: move these Cast-methods to `internal` namespace. -template -Array& CastToArray(T (&arr)[length]) { - return *reinterpret_cast*>(arr); -} - -template -const Array& CastToArray(const T (&arr)[length]) { - return *reinterpret_cast*>(arr); -} - -template -Array& CastToArrayOfEnum(T (&arr)[length]) { - static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); - return *reinterpret_cast*>(arr); -} - -template -const Array& CastToArrayOfEnum(const T (&arr)[length]) { - static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); - return *reinterpret_cast*>(arr); -} - -template -bool operator==(const Array& lhs, - const Array& rhs) noexcept { - return std::addressof(lhs) == std::addressof(rhs) || - (lhs.size() == rhs.size() && - std::memcmp(lhs.Data(), rhs.Data(), rhs.size() * sizeof(T)) == 0); -} - -} // namespace flatbuffers - -#endif // FLATBUFFERS_ARRAY_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h deleted file mode 100644 index 1d2ab58..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h +++ /dev/null @@ -1,503 +0,0 @@ -#ifndef FLATBUFFERS_BASE_H_ -#define FLATBUFFERS_BASE_H_ - -// clang-format off - -// If activate should be declared and included first. -#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && \ - defined(_MSC_VER) && defined(_DEBUG) - // The _CRTDBG_MAP_ALLOC inside will replace - // calloc/free (etc) to its debug version using #define directives. - #define _CRTDBG_MAP_ALLOC - #include - #include - // Replace operator new by trace-enabled version. - #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) - #define new DEBUG_NEW -#endif - -#if !defined(FLATBUFFERS_ASSERT) -#include -#define FLATBUFFERS_ASSERT assert -#elif defined(FLATBUFFERS_ASSERT_INCLUDE) -// Include file with forward declaration -#include FLATBUFFERS_ASSERT_INCLUDE -#endif - -#ifndef ARDUINO -#include -#endif - -#include -#include -#include - -#if defined(ARDUINO) && !defined(ARDUINOSTL_M_H) && defined(__AVR__) - #include -#else - #include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__unix__) && !defined(FLATBUFFERS_LOCALE_INDEPENDENT) - #include -#endif - -#ifdef __ANDROID__ - #include -#endif - -#if defined(__ICCARM__) -#include -#endif - -// Note the __clang__ check is needed, because clang presents itself -// as an older GNUC compiler (4.2). -// Clang 3.3 and later implement all of the ISO C++ 2011 standard. -// Clang 3.4 and later implement all of the ISO C++ 2014 standard. -// http://clang.llvm.org/cxx_status.html - -// Note the MSVC value '__cplusplus' may be incorrect: -// The '__cplusplus' predefined macro in the MSVC stuck at the value 199711L, -// indicating (erroneously!) that the compiler conformed to the C++98 Standard. -// This value should be correct starting from MSVC2017-15.7-Preview-3. -// The '__cplusplus' will be valid only if MSVC2017-15.7-P3 and the `/Zc:__cplusplus` switch is set. -// Workaround (for details see MSDN): -// Use the _MSC_VER and _MSVC_LANG definition instead of the __cplusplus for compatibility. -// The _MSVC_LANG macro reports the Standard version regardless of the '/Zc:__cplusplus' switch. - -#if defined(__GNUC__) && !defined(__clang__) - #define FLATBUFFERS_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#else - #define FLATBUFFERS_GCC 0 -#endif - -#if defined(__clang__) - #define FLATBUFFERS_CLANG (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#else - #define FLATBUFFERS_CLANG 0 -#endif - -/// @cond FLATBUFFERS_INTERNAL -#if __cplusplus <= 199711L && \ - (!defined(_MSC_VER) || _MSC_VER < 1600) && \ - (!defined(__GNUC__) || \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400)) - #error A C++11 compatible compiler with support for the auto typing is \ - required for FlatBuffers. - #error __cplusplus _MSC_VER __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ -#endif - -#if !defined(__clang__) && \ - defined(__GNUC__) && \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40600) - // Backwards compatibility for g++ 4.4, and 4.5 which don't have the nullptr - // and constexpr keywords. Note the __clang__ check is needed, because clang - // presents itself as an older GNUC compiler. - #ifndef nullptr_t - const class nullptr_t { - public: - template inline operator T*() const { return 0; } - private: - void operator&() const; - } nullptr = {}; - #endif - #ifndef constexpr - #define constexpr const - #endif -#endif - -// The wire format uses a little endian encoding (since that's efficient for -// the common platforms). -#if defined(__s390x__) - #define FLATBUFFERS_LITTLEENDIAN 0 -#endif // __s390x__ -#if !defined(FLATBUFFERS_LITTLEENDIAN) - #if defined(__GNUC__) || defined(__clang__) || defined(__ICCARM__) - #if (defined(__BIG_ENDIAN__) || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - #define FLATBUFFERS_LITTLEENDIAN 0 - #else - #define FLATBUFFERS_LITTLEENDIAN 1 - #endif // __BIG_ENDIAN__ - #elif defined(_MSC_VER) - #if defined(_M_PPC) - #define FLATBUFFERS_LITTLEENDIAN 0 - #else - #define FLATBUFFERS_LITTLEENDIAN 1 - #endif - #else - #error Unable to determine endianness, define FLATBUFFERS_LITTLEENDIAN. - #endif -#endif // !defined(FLATBUFFERS_LITTLEENDIAN) - -#define FLATBUFFERS_VERSION_MAJOR 25 -#define FLATBUFFERS_VERSION_MINOR 12 -#define FLATBUFFERS_VERSION_REVISION 19 -#define FLATBUFFERS_STRING_EXPAND(X) #X -#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) -namespace flatbuffers { - // Returns version as string "MAJOR.MINOR.REVISION". - const char* FLATBUFFERS_VERSION(); -} - -#if (!defined(_MSC_VER) || _MSC_VER > 1600) && \ - (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \ - defined(__clang__) - #define FLATBUFFERS_FINAL_CLASS final - #define FLATBUFFERS_OVERRIDE override - #define FLATBUFFERS_EXPLICIT_CPP11 explicit - #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : ::flatbuffers::voffset_t -#else - #define FLATBUFFERS_FINAL_CLASS - #define FLATBUFFERS_OVERRIDE - #define FLATBUFFERS_EXPLICIT_CPP11 - #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE -#endif - -#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \ - (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \ - (defined(__cpp_constexpr) && __cpp_constexpr >= 200704) - #define FLATBUFFERS_CONSTEXPR constexpr - #define FLATBUFFERS_CONSTEXPR_CPP11 constexpr - #define FLATBUFFERS_CONSTEXPR_DEFINED -#else - #define FLATBUFFERS_CONSTEXPR const - #define FLATBUFFERS_CONSTEXPR_CPP11 -#endif - -#if (defined(__cplusplus) && __cplusplus >= 201402L) || \ - (defined(__cpp_constexpr) && __cpp_constexpr >= 201304) - #define FLATBUFFERS_CONSTEXPR_CPP14 FLATBUFFERS_CONSTEXPR_CPP11 -#else - #define FLATBUFFERS_CONSTEXPR_CPP14 -#endif - -#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \ - (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 190023026)) || \ - defined(__clang__) - #define FLATBUFFERS_NOEXCEPT noexcept -#else - #define FLATBUFFERS_NOEXCEPT -#endif - -// NOTE: the FLATBUFFERS_DELETE_FUNC macro may change the access mode to -// private, so be sure to put it at the end or reset access mode explicitly. -#if (!defined(_MSC_VER) || _MSC_FULL_VER >= 180020827) && \ - (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) || \ - defined(__clang__) - #define FLATBUFFERS_DELETE_FUNC(func) func = delete -#else - #define FLATBUFFERS_DELETE_FUNC(func) private: func -#endif - -#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \ - (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \ - defined(__clang__) - #define FLATBUFFERS_DEFAULT_DECLARATION -#endif - -// Check if we can use template aliases -// Not possible if Microsoft Compiler before 2012 -// Possible is the language feature __cpp_alias_templates is defined well -// Or possible if the C++ std is C+11 or newer -#if (defined(_MSC_VER) && _MSC_VER > 1700 /* MSVC2012 */) \ - || (defined(__cpp_alias_templates) && __cpp_alias_templates >= 200704) \ - || (defined(__cplusplus) && __cplusplus >= 201103L) - #define FLATBUFFERS_TEMPLATES_ALIASES -#endif - -#ifndef FLATBUFFERS_HAS_STRING_VIEW - // Only provide flatbuffers::string_view if __has_include can be used - // to detect a header that provides an implementation - #if defined(__has_include) - // Check for std::string_view (in c++17) - #if __has_include() && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17)) - #include - namespace flatbuffers { - typedef std::string_view string_view; - } - #define FLATBUFFERS_HAS_STRING_VIEW 1 - // Check for std::experimental::string_view (in c++14, compiler-dependent) - #elif __has_include() && (__cplusplus >= 201411) - #include - namespace flatbuffers { - typedef std::experimental::string_view string_view; - } - #define FLATBUFFERS_HAS_STRING_VIEW 1 - // Check for absl::string_view - #elif __has_include("absl/strings/string_view.h") && \ - __has_include("absl/base/config.h") && \ - (__cplusplus >= 201411) - #include "absl/base/config.h" - #if !defined(ABSL_USES_STD_STRING_VIEW) - #include "absl/strings/string_view.h" - namespace flatbuffers { - typedef absl::string_view string_view; - } - #define FLATBUFFERS_HAS_STRING_VIEW 1 - #endif - #endif - #endif // __has_include -#endif // !FLATBUFFERS_HAS_STRING_VIEW - -#ifndef FLATBUFFERS_GENERAL_HEAP_ALLOC_OK - // Allow heap allocations to be used - #define FLATBUFFERS_GENERAL_HEAP_ALLOC_OK 1 -#endif // !FLATBUFFERS_GENERAL_HEAP_ALLOC_OK - -#ifndef FLATBUFFERS_HAS_NEW_STRTOD - // Modern (C++11) strtod and strtof functions are available for use. - // 1) nan/inf strings as argument of strtod; - // 2) hex-float as argument of strtod/strtof. - #if (defined(_MSC_VER) && _MSC_VER >= 1900) || \ - (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \ - (defined(__clang__)) - #define FLATBUFFERS_HAS_NEW_STRTOD 1 - #endif -#endif // !FLATBUFFERS_HAS_NEW_STRTOD - -#ifndef FLATBUFFERS_LOCALE_INDEPENDENT - // Enable locale independent functions {strtof_l, strtod_l,strtoll_l, - // strtoull_l} on platforms that support them. - #if (defined(_MSC_VER) && _MSC_VER >= 1800) || \ - (defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__>= 26) || \ - (defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 700)) && \ - !defined(__Fuchsia__) - #define FLATBUFFERS_LOCALE_INDEPENDENT 1 - #else - #define FLATBUFFERS_LOCALE_INDEPENDENT 0 - #endif -#endif // !FLATBUFFERS_LOCALE_INDEPENDENT - -// Suppress Undefined Behavior Sanitizer (recoverable only). Usage: -// - FLATBUFFERS_SUPPRESS_UBSAN("undefined") -// - FLATBUFFERS_SUPPRESS_UBSAN("signed-integer-overflow") -#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7)) - #define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize(type))) -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409) - #define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize_undefined)) -#else - #define FLATBUFFERS_SUPPRESS_UBSAN(type) -#endif - -namespace flatbuffers { - // This is constexpr function used for checking compile-time constants. - // Avoid `#pragma warning(disable: 4127) // C4127: expression is constant`. - template FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) { - return !!t; - } -} - -// Enable C++ attribute [[]] if std:c++17 or higher. -#if ((__cplusplus >= 201703L) \ - || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))) - // All attributes unknown to an implementation are ignored without causing an error. - #define FLATBUFFERS_ATTRIBUTE(attr) attr - - #define FLATBUFFERS_FALLTHROUGH() [[fallthrough]] -#else - #define FLATBUFFERS_ATTRIBUTE(attr) - - #if FLATBUFFERS_CLANG >= 30800 - #define FLATBUFFERS_FALLTHROUGH() [[clang::fallthrough]] - #elif FLATBUFFERS_GCC >= 70300 - #define FLATBUFFERS_FALLTHROUGH() [[gnu::fallthrough]] - #else - #define FLATBUFFERS_FALLTHROUGH() - #endif -#endif - -/// @endcond - -/// @file -namespace flatbuffers { - -/// @cond FLATBUFFERS_INTERNAL -// Our default offset / size type, 32bit on purpose on 64bit systems. -// Also, using a consistent offset type maintains compatibility of serialized -// offset values between 32bit and 64bit systems. -typedef uint32_t uoffset_t; -typedef uint64_t uoffset64_t; - -// Signed offsets for references that can go in both directions. -typedef int32_t soffset_t; -typedef int64_t soffset64_t; - -// Offset/index used in v-tables, can be changed to uint8_t in -// format forks to save a bit of space if desired. -typedef uint16_t voffset_t; - -typedef uintmax_t largest_scalar_t; - -// In 32bits, this evaluates to 2GB - 1 -#define FLATBUFFERS_MAX_BUFFER_SIZE (std::numeric_limits<::flatbuffers::soffset_t>::max)() -#define FLATBUFFERS_MAX_64_BUFFER_SIZE (std::numeric_limits<::flatbuffers::soffset64_t>::max)() - -// The minimum size buffer that can be a valid flatbuffer. -// Includes the offset to the root table (uoffset_t), the offset to the vtable -// of the root table (soffset_t), the size of the vtable (uint16_t), and the -// size of the referring table (uint16_t). -#define FLATBUFFERS_MIN_BUFFER_SIZE sizeof(::flatbuffers::uoffset_t) + \ - sizeof(::flatbuffers::soffset_t) + sizeof(uint16_t) + sizeof(uint16_t) - -// We support aligning the contents of buffers up to this size. -#ifndef FLATBUFFERS_MAX_ALIGNMENT - #define FLATBUFFERS_MAX_ALIGNMENT 32 -#endif - -/// @brief The length of a FlatBuffer file header. -static const size_t kFileIdentifierLength = 4; - -inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) { - return (min_align <= align) && (align <= (FLATBUFFERS_MAX_ALIGNMENT)) && - (align & (align - 1)) == 0; // must be power of 2 -} - -#if defined(_MSC_VER) - #pragma warning(push) - #pragma warning(disable: 4127) // C4127: conditional expression is constant -#endif - -template T EndianSwap(T t) { - #if defined(_MSC_VER) - #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort - #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong - #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 - #elif defined(__ICCARM__) - #define FLATBUFFERS_BYTESWAP16 __REV16 - #define FLATBUFFERS_BYTESWAP32 __REV - #define FLATBUFFERS_BYTESWAP64(x) \ - ((__REV(static_cast(x >> 32U))) | (static_cast(__REV(static_cast(x)))) << 32U) - #else - #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 && !defined(__clang__) - // __builtin_bswap16 was missing prior to GCC 4.8. - #define FLATBUFFERS_BYTESWAP16(x) \ - static_cast(__builtin_bswap32(static_cast(x) << 16)) - #else - #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 - #endif - #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 - #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 - #endif - if (sizeof(T) == 1) { // Compile-time if-then's. - return t; - } else if (sizeof(T) == 2) { - union { T t; uint16_t i; } u = { t }; - u.i = FLATBUFFERS_BYTESWAP16(u.i); - return u.t; - } else if (sizeof(T) == 4) { - union { T t; uint32_t i; } u = { t }; - u.i = FLATBUFFERS_BYTESWAP32(u.i); - return u.t; - } else if (sizeof(T) == 8) { - union { T t; uint64_t i; } u = { t }; - u.i = FLATBUFFERS_BYTESWAP64(u.i); - return u.t; - } else { - FLATBUFFERS_ASSERT(0); - return t; - } -} - -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - - -template T EndianScalar(T t) { - #if FLATBUFFERS_LITTLEENDIAN - return t; - #else - return EndianSwap(t); - #endif -} - -template -// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details. -FLATBUFFERS_SUPPRESS_UBSAN("alignment") -T ReadScalar(const void *p) { - return EndianScalar(*reinterpret_cast(p)); -} - -// See https://github.com/google/flatbuffers/issues/5950 - -#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstringop-overflow" -#endif - -template -// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details. -FLATBUFFERS_SUPPRESS_UBSAN("alignment") -void WriteScalar(void *p, T t) { - *reinterpret_cast(p) = EndianScalar(t); -} - -template struct Offset; -template FLATBUFFERS_SUPPRESS_UBSAN("alignment") void WriteScalar(void *p, Offset t) { - *reinterpret_cast(p) = EndianScalar(t.o); -} - -#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000) - #pragma GCC diagnostic pop -#endif - -// Computes how many bytes you'd have to pad to be able to write an -// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in -// memory). -FLATBUFFERS_SUPPRESS_UBSAN("unsigned-integer-overflow") -inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) { - return ((~buf_size) + 1) & (scalar_size - 1); -} - -#if !defined(_MSC_VER) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" -#endif -// Generic 'operator==' with conditional specialisations. -// T e - new value of a scalar field. -// T def - default of scalar (is known at compile-time). -template inline bool IsTheSameAs(T e, T def) { return e == def; } -#if !defined(_MSC_VER) - #pragma GCC diagnostic pop -#endif - -#if defined(FLATBUFFERS_NAN_DEFAULTS) && \ - defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0) -// Like `operator==(e, def)` with weak NaN if T=(float|double). -template inline bool IsFloatTheSameAs(T e, T def) { - return (e == def) || ((def != def) && (e != e)); -} -template<> inline bool IsTheSameAs(float e, float def) { - return IsFloatTheSameAs(e, def); -} -template<> inline bool IsTheSameAs(double e, double def) { - return IsFloatTheSameAs(e, def); -} -#endif - -// Check 'v' is out of closed range [low; high]. -// Workaround for GCC warning [-Werror=type-limits]: -// comparison is always true due to limited range of data type. -template -inline bool IsOutRange(const T &v, const T &low, const T &high) { - return (v < low) || (high < v); -} - -// Check 'v' is in closed range [low; high]. -template -inline bool IsInRange(const T &v, const T &low, const T &high) { - return !IsOutRange(v, low, high); -} - -} // namespace flatbuffers -#endif // FLATBUFFERS_BASE_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h deleted file mode 100644 index 154d187..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_BUFFER_H_ -#define FLATBUFFERS_BUFFER_H_ - -#include - -#include "flatbuffers/base.h" -#include "flatbuffers/stl_emulation.h" - -namespace flatbuffers { - -// Wrapper for uoffset_t to allow safe template specialization. -// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset). -template -struct Offset { - // The type of offset to use. - typedef uoffset_t offset_type; - - offset_type o; - Offset() : o(0) {} - Offset(const offset_type _o) : o(_o) {} - Offset<> Union() const { return o; } - bool IsNull() const { return !o; } -}; - -template -struct is_specialisation_of_Offset : false_type {}; -template -struct is_specialisation_of_Offset> : true_type {}; - -// Wrapper for uoffset64_t Offsets. -template -struct Offset64 { - // The type of offset to use. - typedef uoffset64_t offset_type; - - offset_type o; - Offset64() : o(0) {} - Offset64(const offset_type offset) : o(offset) {} - Offset64<> Union() const { return o; } - bool IsNull() const { return !o; } -}; - -template -struct is_specialisation_of_Offset64 : false_type {}; -template -struct is_specialisation_of_Offset64> : true_type {}; - -// Litmus check for ensuring the Offsets are the expected size. -static_assert(sizeof(Offset<>) == 4, "Offset has wrong size"); -static_assert(sizeof(Offset64<>) == 8, "Offset64 has wrong size"); - -inline void EndianCheck() { - int endiantest = 1; - // If this fails, see FLATBUFFERS_LITTLEENDIAN above. - FLATBUFFERS_ASSERT(*reinterpret_cast(&endiantest) == - FLATBUFFERS_LITTLEENDIAN); - (void)endiantest; -} - -template -FLATBUFFERS_CONSTEXPR size_t AlignOf() { - // clang-format off - #ifdef _MSC_VER - return __alignof(T); - #else - #ifndef alignof - return __alignof__(T); - #else - return alignof(T); - #endif - #endif - // clang-format on -} - -// Lexicographically compare two strings (possibly containing nulls), and -// return true if the first is less than the second. -static inline bool StringLessThan(const char* a_data, uoffset_t a_size, - const char* b_data, uoffset_t b_size) { - const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); - return cmp == 0 ? a_size < b_size : cmp < 0; -} - -// When we read serialized data from memory, in the case of most scalars, -// we want to just read T, but in the case of Offset, we want to actually -// perform the indirection and return a pointer. -// The template specialization below does just that. -// It is wrapped in a struct since function templates can't overload on the -// return type like this. -// The typedef is for the convenience of callers of this function -// (avoiding the need for a trailing return decltype) -template -struct IndirectHelper { - typedef T return_type; - typedef T mutable_return_type; - static const size_t element_stride = sizeof(T); - - static return_type Read(const uint8_t* p, const size_t i) { - return EndianScalar((reinterpret_cast(p))[i]); - } - static mutable_return_type Read(uint8_t* p, const size_t i) { - return reinterpret_cast( - Read(const_cast(p), i)); - } -}; - -// For vector of Offsets. -template class OffsetT> -struct IndirectHelper> { - typedef const T* return_type; - typedef T* mutable_return_type; - typedef typename OffsetT::offset_type offset_type; - static const offset_type element_stride = sizeof(offset_type); - - static return_type Read(const uint8_t* const p, const offset_type i) { - // Offsets are relative to themselves, so first update the pointer to - // point to the offset location. - const uint8_t* const offset_location = p + i * element_stride; - - // Then read the scalar value of the offset (which may be 32 or 64-bits) and - // then determine the relative location from the offset location. - return reinterpret_cast( - offset_location + ReadScalar(offset_location)); - } - static mutable_return_type Read(uint8_t* const p, const offset_type i) { - // Offsets are relative to themselves, so first update the pointer to - // point to the offset location. - uint8_t* const offset_location = p + i * element_stride; - - // Then read the scalar value of the offset (which may be 32 or 64-bits) and - // then determine the relative location from the offset location. - return reinterpret_cast( - offset_location + ReadScalar(offset_location)); - } -}; - -// For vector of structs. -template -struct IndirectHelper< - T, typename std::enable_if< - !std::is_scalar::type>::value && - !is_specialisation_of_Offset::value && - !is_specialisation_of_Offset64::value>::type> { - private: - typedef typename std::remove_pointer::type>::type - pointee_type; - - public: - typedef const pointee_type* return_type; - typedef pointee_type* mutable_return_type; - static const size_t element_stride = sizeof(pointee_type); - - static return_type Read(const uint8_t* const p, const size_t i) { - // Structs are stored inline, relative to the first struct pointer. - return reinterpret_cast(p + i * element_stride); - } - static mutable_return_type Read(uint8_t* const p, const size_t i) { - // Structs are stored inline, relative to the first struct pointer. - return reinterpret_cast(p + i * element_stride); - } -}; - -/// @brief Get a pointer to the file_identifier section of the buffer. -/// @return Returns a const char pointer to the start of the file_identifier -/// characters in the buffer. The returned char * has length -/// 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'. -/// This function is UNDEFINED for FlatBuffers whose schema does not include -/// a file_identifier (likely points at padding or the start of a the root -/// vtable). -inline const char* GetBufferIdentifier(const void* buf, - bool size_prefixed = false) { - return reinterpret_cast(buf) + - ((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t)); -} - -// Helper to see if the identifier in a buffer has the expected value. -inline bool BufferHasIdentifier(const void* buf, const char* identifier, - bool size_prefixed = false) { - return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier, - flatbuffers::kFileIdentifierLength) == 0; -} - -/// @cond FLATBUFFERS_INTERNAL -// Helpers to get a typed pointer to the root object contained in the buffer. -template -T* GetMutableRoot(void* buf) { - if (!buf) return nullptr; - EndianCheck(); - return reinterpret_cast(reinterpret_cast(buf) + - EndianScalar(*reinterpret_cast(buf))); -} - -template -T* GetMutableSizePrefixedRoot(void* buf) { - return GetMutableRoot(reinterpret_cast(buf) + sizeof(SizeT)); -} - -template -const T* GetRoot(const void* buf) { - return GetMutableRoot(const_cast(buf)); -} - -template -const T* GetSizePrefixedRoot(const void* buf) { - return GetRoot(reinterpret_cast(buf) + sizeof(SizeT)); -} - -} // namespace flatbuffers - -#endif // FLATBUFFERS_BUFFER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h deleted file mode 100644 index 746903e..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_BUFFER_REF_H_ -#define FLATBUFFERS_BUFFER_REF_H_ - -#include "flatbuffers/base.h" -#include "flatbuffers/verifier.h" - -namespace flatbuffers { - -// Convenient way to bundle a buffer and its length, to pass it around -// typed by its root. -// A BufferRef does not own its buffer. -struct BufferRefBase {}; // for std::is_base_of - -template -struct BufferRef : BufferRefBase { - BufferRef() : buf(nullptr), len(0), must_free(false) {} - BufferRef(uint8_t* _buf, uoffset_t _len) - : buf(_buf), len(_len), must_free(false) {} - - ~BufferRef() { - if (must_free) free(buf); - } - - const T* GetRoot() const { return flatbuffers::GetRoot(buf); } - - bool Verify() { - Verifier verifier(buf, len); - return verifier.VerifyBuffer(nullptr); - } - - uint8_t* buf; - uoffset_t len; - bool must_free; -}; - -} // namespace flatbuffers - -#endif // FLATBUFFERS_BUFFER_REF_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h deleted file mode 100644 index bfd771d..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2023 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_CODE_GENERATOR_H_ -#define FLATBUFFERS_CODE_GENERATOR_H_ - -#include - -#include "flatbuffers/file_manager.h" -#include "flatbuffers/idl.h" - -namespace flatbuffers { - -struct CodeGenOptions { - std::string output_path; - FileSaver* file_saver{nullptr}; -}; - -// A code generator interface for producing converting flatbuffer schema into -// code. -class CodeGenerator { - public: - virtual ~CodeGenerator() = default; - - enum Status { - OK = 0, - ERROR = 1, - FAILED_VERIFICATION = 2, - NOT_IMPLEMENTED = 3 - }; - - std::string status_detail; - - // Generate code from the provided `parser`. - // - // DEPRECATED: prefer using the other overload of GenerateCode for bfbs. - virtual Status GenerateCode(const Parser& parser, const std::string& path, - const std::string& filename) = 0; - - // Generate code from the provided `parser` and place it in the output. - virtual Status GenerateCodeString(const Parser& parser, - const std::string& filename, - std::string& output) { - (void)parser; - (void)filename; - (void)output; - return Status::NOT_IMPLEMENTED; - } - - // Generate code from the provided `buffer` of given `length`. The buffer is a - // serialized reflection.fbs. - virtual Status GenerateCode(const uint8_t* buffer, int64_t length, - const CodeGenOptions& options) = 0; - - virtual Status GenerateMakeRule(const Parser& parser, const std::string& path, - const std::string& filename, - std::string& output) = 0; - - virtual Status GenerateGrpcCode(const Parser& parser, const std::string& path, - const std::string& filename) = 0; - - virtual Status GenerateRootFile(const Parser& parser, - const std::string& path) = 0; - - virtual bool IsSchemaOnly() const = 0; - - virtual bool SupportsBfbsGeneration() const = 0; - - virtual bool SupportsRootFileGeneration() const = 0; - - virtual IDLOptions::Language Language() const = 0; - - virtual std::string LanguageName() const = 0; - - protected: - CodeGenerator() = default; - - private: - // Copying is not supported. - CodeGenerator(const CodeGenerator&) = delete; - CodeGenerator& operator=(const CodeGenerator&) = delete; -}; - -} // namespace flatbuffers - -#endif // FLATBUFFERS_CODE_GENERATOR_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h deleted file mode 100644 index d284ac5..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2014 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_CODE_GENERATORS_H_ -#define FLATBUFFERS_CODE_GENERATORS_H_ - -#include -#include - -#include "flatbuffers/idl.h" - -namespace flatbuffers { - -// Utility class to assist in generating code through use of text templates. -// -// Example code: -// CodeWriter code("\t"); -// code.SetValue("NAME", "Foo"); -// code += "void {{NAME}}() { printf("%s", "{{NAME}}"); }"; -// code.SetValue("NAME", "Bar"); -// code += "void {{NAME}}() { printf("%s", "{{NAME}}"); }"; -// std::cout << code.ToString() << std::endl; -// -// Output: -// void Foo() { printf("%s", "Foo"); } -// void Bar() { printf("%s", "Bar"); } -class CodeWriter { - public: - CodeWriter(std::string pad = std::string()) - : pad_(pad), cur_ident_lvl_(0), ignore_ident_(false) {} - - // Clears the current "written" code. - void Clear() { - stream_.str(""); - stream_.clear(); - } - - // Associates a key with a value. All subsequent calls to operator+=, where - // the specified key is contained in {{ and }} delimiters will be replaced by - // the given value. - void SetValue(const std::string& key, const std::string& value) { - value_map_[key] = value; - } - - std::string GetValue(const std::string& key) const { - const auto it = value_map_.find(key); - return it == value_map_.end() ? "" : it->second; - } - - // Appends the given text to the generated code as well as a newline - // character. Any text within {{ and }} delimiters is replaced by values - // previously stored in the CodeWriter by calling SetValue above. The newline - // will be suppressed if the text ends with the \\ character. - void operator+=(std::string text); - - // Returns the current contents of the CodeWriter as a std::string. - std::string ToString() const { return stream_.str(); } - - // Increase ident level for writing code - void IncrementIdentLevel() { cur_ident_lvl_++; } - // Decrease ident level for writing code - void DecrementIdentLevel() { - if (cur_ident_lvl_) cur_ident_lvl_--; - } - - void SetPadding(const std::string& padding) { pad_ = padding; } - - private: - std::map value_map_; - std::stringstream stream_; - std::string pad_; - int cur_ident_lvl_; - bool ignore_ident_; - - // Add ident padding (tab or space) based on ident level - void AppendIdent(std::stringstream& stream); -}; - -class BaseGenerator { - public: - virtual bool generate() = 0; - - static std::string NamespaceDir(const Parser& parser, const std::string& path, - const Namespace& ns, - const bool dasherize = false); - - std::string GeneratedFileName(const std::string& path, - const std::string& file_name, - const IDLOptions& options) const; - - protected: - BaseGenerator(const Parser& parser, const std::string& path, - const std::string& file_name, std::string qualifying_start, - std::string qualifying_separator, std::string default_extension) - : parser_(parser), - path_(path), - file_name_(file_name), - qualifying_start_(qualifying_start), - qualifying_separator_(qualifying_separator), - default_extension_(default_extension) {} - virtual ~BaseGenerator() {} - - // No copy/assign. - BaseGenerator& operator=(const BaseGenerator&); - BaseGenerator(const BaseGenerator&); - - std::string NamespaceDir(const Namespace& ns, - const bool dasherize = false) const; - - static const char* FlatBuffersGeneratedWarning(); - - static std::string FullNamespace(const char* separator, const Namespace& ns); - - static std::string LastNamespacePart(const Namespace& ns); - - // tracks the current namespace for early exit in WrapInNameSpace - // c++, java and csharp returns a different namespace from - // the following default (no early exit, always fully qualify), - // which works for js and php - virtual const Namespace* CurrentNameSpace() const { return nullptr; } - - // Ensure that a type is prefixed with its namespace even within - // its own namespace to avoid conflict between generated method - // names and similarly named classes or structs - std::string WrapInNameSpace(const Namespace* ns, - const std::string& name) const; - - std::string WrapInNameSpace(const Definition& def, - const std::string& suffix = "") const; - - std::string GetNameSpace(const Definition& def) const; - - const Parser& parser_; - const std::string& path_; - const std::string& file_name_; - const std::string qualifying_start_; - const std::string qualifying_separator_; - const std::string default_extension_; -}; - -struct CommentConfig { - const char* first_line; - const char* content_line_prefix; - const char* last_line; -}; - -extern void GenComment(const std::vector& dc, - std::string* code_ptr, const CommentConfig* config, - const char* prefix = ""); - -class FloatConstantGenerator { - public: - virtual ~FloatConstantGenerator() {} - std::string GenFloatConstant(const FieldDef& field) const; - - private: - virtual std::string Value(double v, const std::string& src) const = 0; - virtual std::string Inf(double v) const = 0; - virtual std::string NaN(double v) const = 0; - - virtual std::string Value(float v, const std::string& src) const = 0; - virtual std::string Inf(float v) const = 0; - virtual std::string NaN(float v) const = 0; - - template - std::string GenFloatConstantImpl(const FieldDef& field) const; -}; - -class SimpleFloatConstantGenerator : public FloatConstantGenerator { - public: - SimpleFloatConstantGenerator(const char* nan_number, - const char* pos_inf_number, - const char* neg_inf_number); - - private: - std::string Value(double v, - const std::string& src) const FLATBUFFERS_OVERRIDE; - std::string Inf(double v) const FLATBUFFERS_OVERRIDE; - std::string NaN(double v) const FLATBUFFERS_OVERRIDE; - - std::string Value(float v, const std::string& src) const FLATBUFFERS_OVERRIDE; - std::string Inf(float v) const FLATBUFFERS_OVERRIDE; - std::string NaN(float v) const FLATBUFFERS_OVERRIDE; - - const std::string nan_number_; - const std::string pos_inf_number_; - const std::string neg_inf_number_; -}; - -// C++, C#, Java like generator. -class TypedFloatConstantGenerator : public FloatConstantGenerator { - public: - TypedFloatConstantGenerator(const char* double_prefix, - const char* single_prefix, const char* nan_number, - const char* pos_inf_number, - const char* neg_inf_number = ""); - - private: - std::string Value(double v, - const std::string& src) const FLATBUFFERS_OVERRIDE; - std::string Inf(double v) const FLATBUFFERS_OVERRIDE; - - std::string NaN(double v) const FLATBUFFERS_OVERRIDE; - - std::string Value(float v, const std::string& src) const FLATBUFFERS_OVERRIDE; - std::string Inf(float v) const FLATBUFFERS_OVERRIDE; - std::string NaN(float v) const FLATBUFFERS_OVERRIDE; - - std::string MakeNaN(const std::string& prefix) const; - std::string MakeInf(bool neg, const std::string& prefix) const; - - const std::string double_prefix_; - const std::string single_prefix_; - const std::string nan_number_; - const std::string pos_inf_number_; - const std::string neg_inf_number_; -}; - -std::string JavaCSharpMakeRule(const bool java, const Parser& parser, - const std::string& path, - const std::string& file_name); - -} // namespace flatbuffers - -#endif // FLATBUFFERS_CODE_GENERATORS_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h deleted file mode 100644 index d1cab08..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_ -#define FLATBUFFERS_DEFAULT_ALLOCATOR_H_ - -#include "flatbuffers/allocator.h" -#include "flatbuffers/base.h" - -namespace flatbuffers { - -// DefaultAllocator uses new/delete to allocate memory regions -class DefaultAllocator : public Allocator { - public: - uint8_t* allocate(size_t size) FLATBUFFERS_OVERRIDE { - return new uint8_t[size]; - } - - void deallocate(uint8_t* p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; } - - static void dealloc(void* p, size_t) { delete[] static_cast(p); } -}; - -// These functions allow for a null allocator to mean use the default allocator, -// as used by DetachedBuffer and vector_downward below. -// This is to avoid having a statically or dynamically allocated default -// allocator, or having to move it between the classes that may own it. -inline uint8_t* Allocate(Allocator* allocator, size_t size) { - return allocator ? allocator->allocate(size) - : DefaultAllocator().allocate(size); -} - -inline void Deallocate(Allocator* allocator, uint8_t* p, size_t size) { - if (allocator) - allocator->deallocate(p, size); - else - DefaultAllocator().deallocate(p, size); -} - -inline uint8_t* ReallocateDownward(Allocator* allocator, uint8_t* old_p, - size_t old_size, size_t new_size, - size_t in_use_back, size_t in_use_front) { - return allocator ? allocator->reallocate_downward(old_p, old_size, new_size, - in_use_back, in_use_front) - : DefaultAllocator().reallocate_downward( - old_p, old_size, new_size, in_use_back, in_use_front); -} - -} // namespace flatbuffers - -#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h deleted file mode 100644 index 0577a42..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_DETACHED_BUFFER_H_ -#define FLATBUFFERS_DETACHED_BUFFER_H_ - -#include "flatbuffers/allocator.h" -#include "flatbuffers/base.h" -#include "flatbuffers/default_allocator.h" - -namespace flatbuffers { - -// DetachedBuffer is a finished flatbuffer memory region, detached from its -// builder. The original memory region and allocator are also stored so that -// the DetachedBuffer can manage the memory lifetime. -class DetachedBuffer { - public: - DetachedBuffer() - : allocator_(nullptr), - own_allocator_(false), - buf_(nullptr), - reserved_(0), - cur_(nullptr), - size_(0) {} - - DetachedBuffer(Allocator* allocator, bool own_allocator, uint8_t* buf, - size_t reserved, uint8_t* cur, size_t sz) - : allocator_(allocator), - own_allocator_(own_allocator), - buf_(buf), - reserved_(reserved), - cur_(cur), - size_(sz) {} - - DetachedBuffer(DetachedBuffer&& other) noexcept - : allocator_(other.allocator_), - own_allocator_(other.own_allocator_), - buf_(other.buf_), - reserved_(other.reserved_), - cur_(other.cur_), - size_(other.size_) { - other.reset(); - } - - DetachedBuffer& operator=(DetachedBuffer&& other) noexcept { - if (this == &other) return *this; - - destroy(); - - allocator_ = other.allocator_; - own_allocator_ = other.own_allocator_; - buf_ = other.buf_; - reserved_ = other.reserved_; - cur_ = other.cur_; - size_ = other.size_; - - other.reset(); - - return *this; - } - - ~DetachedBuffer() { destroy(); } - - const uint8_t* data() const { return cur_; } - - uint8_t* data() { return cur_; } - - size_t size() const { return size_; } - - uint8_t* begin() { return data(); } - const uint8_t* begin() const { return data(); } - uint8_t* end() { return data() + size(); } - const uint8_t* end() const { return data() + size(); } - - // These may change access mode, leave these at end of public section - FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer& other)); - FLATBUFFERS_DELETE_FUNC( - DetachedBuffer& operator=(const DetachedBuffer& other)); - - protected: - Allocator* allocator_; - bool own_allocator_; - uint8_t* buf_; - size_t reserved_; - uint8_t* cur_; - size_t size_; - - inline void destroy() { - if (buf_) Deallocate(allocator_, buf_, reserved_); - if (own_allocator_ && allocator_) { - delete allocator_; - } - reset(); - } - - inline void reset() { - allocator_ = nullptr; - own_allocator_ = false; - buf_ = nullptr; - reserved_ = 0; - cur_ = nullptr; - size_ = 0; - } -}; - -} // namespace flatbuffers - -#endif // FLATBUFFERS_DETACHED_BUFFER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h deleted file mode 100644 index bafe6f2..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_FILE_MANAGER_H_ -#define FLATBUFFERS_FILE_MANAGER_H_ - -#include -#include -#include - -namespace flatbuffers { - -// A File interface to write data to file by default or -// save only file names -class FileSaver { - public: - FileSaver() = default; - virtual ~FileSaver() = default; - - virtual bool SaveFile(const char* name, const char* buf, size_t len, - bool binary) = 0; - - bool SaveFile(const char* name, const std::string& buf, bool binary) { - return SaveFile(name, buf.c_str(), buf.size(), binary); - } - - virtual void Finish() {} - - private: - // Copying is not supported. - FileSaver(const FileSaver&) = delete; - FileSaver& operator=(const FileSaver&) = delete; - // Rule of 5 - FileSaver(FileSaver&&) = default; - FileSaver& operator=(FileSaver&&) = default; -}; - -class RealFileSaver final : public FileSaver { - public: - bool SaveFile(const char* name, const char* buf, size_t len, - bool binary) final; -}; - -class FileNameSaver final : public FileSaver { - public: - bool SaveFile(const char* name, const char* buf, size_t len, - bool binary) final; - - void Finish() final; - - private: - std::set file_names_{}; -}; - -} // namespace flatbuffers - -#endif // FLATBUFFERS_FILE_MANAGER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h deleted file mode 100644 index 636d377..0000000 --- a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h +++ /dev/null @@ -1,1518 +0,0 @@ -/* - * Copyright 2021 Google Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_ -#define FLATBUFFERS_FLATBUFFER_BUILDER_H_ - -#include -#include -#include -#include -#include - -#include "flatbuffers/allocator.h" -#include "flatbuffers/array.h" -#include "flatbuffers/base.h" -#include "flatbuffers/buffer.h" -#include "flatbuffers/buffer_ref.h" -#include "flatbuffers/default_allocator.h" -#include "flatbuffers/detached_buffer.h" -#include "flatbuffers/stl_emulation.h" -#include "flatbuffers/string.h" -#include "flatbuffers/struct.h" -#include "flatbuffers/table.h" -#include "flatbuffers/vector.h" -#include "flatbuffers/vector_downward.h" -#include "flatbuffers/verifier.h" - -namespace flatbuffers { - -// Converts a Field ID to a virtual table offset. -inline voffset_t FieldIndexToOffset(voffset_t field_id) { - // Should correspond to what EndTable() below builds up. - const voffset_t fixed_fields = - 2 * sizeof(voffset_t); // Vtable size and Object Size. - size_t offset = fixed_fields + field_id * sizeof(voffset_t); - FLATBUFFERS_ASSERT(offset < std::numeric_limits::max()); - return static_cast(offset); -} - -template > -const T* data(const std::vector& v) { - // Eventually the returned pointer gets passed down to memcpy, so - // we need it to be non-null to avoid undefined behavior. - static uint8_t t; - return v.empty() ? reinterpret_cast(&t) : &v.front(); -} -template > -T* data(std::vector& v) { - // Eventually the returned pointer gets passed down to memcpy, so - // we need it to be non-null to avoid undefined behavior. - static uint8_t t; - return v.empty() ? reinterpret_cast(&t) : &v.front(); -} - -/// @addtogroup flatbuffers_cpp_api -/// @{ -/// @class FlatBufferBuilder -/// @brief Helper class to hold data needed in creation of a FlatBuffer. -/// To serialize data, you typically call one of the `Create*()` functions in -/// the generated code, which in turn call a sequence of `StartTable`/ -/// `PushElement`/`AddElement`/`EndTable`, or the builtin `CreateString`/ -/// `CreateVector` functions. Do this is depth-first order to build up a tree to -/// the root. `Finish()` wraps up the buffer ready for transport. -template -class FlatBufferBuilderImpl { - public: - // This switches the size type of the builder, based on if its 64-bit aware - // (uoffset64_t) or not (uoffset_t). - typedef - typename std::conditional::type SizeT; - - /// @brief Default constructor for FlatBufferBuilder. - /// @param[in] initial_size The initial size of the buffer, in bytes. Defaults - /// to `1024`. - /// @param[in] allocator An `Allocator` to use. If null will use - /// `DefaultAllocator`. - /// @param[in] own_allocator Whether the builder/vector should own the - /// allocator. Defaults to / `false`. - /// @param[in] buffer_minalign Force the buffer to be aligned to the given - /// minimum alignment upon reallocation. Only needed if you intend to store - /// types with custom alignment AND you wish to read the buffer in-place - /// directly after creation. - explicit FlatBufferBuilderImpl( - size_t initial_size = 1024, Allocator* allocator = nullptr, - bool own_allocator = false, - size_t buffer_minalign = AlignOf()) - : buf_(initial_size, allocator, own_allocator, buffer_minalign, - static_cast(Is64Aware ? FLATBUFFERS_MAX_64_BUFFER_SIZE - : FLATBUFFERS_MAX_BUFFER_SIZE)), - num_field_loc(0), - max_voffset_(0), - length_of_64_bit_region_(0), - nested(false), - finished(false), - minalign_(1), - force_defaults_(false), - dedup_vtables_(true), - string_pool(nullptr) { - EndianCheck(); - } - - /// @brief Move constructor for FlatBufferBuilder. - FlatBufferBuilderImpl(FlatBufferBuilderImpl&& other) noexcept - : buf_(1024, nullptr, false, AlignOf(), - static_cast(Is64Aware ? FLATBUFFERS_MAX_64_BUFFER_SIZE - : FLATBUFFERS_MAX_BUFFER_SIZE)), - num_field_loc(0), - max_voffset_(0), - length_of_64_bit_region_(0), - nested(false), - finished(false), - minalign_(1), - force_defaults_(false), - dedup_vtables_(true), - string_pool(nullptr) { - EndianCheck(); - // Default construct and swap idiom. - // Lack of delegating constructors in vs2010 makes it more verbose than - // needed. - Swap(other); - } - - /// @brief Move assignment operator for FlatBufferBuilder. - FlatBufferBuilderImpl& operator=(FlatBufferBuilderImpl&& other) noexcept { - // Move construct a temporary and swap idiom - FlatBufferBuilderImpl temp(std::move(other)); - Swap(temp); - return *this; - } - - void Swap(FlatBufferBuilderImpl& other) { - using std::swap; - buf_.swap(other.buf_); - swap(num_field_loc, other.num_field_loc); - swap(max_voffset_, other.max_voffset_); - swap(length_of_64_bit_region_, other.length_of_64_bit_region_); - swap(nested, other.nested); - swap(finished, other.finished); - swap(minalign_, other.minalign_); - swap(force_defaults_, other.force_defaults_); - swap(dedup_vtables_, other.dedup_vtables_); - swap(string_pool, other.string_pool); - } - - ~FlatBufferBuilderImpl() { - if (string_pool) delete string_pool; - } - - void Reset() { - Clear(); // clear builder state - buf_.reset(); // deallocate buffer - } - - /// @brief Reset all the state in this FlatBufferBuilder so it can be reused - /// to construct another buffer. - void Clear() { - ClearOffsets(); - buf_.clear(); - nested = false; - finished = false; - minalign_ = 1; - length_of_64_bit_region_ = 0; - if (string_pool) string_pool->clear(); - } - - /// @brief The current size of the serialized buffer, counting from the end. - /// @return Returns an `SizeT` with the current size of the buffer. - SizeT GetSize() const { return buf_.size(); } - - /// @brief The current size of the serialized buffer relative to the end of - /// the 32-bit region. - /// @return Returns an `uoffset_t` with the current size of the buffer. - template - // Only enable this method for the 64-bit builder, as only that builder is - // concerned with the 32/64-bit boundary, and should be the one to bare any - // run time costs. - typename std::enable_if::type GetSizeRelative32BitRegion() - const { - //[32-bit region][64-bit region] - // [XXXXXXXXXXXXXXXXXXX] GetSize() - // [YYYYYYYYYYYYY] length_of_64_bit_region_ - // [ZZZZ] return size - return static_cast(GetSize() - length_of_64_bit_region_); - } - - template - // Only enable this method for the 32-bit builder. - typename std::enable_if::type GetSizeRelative32BitRegion() - const { - return static_cast(GetSize()); - } - - /// @brief Get the serialized buffer (after you call `Finish()`). - /// @return Returns an `uint8_t` pointer to the FlatBuffer data inside the - /// buffer. - uint8_t* GetBufferPointer() const { - Finished(); - return buf_.data(); - } - - /// @brief Get the serialized buffer (after you call `Finish()`) as a span. - /// @return Returns a constructed flatbuffers::span that is a view over the - /// FlatBuffer data inside the buffer. - flatbuffers::span GetBufferSpan() const { - Finished(); - return flatbuffers::span(buf_.data(), buf_.size()); - } - - /// @brief Get a pointer to an unfinished buffer. - /// @return Returns a `uint8_t` pointer to the unfinished buffer. - uint8_t* GetCurrentBufferPointer() const { return buf_.data(); } - - /// @brief Get the released DetachedBuffer. - /// @return A `DetachedBuffer` that owns the buffer and its allocator. - DetachedBuffer Release() { - Finished(); - DetachedBuffer buffer = buf_.release(); - Clear(); - return buffer; - } - - /// @brief Get the released pointer to the serialized buffer. - /// @param size The size of the memory block containing - /// the serialized `FlatBuffer`. - /// @param offset The offset from the released pointer where the finished - /// `FlatBuffer` starts. - /// @return A raw pointer to the start of the memory block containing - /// the serialized `FlatBuffer`. - /// @remark If the allocator is owned, it gets deleted when the destructor is - /// called. - uint8_t* ReleaseRaw(size_t& size, size_t& offset) { - Finished(); - uint8_t* raw = buf_.release_raw(size, offset); - Clear(); - return raw; - } - - /// @brief get the minimum alignment this buffer needs to be accessed - /// properly. This is only known once all elements have been written (after - /// you call Finish()). You can use this information if you need to embed - /// a FlatBuffer in some other buffer, such that you can later read it - /// without first having to copy it into its own buffer. - size_t GetBufferMinAlignment() const { - Finished(); - return minalign_; - } - - /// @cond FLATBUFFERS_INTERNAL - void Finished() const { - // If you get this assert, you're attempting to get access a buffer - // which hasn't been finished yet. Be sure to call - // FlatBufferBuilder::Finish with your root table. - // If you really need to access an unfinished buffer, call - // GetCurrentBufferPointer instead. - FLATBUFFERS_ASSERT(finished); - } - /// @endcond - - /// @brief In order to save space, fields that are set to their default value - /// don't get serialized into the buffer. - /// @param[in] fd When set to `true`, always serializes default values that - /// are set. Optional fields which are not set explicitly, will still not be - /// serialized. - void ForceDefaults(bool fd) { force_defaults_ = fd; } - - /// @brief By default vtables are deduped in order to save space. - /// @param[in] dedup When set to `true`, dedup vtables. - void DedupVtables(bool dedup) { dedup_vtables_ = dedup; } - - /// @cond FLATBUFFERS_INTERNAL - void Pad(size_t num_bytes) { buf_.fill(num_bytes); } - - void TrackMinAlign(size_t elem_size) { - if (elem_size > minalign_) minalign_ = elem_size; - } - - void Align(size_t elem_size) { - TrackMinAlign(elem_size); - buf_.fill(PaddingBytes(buf_.size(), elem_size)); - } - - void PushFlatBuffer(const uint8_t* bytes, size_t size) { - PushBytes(bytes, size); - finished = true; - } - - void PushBytes(const uint8_t* bytes, size_t size) { buf_.push(bytes, size); } - - void PopBytes(size_t amount) { buf_.pop(amount); } - - template - void AssertScalarT() { - // The code assumes power of 2 sizes and endian-swap-ability. - static_assert(flatbuffers::is_scalar::value, "T must be a scalar type"); - } - - // Write a single aligned scalar to the buffer - template - ReturnT PushElement(T element) { - AssertScalarT(); - Align(sizeof(T)); - buf_.push_small(EndianScalar(element)); - return CalculateOffset(); - } - - template class OffsetT = Offset> - uoffset_t PushElement(OffsetT off) { - // Special case for offsets: see ReferTo below. - return PushElement(ReferTo(off.o)); - } - - // When writing fields, we track where they are, so we can create correct - // vtables later. - void TrackField(voffset_t field, uoffset_t off) { - FieldLoc fl = {off, field}; - buf_.scratch_push_small(fl); - num_field_loc++; - if (field > max_voffset_) { - max_voffset_ = field; - } - } - - // Like PushElement, but additionally tracks the field this represents. - template - void AddElement(voffset_t field, T e, T def) { - // We don't serialize values equal to the default. - if (IsTheSameAs(e, def) && !force_defaults_) return; - TrackField(field, PushElement(e)); - } - - template - void AddElement(voffset_t field, T e) { - TrackField(field, PushElement(e)); - } - - template - void AddOffset(voffset_t field, Offset off) { - if (off.IsNull()) return; // Don't store. - AddElement(field, ReferTo(off.o), static_cast(0)); - } - - template - void AddOffset(voffset_t field, Offset64 off) { - if (off.IsNull()) return; // Don't store. - AddElement(field, ReferTo(off.o), static_cast(0)); - } - - template - void AddStruct(voffset_t field, const T* structptr) { - if (!structptr) return; // Default, don't store. - Align(AlignOf()); - buf_.push_small(*structptr); - TrackField(field, CalculateOffset()); - } - - void AddStructOffset(voffset_t field, uoffset_t off) { - TrackField(field, off); - } - - // Offsets initially are relative to the end of the buffer (downwards). - // This function converts them to be relative to the current location - // in the buffer (when stored here), pointing upwards. - uoffset_t ReferTo(uoffset_t off) { - // Align to ensure GetSizeRelative32BitRegion() below is correct. - Align(sizeof(uoffset_t)); - // 32-bit offsets are relative to the tail of the 32-bit region of the - // buffer. For most cases (without 64-bit entities) this is equivalent to - // size of the whole buffer (e.g. GetSize()) - return ReferTo(off, GetSizeRelative32BitRegion()); - } - - uoffset64_t ReferTo(uoffset64_t off) { - // Align to ensure GetSize() below is correct. - Align(sizeof(uoffset64_t)); - // 64-bit offsets are relative to tail of the whole buffer - return ReferTo(off, GetSize()); - } - - template - T ReferTo(const T off, const T2 size) { - FLATBUFFERS_ASSERT(off && off <= size); - return size - off + static_cast(sizeof(T)); - } - - template - T ReferTo(const T off, const T size) { - FLATBUFFERS_ASSERT(off && off <= size); - return size - off + static_cast(sizeof(T)); - } - - void NotNested() { - // If you hit this, you're trying to construct a Table/Vector/String - // during the construction of its parent table (between the MyTableBuilder - // and table.Finish(). - // Move the creation of these sub-objects to above the MyTableBuilder to - // not get this assert. - // Ignoring this assert may appear to work in simple cases, but the reason - // it is here is that storing objects in-line may cause vtable offsets - // to not fit anymore. It also leads to vtable duplication. - FLATBUFFERS_ASSERT(!nested); - // If you hit this, fields were added outside the scope of a table. - FLATBUFFERS_ASSERT(!num_field_loc); - } - - // From generated code (or from the parser), we call StartTable/EndTable - // with a sequence of AddElement calls in between. - uoffset_t StartTable() { - NotNested(); - nested = true; - return GetSizeRelative32BitRegion(); - } - - // This finishes one serialized object by generating the vtable if it's a - // table, comparing it against existing vtables, and writing the - // resulting vtable offset. - uoffset_t EndTable(uoffset_t start) { - // If you get this assert, a corresponding StartTable wasn't called. - FLATBUFFERS_ASSERT(nested); - // Write the vtable offset, which is the start of any Table. - // We fill its value later. - // This is relative to the end of the 32-bit region. - const uoffset_t vtable_offset_loc = - static_cast(PushElement(0)); - // Write a vtable, which consists entirely of voffset_t elements. - // It starts with the number of offsets, followed by a type id, followed - // by the offsets themselves. In reverse: - // Include space for the last offset and ensure empty tables have a - // minimum size. - max_voffset_ = - (std::max)(static_cast(max_voffset_ + sizeof(voffset_t)), - FieldIndexToOffset(0)); - buf_.fill_big(max_voffset_); - const uoffset_t table_object_size = vtable_offset_loc - start; - // Vtable use 16bit offsets. - FLATBUFFERS_ASSERT(table_object_size < 0x10000); - WriteScalar(buf_.data() + sizeof(voffset_t), - static_cast(table_object_size)); - WriteScalar(buf_.data(), max_voffset_); - // Write the offsets into the table - for (auto it = buf_.scratch_end() - num_field_loc * sizeof(FieldLoc); - it < buf_.scratch_end(); it += sizeof(FieldLoc)) { - auto field_location = reinterpret_cast(it); - const voffset_t pos = - static_cast(vtable_offset_loc - field_location->off); - // If this asserts, it means you've set a field twice. - FLATBUFFERS_ASSERT( - !ReadScalar(buf_.data() + field_location->id)); - WriteScalar(buf_.data() + field_location->id, pos); - } - ClearOffsets(); - auto vt1 = reinterpret_cast(buf_.data()); - auto vt1_size = ReadScalar(vt1); - auto vt_use = GetSizeRelative32BitRegion(); - // See if we already have generated a vtable with this exact same - // layout before. If so, make it point to the old one, remove this one. - if (dedup_vtables_) { - for (auto it = buf_.scratch_data(); it < buf_.scratch_end(); - it += sizeof(uoffset_t)) { - auto vt_offset_ptr = reinterpret_cast(it); - auto vt2 = reinterpret_cast( - buf_.data_at(*vt_offset_ptr + length_of_64_bit_region_)); - auto vt2_size = ReadScalar(vt2); - if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; - vt_use = *vt_offset_ptr; - buf_.pop(GetSizeRelative32BitRegion() - vtable_offset_loc); - break; - } - } - // If this is a new vtable, remember it. - if (vt_use == GetSizeRelative32BitRegion()) { - buf_.scratch_push_small(vt_use); - } - // Fill the vtable offset we created above. - // The offset points from the beginning of the object to where the vtable is - // stored. - // Offsets default direction is downward in memory for future format - // flexibility (storing all vtables at the start of the file). - WriteScalar(buf_.data_at(vtable_offset_loc + length_of_64_bit_region_), - static_cast(vt_use) - - static_cast(vtable_offset_loc)); - nested = false; - return vtable_offset_loc; - } - - FLATBUFFERS_ATTRIBUTE([[deprecated("call the version above instead")]]) - uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) { - return EndTable(start); - } - - // This checks a required field has been set in a given table that has - // just been constructed. - template - void Required(Offset table, voffset_t field) { - auto table_ptr = reinterpret_cast(buf_.data_at(table.o)); - bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; - // If this fails, the caller will show what field needs to be set. - FLATBUFFERS_ASSERT(ok); - (void)ok; - } - - uoffset_t StartStruct(size_t alignment) { - Align(alignment); - return GetSizeRelative32BitRegion(); - } - - uoffset_t EndStruct() { return GetSizeRelative32BitRegion(); } - - void ClearOffsets() { - buf_.scratch_pop(num_field_loc * sizeof(FieldLoc)); - num_field_loc = 0; - max_voffset_ = 0; - } - - // Aligns such that when "len" bytes are written, an object can be written - // after it (forward in the buffer) with "alignment" without padding. - void PreAlign(size_t len, size_t alignment) { - if (len == 0) return; - TrackMinAlign(alignment); - buf_.fill(PaddingBytes(GetSize() + len, alignment)); - } - - // Aligns such than when "len" bytes are written, an object of type `AlignT` - // can be written after it (forward in the buffer) without padding. - template - void PreAlign(size_t len) { - AssertScalarT(); - PreAlign(len, AlignOf()); - } - /// @endcond - - /// @brief Store a string in the buffer, which can contain any binary data. - /// @param[in] str A const char pointer to the data to be stored as a string. - /// @param[in] len The number of bytes that should be stored from `str`. - /// @return Returns the offset in the buffer where the string starts. - template