mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 11:50:43 -05:00
- Merge master changes into 310-dev in prep for merging back into master
This commit is contained in:
commit
270bac8592
@ -13,6 +13,7 @@ SPT.Debugging | Debug utilities (disabled in release builds)
|
||||
SPT.Reflection | Reflection utilities used across the project
|
||||
SPT.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:
|
||||
@ -21,6 +22,7 @@ git config --local user.name "USERNAME"
|
||||
git config --local user.email "USERNAME@SOMETHING.com"
|
||||
```
|
||||
|
||||
|
||||
## Requirements
|
||||
- Escape From Tarkov 33420
|
||||
- Visual Studio Code -OR- Visual Studio 2022
|
||||
|
@ -7,7 +7,8 @@ namespace SPT.Core.Utils
|
||||
public static class ValidationUtil
|
||||
{
|
||||
public static string _crashHandler = "0";
|
||||
|
||||
private static bool _hasRun = false;
|
||||
|
||||
public static bool Validate()
|
||||
{
|
||||
const string c0 = @"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov";
|
||||
@ -29,11 +30,15 @@ namespace SPT.Core.Utils
|
||||
new FileInfo(Path.Combine(v2, "UnityCrashHandler64.exe"))
|
||||
};
|
||||
|
||||
_crashHandler = Gfs(v2, "UnityCrashHandler64.exe")?.Length.ToString() ?? "0";
|
||||
ServerLog.Debug("SPT.Core", _crashHandler);
|
||||
ServerLog.Debug("SPT.Core", Gfs(v2, "Uninstall.exe")?.Length.ToString() ?? "0");
|
||||
ServerLog.Debug("SPT.Core", Gfs(v2, "Register.bat")?.Length.ToString() ?? "0");
|
||||
|
||||
if (!_hasRun)
|
||||
{
|
||||
_crashHandler = Gfs(v2, "UnityCrashHandler64.exe")?.Length.ToString() ?? "0";
|
||||
ServerLog.Debug("SPT.Core", _crashHandler);
|
||||
ServerLog.Debug("SPT.Core", Gfs(v2, "Uninstall.exe")?.Length.ToString() ?? "0");
|
||||
ServerLog.Debug("SPT.Core", Gfs(v2, "Register.bat")?.Length.ToString() ?? "0");
|
||||
_hasRun = true;
|
||||
}
|
||||
|
||||
v0 = v4.Length - 1;
|
||||
|
||||
foreach (var value in v4)
|
||||
|
@ -1,4 +1,5 @@
|
||||
using EFT;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SPT.Custom.CustomAI
|
||||
{
|
||||
@ -33,5 +34,44 @@ namespace SPT.Custom.CustomAI
|
||||
var nicknameContainsPScvCharacter = botOwner.Profile.Info.Nickname?.Contains("(");
|
||||
return nicknameContainsPScvCharacter.HasValue && nicknameContainsPScvCharacter.Value && role == WildSpawnType.assault;
|
||||
}
|
||||
|
||||
public static List<BotOwner> GetAllMembers(this BotsGroup group)
|
||||
{
|
||||
List<BotOwner> members = new List<BotOwner>();
|
||||
|
||||
if (group != null)
|
||||
{
|
||||
for (int m = 0; m < group.MembersCount; m++)
|
||||
{
|
||||
members.Add(group.Member(m));
|
||||
}
|
||||
}
|
||||
|
||||
return members;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the player is found in the collection by searching for matching player Id's
|
||||
/// </summary>
|
||||
/// <param name="players"></param>
|
||||
/// <param name="playerToCheck"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ContainsPlayer(this IEnumerable<IPlayer> players, IPlayer playerToCheck)
|
||||
{
|
||||
if (playerToCheck == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (IPlayer player in players)
|
||||
{
|
||||
if (player != null && player.Id == playerToCheck.Id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,9 +95,12 @@ namespace SPT.Custom.Patches
|
||||
path = BundleManager.GetBundlePath(bundleInfo);
|
||||
|
||||
// only download when connected externally
|
||||
if (await BundleManager.ShouldReaquire(bundleInfo))
|
||||
if (await BundleManager.ShouldAcquire(bundleInfo))
|
||||
{
|
||||
VFS.DeleteFile(BundleManager.GetBundleFilePath(bundleInfo));
|
||||
if (VFS.Exists(BundleManager.GetBundleFilePath(bundleInfo)))
|
||||
{
|
||||
VFS.DeleteFile(BundleManager.GetBundleFilePath(bundleInfo));
|
||||
}
|
||||
|
||||
await BundleManager.DownloadBundle(bundleInfo);
|
||||
}
|
||||
|
@ -51,7 +51,8 @@ namespace SPT.Custom.Utils
|
||||
await VFS.WriteFileAsync(filepath, data);
|
||||
}
|
||||
|
||||
public static async Task<bool> ShouldReaquire(BundleItem bundle)
|
||||
// Handles both the check for initially acquiring and also re-acquiring a file.
|
||||
public static async Task<bool> ShouldAcquire(BundleItem bundle)
|
||||
{
|
||||
// read cache
|
||||
var filepath = GetBundleFilePath(bundle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user