0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 04:50:45 -05:00

592 Commits

Author SHA1 Message Date
Dev
860e354b77 Merge branch '3.8.2-DEV' into 3.9.0-DEV
# Conflicts:
#	project/Aki.Common/Http/Client.cs
#	project/Aki.Common/Http/RequestHandler.cs
2024-05-06 22:34:10 +01:00
b529261845 If SPT is started by directly running EscapeFromTarkov.exe, exit (!116)
Inform user via messagebox that they need to run Aki.Launcher.exe
Refactored a bit of the validation code in Aki.Prepatch

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#116
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
(cherry picked from commit d6845c4337d616cd17d6d2e1eed746c25779b35b)
2024-05-06 22:13:40 +01:00
Dev
296d4fa391 Add remapping of Class3199 to EasyAssetHelperClass 2024-05-06 22:07:19 +01:00
Merijn Hendriks
9e65e68c81 Improve async bundles (!123)
Synchronizes the changes with NoHurry.AsyncBundleLoader.

A large chunk of this coded has been tested at scale in Fika with very good results.

- Targets `EasyAssets.Create` instead of using a complex lookup pattern
- Delays downloading of bundles to initial loading screen
- Bundles are downloaded using intended sequence
- Improved logging of bundle loading

Reviewed-on: SPT-AKI/Modules#123
Co-authored-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
Co-committed-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
2024-05-06 19:44:28 +00:00
Merijn Hendriks
4b401e7449 async-bundles (!117)
This patch contains the following:

- Initial async VFS code (for reading / writing files)
- Simplified Http Client code
- Added async support to Http Client, RequestHandler
- Improved RequestHandler logging
- Deferred bundle loading to EasyAssetPatch
- Make GetManifestJson run async

This comes with a number of benefits:

- When downloading bundles, it will mention which files succeeded or failed to download
- Bundle loading happens in the initial screen, not the white screen
- Fixed the issue where bundle loading could break bepinex loading (too long load time)
- Modders can now make async http request and read/write files async

I removed logging of sessionid inside the RequestHandler for each request, sessionid is already visible from bepinex log startup parameters.

At last, sorry for the amount of commits it took. I initially wanted to target the 3.9.0 branch, but decided to use 3.8.1 instead as async request can really help out some mods.

Reviewed-on: SPT-AKI/Modules#117
Co-authored-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
Co-committed-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
2024-05-06 10:28:51 +00:00
d3e6a8527b feat: patch to resolve btr on woods loading destination path (!122)
should fix SPT-AKI/Issues#646

Reviewed-on: SPT-AKI/Modules#122
Co-authored-by: kiobu <kiobu@sdf.org>
Co-committed-by: kiobu <kiobu@sdf.org>
2024-05-05 20:45:08 +00:00
ed5428ed88 3.8.1-DEV (!121)
Reviewed-on: SPT-AKI/Modules#121
2024-05-05 08:57:18 +00:00
8e53f59d30 fixed yet another method not being renamed properly LoadOfflineRaidScreenPatch for the "Ready" callback (!120)
When pressing ready on the scav offline raid screen the OnShowReadyScreen callback currently gets assigned to method_73. But that is the new name of the insurance screen as seen in 2abc1ab0ce7e6c8e7fe2365cae2321df2ccfa4bc.
And this is indeed what currently happens. You get your PMC insurance screen.
The correct method name it should register appears to be method_76. My reasoning for this is that method_44, which is the one called for non-pmcs in method_72, registers method_76 as the ready callback in the original unpatched code.

I am trying to be less gung ho and have checked more thoroughly this time, but please tripple check as I've fucked up once already!

Reviewed-on: SPT-AKI/Modules#120
Co-authored-by: BluBb_mADe <ku21runy1k11@opayq.com>
Co-committed-by: BluBb_mADe <ku21runy1k11@opayq.com>
2024-05-01 11:24:16 +00:00
5676c58fce fix: disablepve in-raid bug when finding tooltip (!119)
should fix SPT-AKI/Issues#640

