Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up DataProcessing and AkiBackend #297

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Source/AkiSupport/Custom/BotDifficultyPatch.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using EFT;
using StayInTarkov.Networking;
using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;

namespace StayInTarkov.AkiSupport.Custom
{
Expand All @@ -24,7 +24,14 @@ protected override MethodBase GetTargetMethod()
[PatchPrefix]
private static bool PatchPrefix(ref string __result, BotDifficulty botDifficulty, WildSpawnType role)
{
__result = AkiBackendCommunication.Instance.GetJsonBLOCKING($"/singleplayer/settings/bot/difficulty/{role}/{botDifficulty}");
try
{
__result = AkiBackendCommunication.Instance.GetJsonBLOCKING($"/singleplayer/settings/bot/difficulty/{role}/{botDifficulty}", 15000);
}
catch (Exception ex)
{
Logger.LogError($"Could not fetch bot difficulty: {ex}");
}
return string.IsNullOrWhiteSpace(__result);
}
}
Expand Down
10 changes: 9 additions & 1 deletion Source/AkiSupport/Custom/CoreDifficultyPatch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using StayInTarkov.Networking;
using System;
using System.Linq;
using System.Reflection;

Expand All @@ -22,7 +23,14 @@ protected override MethodBase GetTargetMethod()
[PatchPrefix]
private static bool PatchPrefix(ref string __result)
{
__result = AkiBackendCommunication.Instance.GetJsonBLOCKING("/singleplayer/settings/bot/difficulty/core/core");
try
{
__result = AkiBackendCommunication.Instance.GetJsonBLOCKING("/singleplayer/settings/bot/difficulty/core/core", 15000);
}
catch (Exception ex)
{
Logger.LogError($"Could not fetch bot core difficulty: {ex}");
}
return string.IsNullOrWhiteSpace(__result);
}
}
Expand Down
2 changes: 0 additions & 2 deletions Source/Coop/CoopPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ internal static void LeftGameDestroyEverything()
GameObject.DestroyImmediate(coopGameComponent);
}

AkiBackendCommunication.Instance.WebSocketClose();

EnableDisablePatches();
}
}
Expand Down
Loading
Loading