Commit graph

59 commits

Author SHA1 Message Date
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
1d08498131
feat(dtmt): Add command to print the dictionary
This is mostly helpful to check/debug whether the internal dictionary
actually contains the expected data. For manually looking through the
entire dictionary, opening the CSV file is still more convenient.
2023-02-17 22:51:46 +01:00
9077d791b2
feat(sdk): Implement file properties 2023-02-17 22:51:45 +01:00
073a91d788
bug(sdk): Fix type conversion recursion
The compiler doesn't complain about this, so I assumed it
was able to correctly resolve a conversion
`BundleFileType` -> `Murmur64` via their shared `From` impl: `u64`.

But it appears that is not the case, and the simple `t.into()` just
calls itself. So I need to do the conversion via the intermediary value
manually.
2023-02-08 14:40:54 +01:00
61b3a07666
feat(sdk): Implement bundle database handling 2023-02-08 14:40:51 +01:00
9f84340b73
refactor: Extract Oodle into separate library
The library utilizes an internal global singleton to allow
using the functions without having to lug around an instance of
`libloading::Library`.
2023-02-08 14:33:47 +01:00
5eebced362
bug: Fix building 2023-01-17 11:09:02 +01:00
5ce35f2014
refactor: Improve conversions between murmur hashes and primitives 2023-01-08 15:34:35 +01:00
96c9da16de
bug: Fix package test 2023-01-08 15:33:53 +01:00
f61fab4257
feat: Implement building mod bundles 2023-01-07 21:27:26 +01:00
56bcbd8648
feat: Implement initial bundle building
For now, only empty bundles can be created, though.
2023-01-07 16:20:26 +01:00
0811f47ae2
bug: Fix reading bundle properties
Clippy's suggestion failed me, as `slice::take` only yields _at most_
the given number of elements, but `Vec::with_capacity` doesn't resize
in a way that it would yield `capacity` elements.
2023-01-07 16:19:01 +01:00
db7790ec5b
refactor: Properly handle unknown field 2023-01-06 18:55:55 +01:00
0441a0d932
feat: Recognize bundle properties
Ref: #3.
2023-01-06 18:54:33 +01:00
385e1f98e2
bug: Fix tracing spans not being entered 2023-01-06 13:32:58 +01:00
20c0382c22
refactor: Make operations on binary data sync
There is no benefit from making all operations on binary data read
in small, async steps directly from the file.
Since we know file sizes beforehand, it's less complex to read
the entire data blob into memory once, then operate on that
synchronously.
2023-01-06 13:30:18 +01:00
fddf8fcbbd
refactor: Remove synchronization for context parameter
The context is only written to during initial setup. After that
it is only ever read, so no synchronization is necessary.
2023-01-04 10:40:25 +01:00
2c34d98193
feat: Show status when adding dictionary entries 2023-01-01 18:54:09 +01:00
95aa145569
version: v0.2.0 2022-12-28 19:59:10 +01:00
3913684898
refactor: Apply clippy suggestion 2022-12-28 19:44:27 +01:00
c2ed9275b0
fix: Decompression doesn't work for some bundles
It seems that with the new bundle format, chunks are stored uncompressed
when their compressed size equals the chunk size.
2022-12-28 19:44:23 +01:00
2219f4fab3
feat: Implement decompilation for strings file type 2022-12-28 18:30:11 +01:00
cfb73fbb00
version: sdk v0.1.2 2022-12-28 13:15:03 +01:00
1c27224221
feat: Implement new bundle format 2022-12-28 13:10:54 +01:00
aa9277c394
version: v0.1.1 2022-12-11 12:11:59 +01:00