Reviewed-on: SPT-AKI/Modules#119
Co-authored-by: kiobu <kiobu@sdf.org>
Co-committed-by: kiobu <kiobu@sdf.org>
2024-05-01 08:17:57 +00:00
d9a4df3a03 refactor LoadOfflineRaidScreenPatch (!118)
The patch was very hard to understand and unnecessarily convoluted which caused me to not properly understand what it was supposed to do so I decided to rework it properly for the next time it inevitably breaks again.
The emitted IL should be identical. This is just about making it straight forward to understand and simplifying the patch which might make it a little more robust.

Reviewed-on: SPT-AKI/Modules#118
Reviewed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-authored-by: BluBb_mADe <ku21runy1k11@opayq.com>
Co-committed-by: BluBb_mADe <ku21runy1k11@opayq.com>
2024-04-30 10:39:06 +00:00
b5d3511e3c Update missed method in LoadOfflineRaidScreenPatch (!115)
Fixes the need to hit next twice to get to insurance screen

This method was missed during the last commit made to update the methods

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#115
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-29 20:57:33 +00:00
d6845c4337 If SPT is started by directly running EscapeFromTarkov.exe, exit (!116)
Inform user via messagebox that they need to run Aki.Launcher.exe
Refactored a bit of the validation code in Aki.Prepatch

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#116
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
3.8.1
2024-04-29 07:00:32 +00:00
cc2377bf72 fix: difficulties response parsing (!113)
fixed bot difficulties model to match server response for `/singleplayer/settings/bot/difficulties`
also bumps up the sptBear and sptUsec enums so they don't collide with new pmcUSEC and pmcBEAR

Reviewed-on: SPT-AKI/Modules#113
Co-authored-by: kiobu <kiobu@sdf.org>
Co-committed-by: kiobu <kiobu@sdf.org>
2024-04-28 08:17:13 +00:00
2abc1ab0ce fixed insurance screen patch (!114)
I am not entirely sure what the method name index of the added method is that has offset everything by one. There might be other patches affected by this that reference a method by name instead of signature but everything seems to work with just these two adjustments.
I don't have a diff ready to easily spot where the offset happens and what else might potentially be affected.

Reviewed-on: SPT-AKI/Modules#114
Co-authored-by: BluBb_mADe <ku21runy1k11@opayq.com>
Co-committed-by: BluBb_mADe <ku21runy1k11@opayq.com>
2024-04-27 09:38:27 +00:00
199502d18a feat: updated-refs (!112)
update assembly refs and transpiler lookups for 29862

Reviewed-on: SPT-AKI/Modules#112
Co-authored-by: kiobu <kiobu@sdf.org>
Co-committed-by: kiobu <kiobu@sdf.org>
2024-04-26 07:36:56 +00:00
Dev
8b5159b6c6 Update readme 2024-04-25 18:23:09 +01:00
Dev
094c50a1bc 29862 2024-04-25 18:17:12 +01:00
Dev
f7a469089b 29774 2024-04-21 11:39:04 +01:00
Dev
47002335ff 29774 2024-04-21 11:37:10 +01:00
Merijn Hendriks
accb0ab9f6 Reduce bot difficulty requests (!111)
Requires server-side changes (will need your help @TheSparta for this!).

This combined all the single bot difficulty requests into a single GET request (`/singleplayer/bot/difficulties`) with the following data structure:
```json
[
    {
        "role": "assault",
        "difficulty": "easy",
        "data": "assets/database/bots/types/assault.json difficulty easy contents"
    },
    {
        "role": "pmcbot",
        "difficulty": "normal",
        "data": "assets/database/bots/types/pmcbot.json difficulty normal contents"
    }
]
```
The request expects all roles and all their respective difficulties to be in the response.

