0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-12 22:30:44 -05:00
Merijn Hendriks 3c23adebe2 [enhancement] Simplify zlib (!43)
## Preface

EFT has been reworking the `bsg.componentace.compression.libs.zlib` alot the past versions, including various enhancements and introduced bugs (zero-tail decompression infinite looping). This also includes working towards deprecating `SimpleZlib` and improving `ZOutputStream`'s performance.

While working on Haru, @waffle.lord and I have been reworking the zlib code to be much simpler. These changes are compatible with Aki.

## The issue

- The current code is complex to understand without experience with the zlib library in question
- `Zlib.IsCompressed` has a bug when operating on < 3 bytes. The third statement is reached and thus out of bounds.

## Why fix this

- Simplifying the code improves future readability.
- Using `ZOutputStream` enables usage of further performance improvements made to `ZOutputStream` by BSG.
- `Zlib.IsCompressed` will work again on `byte[2]` and below.

## Why was it like this in the first place?

At the time of writing this code, there was poor understanding of how the zlib library worked. The implementation was a best-guess from decompiled code.

## What's affected?

Only Zlib utility's internal code. No external libraries are affected.

Co-authored-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
Reviewed-on: SPT-AKI/Modules#43
Co-authored-by: Merijn Hendriks <senko-san@noreply.dev.sp-tarkov.com>
Co-committed-by: Merijn Hendriks <senko-san@noreply.dev.sp-tarkov.com>
2023-12-09 22:49:16 +00:00
2023-03-03 18:52:31 +00:00
2023-12-09 22:49:16 +00:00
2023-03-03 18:52:31 +00:00
2023-10-10 10:58:33 +00:00
2023-03-03 18:52:31 +00:00
2023-11-09 14:48:36 +00:00

Modules

BepInEx plugins to alter Escape From Tarkov's behaviour

Project Function
Aki.Build Build script
Aki.Bundles External bundle loader
Aki.Common Common utilities used across projects
Aki.Core Required patches to start the game
Aki.Custom SPT-AKI enhancements to EFT
Aki.Debugging Debug utilities (disabled in release builds)
Aki.Reflection Reflection utilities used across the project
Aki.SinglePlayer Simulating online game while offline

Privacy

SPT is an open source project. Your commit credentials as author of a commit will be visible by anyone. Please make sure you understand this before submitting a PR. Feel free to use a "fake" username and email on your commits by using the following commands:

git config --local user.name "USERNAME"
git config --local user.email "USERNAME@SOMETHING.com"

Requirements

  • Escape From Tarkov 27050
  • BepInEx 5.4.22
  • Visual Studio Code
  • .NET 6 SDK

Setup

Copy-paste Live EFT's EscapeFromTarkov_Data/Managed/ folder to into Modules' Project/Shared/ folder

Build (vscode)

  1. File > Open Workspace > Modules.code-workspace
  2. Terminal > Run Build Task...
  3. Copy contents of /Build into SPT game folder and overwrite

Build (VS)

  1. Open solution
  2. Restore nuget packages
  3. Run dotnet new tool-manifest
  4. Sometimes you need to run dotnet tool restore
  5. Run dotnet tool install Cake.Tool
  6. Build solution
  7. Copy contents of /Build into SPT game folder and overwrite
Description
No description provided
Readme 151 MiB
Languages
C# 99.5%
PowerShell 0.5%