Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- A constructor with a boolean argument in `Blowfish`.
- `Workspace` parameter in deserialize methods in `Toolkit`.
- Helper methods for `VersionInfo`.
- Helper version crc calculator method for `MetaClass`.
- Better `TTArchive` compression detection.
- A dedicated `Compression` class.

### Changed
- Rename the following MetaStream implementations: `MetaStreamReader`/`MetaStreamWriter` to `BinaryMetaStreamReader`/`BinaryMetaStreamWriter`.
Expand All @@ -28,6 +31,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Reorganize some namespaces.
- Make the default serializer not throw errors and use logger instead.
- `Serialize` from `MetaStream` now automatically preserializes.
- Namespaces organization. (#24)
- Various class names. (#24)

### Fixed
- A regression that did not allow files being copied to the output folder.
Expand All @@ -39,6 +44,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- `AreSymbolsHashed` from `GameProfile` as symbols are always hashed.
- `PreSerialize` from `MetaStream`.
- Redundant `Version` from `MetaStreamParams`.
- Unused `ISymbolResolver` interface.

## [0.2.0] - 2026-05-28

Expand Down
15 changes: 8 additions & 7 deletions samples/VersionDatabaseCreator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
using System.Text.Encodings.Web;
using System.Text.Json;
using TelltaleToolKit;
using TelltaleToolKit.GamesDatabase;
using TelltaleToolKit.Reflection;
using TelltaleToolKit.Serialization;
using TelltaleToolKit.Serialization.Binary;
using TelltaleToolKit.TelltaleArchives;
using TelltaleToolKit.Utility.Blowfish;
using TelltaleToolKit.Utility.Lua;
using TelltaleToolKit.Encryption;
using TelltaleToolKit.Games;
using TelltaleToolKit.IO.Archives;
using TelltaleToolKit.Lua;
using TelltaleToolKit.Meta;
using TelltaleToolKit.Meta.Reflection;
using TelltaleToolKit.Meta.Serialization;
using TelltaleToolKit.Meta.Serialization.Binary;

// !!!IMPORTANT!!!
// This project creates ONLY the VERSION DATABASE for a specific game.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Buffers.Binary;
using System.Text;

namespace TelltaleToolKit.Utility.Blowfish;
namespace TelltaleToolKit.Encryption;

/// <summary>
/// Class that provides 'Blowfish' encryption.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TelltaleToolKit.Utility.Blowfish;
namespace TelltaleToolKit.Encryption;

public static class BlowfishConstants
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Buffers;
using System.Buffers.Binary;
using TelltaleToolKit.Utility.Blowfish;
using TelltaleToolKit.Meta.Serialization;

namespace TelltaleToolKit.Serialization.Binary;
namespace TelltaleToolKit.Encryption;

/// <summary>
/// Provides static helpers to encrypt and decrypt legacy Telltale MetaStream files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

namespace TelltaleToolKit.Utility.Blowfish;
namespace TelltaleToolKit.Encryption;

/// <summary>
/// Enum representing the various Telltale games which use different blowfish keys.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.Reflection;

namespace TelltaleToolKit.Utility.Blowfish;
namespace TelltaleToolKit.Encryption;

public static class T3BlowfishKeyExtensions
{
// TODO: In C#13 there is a feature that makes adding extensions easier.
// TODO: In C#14 there is a feature that makes adding extensions easier.

/// <summary>
/// Gets the display name of <see cref="T3BlowfishKey"></see>.
Expand Down Expand Up @@ -198,4 +198,4 @@ public static string GetBlowfishKey(this T3BlowfishKey game)
_ => throw new NotImplementedException("Game is not supported or the key is invalid.")
};
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using TelltaleToolKit.Reflection;
using TelltaleToolKit.Serialization;
using TelltaleToolKit.TelltaleArchives;
using TelltaleToolKit.Utility.Blowfish;
using TelltaleToolKit.Utility.Lua;
using TelltaleToolKit.Encryption;
using TelltaleToolKit.IO.Archives;
using TelltaleToolKit.Lua;
using TelltaleToolKit.Meta.Reflection;

namespace TelltaleToolKit.GamesDatabase;
namespace TelltaleToolKit.Games;

/// <summary>
/// Represents a registry entry for a Telltale game configuration.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using TelltaleToolKit.TelltaleArchives;
using TelltaleToolKit.Utility.Blowfish;
using TelltaleToolKit.Utility.Lua;
using TelltaleToolKit.Encryption;
using TelltaleToolKit.IO.Archives;
using TelltaleToolKit.Lua;

namespace TelltaleToolKit.GamesDatabase;
namespace TelltaleToolKit.Games;

/// <summary>
/// Custom JSON converter for <see cref="GameProfile" /> objects.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json;
using TelltaleToolKit.Reflection;
using TelltaleToolKit.Meta.Reflection;

namespace TelltaleToolKit.GamesDatabase;
namespace TelltaleToolKit.Games;

public class GameProfileJsonExtensions
{
Expand Down
46 changes: 0 additions & 46 deletions src/TelltaleToolKit/HashDatabase/ISymbolResolver.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Diagnostics;

namespace TelltaleToolKit.Utility.Hashing;
namespace TelltaleToolKit.Hashing;

public static class Crc64
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using System.Collections.Concurrent;
using System.Text;
using TelltaleToolKit.T3Types;
using TelltaleToolKit.Utility.Hashing;

namespace TelltaleToolKit.HashDatabase;
namespace TelltaleToolKit.Hashing;

/// <summary>
/// An in-memory, thread-safe hash database for storing and resolving <see cref="Symbol"/> entries.
/// Supports loading from text files and automatic caching.
/// </summary>
public class HashDatabase : ISymbolResolver
public class HashDatabase
{
private readonly ConcurrentDictionary<ulong, string> _symbols = new();

Expand Down Expand Up @@ -326,20 +325,13 @@ public void ExportToFile(string filePath, IEnumerable<KeyValuePair<ulong, string
/// <summary>
/// Merges another hash database into this one.
/// </summary>
public void Merge(ISymbolResolver other)
public void Merge(HashDatabase other)
{
if (other == null) throw new ArgumentNullException(nameof(other));

if (other is HashDatabase memoryDb)
foreach (KeyValuePair<ulong, string> kvp in other._symbols)
{
foreach (KeyValuePair<ulong, string> kvp in memoryDb._symbols)
{
AddSymbol(kvp.Key, kvp.Value);
}
}
else
{
throw new NotImplementedException("Merging with non-HashDatabase not yet implemented");
AddSymbol(kvp.Key, kvp.Value);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.IO.Enumeration;
using TelltaleToolKit.Encryption;
using TelltaleToolKit.Hashing;
using TelltaleToolKit.IO.Archives.Formats;
using TelltaleToolKit.T3Types;
using TelltaleToolKit.TelltaleArchives.Formats;
using TelltaleToolKit.Utility.Blowfish;
using TelltaleToolKit.Utility.Hashing;

namespace TelltaleToolKit.TelltaleArchives;
namespace TelltaleToolKit.IO.Archives;

/// <summary>
/// Base class for all Telltale archive formats (<c>.ttarch</c>, <c>.ttarch2</c>, PK2).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TelltaleToolKit.TelltaleArchives;
namespace TelltaleToolKit.IO.Archives;

/// <summary>
/// Flags that describe the encryption and compression state of a Telltale archive.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TelltaleToolKit.TelltaleArchives;
namespace TelltaleToolKit.IO.Archives;

/// <summary>
/// Contains metadata about a Telltale archive, including its container type,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using TelltaleToolKit.Serialization;
using TelltaleToolKit.Utility.Compression;
using TelltaleToolKit.IO.Streams;

namespace TelltaleToolKit.TelltaleArchives;
namespace TelltaleToolKit.IO.Archives;

/// <summary>
/// Controls how an archive is written or repacked.
Expand All @@ -27,9 +26,9 @@ public sealed class ArchiveWriteOptions

/// <summary>
/// Gets or sets the compression algorithm to use.
/// Defaults to <see cref="Compression.Deflate" />.
/// Defaults to <see cref="Compression.Mode.Deflate" />.
/// </summary>
public Compression Algorithm { get; set; } = Compression.Deflate;
public Compression.Mode Compression { get; set; } = IO.Compression.Mode.Deflate;

/// <summary>
/// Gets or sets the decompressed size of each chunk in bytes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TelltaleToolKit.TelltaleArchives.Formats;
namespace TelltaleToolKit.IO.Archives.Formats;

// TODO: PK2 for CSI.
public class Pk2TTArchive : Archive
Expand Down
Loading