Co-authored-by: Merijn Hendriks <merijnhendriks@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#111
Reviewed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-authored-by: Merijn Hendriks <senko-san@noreply.dev.sp-tarkov.com>
Co-committed-by: Merijn Hendriks <senko-san@noreply.dev.sp-tarkov.com>
2024-04-20 22:32:28 +00:00
Merijn Hendriks
d5fc27e383 improve-http (!110)
Ported Haru's updated HTTP code to Aki.

## Changes

- Added async support to Client
- Removed obsolete-marked code

## Impact

The code marked deprecated and scheduled for removal in 3.8.0 is removed in this PR.
Modders were already informed through IDE warnings and in the release notes, which also contained an upgrade path to the new `Aki.Common.Http.Client`.

Reviewed-on: SPT-AKI/Modules#110
Reviewed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-authored-by: Merijn Hendriks <senko-san@noreply.dev.sp-tarkov.com>
Co-committed-by: Merijn Hendriks <senko-san@noreply.dev.sp-tarkov.com>
2024-04-20 22:32:16 +00:00
Dev
edf81d800c Update incorrect gclass ref inside GetNewBotTemplatesPatch 2024-04-20 22:41:11 +01:00
Dev
14b4eb2f63 merge 381 into 390 2024-04-20 22:36:42 +01:00
efa7a175c3 Exit if the user has deleted the BepInEx/plugins/spt folder (!109)
Added as a check in the PrePatch, because while users delete `BepInEx/plugins/spt` often, it would be uncommon for them to also delete the prepatcher

No idea why there's a second commit in this PR, it doesn't actually change anything. Just Git Things™

Co-authored-by: Terkoiz <terkoiz@spt.dev>
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#109
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-20 21:54:26 +01:00
84cc152e17 Exit if the user has deleted the BepInEx/plugins/spt folder (!109)
Added as a check in the PrePatch, because while users delete `BepInEx/plugins/spt` often, it would be uncommon for them to also delete the prepatcher

No idea why there's a second commit in this PR, it doesn't actually change anything. Just Git Things™

Co-authored-by: Terkoiz <terkoiz@spt.dev>
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#109
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-17 07:49:49 +00:00
Dev
91bc0ed1e0 Update class refs to get project building 2024-04-15 12:04:31 +01:00
Dev
ef08750adb 29704 2024-04-15 11:47:56 +01:00
83ca08ac87 381 > 390 (!108)
Co-authored-by: Kaeno <kaeno@noreply.dev.sp-tarkov.com>
Co-authored-by: Dev <dev@dev.sp-tarkov.com>
Reviewed-on: SPT-AKI/Modules#108
2024-04-15 10:36:40 +00:00
Dev
6041bea712 made AddLoot() async Task so it can be awaited 2024-04-11 16:20:15 +01:00
Dev
558d5a3f6e Added money to non-FiR list for PMCs 2024-04-08 10:07:11 +01:00
c5a0c6998d Fixed BTR exceptions introduced by previous commit (!107)
Todo:

- Fix BTR spawning in and driving around at a weird angle
  - Perhaps because the serverside BTR is missing an instance of `VehicleSuspension`
- Randomise BTR spawn time instead of always spawning at raid start
- Add spawn chance for BTR instead of guaranteed spawn in raid
- Test BTR trader services

Reviewed-on: SPT-AKI/Modules#107
Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com>
Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
2024-04-07 08:05:07 +00:00
Dev
b6a86e0edb 29624 2024-04-05 18:49:44 +01:00
Dev
fe9d7cafa3 29618 2024-04-05 09:30:09 +01:00
9e8cdc6469 Fixed BTR NRE at raid start, more NREs to solve (!105)
Todo:

- Fix NREs that randomly occur while the BTR is moving, relating to `ToDestinationEvent`
- Fix NRE spam upon exfiltration from raid with BTR, relating to `BTREndRaidItemDeliveryPatch`
- Enter BTR and test trader functionality

Errors were observed on Woods, not yet tested on Streets

