0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-12 16:50:43 -05:00

647 Commits

Author SHA1 Message Date
Dev
20af3f6a73 Expand debug patch
only run on streets
Split patch into pre and post fixes
lots of logging
assign btrcontroller an instance of GClass2911, not a newed version of the class
2024-01-01 14:52:13 +00:00
Terkoiz
fc1bb34bc2 Fixed post-raid healing; Exposed SessionId from RequestHandler 2023-12-30 21:26:22 +02:00
8590f243a4 fix patch 2023-12-30 15:32:51 +00:00
53d99fff2f added test BTR patch, not tested 2023-12-30 15:27:30 +00:00
e3bdf9c1fd Update for 28375 + fixes (!47)
- Update GClass references
- Fix incorrect method in InsuranceScreenPatch (Makes insurance screen actually show)
- Fix incorrect method in Scav offline raid screen patch (Makes "Ready" from the practice screen start the raid)
- Update hollowed.dll with one provided by Chomp

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#47
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2023-12-29 09:43:15 +00:00
89f3842ae9 change so patch is off by default 2023-12-28 15:15:54 +00:00
f7c2c57dc6 temp debugging patch for logging static loot containers 2023-12-28 15:10:09 +00:00
Terkoiz
850fc2b6a2 Fix for ValidationUtil 2023-12-27 23:58:33 +02:00
Terkoiz
755bae830f Fix for ValidationUtil 2023-12-27 23:57:37 +02:00
Terkoiz
e953de545d Fixed PostRaidHealingPricePatch 2023-12-27 21:45:33 +02:00
Terkoiz
eaf0c40d46 Fixed a couple runtime errors 2023-12-27 20:51:47 +02:00
Dev
655ef5bb7b Fix colliding sptUsecValue/sptBearValue values 2023-12-27 18:38:46 +00:00
Terkoiz
4da61ffb64 Fixed compile-time errors 2023-12-27 17:10:25 +02:00
Dev
15902f7e8f Update dll (28333) 2023-12-27 13:46:37 +00:00
bf07137cf7 Improve Robustness of RaidChangesUtil and RaidTimeUtil (!45)
While continuing mod development with SPT 3.7.4 (namely for Questing Bots and SAIN), I found that the API I added to SPT 3.7.4 is unintuitive and clunky to use after the raid is done loading but before the countdown timer expires. With the current SPT code, calling `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` will result in an exception during this time unless you check `HasRaidStarted()` first.

These changes will prevent those methods from throwing an exception unless you try calling them before a raid has finished loading (which should rarely happen). This allows mods to more easily do things using `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` before the countdown timer expires (i.e. cache bots).

These changes only improve the robustness of the existing code and will not break any mods that use the existing API.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT-AKI/Modules#45
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-27 11:25:15 +00:00
612e7f0b1b Prevent Bots from Running into Airdrop Crates (!46)
Adds a `NavMeshObstacle` component to airdrop boxes at the end of `OnBoxLand`. Without this change, bots run into the crates as if they aren't there (because they're dumb).

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#46
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-27 11:25:15 +00:00
Dev
43fc5c9985 More checks 2023-12-27 11:25:15 +00:00
Dev
109e9a0890 Fix build issue 2023-12-27 11:25:15 +00:00
54a6c706f0 update game check (!44)
Co-authored-by: waffle.lord <waffle.lord@hotmail.com>
Reviewed-on: SPT-AKI/Modules#44
Co-authored-by: IsWaffle <waffle.lord@noreply.dev.sp-tarkov.com>
Co-committed-by: IsWaffle <waffle.lord@noreply.dev.sp-tarkov.com>
2023-12-27 11:25:15 +00:00
1c7888b446 Improve Robustness of RaidChangesUtil and RaidTimeUtil (!45)
While continuing mod development with SPT 3.7.4 (namely for Questing Bots and SAIN), I found that the API I added to SPT 3.7.4 is unintuitive and clunky to use after the raid is done loading but before the countdown timer expires. With the current SPT code, calling `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` will result in an exception during this time unless you check `HasRaidStarted()` first.

