LlamaLogic.Packages
1.1.0
See the version list below for details.
dotnet add package LlamaLogic.Packages --version 1.1.0
NuGet\Install-Package LlamaLogic.Packages -Version 1.1.0
<PackageReference Include="LlamaLogic.Packages" Version="1.1.0" />
<PackageVersion Include="LlamaLogic.Packages" Version="1.1.0" />
<PackageReference Include="LlamaLogic.Packages" />
paket add LlamaLogic.Packages --version 1.1.0
#r "nuget: LlamaLogic.Packages, 1.1.0"
#:package LlamaLogic.Packages@1.1.0
#addin nuget:?package=LlamaLogic.Packages&version=1.1.0
#tool nuget:?package=LlamaLogic.Packages&version=1.1.0
How to install
Using the .NET CLI
Navigate to your project in a terminal and enter the following command:
dotnet add package LlamaLogic.Packages
Using Visual Studio
Follow these steps:
- right-click on your project under Solution Explorer;
- select Manage NuGet Packages...;
- in the Search textbox, enter
LlamaLogic.Packages; - press the return key;
- select the LlamaLogic.Packages result; and,
- click the Install button.
Common tasks
Creating a new package
Use the constructor of the Package class.
using LlamaLogic.Packages;
var brandNewCareerMod = new Package();
Loading a package
Pass a Stream object to LlamaLogic.Packages.Package.FromStream or LlamaLogic.Packages.Package.FromStreamAsync to be given a package object to examine and/or alter the contents of a package.
using LlamaLogic.Packages;
using var packageStream = File.OpenRead(@"C:\Users\Jessica\Downloads\SnazzyCouch.package");
using var package = await Package.FromStreamAsync(packageStream);
Important: In order to conserve memory, Package objects do not load resources from streams until they are requested. It is important to create streams only for use by Package objects and to let them dispose of those streams when they, themselves, are disposed of by you.
Getting the keys of resources in a package
Call the GetResourceKeys method of a Package object to be given an IEnumerable<LlamaLogic.Packages.PackageResourceKey>.
var keys = package.GetResourceKeys().ToList().AsReadOnly();
Console.WriteLine($"This package has {keys.Count:n0} resource(s) consisting of the following types: {string.Join(", ", keys.GroupBy(key => key.Type.ToString()).OrderBy(keysGroupedByType => keysGroupedByType.Key /* the type of which all keys in this group are a part */).Select(keysGroupedByType => $"{keysGroupedByType.Key} ({keysGroupedByType.Count():n0})"))}");
Getting the content of a resource in a package
Call the GetResourceContent or GetResourceContentAsync method of a Package object with a PackageResourceKey to be given a ReadOnlyMemory<byte> consisting of the resource content.
using System.Text;
var loot_Cauldron_Potion_FeelGood_Success_key =
new PackageResourceKey
(
PackageResourceType.ActionTuning,
0x15,
0x346c3
);
var actionTuningXml =
await package.GetResourceContentAsync
(loot_Cauldron_Potion_FeelGood_Success_key);
var actionTuningXmlString = Encoding.UTF8.GetString(actionTuningXml.Span);
Console.WriteLine("Potion of Plentiful Needs success override:");
Console.WriteLine(actionTuningXmlString);
Note: Packages may contain content which has been compressed. The library abstracts this detail away by performing any decompression which may be needed when you request the content of a resource. You will always be given usable data that is not compacted or encrypted in any way.
Adding or updating the content of a resource in a package
Call the SetResourceContent method of a Package object with a PackageResourceKey and a ReadOnlySpan<byte> representing the content of the resource that you wish to add or update.
using System.Linq;
using System.Xml.Linq;
// Kuttoe says you guys shouldn't be getting your jollies from a potion...
var actionTuningXmlDocument = XDocument.Parse(actionTuningXmlString);
var funHygieneAndSocialMotiveStatisticsLootActionsXPathQuery = "./I[@i = 'action' and @c = 'LootActions' and @m = 'interactions.utils.loot']/L[@n = 'loot_actions']/V[@t = 'statistics']/V[@n = 'statistics' and @t = 'statistic_set_max']/U[@n = 'statistic_set_max']/T[@n = 'stat' and normalize-space(text()) = ('16655', '16657', '16658')]/../../..";
var funHygieneAndSocialMotiveStatisticsLootActions =
actionTuningXmlDocument.XPathSelectElements
(funHygieneAndSocialMotiveStatisticsLootActionsQuery)
.ToList().AsReadOnly();
foreach (var lootAction in funHygieneAndSocialMotiveStatisticsLootActions)
lootAction.Remove();
package.SetResourceContent
(
loot_Cauldron_Potion_FeelGood_Success_key,
Encoding.UTF8.GetBytes(actionTuningXmlDocument.ToString())
);
Saving a package
Call the SaveTo or SaveToAsync method with a Stream object to save current state of the Package object to that stream.
using var savePackageStream = File.OpenWrite(@"C:\Users\Jessica\Desktop\SnazzyCouchRevised.package");
await package.SaveToAsync(savePackageStream);
Important: If the Package object was originally created from a stream, that stream is still in use. Do not pass the same stream to this method, and do not create a new stream writing to the same file. If you intend to save changes to the original file, have your Package object save to an alternate location (such as one provided by System.IO.Path.GetTempFileName), dispose of your Package object (causing it to dispose of its underlying original stream), and then overwrite the original file with the one created in the temporary location.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- SharpZipLib (>= 1.4.2)
- System.Collections.Immutable (>= 8.0.0)
-
net6.0
- SharpZipLib (>= 1.4.2)
- System.Collections.Immutable (>= 8.0.0)
-
net7.0
- SharpZipLib (>= 1.4.2)
- System.Collections.Immutable (>= 8.0.0)
-
net8.0
- SharpZipLib (>= 1.4.2)
- System.Collections.Immutable (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.0 | 119 | 10/31/2025 |
| 3.5.2 | 160 | 10/3/2025 |
| 3.5.1 | 165 | 9/1/2025 |
| 3.5.0 | 240 | 8/8/2025 |
| 3.4.1 | 237 | 8/7/2025 |
| 3.4.0 | 249 | 8/7/2025 |
| 3.3.0 | 243 | 8/7/2025 |
| 3.2.0 | 150 | 7/31/2025 |
| 3.1.1 | 493 | 7/24/2025 |
| 3.1.0 | 545 | 7/23/2025 |
| 3.0.3 | 107 | 7/11/2025 |
| 3.0.2 | 180 | 6/30/2025 |
| 3.0.1 | 167 | 6/30/2025 |
| 3.0.0 | 171 | 6/19/2025 |
| 2.23.1 | 294 | 3/7/2025 |
| 2.23.0 | 129 | 2/26/2025 |
| 2.22.2 | 136 | 2/5/2025 |
| 2.22.1 | 148 | 2/3/2025 |
| 2.22.0 | 139 | 1/31/2025 |
| 2.21.2 | 122 | 1/30/2025 |
| 2.21.1 | 136 | 1/30/2025 |
| 2.21.0 | 142 | 1/26/2025 |
| 2.20.0 | 151 | 1/23/2025 |
| 2.19.3 | 123 | 1/22/2025 |
| 2.19.2 | 129 | 1/7/2025 |
| 2.19.1 | 168 | 1/4/2025 |
| 2.19.0 | 181 | 1/3/2025 |
| 2.18.0 | 142 | 12/31/2024 |
| 2.17.0 | 136 | 12/24/2024 |
| 2.16.0 | 134 | 12/20/2024 |
| 2.15.2 | 157 | 12/4/2024 |
| 2.15.1 | 148 | 12/4/2024 |
| 2.15.0 | 159 | 11/19/2024 |
| 2.14.0 | 139 | 11/12/2024 |
| 2.13.2 | 129 | 10/27/2024 |
| 2.13.1 | 137 | 10/25/2024 |
| 2.13.0 | 156 | 10/25/2024 |
| 2.12.3 | 156 | 10/23/2024 |
| 2.12.2 | 157 | 10/23/2024 |
| 2.12.1 | 178 | 10/20/2024 |
| 2.12.0 | 183 | 10/18/2024 |
| 2.11.0 | 154 | 10/14/2024 |
| 2.10.0 | 140 | 10/14/2024 |
| 2.9.0 | 143 | 10/14/2024 |
| 2.8.0 | 154 | 9/29/2024 |
| 2.7.1 | 147 | 9/28/2024 |
| 2.7.0 | 137 | 9/27/2024 |
| 2.6.0 | 142 | 9/25/2024 |
| 2.5.0 | 138 | 9/25/2024 |
| 2.4.0 | 161 | 9/22/2024 |
| 2.3.0 | 176 | 9/18/2024 |
| 2.1.5 | 189 | 9/15/2024 |
| 2.1.4 | 155 | 9/11/2024 |
| 2.1.3 | 145 | 9/10/2024 |
| 2.1.2 | 148 | 9/9/2024 |
| 2.1.1 | 154 | 9/9/2024 |
| 2.1.0 | 161 | 9/8/2024 |
| 2.0.2 | 150 | 8/29/2024 |
| 2.0.1 | 173 | 8/26/2024 |
| 2.0.0 | 187 | 8/24/2024 |
| 1.3.0 | 117 | 8/3/2024 |
| 1.2.4 | 148 | 7/24/2024 |
| 1.2.3 | 150 | 7/22/2024 |
| 1.2.2 | 136 | 7/22/2024 |
| 1.2.1 | 134 | 7/22/2024 |
| 1.2.0 | 135 | 7/22/2024 |
| 1.1.0 | 146 | 7/22/2024 |
| 1.0.1 | 143 | 7/21/2024 |
| 1.0.0 | 145 | 7/21/2024 |
We made various performance optimizations and introduced support for indexing of resource names by examining tuning markup. This feature is lazy-loaded; indexing of resources will occur the first time names are referenced by the caller.