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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>