These changes will prevent those methods from throwing an exception unless you try calling them before a raid has finished loading (which should rarely happen). This allows mods to more easily do things using `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` before the countdown timer expires (i.e. cache bots).

These changes only improve the robustness of the existing code and will not break any mods that use the existing API.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT-AKI/Modules#45
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-21 22:31:33 +00:00
deecc39107 Prevent Bots from Running into Airdrop Crates (!46)
Adds a `NavMeshObstacle` component to airdrop boxes at the end of `OnBoxLand`. Without this change, bots run into the crates as if they aren't there (because they're dumb).

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#46
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-21 22:29:49 +00:00
Dev
5544ae0c04 More checks 2023-12-19 21:15:04 +00:00
Dev
fbef0eae48 Fix build issue 2023-12-19 20:44:13 +00:00
072f100c56 update game check (!44)
Co-authored-by: waffle.lord <waffle.lord@hotmail.com>
Reviewed-on: SPT-AKI/Modules#44
Co-authored-by: IsWaffle <waffle.lord@noreply.dev.sp-tarkov.com>
Co-committed-by: IsWaffle <waffle.lord@noreply.dev.sp-tarkov.com>
2023-12-19 20:23:07 +00: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
Merijn Hendriks
820619b0dc [critical] Fix .NET Framework version (!42)
## Preface

The current version of Aki uses .NET Framework 4.7.2, C# 7.3.

However, this is not correct. Unity 2019.4.31f uses .NET Framework 4.7.1, C# 7.0 (you can see this when creating a new blank project in this unity version, then check the Assembly-CSharp.csproj).

You can load netstandard2.0 assemblies into EFT, which support C# 7.3.

## The issue

