mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 04:30:45 -05:00
add saving of scav profile to end of patch
This commit is contained in:
parent
ccad89df05
commit
d943d2750a
@ -3,6 +3,7 @@ using HarmonyLib;
|
|||||||
using SPT.Reflection.Patching;
|
using SPT.Reflection.Patching;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using SPT.Common.Http;
|
||||||
|
|
||||||
|
|
||||||
namespace SPT.SinglePlayer.Patches.ScavMode
|
namespace SPT.SinglePlayer.Patches.ScavMode
|
||||||
@ -39,10 +40,12 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
|||||||
private static void PatchPrefix(ref ISession ___iSession)
|
private static void PatchPrefix(ref ISession ___iSession)
|
||||||
{
|
{
|
||||||
var profile = GetProfileAtEndOfRaidPatch.Profile.ParseJsonTo<Profile>();
|
var profile = GetProfileAtEndOfRaidPatch.Profile.ParseJsonTo<Profile>();
|
||||||
|
|
||||||
if (profile.Side != EPlayerSide.Savage)
|
if (profile.Side != EPlayerSide.Savage)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var session = (ProfileEndpointFactoryAbstractClass)___iSession;
|
var session = (ProfileEndpointFactoryAbstractClass)___iSession;
|
||||||
session.AllProfiles = new Profile[]
|
session.AllProfiles = new Profile[]
|
||||||
{
|
{
|
||||||
@ -50,6 +53,13 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
|||||||
profile
|
profile
|
||||||
};
|
};
|
||||||
session.ProfileOfPet.UncoverAll();
|
session.ProfileOfPet.UncoverAll();
|
||||||
|
|
||||||
|
// make a request to the server, so it knows of the items we might transfer
|
||||||
|
RequestHandler.PutJson("/raid/profile/scavsave", new
|
||||||
|
{
|
||||||
|
profile = session.ProfileOfPet
|
||||||
|
}
|
||||||
|
.ToJson());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user