mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 13:57:05 +02:00
Linux build system: server-only target + portable warnings
- CMakeLists: allow Linux 64-bit, server-only includes, portable tests - ProjectOptions: MSVC /W4 vs GCC -Wall, version.rc Windows-only - Core/Dependencies: guard Windows-only libs, OpenSSL for launcher_support - Apps: launcher/emote Windows-only, server Linux links OpenSSL/dl/pthread - Fix launcher_support lambda return, cas_codec Oodle guards, steam dlerror crash
This commit is contained in:
1 parent
eab493987c
commit
9ddbd0c7ce
8 files changed
+261
-175
No files matched your search
@@ -84,7 +84,7 @@ template <typename Function> Function oodle_function(const std::filesystem::path
|
||||
#else
|
||||
// Linux dedicated servers read pre-exported world-layers.json; Oodle blocks
|
||||
// (game CAS) need the Windows game + oo2core DLL and are unsupported here.
|
||||
void *oodle(const std::filesystem::path &) {
|
||||
[[maybe_unused]] void *oodle(const std::filesystem::path &) {
|
||||
throw std::runtime_error("Oodle CAS data is only supported on Windows (export world-layers.json there)");
|
||||
}
|
||||
template <typename Function> Function oodle_function(const std::filesystem::path&, const char* name) {
|
||||
@@ -127,6 +127,7 @@ std::vector<std::byte> zstd_decode(std::span<const std::byte> input, std::size_t
|
||||
|
||||
std::vector<std::byte> oodle_decode(std::span<const std::byte> input, std::size_t size,
|
||||
const std::filesystem::path& gameRoot) {
|
||||
#ifdef _WIN32
|
||||
using Function = std::int64_t(__cdecl*)(const void*, std::int64_t, void*, std::int64_t, int, int,
|
||||
int, void*, std::int64_t, void*, void*, void*, std::int64_t, int);
|
||||
const auto decode = oodle_function<Function>(gameRoot, "OodleLZ_Decompress");
|
||||
@@ -136,10 +137,17 @@ std::vector<std::byte> oodle_decode(std::span<const std::byte> input, std::size_
|
||||
nullptr, 0, 3) != static_cast<std::int64_t>(size))
|
||||
throw std::runtime_error("Oodle CAS block failed to decode");
|
||||
return output;
|
||||
#else
|
||||
(void)input;
|
||||
(void)size;
|
||||
(void)gameRoot;
|
||||
throw std::runtime_error("Oodle CAS data is only supported on Windows (export world-layers.json there)");
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<std::byte> oodle_encode(std::span<const std::byte> input, CasCompression compression,
|
||||
int level, const std::filesystem::path& gameRoot) {
|
||||
#ifdef _WIN32
|
||||
using Bound = std::int64_t(__cdecl*)(int, std::int64_t);
|
||||
using Compress = std::int64_t(__cdecl*)(int, const void*, std::int64_t, void*, int, void*, void*,
|
||||
void*, void*, std::int64_t);
|
||||
@@ -160,6 +168,13 @@ std::vector<std::byte> oodle_encode(std::span<const std::byte> input, CasCompres
|
||||
if (length <= 0 || length > capacity) throw std::runtime_error("Oodle CAS compression failed");
|
||||
output.resize(static_cast<std::size_t>(length));
|
||||
return output;
|
||||
#else
|
||||
(void)input;
|
||||
(void)compression;
|
||||
(void)level;
|
||||
(void)gameRoot;
|
||||
throw std::runtime_error("Oodle CAS data is only supported on Windows");
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<std::byte> read_block(Cursor& cursor, const CasDecodeOptions& options) {
|
||||
|
||||
Reference in new issue
Block a user