Skip to content

Commit 926264f

Browse files
authored
Merge pull request #309 from project-fika/1.2.1-dev
1.2.1
2 parents 38d20b0 + baafbfc commit 926264f

File tree

8 files changed

+28
-18
lines changed

8 files changed

+28
-18
lines changed

Fika.Core/Coop/GameMode/CoopGame.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ public override async Task<LocalPlayer> vmethod_3(GameWorld gameWorld, int playe
997997

998998
//GameObject customButton = null;
999999

1000-
await NetManagerUtils.SetupGameVariables(isServer, coopPlayer);
1000+
await NetManagerUtils.SetupGameVariables(coopPlayer);
10011001
//customButton = CreateCancelButton(coopPlayer, customButton);
10021002

10031003
if (!isServer && !FikaBackendUtils.IsReconnect)
@@ -1446,6 +1446,8 @@ private async Task RetrieveLootFromServer(bool register)
14461446
/// <returns>A <see cref="Player"/></returns>
14471447
private async Task<LocalPlayer> CreateLocalPlayer()
14481448
{
1449+
Status = GameStatus.Running;
1450+
14491451
int num = Singleton<IFikaNetworkManager>.Instance.NetId;
14501452

14511453
Player.EUpdateMode eupdateMode = Player.EUpdateMode.Auto;

Fika.Core/Coop/Patches/LocalGame/TarkovApplication_LocalGameCreator_Patch.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,15 @@ public static async Task CreateFikaGame(TarkovApplication instance, TimeAndWeath
104104

105105
LocalSettings localSettings = await instance.Session.LocalRaidStarted(localRaidSettings);
106106
LocalRaidSettings raidSettingsToUpdate = applicationTraverse.Field<LocalRaidSettings>("localRaidSettings_0").Value;
107+
int escapeTimeLimit = raidSettings.SelectedLocation.EscapeTimeLimit;
107108
if (isServer)
108109
{
109-
raidSettings.SelectedLocation = localSettings.locationLoot;
110+
raidSettings.SelectedLocation = localSettings.locationLoot;
111+
raidSettings.SelectedLocation.EscapeTimeLimit = escapeTimeLimit;
110112
}
111113
raidSettingsToUpdate.serverId = localSettings.serverId;
112114
raidSettingsToUpdate.selectedLocation = localSettings.locationLoot;
115+
raidSettingsToUpdate.selectedLocation.EscapeTimeLimit = escapeTimeLimit;
113116
raidSettingsToUpdate.transition = FikaBackendUtils.TransitData;
114117

115118
GClass1325 profileInsurance = localSettings.profileInsurance;

Fika.Core/Coop/Players/CoopPlayer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ await player.Init(rotation, layerName, pointOfView, profile, inventoryController
172172
}
173173
}
174174

175-
player.Profile.Info.SetProfileNickname(FikaBackendUtils.PMCName);
175+
player.Profile.Info.SetProfileNickname(FikaBackendUtils.PMCName ?? profile.Nickname);
176176

177177
return player;
178178
}
@@ -833,6 +833,11 @@ public override void vmethod_0(WorldInteractiveObject interactiveObject, Interac
833833
// Execute
834834
public override void vmethod_1(WorldInteractiveObject door, InteractionResult interactionResult)
835835
{
836+
if (door == null)
837+
{
838+
return;
839+
}
840+
836841
if (this is ObservedCoopPlayer)
837842
{
838843
base.vmethod_1(door, interactionResult);

Fika.Core/Coop/Players/ObservedCoopPlayer.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ public override void UpdateSpeedLimitByHealth()
330330
// Do nothing
331331
}
332332

333+
public override void UpdateSpeedLimit(float speedDelta, ESpeedLimit cause, float duration)
334+
{
335+
// Do nothing
336+
}
337+
333338
public override void UpdatePhones()
334339
{
335340
// Do nothing
@@ -672,7 +677,7 @@ public override void CreateMovementContext()
672677
public override void OnHealthEffectAdded(IEffect effect)
673678
{
674679
// Check for GClass increments
675-
if (effect is GInterface315 fracture && !fracture.WasPaused && FractureSound != null && Singleton<BetterAudio>.Instantiated)
680+
if (effect is GInterface316 fracture && !fracture.WasPaused && FractureSound != null && Singleton<BetterAudio>.Instantiated)
676681
{
677682
Singleton<BetterAudio>.Instance.PlayAtPoint(Position, FractureSound, CameraClass.Instance.Distance(Position),
678683
BetterAudio.AudioSourceGroupType.Impacts, 15, 0.7f, EOcclusionTest.Fast, null, false);
@@ -1342,7 +1347,7 @@ public void SetMuffledState(bool muffled)
13421347
VoipEftSource.SetMixerGroup(audioMixerGroup);
13431348
}
13441349
}
1345-
}
1350+
}
13461351

13471352
public override void LandingAdjustments(float d)
13481353
{

Fika.Core/Coop/Utils/FikaGlobals.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public static bool IsInRaid()
169169
/// <returns><see cref="bool"/></returns>
170170
public static bool IsHeadlessProfile(this Profile profile)
171171
{
172-
return profile.Info.GroupId.ToLower() == "headless";
172+
return profile.Info != null && profile.Info.GroupId.ToLower() == "headless";
173173
}
174174

175175
/// <summary>
@@ -179,8 +179,7 @@ public static bool IsHeadlessProfile(this Profile profile)
179179
/// <param name="nickname"></param>
180180
public static void SetProfileNickname(this InfoClass infoClass, string nickname)
181181
{
182-
//Traverse.Create(infoClass).Field<string>("MainProfileNickname").Value = nickname;
183-
infoClass.Nickname = nickname;
182+
Traverse.Create(infoClass).Field<string>("MainProfileNickname").Value = nickname;
184183
}
185184

186185
/// <summary>

Fika.Core/Coop/Utils/NetManagerUtils.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,10 @@ public static Task InitNetManager(bool isServer)
176176
throw new NullReferenceException("FikaGameObject was null");
177177
}
178178

179-
public static Task SetupGameVariables(bool isServer, CoopPlayer coopPlayer)
179+
public static Task SetupGameVariables(CoopPlayer coopPlayer)
180180
{
181-
logger.LogInfo("Setting up game variables...");
182-
if (isServer)
183-
{
184-
Singleton<FikaServer>.Instance.SetupGameVariables(coopPlayer);
185-
return Task.CompletedTask;
186-
}
187-
188-
Singleton<FikaClient>.Instance.SetupGameVariables(coopPlayer);
181+
logger.LogInfo("Setting up game variables...");
182+
Singleton<IFikaNetworkManager>.Instance.SetupGameVariables(coopPlayer);
189183
return Task.CompletedTask;
190184
}
191185

Fika.Core/FikaPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace Fika.Core
5555
[BepInDependency("com.SPT.debugging", BepInDependency.DependencyFlags.HardDependency)] // This is used so that we guarantee to load after spt-debugging, that way we can disable its patches
5656
public class FikaPlugin : BaseUnityPlugin
5757
{
58-
public const string FikaVersion = "1.2.0";
58+
public const string FikaVersion = "1.2.1";
5959
public static FikaPlugin Instance;
6060
public static string EFTVersionMajor { get; internal set; }
6161
public static string ServerModVersion { get; private set; }

Fika.Core/Networking/IFikaNetworkManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using EFT;
22
using Fika.Core.Coop.Components;
3+
using Fika.Core.Coop.Players;
34
using Fika.Core.Networking.Packets;
45
using LiteNetLib;
56
using LiteNetLib.Utils;
@@ -15,6 +16,7 @@ public interface IFikaNetworkManager
1516
public EPlayerSide RaidSide { get; set; }
1617
public int SendRate { get; }
1718
public bool AllowVOIP { get; set; }
19+
public void SetupGameVariables(CoopPlayer coopPlayer);
1820
public void SendVOIPPacket(ref VOIPPacket packet, NetPeer peer = null);
1921
public void SendVOIPData(ArraySegment<byte> data, NetPeer peer = null);
2022
/// <summary>

0 commit comments

Comments
 (0)