.NET Core 2.1 support types like `Span<T>` and `ReadOnlySpan<T>` which previous versions of .NET (.NET Core 2.0 / .NET Framework 4.8.1 and below, C# 7.1 and below) need to support through the `System.Memory` nuget package. Right now, this conflicts.

If you attempt to load an assembly like this, EFT will simply crash because `Span<T>` and `ReadOnlySpan<T>` do not exist inside mono's `mscorlib`.

## Why fix this

This is important for a variety of reasons:

- Prevent modders from accessing not available APIs leading to unexpected crashes
- Prevent possible compatability issues with EFT later
- Support for `Span<T>` and `ReadOnlySpan<T>` through `System.Memory` which is important for high-performance code and client mods (one of which I'm working on).

I really want to stress that this is an important issue to fix and should be merged ASAP. Unity 2019.4 being lax doesn't mean the next LTS version won't prevent loading.

## Why was the wrong version in the first place?

It was a best guess made by me 2 years ago. There were more pressing issues back then and it didn't crash on me. It started becoming an issue 1 year ago when I tried to port Aki to C#, because self-signed certificate generation is supported only within 4.7.2 and newer.

For reference: https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.certificaterequest.createselfsigned?view=netframework-4.7.2

## What's affected?

All the `.csproj` files in this repo.

Merging this means that some mods might need to retarget from .NET Framework 4.7.2 to 4.7.1.

Co-authored-by: Dev <dev@dev.sp-tarkov.com>
Co-authored-by: Terkoiz <terkoiz@spt.dev>
Co-authored-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-authored-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
Reviewed-on: SPT-AKI/Modules#42
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 16:32:45 +00:00
e91bf951d2 Added HasRaidStarted Method to RaidTimeUtil (!41)
To avoid issues when somebody calls `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` when a raid isn't in progress, I throw an exception if `GameTimer` isn't running. However, this can be confusing for modders since `GameTimer` starts well after `GameWorld` is instantiated. Therefore, I added a new `HasRaidStarted()` method so it's more clear when these methods can be called. Additionally, I updated the documentation for those methods to warn the user that `HasRaidStarted()` must be true or they'll throw an exception.

Alternatively, I can change the return type from `float` to `float?` for those methods and return null if a raid hasn't started. However, I felt like a null response is less intuitive than an exception in this case.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#41
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-08 22:22:42 +00:00
647fd0af89 Created RaidTimeUtil class to allow modders to retrieve "real" raid-time information (!40)
Added `RaidTimeUtil` which provides the following public methods:
* `GetRemainingRaidSeconds()`: Get the seconds remaining in the raid
* `GetRaidTimeRemainingFraction()`: Get the fraction of time remaining in the raid (relative to the original escape time for the map)
* `GetElapsedRaidSeconds()`: Get the elapsed seconds in the raid (relative to the original escape time for the map)
* `GetSecondsSinceSpawning()`: Get the elapsed seconds since spawning into the raid

This will allow modders to do things based on raid time, even after changes have been made for Scav raids.

The new class required several properties to be added to the existing `RaidChangesUtil` because apparently I can never stop messing with that class...

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#40
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-08 22:22:42 +00:00
d727ac385d Added HasRaidStarted Method to RaidTimeUtil (!41)
To avoid issues when somebody calls `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` when a raid isn't in progress, I throw an exception if `GameTimer` isn't running. However, this can be confusing for modders since `GameTimer` starts well after `GameWorld` is instantiated. Therefore, I added a new `HasRaidStarted()` method so it's more clear when these methods can be called. Additionally, I updated the documentation for those methods to warn the user that `HasRaidStarted()` must be true or they'll throw an exception.

Alternatively, I can change the return type from `float` to `float?` for those methods and return null if a raid hasn't started. However, I felt like a null response is less intuitive than an exception in this case.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#41
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-05 09:39:28 +00:00
e2ff77a2b3 Created RaidTimeUtil class to allow modders to retrieve "real" raid-time information (!40)
Added `RaidTimeUtil` which provides the following public methods:
* `GetRemainingRaidSeconds()`: Get the seconds remaining in the raid
* `GetRaidTimeRemainingFraction()`: Get the fraction of time remaining in the raid (relative to the original escape time for the map)
* `GetElapsedRaidSeconds()`: Get the elapsed seconds in the raid (relative to the original escape time for the map)
* `GetSecondsSinceSpawning()`: Get the elapsed seconds since spawning into the raid

This will allow modders to do things based on raid time, even after changes have been made for Scav raids.

The new class required several properties to be added to the existing `RaidChangesUtil` because apparently I can never stop messing with that class...

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#40
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-03 15:22:28 +00:00
Dev
a7c76768a1 Remove debug logging 2023-12-03 11:16:19 +00:00
cd460851b2 Updated ScavRaidChangesUtil with Improved RaidChangesUtil (!39)
Since my half-baked PR containing a new class, `ScavRaidChangesUtil`, was merged, I figured I should flesh it out a little more.

I renamed the class as `RaidChangesUtil` and changed its namespace from `ScavMode` to `InRaid`. The main reason is because the information in this class is still applicable for PMC raids, so the class name/namespace should reflect that. I also allow modders to get more information about the changes that were made and relevant raid information for them.

I didn't include methods to retrieve changes made to location exits (for train times) because I didn't see much value in spending the time on it right now. I can always add it sometime in the future.

The way I manage `HaveChangesBeenApplied` in the new class is a bit lazy, but I didn't think buffering the values was necessary considering the limited applications for this class. Please let me know if you think this should be improved.

I'll add a new class in the new namespace for getting current raid-time information in another PR.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#39
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-03 11:16:19 +00:00
a8ede7bb13 Add Util to Allow Modders to Access Changes for Scav Raids (!38)
Added `Utils.ScavMode.ScavRaidChangesUtil` class so mods can easily access the change in map settings (currently just escape time) for Scav raids. This will allow mods like Questing Bots, DONUTS, etc. easily be able to alter spawn settings based on "real" raid time. Currently, each mod has to cache original raid settings and calculate the difference in escape times, which is performing redundant work.

I'm not sure what your conventions are for naming and stuff, so feel free to hack this up.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#38
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-03 11:16:18 +00:00
Dev
4de8ee7b50 improve handling of serverResult.NewSurviveTimeSeconds 2023-12-03 11:16:18 +00:00
Dev
c979b89ddd Formatting improvements 2023-12-03 11:16:18 +00:00
Dev
ab2a9bbb40 Reworked ScavLateStart patch
Removed majority of logic from client code in favour of having it in server
Targets different method, method_43
Processes changes provided by server
2023-12-03 11:16:18 +00:00
Dev
2290aaf8d1 use data from server when choosing player scav brain 2023-12-03 11:16:18 +00:00
Dev
d19084c8cf Call into server during raid creation to get a replacement value for _raidSettings.SelectedLocation.EscapeTimeLimit 2023-12-03 11:16:18 +00:00
Dev
30c12fd0ab Remove debug logging 2023-12-03 11:15:45 +00:00
55d9574e1d Updated ScavRaidChangesUtil with Improved RaidChangesUtil (!39)
Since my half-baked PR containing a new class, `ScavRaidChangesUtil`, was merged, I figured I should flesh it out a little more.

I renamed the class as `RaidChangesUtil` and changed its namespace from `ScavMode` to `InRaid`. The main reason is because the information in this class is still applicable for PMC raids, so the class name/namespace should reflect that. I also allow modders to get more information about the changes that were made and relevant raid information for them.

I didn't include methods to retrieve changes made to location exits (for train times) because I didn't see much value in spending the time on it right now. I can always add it sometime in the future.

The way I manage `HaveChangesBeenApplied` in the new class is a bit lazy, but I didn't think buffering the values was necessary considering the limited applications for this class. Please let me know if you think this should be improved.

I'll add a new class in the new namespace for getting current raid-time information in another PR.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#39
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-02 22:29:42 +00:00
b85c27c8a8 Add Util to Allow Modders to Access Changes for Scav Raids (!38)
Added `Utils.ScavMode.ScavRaidChangesUtil` class so mods can easily access the change in map settings (currently just escape time) for Scav raids. This will allow mods like Questing Bots, DONUTS, etc. easily be able to alter spawn settings based on "real" raid time. Currently, each mod has to cache original raid settings and calculate the difference in escape times, which is performing redundant work.

I'm not sure what your conventions are for naming and stuff, so feel free to hack this up.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#38
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-11-30 08:28:17 +00:00
Dev
006ccf7ab1 improve handling of serverResult.NewSurviveTimeSeconds 2023-11-29 13:46:42 +00:00
Dev
814470f93c Formatting improvements 2023-11-27 15:11:45 +00:00
Dev
47b6f926f5 Reworked ScavLateStart patch
Removed majority of logic from client code in favour of having it in server
Targets different method, method_43
Processes changes provided by server
2023-11-27 15:07:10 +00:00
Dev
cbd0cf5ef4 use data from server when choosing player scav brain 2023-11-26 21:50:49 +00:00
Dev
50bcd5fd3b Call into server during raid creation to get a replacement value for _raidSettings.SelectedLocation.EscapeTimeLimit 2023-11-26 21:15:56 +00:00
Dev
a69f628592 Add comments to OfflineSaveProfilePatch 2023-11-22 15:44:37 +00:00
Dev
d8246cc800 Add comments to OfflineSaveProfilePatch 2023-11-22 15:44:13 +00:00
Dev
0993a2353c Fix LabsKeycardRemovalPatch 2023-11-17 09:36:11 +00:00
8dcbd0f0b2 Added patch to remove the Labs Access Card from player inventory when entering Labs (!37)
Co-authored-by: Terkoiz <terkoiz@spt.dev>
Reviewed-on: SPT-AKI/Modules#37
Co-authored-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-committed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
2023-11-17 09:30:13 +00:00