Commit graph

83 commits

Author SHA1 Message Date
a2bbab1398
Update dependencies
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
2024-08-21 14:33:39 +02:00
d7fa80f471
Merge pull request 'Add tests for hash inversion' (#185) from feat/murmur-tests into master
All checks were successful
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
Reviewed-on: https://git.sclu1034.dev///bitsquid_dt/dtmt/pulls/185
2024-08-14 12:07:31 +00:00
2a1d8d815f
Add tests for hash inversion
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
Just a quick round trip test, and an additional assert to demonstrate
that byte order does matter.
2024-08-14 09:22:24 +02:00
7fa08c2efd
dtmt: Implement listing bundle database contents 2024-07-28 22:03:43 +02:00
dbf060032b
sdk: Implement bundle database resource hashes
Algorithm reverse engineered by WhiteGoat.
2024-07-28 14:46:10 +02:00
3a6e954f9a
sdk: Refactor murmur modules and add IdString32
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2024-07-19 11:30:09 +02:00
f1f9a818cc
sdk: Allow any byte stream for hashing dictionary entries
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2024-07-19 09:48:25 +02:00
c997489e18
Add some doc comments 2024-07-19 09:48:23 +02:00
08219f05ba
sdk: Fix reading strings
Fatshark has a few weird string fields, where they provide a length
field, but then sometimes write a shorter, NUL-terminated string into
that same field and adding padding up to the "advertised" length.
To properly read those strings, we can't rely on just the length field
anymore, but need to check for a NUL, too.
2024-07-19 09:48:21 +02:00
95fc6c160b
dtmt: Implement name overrides
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
For most of the game files, we don't know the actual name, only the hash
of that name. To still allow building bundles that contain files with
that name (e.g. to override a game file with a custom one), there needs
to be a way to tell DTMT to name a file such that its hash is the same
as the one in the game.
The initial idea was to just expect the file name on disk to be the
hash, but that wouldn't allow for arbitrary folder structures anymore.

So instead, there is now a new, optional setting in `dtmt.cfg`, where
the modder can map a file path to an override name.
2024-07-18 09:50:48 +02:00
b7e26eee57
refactor(sdk): Split BundleFileType into its own file 2024-07-17 11:14:22 +02:00
a47167b735
Fix printing hashes with leading zeroes
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
Closes #179
2024-07-12 15:58:39 +02:00
96a7eeb1e0
Implement faster hex string parsing 2024-07-09 16:16:48 +02:00
189c3199a0
Update bitflags 2024-07-09 16:16:42 +02:00
ae30499a49
Remove unused dependency 2024-05-15 19:19:54 +02:00
647cb1b8bd
Update fastrand 2024-05-15 19:16:34 +02:00
e633a571b5 Apply clippy lints 2023-11-24 11:52:47 +01:00
4ec44720b0
sdk: Don't fail decompilation on LJD error
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
2023-11-17 15:10:20 +01:00
46a61a7473
Use exit status to determine LJD failure
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
2023-11-17 09:58:53 +01:00
7080dcb8de
sdk: Use common ljd flags
Some checks failed
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2023-10-30 14:07:00 +01:00
57224622d9
sdk: Don't wait for cleanup
Some checks failed
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2023-10-30 09:28:15 +01:00
93db78d58f
sdk: Implement decompiling Lua
Closes #48.
2023-10-30 09:28:07 +01:00
690098d7c7
feat(dtmm): Improve debug logging
This re-enables stdout/stderr logging for release binaries for DTMM.
As a GUI application, it usually won't be started from a CLI, and there
should be no negative impact from that.
But since stdout logging is synchronous and much faster than the async
action that writes to the log file, it might get to log more when the
application panics.
2023-04-09 14:33:55 +02:00
1887cdf2ef
fix(sdk): Fix creating invalid bytecode
An update to LuaJIT made an option enabled by default that changed the
bytecode output.

Fixes #99.
2023-04-06 12:17:16 +02:00
e2a285a739
feat: Add Docker images for CI compilation 2023-03-23 13:42:03 +01:00
ba753cf6bb
feat: Implement static linking, second attempt
This is mostly just the code from the previous attempt. All that was
missing were the `.lib` files to link to on Windows.
2023-03-16 18:09:40 +01:00
308613d5fc
feat(dtmt): Improve error messages when compiling Lua
Fixes #58.
2023-03-08 21:27:29 +01:00
a8db19cf9f
refactor: Capitalize error messages 2023-03-08 20:40:30 +01:00
4a1e88987c
fix: Force unix path separators for engine values
The engine, and therefore the SDK, too, use unix path separators.
However, on Windows, `PathBuf` automatically produces backslashes.

Fix #46.
2023-03-03 17:36:53 +01:00
ed4a22c97a
Revert "feat(sdk): Switch to statically linked Oodle"
This reverts commit d08321a645.

Closes #42.
2023-03-02 13:51:44 +01:00
638b081cb7
version: dtmt v0.3.0, dtmm v0.1.0 2023-03-01 22:29:27 +01:00
d08321a645
feat(sdk): Switch to statically linked Oodle
This removes another runtime dependency.
2023-03-01 22:14:31 +01:00
1d26a5c113
fix(sdk): Fix generating Lua file names during compilation 2023-02-25 16:28:21 +01:00
cd9554fbe3
fix(dtmm): Fix deploying mod bundles
Two different functions were each reading the bundle database
from the backup, so their changes would overwrite each other.
Additionally, mod bundles were missing from the database.

Ref: #28.
2023-02-25 16:09:09 +01:00
0b17e8edf5
fix(sdk): Fix generating bundle name from file path 2023-02-25 16:07:16 +01:00
93c8f4fe9c
fix(sdk): Add missing value in Package binary format
After digging through the VT2 SDK `.exe`, I found that `.package` files
(`stingray::ResourcePackageResource`) actually have more data than I
originally knew about. Most notably, there is a 1 byte `flags` value
that is written at the end of every package file.

Depending on what value those flags have, more data could come after it,
but in most cases, it's just that one byte, which I must have missed in
the binary.

Ref: #28.
Ref: #36.
2023-02-25 13:57:37 +01:00
b9cd9ed5de
chore(sdk): Add debugging for unknown value in bundle database
Ref #28.
2023-02-25 12:58:21 +01:00
09f357d72d
fix(sdk): Prevent duplicates in bundle database bundles
Ref #28.
2023-02-25 11:42:16 +01:00
45e0d79fa7
refactor: Add crate for shared functionality
Adds an additional crate for shared functionality between dtmt and dtmm
that doesn't fit in the sdk.
2023-02-23 21:38:35 +01:00
701516aa7c
feat: Make mod resource scripts optional
With splitting DMF and DML, there is now more than one case where this
is needed, so it may well be made proper now.
The template still defines them, and, as with VT2 most creators will
probably stick with it, but they do have the option to make a non-DMF
mod now.
2023-02-22 16:40:02 +01:00
0cf2908904
fix(sdk): Fix resolving package wildcards
Directories were ignored as invalid extension type. Now they are
recursed into.
2023-02-22 16:37:07 +01:00
bc4d2fcd8a
feat(dtmt): Add unique mod ID 2023-02-22 16:08:32 +01:00
8ebc948252
refactor: Make function parameters more generic 2023-02-22 16:01:14 +01:00
ebcbdaeec0
feat(dtmm): Rework mod template
Ditch the `.mod` file and move its data into the config file.

The `run` function was the only thing that could have been dynamic, but
the vast majority of mods in VT2 never made use of that. Infact, VMF was
probably the only mod that had a different content for that.
2023-02-22 16:01:13 +01:00
aa05c5bd4a
chore: Improve debug logs 2023-02-22 16:01:12 +01:00
e65579d8aa
feat(dtmm): Implement rudimentary mod deployment 2023-02-18 10:20:10 +01:00
cb9f154f1e
fix(sdk): Fix lua file compilation
Aussiemon provided the last missing piece of information about the
binary format.
2023-02-18 10:18:53 +01:00
16bfe88101
feat(sdk): Link LuaJIT for bytecode compilation
This removes the LuaJIT binary as a runtime dependency and decreases
the complexity of the compilation, by not needing to juggle a bunch of
temp files anymore.

However, it was a bit of a pain to get everything set up in the end.

Closes #4.
2023-02-17 22:56:47 +01:00
df06182ca0
fix(sdk): Fix file header binary format
The file header format is a bit more complex than I first realized,
especially around when a path to `data/` is included, and which size
field determines its file name length.
2023-02-17 22:51:48 +01:00
036c20bd8c
feat(lib): Implement IdString type
This type is similar to an `Either` between a `Murmur64` hash and a
`String`. This is necessary to be able to retain hash information where
the hash is not in the dictionary, but at the same time allow string
names where they are available.

Up until now, when reading a bundle, all hashes would be converted to
strings, which made sense for displaying those names. But when writing
the same bundle back, those strings ended up being re-hashed, resulting
in incorrect hashes.
2023-02-17 22:51:46 +01:00