Reviewed-on: SPT-AKI/Modules#105
Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com>
Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
2024-04-05 08:10:37 +00:00
Dev
95edd14226
Update eft version number 2024-04-05 00:17:33 -04:00
6dd3a3cf99
Fix betalogoPatch 2024-04-05 00:17:33 -04:00
70d0d60198
Update modules to 29577 UNTESTED 2024-04-05 00:17:32 -04:00
Dev
9feec7ec7f
29577 2024-04-05 00:17:32 -04:00
42d2ac37dd
increase the ragdoll limits to hopefully prevent bodys falling into themselves 2024-04-05 00:17:23 -04:00
688ff6f334
Merge tag '3.8.0'
# Conflicts:
#	project/Aki.Core/AkiCorePlugin.cs
#	project/Aki.Core/Utils/ValidationUtil.cs
#	project/Aki.Custom/Aki.Custom.csproj
#	project/Aki.Custom/Patches/CustomAiPatch.cs
#	project/Aki.Debugging/AkiDebuggingPlugin.cs
#	project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs
#	project/Aki.SinglePlayer/Patches/Progression/OfflineSaveProfilePatch.cs
#	project/Aki.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs
#	project/Aki.SinglePlayer/Patches/ScavMode/ScavLateStartPatch.cs
3.8.0
2024-04-05 00:14:52 -04:00
2fbaef5eff Clamp the Y velocity so bots dont go flying into the air. 2024-04-01 14:03:10 +01:00
Merijn Hendriks
9c89c31c68 Modernize HTTP v2 (!104)
This PR won't affect modders who have already updated their mods to 3.8.0. They just need to re-compile.

This is a resubmission of my previous PR (SPT-AKI/Modules#99) with additional code cleanup and fixes.
Instead of outright removing the functionality, this time I deprecate it instead (marked for removal in next release).

Requires SPT-AKI/Server#274 to function.

## Overview

- HTTP modernization
  - Adds `Aki.Common.Http.Client`, a replacement for `Aki.Common.Http.Request` and builds on top of `System.Net.Http.HttpClient`
  - Implements failsafe retries when requesting during busy connections
  - Improved debugging
  - Improved performance
  - Deprecades old request code
- Bundle system
  - Fixes remote downloaded bundles using external IP
  - Implements functional bundle caching from remote sources
  - Implements multi-threaded bundle downloads
  - Implements Unity-compatible bundle format support
  - Extensive cleanup
  - Deprecated unneccecary models

## Why?

In it's current state, the bundle system is ducktaped together in 2021, fundumentally broken and in desperate need of a cleanup and fixes.
The HTTP code hasn't been updated since 2021, and `HttpWebRequest` has been deprecated by Microsoft for a while now.
There was also a lot of opportunity left for simple performance gains that even reduces the complexity of the code.

As for why not two separate PRs (HTTP modernization, bundle rework): both were deeply interconnected. A change in one requires modification in the other. Hence the current approach.

## Testing

The code has been validated and tested by @TheSparta and me.
A large section of the code has been implemented and tested extensively by modders.

### Local

1. Start the game from 127.0.0.1
2. The game starts loading bundles from the mods path

### Remote, full re-aquire

1. Start the server from LAN IP (http.json, set host to `cmd > ipconfig` address, example: `192.168.178.32`)
2. Start the game from LAN IP
3. A folder named `user/cache/bundles` is created

### Remote, partial-aquire (deleted)

1. Ensure all bundles are cached
2. Delete one of the aquired bundles from cache
3. Start the server from LAN IP (http.json, set host to `cmd > ipconfig` address, example: `192.168.178.32`)
4. Start the game from LAN IP
5. The bundle is redownloaded

### Remote, partial-aquire (invalid crc)

1. Ensure all bundles are cached
2. Update a bundle mod with a new bundle on the same path
3. Start the server from LAN IP (http.json, set host to `cmd > ipconfig` address, example: `192.168.178.32`)
4. Start the game from LAN IP
5. The bundle is redownloaded

### Remote, use cache

1. Ensure all bundles are cached
2. Start the server from LAN IP (http.json, set host to `cmd > ipconfig` address, example: `192.168.178.32`)
3. Start the game from LAN IP
4. The game starts loading bundles from the cache path

## Risk assessment

In order to reduce friction between releases, this PR introduces a deprecation system.
Obsolete classes and methods have been marked deprecated.
These will remain available for the current release and continue to function as normal for this release.
A warning will be displayed during build when a modder relies on the deprecated functionality.
The marked classes and methods are to be removed in the next release.

The server-side changes have no impact on modders.

## Deprecation

The following classes are affected:

- `Aki.Common.Http.Request`: Replaced by `Aki.Common.Http.Request`
- `Aki.Common.Http.WebConstants`: Replaced by functionality from `System.Net.Http`
- `Aki.Custom.Models.BundleInfo`: Replaced by `Aki.Custom.Models.BundleItem`

The following methods are affected:

- `Aki.Common.Http.RequestHandler.GetData(path, hasHost)`: `hasHost` enables connection outside intended host.
- `Aki.Common.Http.RequestHandler.GetJson(path, hasHost)`: `hasHost` enables connection outside intended host.
- `Aki.Common.Http.RequestHandler.PostJson(path, json, hasHost)`: `hasHost` enables connection outside intended host.
- `Aki.Common.Http.RequestHandler.PutJson(path, json, hasHost)`: `hasHost` enables connection outside intended host.

The deprecated methods and `Aki.Custom.Models.BundleInfo` are self-contained and can be removed independently.
The deprecated classes require removal of all deprecated code at once.

Reviewed-on: SPT-AKI/Modules#104
Reviewed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-authored-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
Co-committed-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
2024-03-29 18:43:46 +00:00
f0c18a5135
Updates build trigger email address 2024-03-28 20:25:43 -04:00
Dev
a4669f9c1e Remove bad remapping:
"GStruct419": "AchievementModelClass"
2024-03-28 15:14:06 +00:00
979fb693c5 Modules Build Trigger (!103)
This is a workflow that triggers the build workflow of the Build project whenever this project has a tag pushed to it.

Reviewed-on: SPT-AKI/Modules#103
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-03-28 14:55:47 +00:00
Dev
39483b13c3 Rename bad remapping of IBallisticsCalculator to ISubInteractions 2024-03-26 22:48:55 +00:00
Merijn Hendriks
245f21c3d8 Improve bundle documentation (!101)
Most of this code was (re-)written in 0.12.9, almost 3 years ago.
Current understanding of how it worked was limited, so I went back and broke it until I understood it properly.

I added comments where I could and slightly altered the logic of `GetManifestJson` to make it easier to read.

Regarding removal of `GetManifestBundle`: you can't. While `Windows.json` contains most of the bundle info, some info (like `Doge`) resides outside of this. Removing `GetManifestBundle` results in the game failing to load.

Reviewed-on: SPT-AKI/Modules#101
Co-authored-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
Co-committed-by: Merijn Hendriks <merijn.d.hendriks@gmail.com>
2024-03-25 09:53:20 +00:00
Dev
f3df1e319c Update mappings 2024-03-24 17:40:52 +00:00
701f676085 Decapitalize BepInEx sub-directories (!100)
This reverts changes to the directory paths made in commit: c7bc0b05143c7062a0c70150cb872b5070f4859c

fixes [SPT-AKI/Issues#588](SPT-AKI/Issues#588)

Co-authored-by: MadByte <madbyte@tuta.io>
Reviewed-on: SPT-AKI/Modules#100
Co-authored-by: MadByte <madbyte@noreply.dev.sp-tarkov.com>
Co-committed-by: MadByte <madbyte@noreply.dev.sp-tarkov.com>
2024-03-24 09:09:43 +00:00
b327096980 Ensure we only alter Playerscavs IsAi Data 2024-03-23 12:48:51 +00:00