From e566206e5bed1df7771dd375e58d80f2973083f8 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 24 May 2024 00:34:59 +0200 Subject: [PATCH] Init branch --- .../Airdrops/Utils/FikaItemFactoryUtil.cs | 2 +- ...EnemyToAllGroupsInBotZonePatch_Override.cs | 2 +- .../Overrides/BotDifficultyPatch_Override.cs | 2 +- .../OfflineRaidSettingsMenuPatch_Override.cs | 2 +- .../BotClasses/CoopBotHealthController.cs | 6 +- .../BotClasses/CoopBotInventoryController.cs | 4 +- .../CoopClientHealthController.cs | 6 +- .../CoopClientInventoryController.cs | 18 +-- .../CoopClientStatisticsManager.cs | 4 +- .../CoopClientFirearmController.cs | 143 ++++++++---------- Fika.Core/Coop/Components/CoopHandler.cs | 6 +- .../Coop/FreeCamera/FreeCameraController.cs | 8 +- Fika.Core/Coop/GameMode/AFikaGame.cs | 47 +----- Fika.Core/Coop/GameMode/CoopGame.cs | 127 ++++++++-------- .../MatchmakerAcceptPatches.cs | 2 +- .../CoopObservedStatisticsManager.cs | 4 +- .../CoopObservedFirearmController.cs | 68 ++++----- .../MovementStates/ObservedRunState.cs | 2 +- .../MovementStates/ObservedSprintState.cs | 4 +- .../ObservedHealthController.cs | 2 +- .../Coop/PacketHandlers/PacketReceiver.cs | 2 +- Fika.Core/Coop/Patches/BotCacher_Patch.cs | 18 +-- ...arkovApplication_LocalGameCreator_Patch.cs | 30 ++-- .../Minefield/Minefield_method_2_Patch.cs | 2 +- Fika.Core/Coop/Players/CoopBot.cs | 10 +- Fika.Core/Coop/Players/CoopPlayer.cs | 60 ++++---- Fika.Core/Coop/Players/ObservedCoopPlayer.cs | 54 +++---- Fika.Core/Fika.Core.csproj | 3 +- Fika.Core/Models/BotDifficulties.cs | 6 +- Fika.Core/Networking/FikaClient.cs | 6 +- Fika.Core/Networking/FikaSerialization.cs | 48 +++--- .../Networking/FikaSerializationExtensions.cs | 24 +-- Fika.Core/Networking/FikaServer.cs | 10 +- .../Packets/Player/HealthSyncPacket.cs | 100 ++++++------ .../Packets/Player/PlayerStatePacket.cs | 4 +- Fika.Core/UI/FikaUIUtils.cs | 16 +- Fika.Core/UI/Patches/ItemContext_Patch.cs | 4 +- 37 files changed, 396 insertions(+), 460 deletions(-) diff --git a/Fika.Core/AkiSupport/Airdrops/Utils/FikaItemFactoryUtil.cs b/Fika.Core/AkiSupport/Airdrops/Utils/FikaItemFactoryUtil.cs index ad94d25e..a4e7cbaa 100644 --- a/Fika.Core/AkiSupport/Airdrops/Utils/FikaItemFactoryUtil.cs +++ b/Fika.Core/AkiSupport/Airdrops/Utils/FikaItemFactoryUtil.cs @@ -28,7 +28,7 @@ public void BuildContainer(LootableContainer container, FikaAirdropConfigModel c if (itemFactory.ItemTemplates.TryGetValue(containerId, out ItemTemplate template)) { Item item = itemFactory.CreateItem(containerId, template._id, null); - item.Id = Singleton.Instance.MainPlayer.GClass2761_0.NextId; + item.Id = Singleton.Instance.MainPlayer.GClass2774_0.NextId; LootItem.CreateLootContainer(container, item, "CRATE", Singleton.Instance); } else diff --git a/Fika.Core/AkiSupport/Overrides/AddEnemyToAllGroupsInBotZonePatch_Override.cs b/Fika.Core/AkiSupport/Overrides/AddEnemyToAllGroupsInBotZonePatch_Override.cs index e8e229b8..220a8b7a 100644 --- a/Fika.Core/AkiSupport/Overrides/AddEnemyToAllGroupsInBotZonePatch_Override.cs +++ b/Fika.Core/AkiSupport/Overrides/AddEnemyToAllGroupsInBotZonePatch_Override.cs @@ -43,7 +43,7 @@ private static bool PatchPrefix(BotsController __instance, IPlayer aggressor, IP } BotZone botZone = groupOwner.AIData.BotOwner.BotsGroup.BotZone; - foreach (KeyValuePair item in __instance.Groups()) + foreach (KeyValuePair item in __instance.Groups()) { if (item.Key != botZone) { diff --git a/Fika.Core/AkiSupport/Overrides/BotDifficultyPatch_Override.cs b/Fika.Core/AkiSupport/Overrides/BotDifficultyPatch_Override.cs index d75a8300..13c85b4a 100644 --- a/Fika.Core/AkiSupport/Overrides/BotDifficultyPatch_Override.cs +++ b/Fika.Core/AkiSupport/Overrides/BotDifficultyPatch_Override.cs @@ -10,7 +10,7 @@ public class BotDifficultyPatch_Override : ModulePatch { protected override MethodBase GetTargetMethod() { - return typeof(GClass532).GetMethod(nameof(GClass532.LoadDifficultyStringInternal)); + return typeof(GClass531).GetMethod(nameof(GClass531.LoadDifficultyStringInternal)); } [PatchPrefix] diff --git a/Fika.Core/AkiSupport/Overrides/OfflineRaidSettingsMenuPatch_Override.cs b/Fika.Core/AkiSupport/Overrides/OfflineRaidSettingsMenuPatch_Override.cs index 8b76e5e7..137286a0 100644 --- a/Fika.Core/AkiSupport/Overrides/OfflineRaidSettingsMenuPatch_Override.cs +++ b/Fika.Core/AkiSupport/Overrides/OfflineRaidSettingsMenuPatch_Override.cs @@ -42,7 +42,7 @@ private static void PatchPostfix(RaidSettingsWindow __instance, UiElementBlocker } // Remove redundant settings and add our own "Random" to make the setting clear, while also renaming index 0 to "Together" - List labelList = Traverse.Create(____playersSpawnPlaceDropdown).Field("list_0").GetValue>(); + List labelList = Traverse.Create(____playersSpawnPlaceDropdown).Field("list_0").GetValue>(); labelList.Clear(); labelList.Add(new() { diff --git a/Fika.Core/Coop/BotClasses/CoopBotHealthController.cs b/Fika.Core/Coop/BotClasses/CoopBotHealthController.cs index 15c779f2..029644b6 100644 --- a/Fika.Core/Coop/BotClasses/CoopBotHealthController.cs +++ b/Fika.Core/Coop/BotClasses/CoopBotHealthController.cs @@ -6,7 +6,7 @@ namespace Fika.Core.Coop.ClientClasses { - public sealed class CoopBotHealthController(Profile.GClass1756 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth) + public sealed class CoopBotHealthController(Profile.GClass1766 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth) : PlayerHealthController(healthInfo, player, inventoryController, skillManager, aiHealth) { private readonly CoopBot coopBot = (CoopBot)player; @@ -18,9 +18,9 @@ public override bool _sendNetworkSyncPackets } } - public override void SendNetworkSyncPacket(GStruct346 packet) + public override void SendNetworkSyncPacket(GStruct347 packet) { - if (packet.SyncType == GStruct346.ESyncType.IsAlive && !packet.Data.IsAlive.IsAlive) + if (packet.SyncType == GStruct347.ESyncType.IsAlive && !packet.Data.IsAlive.IsAlive) { coopBot.PacketSender.HealthSyncPackets.Enqueue(coopBot.SetupDeathPacket(packet)); return; diff --git a/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs b/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs index 03410663..86e75b2c 100644 --- a/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs +++ b/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs @@ -14,7 +14,7 @@ public class CoopBotInventoryController(Player player, Profile profile, bool exa { private readonly CoopBot CoopBot = (CoopBot)player; - public override void Execute(GClass2837 operation, [CanBeNull] Callback callback) + public override void Execute(GClass2850 operation, [CanBeNull] Callback callback) { base.Execute(operation, callback); @@ -25,7 +25,7 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1632.FromInventoryOperation(operation, false)); + binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(operation, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { diff --git a/Fika.Core/Coop/ClientClasses/CoopClientHealthController.cs b/Fika.Core/Coop/ClientClasses/CoopClientHealthController.cs index 1263336e..9f1bed49 100644 --- a/Fika.Core/Coop/ClientClasses/CoopClientHealthController.cs +++ b/Fika.Core/Coop/ClientClasses/CoopClientHealthController.cs @@ -6,7 +6,7 @@ namespace Fika.Core.Coop.ClientClasses { - public sealed class CoopClientHealthController(Profile.GClass1756 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth) + public sealed class CoopClientHealthController(Profile.GClass1766 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth) : PlayerHealthController(healthInfo, player, inventoryController, skillManager, aiHealth) { private readonly CoopPlayer coopPlayer = (CoopPlayer)player; @@ -18,9 +18,9 @@ public override bool _sendNetworkSyncPackets } } - public override void SendNetworkSyncPacket(GStruct346 packet) + public override void SendNetworkSyncPacket(GStruct347 packet) { - if (packet.SyncType == GStruct346.ESyncType.IsAlive && !packet.Data.IsAlive.IsAlive) + if (packet.SyncType == GStruct347.ESyncType.IsAlive && !packet.Data.IsAlive.IsAlive) { coopPlayer.PacketSender.HealthSyncPackets.Enqueue(coopPlayer.SetupDeathPacket(packet)); return; diff --git a/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs b/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs index ae5d9882..e0b4c0d5 100644 --- a/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs +++ b/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs @@ -30,10 +30,10 @@ public override void CallMalfunctionRepaired(Weapon weapon) } } - public override void Execute(GClass2837 operation, [CanBeNull] Callback callback) + public override void Execute(GClass2850 operation, [CanBeNull] Callback callback) { // Do not replicate picking up quest items, throws an error on the other clients - if (operation is GClass2839 pickupOperation) + if (operation is GClass2852 pickupOperation) { if (pickupOperation.Item.Template.QuestItem) { @@ -63,7 +63,7 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1632.FromInventoryOperation(operation, false)); + binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(operation, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { @@ -99,12 +99,12 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback inventoryController = this }; - clientOperationManager.callback ??= new Callback(ClientPlayer.Control0.Class1400.class1400_0.method_0); + clientOperationManager.callback ??= new Callback(ClientPlayer.Control0.Class1422.class1422_0.method_0); uint operationNum = AddOperationCallback(operation, new Callback(clientOperationManager.HandleResult)); using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1632.FromInventoryOperation(operation, false)); + binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(operation, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { @@ -116,17 +116,17 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback } } - private uint AddOperationCallback(GClass2837 operation, Callback callback) + private uint AddOperationCallback(GClass2850 operation, Callback callback) { ushort id = operation.Id; CoopPlayer.OperationCallbacks.Add(id, callback); return id; } - private class HostInventoryOperationManager(CoopClientInventoryController inventoryController, GClass2837 operation, Callback callback) + private class HostInventoryOperationManager(CoopClientInventoryController inventoryController, GClass2850 operation, Callback callback) { public readonly CoopClientInventoryController inventoryController = inventoryController; - public GClass2837 operation = operation; + public GClass2850 operation = operation; public readonly Callback callback = callback; public void HandleResult(IResult result) @@ -143,7 +143,7 @@ private class ClientInventoryOperationManager { public EOperationStatus? serverOperationStatus; public EOperationStatus? localOperationStatus; - public GClass2837 operation; + public GClass2850 operation; public Callback callback; public CoopClientInventoryController inventoryController; diff --git a/Fika.Core/Coop/ClientClasses/CoopClientStatisticsManager.cs b/Fika.Core/Coop/ClientClasses/CoopClientStatisticsManager.cs index ee90a2ee..8e0d2b33 100644 --- a/Fika.Core/Coop/ClientClasses/CoopClientStatisticsManager.cs +++ b/Fika.Core/Coop/ClientClasses/CoopClientStatisticsManager.cs @@ -3,7 +3,7 @@ namespace Fika.Core.Coop.ClientClasses { - public sealed class CoopClientStatisticsManager(Profile profile) : GClass1790() + public sealed class CoopClientStatisticsManager(Profile profile) : GClass1800() { public Profile Profile = profile; @@ -17,7 +17,7 @@ public override void ShowStatNotification(LocalizationKey localizationKey1, Loca { if (value > 0) { - NotificationManagerClass.DisplayNotification(new GClass2040(localizationKey1, localizationKey2, value)); + NotificationManagerClass.DisplayNotification(new GClass2053(localizationKey1, localizationKey2, value)); } } } diff --git a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs index cd92be42..093d0242 100644 --- a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs +++ b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.IO; using UnityEngine; +using static EFT.ClientFirearmController; namespace Fika.Core.Coop.ClientClasses { @@ -47,7 +48,7 @@ public override Dictionary GetOperationFactoryDe return operationFactoryDelegates; } - public Player.GClass1583 Weapon1() + public Player.GClass1593 Weapon1() { if (Item.ReloadMode == Weapon.EReloadMode.InternalMagazine && Item.Chambers.Length == 0) { @@ -60,32 +61,32 @@ public Player.GClass1583 Weapon1() return new FirearmClass2(this); } - public Player.GClass1583 Weapon2() + public Player.GClass1593 Weapon2() { return new FirearmClass1(this); } - public Player.GClass1583 Weapon3() + public Player.GClass1593 Weapon3() { if (Item.IsFlareGun) { - return new GClass1605(this); + return new GClass1615(this); } if (Item.IsOneOff) { - return new GClass1607(this); + return new GClass1617(this); } if (Item.ReloadMode == Weapon.EReloadMode.OnlyBarrel) { - return new GClass1604(this); + return new GClass1614(this); } - if (Item is GClass2696) + if (Item is GClass2708) { - return new GClass1603(this); + return new GClass1613(this); } if (!Item.BoltAction) { - return new GClass1601(this); + return new GClass1611(this); } return new FirearmClass4(this); } @@ -95,7 +96,7 @@ public override bool CheckChamber() bool flag = base.CheckChamber(); if (flag) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { CheckChamber = true }); @@ -108,7 +109,7 @@ public override bool CheckAmmo() bool flag = base.CheckAmmo(); if (flag) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { CheckAmmo = true }); @@ -121,7 +122,7 @@ public override bool ChangeFireMode(Weapon.EFireMode fireMode) bool flag = base.ChangeFireMode(fireMode); if (flag) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ChangeFireMode = true, FireMode = fireMode @@ -133,7 +134,7 @@ public override bool ChangeFireMode(Weapon.EFireMode fireMode) public override void ChangeAimingMode() { base.ChangeAimingMode(); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ToggleAim = true, AimingIndex = IsAiming ? Item.AimIndex.Value : -1 @@ -147,7 +148,7 @@ public override void SetAim(bool value) base.SetAim(value); if (IsAiming != isAiming || aimingInterruptedByOverlap) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ToggleAim = true, AimingIndex = IsAiming ? Item.AimIndex.Value : -1 @@ -160,7 +161,7 @@ public override bool CheckFireMode() bool flag = base.CheckFireMode(); if (flag) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { CheckFireMode = true }); @@ -171,7 +172,7 @@ public override bool CheckFireMode() public override void DryShot(int chamberIndex = 0, bool underbarrelShot = false) { base.DryShot(chamberIndex, underbarrelShot); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasShotInfo = true, ShotInfoPacket = new() @@ -190,7 +191,7 @@ public override bool ExamineWeapon() bool flag = base.ExamineWeapon(); if (flag) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ExamineWeapon = true }); @@ -198,7 +199,7 @@ public override bool ExamineWeapon() return flag; } - public override void InitiateShot(GInterface322 weapon, BulletClass ammo, Vector3 shotPosition, Vector3 shotDirection, Vector3 fireportPosition, int chamberIndex, float overheat) + public override void InitiateShot(GInterface336 weapon, BulletClass ammo, Vector3 shotPosition, Vector3 shotDirection, Vector3 fireportPosition, int chamberIndex, float overheat) { EShotType shotType = new(); @@ -224,7 +225,7 @@ public override void InitiateShot(GInterface322 weapon, BulletClass ammo, Vector break; } - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasShotInfo = true, ShotInfoPacket = new() @@ -237,7 +238,7 @@ public override void InitiateShot(GInterface322 weapon, BulletClass ammo, Vector FireportPosition = fireportPosition, ChamberIndex = chamberIndex, Overheat = overheat, - UnderbarrelShot = Weapon.IsUnderBarrelDeviceActive, + UnderbarrelShot = weapon.IsUnderbarrelWeapon, AmmoTemplate = ammo.AmmoTemplate._id, LastShotOverheat = weapon.MalfState.LastShotOverheat, LastShotTime = weapon.MalfState.LastShotTime, @@ -259,7 +260,7 @@ public override void QuickReloadMag(MagazineClass magazine, Callback callback) base.QuickReloadMag(magazine, callback); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasQuickReloadMagPacket = true, QuickReloadMagPacket = new() @@ -270,7 +271,7 @@ public override void QuickReloadMag(MagazineClass magazine, Callback callback) }); } - public override void ReloadBarrels(GClass2495 ammoPack, GClass2769 placeToPutContainedAmmoMagazine, Callback callback) + public override void ReloadBarrels(GClass2506 ammoPack, GClass2782 placeToPutContainedAmmoMagazine, Callback callback) { if (!CanStartReload() && ammoPack.AmmoCount < 1) { @@ -281,7 +282,7 @@ public override void ReloadBarrels(GClass2495 ammoPack, GClass2769 placeToPutCon CurrentOperation.ReloadBarrels(ammoPack, placeToPutContainedAmmoMagazine, callback, new Callback(handler.Process)); } - public override void ReloadCylinderMagazine(GClass2495 ammoPack, Callback callback, bool quickReload = false) + public override void ReloadCylinderMagazine(GClass2506 ammoPack, Callback callback, bool quickReload = false) { if (Blindfire) { @@ -301,46 +302,28 @@ public override void ReloadCylinderMagazine(GClass2495 ammoPack, Callback callba CurrentOperation.ReloadCylinderMagazine(ammoPack, callback, new Callback(handler.Process), handler.quickReload); } - public override void ReloadGrenadeLauncher(GClass2495 ammoPack, Callback callback) + public override void ReloadGrenadeLauncher(GClass2506 ammoPack, Callback callback) { if (!CanStartReload()) { return; } + CurrentOperation.ReloadGrenadeLauncher(ammoPack, callback); + string[] reloadingAmmoIds = ammoPack.GetReloadingAmmoIds(); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { - HasReloadLauncherPacket = true, ReloadLauncher = new() { Reload = true, AmmoIds = reloadingAmmoIds } }); - - CurrentOperation.ReloadGrenadeLauncher(ammoPack, callback); - } - - public override void UnderbarrelSightingRangeUp() - { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() - { - UnderbarrelSightingRangeUp = true - }); - base.UnderbarrelSightingRangeUp(); - } - - public override void UnderbarrelSightingRangeDown() - { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() - { - UnderbarrelSightingRangeDown = true - }); - base.UnderbarrelSightingRangeDown(); } - public override void ReloadMag(MagazineClass magazine, GClass2769 gridItemAddress, Callback callback) + public override void ReloadMag(MagazineClass magazine, GClass2782 gridItemAddress, Callback callback) { if (!CanStartReload() || Blindfire) { @@ -351,7 +334,7 @@ public override void ReloadMag(MagazineClass magazine, GClass2769 gridItemAddres CurrentOperation.ReloadMag(magazine, gridItemAddress, callback, new Callback(handler.Process)); } - public override void ReloadWithAmmo(GClass2495 ammoPack, Callback callback) + public override void ReloadWithAmmo(GClass2506 ammoPack, Callback callback) { if (Item.GetCurrentMagazine() == null) { @@ -366,11 +349,11 @@ public override void ReloadWithAmmo(GClass2495 ammoPack, Callback callback) CurrentOperation.ReloadWithAmmo(ammoPack, callback, new Callback(handler.Process)); } - public override void SetLightsState(GStruct163[] lightsStates, bool force = false) + public override void SetLightsState(GStruct164[] lightsStates, bool force = false) { if (force || CurrentOperation.CanChangeLightState(lightsStates)) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ToggleTacticalCombo = true, LightStatesPacket = new() @@ -383,20 +366,20 @@ public override void SetLightsState(GStruct163[] lightsStates, bool force = fals base.SetLightsState(lightsStates, force); } - public override void SetScopeMode(GStruct164[] scopeStates) + public override void SetScopeMode(GStruct165[] scopeStates) { if (!CurrentOperation.CanChangeScopeStates(scopeStates)) { return; } - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ChangeSightMode = true, ScopeStatesPacket = new() { Amount = scopeStates.Length, - GStruct164 = scopeStates + GStruct165 = scopeStates } }); @@ -426,7 +409,7 @@ public override void ShotMisfired(BulletClass ammo, Weapon.EMalfunctionState mal break; } - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasShotInfo = true, ShotInfoPacket = new() @@ -447,7 +430,7 @@ public override bool ToggleLauncher() bool flag = base.ToggleLauncher(); if (flag) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ToggleLauncher = true }); @@ -458,7 +441,7 @@ public override bool ToggleLauncher() public override void Loot(bool p) { base.Loot(p); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { Loot = p }); @@ -467,7 +450,7 @@ public override void Loot(bool p) public override void SetInventoryOpened(bool opened) { base.SetInventoryOpened(opened); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { EnableInventory = true, InventoryStatus = opened @@ -477,7 +460,7 @@ public override void SetInventoryOpened(bool opened) public override void ChangeLeftStance() { base.ChangeLeftStance(); - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasStanceChange = true, LeftStanceState = coopPlayer.MovementContext.LeftStanceEnabled @@ -491,7 +474,7 @@ public override void SendStartOneShotFire() public override void CreateFlareShot(BulletClass flareItem, Vector3 shotPosition, Vector3 forward) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasFlareShot = true, FlareShotPacket = new() @@ -506,7 +489,7 @@ public override void CreateFlareShot(BulletClass flareItem, Vector3 shotPosition private void SendAbortReloadPacket(int amount) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasReloadWithAmmoPacket = true, ReloadWithAmmo = new() @@ -525,7 +508,7 @@ public override void RollCylinder(bool rollToZeroCamora) return; } - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasRollCylinder = true, RollToZeroCamora = rollToZeroCamora @@ -536,7 +519,7 @@ public override void RollCylinder(bool rollToZeroCamora) private void SendEndReloadPacket(int amount) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasReloadWithAmmoPacket = true, ReloadWithAmmo = new() @@ -550,13 +533,13 @@ private void SendEndReloadPacket(int amount) private void SendBoltActionReloadPacket() { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { ReloadBoltAction = true }); } - private class FirearmClass1(Player.FirearmController controller) : GClass1589(controller) + private class FirearmClass1(Player.FirearmController controller) : GClass1599(controller) { public override void SetTriggerPressed(bool pressed) { @@ -578,7 +561,7 @@ public override void SwitchToIdle() private CoopClientFirearmController coopClientFirearmController = (CoopClientFirearmController)controller; } - private class FirearmClass2(Player.FirearmController controller) : GClass1590(controller) + private class FirearmClass2(Player.FirearmController controller) : GClass1600(controller) { public override void SetTriggerPressed(bool pressed) { @@ -599,7 +582,7 @@ public override void SwitchToIdle() private readonly CoopClientFirearmController coopClientFirearmController = (CoopClientFirearmController)controller; } - private class FirearmClass3(Player.FirearmController controller) : GClass1591(controller) + private class FirearmClass3(Player.FirearmController controller) : GClass1601(controller) { public override void SetTriggerPressed(bool pressed) { @@ -620,7 +603,7 @@ public override void SwitchToIdle() private readonly CoopClientFirearmController coopClientFirearmController = (CoopClientFirearmController)controller; } - private class FirearmClass4(Player.FirearmController controller) : GClass1602(controller) + private class FirearmClass4(Player.FirearmController controller) : GClass1612(controller) { public override void Start() { @@ -640,7 +623,7 @@ public override void SetInventoryOpened(bool opened) SendBoltActionReloadPacket(true); } - public override void ReloadMag(MagazineClass magazine, GClass2769 gridItemAddress, Callback finishCallback, Callback startCallback) + public override void ReloadMag(MagazineClass magazine, GClass2782 gridItemAddress, Callback finishCallback, Callback startCallback) { base.ReloadMag(magazine, gridItemAddress, finishCallback, startCallback); SendBoltActionReloadPacket(true); @@ -652,7 +635,7 @@ public override void QuickReloadMag(MagazineClass magazine, Callback finishCallb SendBoltActionReloadPacket(true); } - public override void ReloadWithAmmo(GClass2495 ammoPack, Callback finishCallback, Callback startCallback) + public override void ReloadWithAmmo(GClass2506 ammoPack, Callback finishCallback, Callback startCallback) { base.ReloadWithAmmo(ammoPack, finishCallback, startCallback); SendBoltActionReloadPacket(true); @@ -677,15 +660,15 @@ public override void Reset() private bool hasSent; } - private class ReloadMagHandler(CoopPlayer coopPlayer, GClass2769 gridItemAddress, MagazineClass magazine) + private class ReloadMagHandler(CoopPlayer coopPlayer, GClass2782 gridItemAddress, MagazineClass magazine) { private readonly CoopPlayer coopPlayer = coopPlayer; - private readonly GClass2769 gridItemAddress = gridItemAddress; + private readonly GClass2782 gridItemAddress = gridItemAddress; private readonly MagazineClass magazine = magazine; public void Process(IResult error) { - GClass1528 gridItemAddressDescriptor = (gridItemAddress == null) ? null : GClass1632.FromGridItemAddress(gridItemAddress); + GClass1538 gridItemAddressDescriptor = (gridItemAddress == null) ? null : GClass1642.FromGridItemAddress(gridItemAddress); using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); @@ -702,7 +685,7 @@ public void Process(IResult error) if (error.Succeed) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasReloadMagPacket = true, ReloadMagPacket = new() @@ -727,7 +710,7 @@ private class ReloadCylinderMagazineHandler(CoopPlayer coopPlayer, CoopClientFir public void Process(IResult error) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasReloadWithAmmoPacket = true, ReloadWithAmmo = new() @@ -747,15 +730,15 @@ public void Process(IResult error) } } - private class ReloadBarrelsHandler(CoopPlayer coopPlayer, GClass2769 placeToPutContainedAmmoMagazine, GClass2495 ammoPack) + private class ReloadBarrelsHandler(CoopPlayer coopPlayer, GClass2782 placeToPutContainedAmmoMagazine, GClass2506 ammoPack) { private readonly CoopPlayer coopPlayer = coopPlayer; - private readonly GClass2769 placeToPutContainedAmmoMagazine = placeToPutContainedAmmoMagazine; - private readonly GClass2495 ammoPack = ammoPack; + private readonly GClass2782 placeToPutContainedAmmoMagazine = placeToPutContainedAmmoMagazine; + private readonly GClass2506 ammoPack = ammoPack; public void Process(IResult error) { - GClass1528 gridItemAddressDescriptor = (placeToPutContainedAmmoMagazine == null) ? null : GClass1632.FromGridItemAddress(placeToPutContainedAmmoMagazine); + GClass1538 gridItemAddressDescriptor = (placeToPutContainedAmmoMagazine == null) ? null : GClass1642.FromGridItemAddress(placeToPutContainedAmmoMagazine); string[] ammoIds = ammoPack.GetReloadingAmmoIds(); @@ -774,7 +757,7 @@ public void Process(IResult error) if (coopPlayer.HealthController.IsAlive) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasReloadBarrelsPacket = true, ReloadBarrels = new() @@ -797,7 +780,7 @@ public void Process(IResult error) { if (error.Succeed) { - coopPlayer.PacketSender.FirearmPackets.Enqueue(new() + coopPlayer.PacketSender?.FirearmPackets?.Enqueue(new() { HasReloadWithAmmoPacket = true, ReloadWithAmmo = new() diff --git a/Fika.Core/Coop/Components/CoopHandler.cs b/Fika.Core/Coop/Components/CoopHandler.cs index b881b263..96369912 100644 --- a/Fika.Core/Coop/Components/CoopHandler.cs +++ b/Fika.Core/Coop/Components/CoopHandler.cs @@ -458,10 +458,10 @@ private ObservedCoopPlayer SpawnObservedPlayer(Profile profile, Vector3 position ObservedCoopPlayer otherPlayer = ObservedCoopPlayer.CreateObservedPlayer(playerId, position, Quaternion.identity, "Player", isAI == true ? "Bot_" : $"Player_{profile.Nickname}_", EPointOfView.ThirdPerson, profile, isAI, EUpdateQueue.Update, Player.EUpdateMode.Manual, Player.EUpdateMode.Auto, - GClass549.Config.CharacterController.ObservedPlayerMode, + GClass548.Config.CharacterController.ObservedPlayerMode, () => Singleton.Instance.Control.Settings.MouseSensitivity, () => Singleton.Instance.Control.Settings.MouseAimingSensitivity, - GClass1446.Default).Result; + GClass1456.Default).Result; if (otherPlayer == null) { @@ -638,7 +638,7 @@ public void SetWeaponInHandsOfNewPlayer(Player person, Action successCallback) }); } - public BaseLocalGame LocalGameInstance { get; internal set; } + public BaseLocalGame LocalGameInstance { get; internal set; } } public enum ESpawnState diff --git a/Fika.Core/Coop/FreeCamera/FreeCameraController.cs b/Fika.Core/Coop/FreeCamera/FreeCameraController.cs index 812b80bb..919d2d20 100644 --- a/Fika.Core/Coop/FreeCamera/FreeCameraController.cs +++ b/Fika.Core/Coop/FreeCamera/FreeCameraController.cs @@ -27,7 +27,7 @@ public class FreeCameraController : MonoBehaviour //private GameObject _mainCamera; private FreeCamera _freeCamScript; - private BattleUIScreen _playerUi; + private EftBattleUIScreen _playerUi; private bool _uiHidden; private bool _effectsCleared = false; @@ -233,10 +233,10 @@ private void ClearEffects() Destroy(bloodOnScreen); } - List effectsManagerList = effectsController.Field("list_0").GetValue>(); + List effectsManagerList = effectsController.Field("list_0").GetValue>(); if (effectsManagerList != null) { - foreach (EffectsController.Class566 effectsManager in effectsManagerList) + foreach (EffectsController.Class572 effectsManager in effectsManagerList) { while (effectsManager.ActiveEffects.Count > 0) { @@ -326,7 +326,7 @@ private void ToggleUi() return; } - _playerUi = gameObject.GetComponent(); + _playerUi = gameObject.GetComponent(); if (_playerUi == null) { diff --git a/Fika.Core/Coop/GameMode/AFikaGame.cs b/Fika.Core/Coop/GameMode/AFikaGame.cs index b1acc974..6c502945 100644 --- a/Fika.Core/Coop/GameMode/AFikaGame.cs +++ b/Fika.Core/Coop/GameMode/AFikaGame.cs @@ -1,4 +1,4 @@ -using Aki.Reflection.Utils; +/*using Aki.Reflection.Utils; using BepInEx.Logging; using Comfort.Common; using EFT; @@ -7,13 +7,14 @@ using EFT.Weather; using JsonType; using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Fika.Core.Coop.GameMode { - public abstract class AFikaGame : BaseLocalGame, IBotGame + public abstract class AFikaGame : BaseLocalGame, IBotGame { public new bool InRaid { get { return true; } } @@ -55,50 +56,13 @@ public IWeatherCurve WeatherCurve ManualLogSource Logger { get; set; } - public static T Create(InputTree inputTree, Profile profile, GameDateTime backendDateTime, InsuranceCompanyClass insurance, MenuUI menuUI, - CommonUI commonUI, PreloaderUI preloaderUI, GameUI gameUI, LocationSettingsClass.Location location, TimeAndWeatherSettings timeAndWeather, - WavesSettings wavesSettings, EDateTime dateTime, Callback callback, float fixedDeltaTime, EUpdateQueue updateQueue, - ISession backEndSession, TimeSpan sessionTime) where T : AFikaGame + public static T Create(GInterface170 inputTree, Profile profile, GameDateTime backendDateTime, InsuranceCompanyClass insurance, MenuUI menuUI, GameUI gameUI, LocationSettingsClass.Location location, TimeAndWeatherSettings timeAndWeather, WavesSettings wavesSettings, EDateTime dateTime, Callback callback, float fixedDeltaTime, EUpdateQueue updateQueue, ISession backEndSession, TimeSpan? sessionTime) where T : AFikaGame { - - var r = smethod_0(inputTree, profile, backendDateTime, insurance, menuUI, commonUI, preloaderUI, gameUI, location, timeAndWeather, wavesSettings, dateTime, - callback, fixedDeltaTime, updateQueue, backEndSession, new TimeSpan?(sessionTime)); - - r.Logger = BepInEx.Logging.Logger.CreateLogSource("Coop Game Mode"); - r.Logger.LogInfo("CoopGame::Create"); - - // Non Waves Scenario setup - r.nonWavesSpawnScenario_0 = (NonWavesSpawnScenario)typeof(NonWavesSpawnScenario).GetMethod(nameof(NonWavesSpawnScenario.smethod_0), BindingFlags.Static | BindingFlags.Public).Invoke - (null, [r, location, r.PBotsController]); - r.nonWavesSpawnScenario_0.ImplementWaveSettings(wavesSettings); - - // Waves Scenario setup - r.wavesSpawnScenario_0 = (WavesSpawnScenario)typeof(WavesSpawnScenario).GetMethod(nameof(WavesSpawnScenario.smethod_0), BindingFlags.Static | BindingFlags.Public).Invoke - (null, [r.gameObject, location.waves, new Action(r.PBotsController.ActivateBotsByWave), location]); - - var bosswavemanagerValue = typeof(GClass579).GetMethod(nameof(GClass579.smethod_0), BindingFlags.Static | BindingFlags.Public).Invoke - (null, [location.BossLocationSpawn, new Action(r.PBotsController.ActivateBotsByWave)]); - - r.GetType().GetFields(BindingFlags.NonPublic).Where(x => x.FieldType == typeof(GClass579)).FirstOrDefault().SetValue(r, bosswavemanagerValue); - - r.GClass579 = bosswavemanagerValue as GClass579; - - r.func_1 = (player) => GamePlayerOwner.Create(player, inputTree, insurance, backEndSession, commonUI, preloaderUI, gameUI, r.GameDateTime, location); - - return r; + return null; } public Dictionary Bots { get; set; } = new Dictionary(); - /// - /// Matchmaker countdown - /// - /// - public override void vmethod_1(float timeBeforeDeploy) - { - base.vmethod_1(timeBeforeDeploy); - } - /// /// Reconnection handling. /// @@ -122,3 +86,4 @@ public override void vmethod_3() } } } +*/ \ No newline at end of file diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index 3e368d87..4ac8db46 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -53,7 +53,7 @@ namespace Fika.Core.Coop.GameMode /// /// A custom Game Type /// - internal sealed class CoopGame : BaseLocalGame, IBotGame, IFikaGame + internal sealed class CoopGame : BaseLocalGame, IBotGame, IFikaGame { public string InfiltrationPoint; public bool HasAddedFenceRep = false; @@ -67,12 +67,12 @@ internal sealed class CoopGame : BaseLocalGame, IBotGame, IFika private GameObject fikaStartButton; private readonly Dictionary botQueue = []; private Coroutine extractRoutine; - private GClass2928 spawnPoints = null; + private GClass2945 spawnPoints = null; private ISpawnPoint spawnPoint = null; private GClass579 GClass579; private WavesSpawnScenario wavesSpawnScenario_0; private NonWavesSpawnScenario nonWavesSpawnScenario_0; - private Func func_1; + private Func func_1; private bool hasSaved = false; public FikaDynamicAI DynamicAI { get; private set; } @@ -105,9 +105,10 @@ public IWeatherCurve WeatherCurve private static ManualLogSource Logger; - internal static CoopGame Create(InputTree inputTree, Profile profile, GameDateTime backendDateTime, InsuranceCompanyClass insurance, MenuUI menuUI, - CommonUI commonUI, PreloaderUI preloaderUI, GameUI gameUI, LocationSettingsClass.Location location, TimeAndWeatherSettings timeAndWeather, - WavesSettings wavesSettings, EDateTime dateTime, Callback callback, float fixedDeltaTime, EUpdateQueue updateQueue, + internal static CoopGame Create(GInterface170 inputTree, Profile profile, GameDateTime backendDateTime, + InsuranceCompanyClass insurance, MenuUI menuUI, GameUI gameUI, LocationSettingsClass.Location location, + TimeAndWeatherSettings timeAndWeather, WavesSettings wavesSettings, EDateTime dateTime, + Callback callback, float fixedDeltaTime, EUpdateQueue updateQueue, ISession backEndSession, TimeSpan sessionTime, RaidSettings raidSettings) { Logger = BepInEx.Logging.Logger.CreateLogSource("Coop Game Mode"); @@ -116,8 +117,9 @@ internal static CoopGame Create(InputTree inputTree, Profile profile, GameDateTi bool useCustomWeather = timeAndWeather.IsRandomWeather; timeAndWeather.IsRandomWeather = false; - CoopGame coopGame = smethod_0(inputTree, profile, backendDateTime, insurance, menuUI, commonUI, - preloaderUI, gameUI, location, timeAndWeather, wavesSettings, dateTime, callback, fixedDeltaTime, updateQueue, backEndSession, new TimeSpan?(sessionTime)); + CoopGame coopGame = smethod_0(inputTree, profile, backendDateTime, insurance, menuUI, gameUI, + location, timeAndWeather, wavesSettings, dateTime, callback, fixedDeltaTime, updateQueue, backEndSession, + new TimeSpan?(sessionTime)); // Non Waves Scenario setup coopGame.nonWavesSpawnScenario_0 = NonWavesSpawnScenario.smethod_0(coopGame, location, coopGame.botsController_0); @@ -136,7 +138,7 @@ internal static CoopGame Create(InputTree inputTree, Profile profile, GameDateTi coopGame.SetupCustomWeather(timeAndWeather); } - coopGame.func_1 = (Player player) => GamePlayerOwner.Create(player, inputTree, insurance, backEndSession, commonUI, preloaderUI, gameUI, coopGame.GameDateTime, location); + coopGame.func_1 = (Player player) => EftGamePlayerOwner.Create(player, inputTree, insurance, backEndSession, gameUI, coopGame.GameDateTime, location); Singleton.Create(coopGame); FikaEventDispatcher.DispatchEvent(new FikaGameCreatedEvent(coopGame)); @@ -153,7 +155,7 @@ private void SetupCustomWeather(TimeAndWeatherSettings timeAndWeather) return; } - DateTime dateTime = GClass1296.StartOfDay(); + DateTime dateTime = GClass1304.StartOfDay(); DateTime dateTime2 = dateTime.AddDays(1); WeatherClass weather = WeatherClass.CreateDefault(); @@ -164,7 +166,7 @@ private void SetupCustomWeather(TimeAndWeatherSettings timeAndWeather) weather.ScaterringFogDensity = weather2.ScaterringFogDensity = timeAndWeather.FogType.ToValue(); weather.Time = dateTime.Ticks; weather2.Time = dateTime2.Ticks; - WeatherController.Instance.method_4([weather, weather2]); + WeatherController.Instance.method_0([weather, weather2]); } public async Task CreateCoopHandler() @@ -385,8 +387,8 @@ private async Task CreateBot(Profile profile, Vector3 position) localPlayer = await CoopBot.CreateBot(num, position, Quaternion.identity, "Player", "Bot_", EPointOfView.ThirdPerson, profile, true, UpdateQueue, Player.EUpdateMode.Manual, - Player.EUpdateMode.Auto, GClass549.Config.CharacterController.BotPlayerMode, () => 1f, - () => 1f, GClass1446.Default); + Player.EUpdateMode.Auto, GClass548.Config.CharacterController.BotPlayerMode, () => 1f, + () => 1f, GClass1456.Default); localPlayer.Location = Location_0.Id; @@ -540,9 +542,10 @@ private void DespawnBot(CoopHandler coopHandler, Player bot) /// We use instead /// /// - public override void vmethod_1(float timeBeforeDeploy) + public override IEnumerator vmethod_1() { - /// Do nothing + // Do nothing + yield break; } /// @@ -576,7 +579,7 @@ private async void DeployScreen(float timeBeforeDeploy) NetDataWriter writer = new(); forceStart = false; - MatchmakerAcceptPatches.GClass3163.ChangeStatus("Waiting for other players to finish loading..."); + MatchmakerAcceptPatches.GClass3182.ChangeStatus("Waiting for other players to finish loading..."); if (fikaStartButton != null) { @@ -729,8 +732,8 @@ public override async Task vmethod_2(int playerId, Vector3 position LocalPlayer myPlayer = await CoopPlayer.Create(playerId, spawnPoint.Position, spawnPoint.Rotation, "Player", "Main_", EPointOfView.FirstPerson, profile, false, UpdateQueue, armsUpdateMode, bodyUpdateMode, - GClass549.Config.CharacterController.ClientPlayerMode, getSensitivity, - getAimingSensitivity, new GClass1445(), MatchmakerAcceptPatches.IsServer ? 0 : 1000, statisticsManager); + GClass548.Config.CharacterController.ClientPlayerMode, getSensitivity, + getAimingSensitivity, new GClass1455(), MatchmakerAcceptPatches.IsServer ? 0 : 1000, statisticsManager); profile.SetSpawnedInSession(profile.Side == EPlayerSide.Savage); @@ -877,7 +880,7 @@ private void MainPlayerDied(EDamageType obj) public async Task InitPlayer(BotControllerSettings botsSettings, string backendUrl, InventoryControllerClass inventoryController, Callback runCallback) { Status = GameStatus.Running; - UnityEngine.Random.InitState((int)GClass1296.Now.Ticks); + UnityEngine.Random.InitState((int)GClass1304.Now.Ticks); LocationSettingsClass.Location location; if (Location_0.IsHideout) @@ -890,7 +893,7 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU { int num = UnityEngine.Random.Range(1, 6); method_6(backendUrl, Location_0.Id, num); - location = await ginterface145_0.LoadLocationLoot(Location_0.Id, num); + location = await ginterface158_0.LoadLocationLoot(Location_0.Id, num); } } @@ -907,7 +910,7 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU Logger.LogError("Can't find event prefab in resources. Path : Prefabs/HALLOWEEN_CONTROLLER"); } } - GClass785 config = GClass549.Config; + GClass786 config = GClass548.Config; if (config.FixedFrameRate > 0f) { FixedDeltaTime = 1f / config.FixedFrameRate; @@ -928,9 +931,9 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU await method_11(location, startHandler.FinishLoading); } - private class StartHandler(BaseLocalGame localGame, BotControllerSettings botSettings, ISpawnSystem spawnSystem, Callback runCallback) + private class StartHandler(BaseLocalGame localGame, BotControllerSettings botSettings, ISpawnSystem spawnSystem, Callback runCallback) { - private readonly BaseLocalGame localGame = localGame; + private readonly BaseLocalGame localGame = localGame; private readonly BotControllerSettings botSettings = botSettings; private readonly ISpawnSystem spawnSystem = spawnSystem; private readonly Callback runCallback = runCallback; @@ -946,15 +949,15 @@ private async Task CreateLocalPlayer() int num = method_12(); Player.EUpdateMode eupdateMode = Player.EUpdateMode.Auto; - if (GClass549.Config.UseHandsFastAnimator) + if (GClass548.Config.UseHandsFastAnimator) { eupdateMode = Player.EUpdateMode.Manual; } - spawnPoints = GClass2928.CreateFromScene(new DateTime?(GClass1296.LocalDateTimeFromUnixTime(Location_0.UnixDateTime)), Location_0.SpawnPointParams); + spawnPoints = GClass2945.CreateFromScene(new DateTime?(GClass1304.LocalDateTimeFromUnixTime(Location_0.UnixDateTime)), Location_0.SpawnPointParams); int spawnSafeDistance = (Location_0.SpawnSafeDistanceMeters > 0) ? Location_0.SpawnSafeDistanceMeters : 100; GStruct380 settings = new(Location_0.MinDistToFreePoint, Location_0.MaxDistToFreePoint, Location_0.MaxBotPerZone, spawnSafeDistance); - SpawnSystem = GClass2929.CreateSpawnSystem(settings, () => Time.time, Singleton.Instance, zones: botsController_0, spawnPoints); + SpawnSystem = GClass2946.CreateSpawnSystem(settings, () => Time.time, Singleton.Instance, zones: botsController_0, spawnPoints); if (MatchmakerAcceptPatches.IsServer) { @@ -975,8 +978,8 @@ private async Task CreateLocalPlayer() IStatisticsManager statisticsManager = new CoopClientStatisticsManager(Profile_0); LocalPlayer myPlayer = await vmethod_2(num, spawnPoint.Position, spawnPoint.Rotation, "Player", "Main_", EPointOfView.FirstPerson, Profile_0, false, - UpdateQueue, eupdateMode, Player.EUpdateMode.Auto, GClass549.Config.CharacterController.ClientPlayerMode, - new Func(Class1362.class1362_0.method_1), new Func(Class1362.class1362_0.method_2), + UpdateQueue, eupdateMode, Player.EUpdateMode.Auto, GClass548.Config.CharacterController.ClientPlayerMode, + new Func(Class1380.class1380_0.method_3), new Func(Class1380.class1380_0.method_4), statisticsManager, null, null); myPlayer.Location = Location_0.Id; @@ -989,9 +992,9 @@ private async Task WaitForPlayers() { Logger.LogInfo("Starting task to wait for other players."); - if (MatchmakerAcceptPatches.GClass3163 != null) + if (MatchmakerAcceptPatches.GClass3182 != null) { - MatchmakerAcceptPatches.GClass3163.ChangeStatus($"Initializing Coop Game..."); + MatchmakerAcceptPatches.GClass3182.ChangeStatus($"Initializing Coop Game..."); } int numbersOfPlayersToWaitFor = 0; @@ -1007,15 +1010,15 @@ private async Task WaitForPlayers() do { numbersOfPlayersToWaitFor = MatchmakerAcceptPatches.HostExpectedNumberOfPlayers - (server.NetServer.ConnectedPeersCount + 1); - if (MatchmakerAcceptPatches.GClass3163 != null) + if (MatchmakerAcceptPatches.GClass3182 != null) { if (numbersOfPlayersToWaitFor > 0) { - MatchmakerAcceptPatches.GClass3163.ChangeStatus($"Waiting for {numbersOfPlayersToWaitFor} {(numbersOfPlayersToWaitFor > 1 ? "players" : "player")}"); + MatchmakerAcceptPatches.GClass3182.ChangeStatus($"Waiting for {numbersOfPlayersToWaitFor} {(numbersOfPlayersToWaitFor > 1 ? "players" : "player")}"); } else { - MatchmakerAcceptPatches.GClass3163.ChangeStatus($"All players joined, starting game..."); + MatchmakerAcceptPatches.GClass3182.ChangeStatus($"All players joined, starting game..."); } } else @@ -1044,7 +1047,7 @@ private async Task WaitForPlayers() while (client.ServerConnection == null && connectionAttempts < 5) { // Server retries 10 times with a 500ms interval, we give it 5 seconds to try - MatchmakerAcceptPatches.GClass3163.ChangeStatus("Waiting for client to connect to server... If there is no notification it failed."); + MatchmakerAcceptPatches.GClass3182.ChangeStatus("Waiting for client to connect to server... If there is no notification it failed."); connectionAttempts++; await Task.Delay(1000); @@ -1066,15 +1069,15 @@ private async Task WaitForPlayers() do { numbersOfPlayersToWaitFor = MatchmakerAcceptPatches.HostExpectedNumberOfPlayers - (client.ConnectedClients + 1); - if (MatchmakerAcceptPatches.GClass3163 != null) + if (MatchmakerAcceptPatches.GClass3182 != null) { if (numbersOfPlayersToWaitFor > 0) { - MatchmakerAcceptPatches.GClass3163.ChangeStatus($"Waiting for {numbersOfPlayersToWaitFor} {(numbersOfPlayersToWaitFor > 1 ? "players" : "player")}"); + MatchmakerAcceptPatches.GClass3182.ChangeStatus($"Waiting for {numbersOfPlayersToWaitFor} {(numbersOfPlayersToWaitFor > 1 ? "players" : "player")}"); } else { - MatchmakerAcceptPatches.GClass3163.ChangeStatus($"All players joined, starting game..."); + MatchmakerAcceptPatches.GClass3182.ChangeStatus($"All players joined, starting game..."); } } else @@ -1104,7 +1107,7 @@ private async Task SetStatus(LocalPlayer myPlayer, LobbyEntry.ELobbyStatus statu /// /// /// - public override IEnumerator vmethod_4(float startDelay, BotControllerSettings controllerSettings, ISpawnSystem spawnSystem, Callback runCallback) + public override IEnumerator vmethod_4(BotControllerSettings controllerSettings, ISpawnSystem spawnSystem, Callback runCallback) { if (MatchmakerAcceptPatches.IsClient) { @@ -1113,9 +1116,9 @@ public override IEnumerator vmethod_4(float startDelay, BotControllerSettings co if (MatchmakerAcceptPatches.IsServer) { - BotsPresets profileCreator = new(BackEndSession, wavesSpawnScenario_0.SpawnWaves, GClass579.BossSpawnWaves, nonWavesSpawnScenario_0.GClass1467_0, false); + BotsPresets profileCreator = new(BackEndSession, wavesSpawnScenario_0.SpawnWaves, GClass579.BossSpawnWaves, nonWavesSpawnScenario_0.GClass1477_0, false); - GClass813 botCreator = new(this, profileCreator, CreateBot); + GClass814 botCreator = new(this, profileCreator, CreateBot); BotZone[] botZones = LocationScene.GetAllObjects(false).ToArray(); bool enableWaves = controllerSettings.BotAmount == EBotAmount.Horde; @@ -1175,7 +1178,7 @@ public override IEnumerator vmethod_4(float startDelay, BotControllerSettings co { BotsPresets profileCreator = new(BackEndSession, [], [], [], false); - GClass813 botCreator = new(this, profileCreator, CreateBot); + GClass814 botCreator = new(this, profileCreator, CreateBot); BotZone[] botZones = LocationScene.GetAllObjects(false).ToArray(); // Setting this to an empty array stops the client from downloading bots @@ -1191,10 +1194,12 @@ public override IEnumerator vmethod_4(float startDelay, BotControllerSettings co BackendConfigSettingsClass instance = Singleton.Instance; - bool isWinter = BackEndSession.IsWinter; - Class420 winterEventController = new(); - Singleton.Instance.Class420_0 = winterEventController; - winterEventController.Run(isWinter).HandleExceptions(); + LocalGame.Class1387 seasonTaskHandler = new(); + ESeason season = ginterface158_0.Season; + Class393 seasonHandler = new(); + Singleton.Instance.GInterface26_0 = seasonHandler; + seasonTaskHandler.task = seasonHandler.Run(season); + yield return new WaitUntil(new Func(seasonTaskHandler.method_0)); if (startDelay < 5) { @@ -1324,7 +1329,7 @@ private void SetupBorderzones() } } - private void OnBorderZoneShot(GInterface94 player, BorderZone zone, float arg3, bool arg4) + private void OnBorderZoneShot(GInterface106 player, BorderZone zone, float arg3, bool arg4) { BorderZonePacket packet = new() { @@ -1379,7 +1384,7 @@ public void CreateExfiltrationPointAndInitDeathHandler() ExfiltrationControllerClass.Instance.InitAllExfiltrationPoints(Location_0.exits, MatchmakerAcceptPatches.IsClient, ""); ExfiltrationPoint[] exfilPoints = ExfiltrationControllerClass.Instance.EligiblePoints(Profile_0); - GameUi.TimerPanel.SetTime(GClass1296.UtcNow, Profile_0.Info.Side, GameTimer.SessionSeconds(), exfilPoints); + GameUi.TimerPanel.SetTime(GClass1304.UtcNow, Profile_0.Info.Side, GameTimer.SessionSeconds(), exfilPoints); exfilManager = gameObject.AddComponent(); exfilManager.Run(exfilPoints); @@ -1414,7 +1419,7 @@ public void CreateExfiltrationPointAndInitDeathHandler() } } - dateTime_0 = GClass1296.Now; + dateTime_0 = GClass1304.Now; Status = GameStatus.Started; ConsoleScreen.ApplyStartCommands(); } @@ -1433,7 +1438,7 @@ public void ResetExfilPointsFromServer(ExfiltrationPoint[] points) } currentExfils.Clear(); - GameUi.TimerPanel.SetTime(GClass1296.UtcNow, Profile_0.Info.Side, GameTimer.SessionSeconds(), points); + GameUi.TimerPanel.SetTime(GClass1304.UtcNow, Profile_0.Info.Side, GameTimer.SessionSeconds(), points); } public List ExtractedPlayers { get; } = []; @@ -1508,7 +1513,7 @@ public void Extract(CoopPlayer player, ExfiltrationPoint point) extractRoutine = StartCoroutine(ExtractRoutine(player)); // Prevents players from looting after extracting - GClass3107.Instance.CloseAllScreensForced(); + GClass3126.Instance.CloseAllScreensForced(); // Detroys session timer EndByTimerScenario endByTimerScenario = GetComponent(); @@ -1566,7 +1571,7 @@ public void ClearHostAI(Player player) { if (botsController_0 != null) { - foreach (KeyValuePair kvp in botsController_0.Groups()) + foreach (KeyValuePair kvp in botsController_0.Groups()) { foreach (BotsGroup botsGroup in kvp.Value.GetGroups(true)) { @@ -1612,7 +1617,7 @@ public override void Stop(string profileId, ExitStatus exitStatus, string exitNa { if (myPlayer.Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem != null) { - GStruct414 result = InteractionsHandlerClass.Remove(myPlayer.Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, myPlayer.GClass2761_0, false, true); + GStruct414 result = InteractionsHandlerClass.Remove(myPlayer.Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, myPlayer.GClass2774_0, false, true); if (result.Error != null) { FikaPlugin.Instance.FikaLogger.LogWarning("CoopGame::Stop: Error removing dog tag!"); @@ -1723,7 +1728,7 @@ public override void Stop(string profileId, ExitStatus exitStatus, string exitNa EnvironmentManager.Instance.Stop(); } MonoBehaviourSingleton.Instance.StartBlackScreenShow(1f, 1f, new Action(stopManager.HandleExit)); - GClass549.Config.UseSpiritPlayer = false; + GClass548.Config.UseSpiritPlayer = false; } private void SavePlayer(CoopPlayer player, ExitStatus exitStatus, string exitName, bool fromDeath) @@ -1771,7 +1776,7 @@ private void StopFromError(string profileId, ExitStatus exitStatus) { if (myPlayer.Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem != null) { - GStruct414 result = InteractionsHandlerClass.Remove(myPlayer.Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, myPlayer.GClass2761_0, false, true); + GStruct414 result = InteractionsHandlerClass.Remove(myPlayer.Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, myPlayer.GClass2774_0, false, true); if (result.Error != null) { FikaPlugin.Instance.FikaLogger.LogWarning("CoopGame::StopFromError: Error removing dog tag!"); @@ -1869,7 +1874,7 @@ private void StopFromError(string profileId, ExitStatus exitStatus) EnvironmentManager.Instance.Stop(); } MonoBehaviourSingleton.Instance.StartBlackScreenShow(1f, 1f, new Action(stopManager.ExitOverride)); - GClass549.Config.UseSpiritPlayer = false; + GClass548.Config.UseSpiritPlayer = false; } public override void CleanUp() @@ -1965,7 +1970,7 @@ private class ExitManager(CoopGame localGame, ExitStatus exitStatus, string exit public void HandleExit() { - GClass3107 screenManager = GClass3107.Instance; + GClass3126 screenManager = GClass3126.Instance; if (screenManager.CheckCurrentScreen(EEftScreenType.Reconnect)) { screenManager.CloseAllScreensForced(); @@ -1973,8 +1978,8 @@ public void HandleExit() localGame.gparam_0.Player.OnGameSessionEnd(exitStatus, localGame.PastTime, localGame.Location_0.Id, exitName); localGame.CleanUp(); localGame.Status = GameStatus.Stopped; - TimeSpan timeSpan = GClass1296.Now - localGame.dateTime_0; - localGame.ginterface145_0.OfflineRaidEnded(exitStatus, exitName, timeSpan.TotalSeconds).HandleExceptions(); + TimeSpan timeSpan = GClass1304.Now - localGame.dateTime_0; + localGame.ginterface158_0.OfflineRaidEnded(exitStatus, exitName, timeSpan.TotalSeconds).HandleExceptions(); MonoBehaviourSingleton.Instance.FadeOutVolumeAfterRaid(); StaticManager staticManager = StaticManager.Instance; float num = delay; @@ -1992,16 +1997,16 @@ private void FireCallback() localGame.SavePlayer(localPlayer, exitStatus, exitName, false); - endCallback(new Result(exitStatus, GClass1296.Now - localGame.dateTime_0, new MetricsClass())); + endCallback(new Result(exitStatus, GClass1304.Now - localGame.dateTime_0, new MetricsClass())); UIEventSystem.Instance.Enable(); } } - private class ErrorExitManager : Class1364 + private class ErrorExitManager : Class1382 { public void ExitOverride() { - GClass3107 instance = GClass3107.Instance; + GClass3126 instance = GClass3126.Instance; if (instance != null && instance.CheckCurrentScreen(EEftScreenType.Reconnect)) { instance.CloseAllScreensForced(); diff --git a/Fika.Core/Coop/Matchmaker/MatchmakerAccept/MatchmakerAcceptPatches.cs b/Fika.Core/Coop/Matchmaker/MatchmakerAccept/MatchmakerAcceptPatches.cs index 5aac7c1c..48dc355d 100644 --- a/Fika.Core/Coop/Matchmaker/MatchmakerAccept/MatchmakerAcceptPatches.cs +++ b/Fika.Core/Coop/Matchmaker/MatchmakerAccept/MatchmakerAcceptPatches.cs @@ -51,7 +51,7 @@ public static object MatchmakerScreenController } public static GameObject EnvironmentUIRoot { get; internal set; } - public static MatchmakerTimeHasCome.GClass3163 GClass3163 { get; internal set; } + public static MatchmakerTimeHasCome.GClass3182 GClass3182 { get; internal set; } #endregion public static string GetGroupId() diff --git a/Fika.Core/Coop/ObservedClasses/CoopObservedStatisticsManager.cs b/Fika.Core/Coop/ObservedClasses/CoopObservedStatisticsManager.cs index 951f304c..68d6dc5e 100644 --- a/Fika.Core/Coop/ObservedClasses/CoopObservedStatisticsManager.cs +++ b/Fika.Core/Coop/ObservedClasses/CoopObservedStatisticsManager.cs @@ -46,12 +46,12 @@ public void Init(Player player) Player = player; } - public void OnEnemyDamage(DamageInfo damage, EBodyPart bodyPart, EPlayerSide playerSide, string role, string groupId, float fullHealth, bool isHeavyDamage, float distance, int hour, List targetEquipment, HealthEffects enemyEffects, List zoneIds) + public void OnEnemyDamage(DamageInfo damage, EBodyPart bodyPart, EPlayerSide playerSide, WildSpawnType role, string groupId, float fullHealth, bool isHeavyDamage, float distance, int hour, List targetEquipment, HealthEffects enemyEffects, List zoneIds) { // Do nothing } - public void OnEnemyKill(DamageInfo damage, EDamageType lethalDamageType, EBodyPart bodyPart, EPlayerSide playerSide, WildSpawnType role, string playerAccountId, string playerProfileId, string playerName, string groupId, int level, int killExp, float distance, int hour, List targetEquipment, HealthEffects enemyEffects, List zoneIds, bool isFriendly) + public void OnEnemyKill(DamageInfo damage, EDamageType lethalDamageType, EBodyPart bodyPart, EPlayerSide playerSide, WildSpawnType role, string playerAccountId, string playerProfileId, string playerName, string groupId, int level, int killExp, float distance, int hour, List targetEquipment, HealthEffects enemyEffects, List zoneIds, bool isFriendly, bool isAI) { // Do nothing } diff --git a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs index c7507469..df77383d 100644 --- a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs +++ b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs @@ -3,7 +3,6 @@ using Comfort.Common; using EFT; using EFT.InventoryLogic; -using EFT.UI; using Fika.Core.Coop.Players; using Fika.Core.Networking; using HarmonyLib; @@ -14,9 +13,6 @@ using UnityEngine; using static EFT.Player; -// HandsControllerClass::method_10(GClass2249) -// GClass2370::method_39(GClass2296) - namespace Fika.Core.Coop.ObservedClasses { public class CoopObservedFirearmController : FirearmController @@ -30,7 +26,7 @@ public class CoopObservedFirearmController : FirearmController private float aimMovementSpeed = 1f; private bool hasFired = false; private WeaponPrefab weaponPrefab; - private GClass1582 underBarrelManager; + private GClass1592 underBarrelManager; public override bool IsAiming { get => base.IsAiming; @@ -46,7 +42,7 @@ public override bool IsAiming } _isAiming = value; - _player.Skills.FastAimTimer.Target = value ? 0f : 2f; + _player.Skills.FastAimTimer.Target = (value ? 0f : 2f); _player.MovementContext.SetAimingSlowdown(IsAiming, 0.33f + aimMovementSpeed); _player.Physical.Aim((!_isAiming || !(_player.MovementContext.StationaryWeapon == null)) ? 0f : ErgonomicWeight); coopPlayer.ProceduralWeaponAnimation.IsAiming = _isAiming; @@ -67,7 +63,7 @@ protected void Start() weaponPrefab = ControllerGameObject.GetComponent(); if (UnderbarrelWeapon != null) { - underBarrelManager = Traverse.Create(this).Field("gclass1582_0").GetValue(); + underBarrelManager = Traverse.Create(this).Field("gclass1592_0").GetValue(); } } @@ -146,7 +142,7 @@ public override void OnPlayerDead() base.OnPlayerDead(); } - public override void SetScopeMode(GStruct164[] scopeStates) + public override void SetScopeMode(GStruct165[] scopeStates) { _player.ProceduralWeaponAnimation.ObservedCalibration(); base.SetScopeMode(scopeStates); @@ -233,7 +229,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass } BulletClass ammo = (BulletClass)Singleton.Instance.CreateItem(MongoID.Generate(), packet.ShotInfoPacket.AmmoTemplate, null); - InitiateShot(packet.ShotInfoPacket.UnderbarrelShot ? UnderbarrelWeapon : Item, ammo, packet.ShotInfoPacket.ShotPosition, packet.ShotInfoPacket.ShotDirection, + InitiateShot(Item, ammo, packet.ShotInfoPacket.ShotPosition, packet.ShotInfoPacket.ShotDirection, packet.ShotInfoPacket.FireportPosition, packet.ShotInfoPacket.ChamberIndex, packet.ShotInfoPacket.Overheat); if (Weapon.SelectedFireMode == Weapon.EFireMode.fullauto) @@ -241,7 +237,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass triggerPressed = true; } - float pitchMult = method_55(); + float pitchMult = method_57(); WeaponSoundPlayer.FireBullet(ammo, packet.ShotInfoPacket.ShotPosition, packet.ShotInfoPacket.ShotDirection, pitchMult, Malfunction, false, IsBirstOf2Start); @@ -282,7 +278,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (Weapon.Chambers[i].ContainedItem is BulletClass bClass && !bClass.IsUsed) { bClass.IsUsed = true; - if (weaponPrefab != null && weaponPrefab.ObjectInHands is GClass1668 weaponEffectsManager) + if (weaponPrefab != null && weaponPrefab.ObjectInHands is GClass1678 weaponEffectsManager) { if (!bClass.AmmoTemplate.RemoveShellAfterFire) { @@ -303,8 +299,8 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass } else { - Weapon.Chambers[0].RemoveItem(); - if (weaponPrefab != null && weaponPrefab.ObjectInHands is GClass1668 weaponEffectsManager) + Weapon.Chambers[0].RemoveItem(false); + if (weaponPrefab != null && weaponPrefab.ObjectInHands is GClass1678 weaponEffectsManager) { HandleShellEvent(weaponEffectsManager, packet, ammo, magazine); } @@ -312,7 +308,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass } // Remember to check if classes increment - if (Weapon is GClass2696) + if (Weapon is GClass2708) { Weapon.CylinderHammerClosed = Weapon.FireMode.FireMode == Weapon.EFireMode.doubleaction; @@ -345,7 +341,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { if (Item.HasChambers) { - magazine.Cartridges.PopTo(inventoryController, new GClass2767(Item.Chambers[0])); + magazine.Cartridges.PopTo(inventoryController, new GClass2780(Item.Chambers[0])); } else { @@ -360,7 +356,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (ammo.AmmoTemplate.IsLightAndSoundShot) { - method_56(packet.ShotInfoPacket.ShotPosition, packet.ShotInfoPacket.ShotDirection); + method_58(packet.ShotInfoPacket.ShotPosition, packet.ShotInfoPacket.ShotDirection); LightAndSoundShot(packet.ShotInfoPacket.ShotPosition, packet.ShotInfoPacket.ShotDirection, ammo.AmmoTemplate); } } @@ -403,7 +399,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ChangeSightMode) { - SetScopeMode(packet.ScopeStatesPacket.GStruct164); + SetScopeMode(packet.ScopeStatesPacket.GStruct165); } if (packet.ToggleLauncher) @@ -439,7 +435,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass FikaPlugin.Instance.FikaLogger.LogError($"CoopObservedFirearmController::HandleFirearmPacket: There is no item {packet.ReloadMagPacket.MagId} in profile {coopPlayer.ProfileId}"); throw; } - GClass2769 gridItemAddress = null; + GClass2782 gridItemAddress = null; if (packet.ReloadMagPacket.LocationDescription != null) { using MemoryStream memoryStream = new(packet.ReloadMagPacket.LocationDescription); @@ -448,7 +444,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { if (packet.ReloadMagPacket.LocationDescription.Length != 0) { - GClass1528 descriptor = binaryReader.ReadEFTGridItemAddressDescriptor(); + GClass1538 descriptor = binaryReader.ReadEFTGridItemAddressDescriptor(); gridItemAddress = inventoryController.ToGridItemAddress(descriptor); } } @@ -505,7 +501,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ReloadWithAmmo.Status == FikaSerialization.ReloadWithAmmoPacket.EReloadWithAmmoStatus.StartReload) { List bullets = FindAmmoByIds(packet.ReloadWithAmmo.AmmoIds); - GClass2495 ammoPack = new(bullets); + GClass2506 ammoPack = new(bullets); if (!packet.HasCylinderMagPacket) { CurrentOperation.ReloadWithAmmo(ammoPack, null, null); @@ -531,7 +527,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ReloadWithAmmo.Status == FikaSerialization.ReloadWithAmmoPacket.EReloadWithAmmoStatus.StartReload) { List bullets = FindAmmoByIds(packet.ReloadWithAmmo.AmmoIds); - GClass2495 ammoPack = new(bullets); + GClass2506 ammoPack = new(bullets); ReloadCylinderMagazine(ammoPack, null); } } @@ -540,9 +536,11 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { CurrentOperation.SetTriggerPressed(true); } + + }*/ - if (packet.HasRollCylinder && Weapon is GClass2696 rollWeapon) + if (packet.HasRollCylinder && Weapon is GClass2708 rollWeapon) { RollCylinder(packet.RollToZeroCamora); } @@ -552,7 +550,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ReloadLauncher.Reload) { List ammo = FindAmmoByIds(packet.ReloadLauncher.AmmoIds); - GClass2495 ammoPack = new(ammo); + GClass2506 ammoPack = new(ammo); ReloadGrenadeLauncher(ammoPack, null); } } @@ -563,9 +561,9 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { List ammo = FindAmmoByIds(packet.ReloadBarrels.AmmoIds); - GClass2495 ammoPack = new(ammo); + GClass2506 ammoPack = new(ammo); - GClass2769 gridItemAddress = null; + GClass2782 gridItemAddress = null; using MemoryStream memoryStream = new(packet.ReloadBarrels.LocationDescription); using BinaryReader binaryReader = new(memoryStream); @@ -573,7 +571,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { if (packet.ReloadBarrels.LocationDescription.Length > 0) { - GClass1528 descriptor = binaryReader.ReadEFTGridItemAddressDescriptor(); + GClass1538 descriptor = binaryReader.ReadEFTGridItemAddressDescriptor(); gridItemAddress = inventoryController.ToGridItemAddress(descriptor); } } @@ -611,16 +609,6 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { StartCoroutine(ObservedBoltAction(FirearmsAnimator, this, inventoryController)); } - - if (packet.UnderbarrelSightingRangeUp) - { - UnderbarrelSightingRangeUp(); - } - - if (packet.UnderbarrelSightingRangeDown) - { - UnderbarrelSightingRangeDown(); - } } private IEnumerator ObservedBoltAction(FirearmsAnimator animator, FirearmController controller, InventoryControllerClass inventoryController) @@ -630,7 +618,7 @@ private IEnumerator ObservedBoltAction(FirearmsAnimator animator, FirearmControl yield return new WaitForSeconds(0.75f); - if (weaponPrefab != null && weaponPrefab.ObjectInHands is GClass1668 weaponEffectsManager) + if (weaponPrefab != null && weaponPrefab.ObjectInHands is GClass1678 weaponEffectsManager) { weaponEffectsManager.StartSpawnShell(coopPlayer.Velocity * 0.33f, 0); } @@ -639,14 +627,14 @@ private IEnumerator ObservedBoltAction(FirearmsAnimator animator, FirearmControl if (controller.Item.GetCurrentMagazine() != null && magazine is not CylinderMagazineClass) { - magazine.Cartridges.PopTo(inventoryController, new GClass2767(controller.Item.Chambers[0])); + magazine.Cartridges.PopTo(inventoryController, new GClass2780(controller.Item.Chambers[0])); } animator.SetBoltActionReload(false); animator.SetFire(false); } - private void HandleShellEvent(GClass1668 weaponEffectsManager, WeaponPacket packet, BulletClass ammo, MagazineClass magazine) + private void HandleShellEvent(GClass1678 weaponEffectsManager, WeaponPacket packet, BulletClass ammo, MagazineClass magazine) { weaponEffectsManager.DestroyPatronInWeapon(packet.ShotInfoPacket.ChamberIndex); if (!ammo.AmmoTemplate.RemoveShellAfterFire) @@ -664,7 +652,7 @@ private void HandleShellEvent(GClass1668 weaponEffectsManager, WeaponPacket pack weaponEffectsManager.SetRoundIntoWeapon(ammo, 0); } - if (Weapon is GClass2696 || Weapon.ReloadMode == Weapon.EReloadMode.OnlyBarrel || Weapon.BoltAction) + if (Weapon is GClass2708 || Weapon.ReloadMode == Weapon.EReloadMode.OnlyBarrel || Weapon.BoltAction) { return; } diff --git a/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedRunState.cs b/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedRunState.cs index c9bbc2f6..a0e31940 100644 --- a/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedRunState.cs +++ b/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedRunState.cs @@ -4,7 +4,7 @@ namespace Fika.Core.Coop.ObservedClasses.MovementStates { - internal class ObservedRunState : GClass1705 + internal class ObservedRunState : GClass1715 { public ObservedRunState(MovementContext movementContext) : base(movementContext) { diff --git a/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedSprintState.cs b/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedSprintState.cs index 1b52dabf..6786566a 100644 --- a/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedSprintState.cs +++ b/Fika.Core/Coop/ObservedClasses/MovementStates/ObservedSprintState.cs @@ -5,7 +5,7 @@ namespace Fika.Core.Coop.ObservedClasses.MovementStates { - internal class ObservedSprintState : GClass1705 + internal class ObservedSprintState : GClass1715 { public ObservedSprintState(MovementContext movementContext) : base(movementContext) { @@ -37,7 +37,7 @@ public override void ManualAnimatorMoveUpdate(float deltaTime) /*MovementContext.ProcessSpeedLimits(deltaTime);*/ MovementContext.MovementDirection = Vector2.Lerp(MovementContext.MovementDirection, Direction, deltaTime * EFTHardSettings.Instance.DIRECTION_LERP_SPEED); //MovementContext.ApplyRotation(Quaternion.AngleAxis(MovementContext.Yaw, Vector3.up)); - MovementContext.SetUpDiscreteDirection(GClass1657.ConvertToMovementDirection(Direction)); + MovementContext.SetUpDiscreteDirection(GClass1667.ConvertToMovementDirection(Direction)); Direction = Vector2.zero; MovementContext.SprintAcceleration(deltaTime); UpdateRotationAndPosition(deltaTime); diff --git a/Fika.Core/Coop/ObservedClasses/ObservedHealthController.cs b/Fika.Core/Coop/ObservedClasses/ObservedHealthController.cs index a0379a58..4e4c1821 100644 --- a/Fika.Core/Coop/ObservedClasses/ObservedHealthController.cs +++ b/Fika.Core/Coop/ObservedClasses/ObservedHealthController.cs @@ -5,7 +5,7 @@ namespace Fika.Core.Coop.ObservedClasses { - public sealed class ObservedHealthController(byte[] serializedState, InventoryControllerClass inventory, SkillManager skills) : GClass2417(serializedState, inventory, skills) + public sealed class ObservedHealthController(byte[] serializedState, InventoryControllerClass inventory, SkillManager skills) : GClass2428(serializedState, inventory, skills) { public override bool ApplyItem(Item item, EBodyPart bodyPart, float? amount = null) { diff --git a/Fika.Core/Coop/PacketHandlers/PacketReceiver.cs b/Fika.Core/Coop/PacketHandlers/PacketReceiver.cs index 710bffff..25df953e 100644 --- a/Fika.Core/Coop/PacketHandlers/PacketReceiver.cs +++ b/Fika.Core/Coop/PacketHandlers/PacketReceiver.cs @@ -69,7 +69,7 @@ private void Update() for (int i = 0; i < healthSyncPackets; i++) { HealthSyncPacket packet = HealthSyncPackets.Dequeue(); - if (packet.Packet.SyncType == GStruct346.ESyncType.IsAlive && !packet.Packet.Data.IsAlive.IsAlive) + if (packet.Packet.SyncType == GStruct347.ESyncType.IsAlive && !packet.Packet.Data.IsAlive.IsAlive) { observedPlayer.SetAggressor(packet.KillerId, packet.KillerWeaponId); observedPlayer.SetInventory(packet.Equipment); diff --git a/Fika.Core/Coop/Patches/BotCacher_Patch.cs b/Fika.Core/Coop/Patches/BotCacher_Patch.cs index 815db9b1..50517e14 100644 --- a/Fika.Core/Coop/Patches/BotCacher_Patch.cs +++ b/Fika.Core/Coop/Patches/BotCacher_Patch.cs @@ -10,11 +10,11 @@ public class BotCacher_Patch : ModulePatch { protected override MethodBase GetTargetMethod() { - return typeof(GClass532).GetMethod(nameof(GClass532.LoadInternal), BindingFlags.Static | BindingFlags.Public); + return typeof(GClass531).GetMethod(nameof(GClass531.LoadInternal), BindingFlags.Static | BindingFlags.Public); } [PatchPrefix] - private static bool PatchPrefix(out GClass531 core, ref bool __result) + private static bool PatchPrefix(out GClass530 core, ref bool __result) { if (FikaPlugin.Instance.BotDifficulties != null) { @@ -22,14 +22,14 @@ private static bool PatchPrefix(out GClass531 core, ref bool __result) } else { - string text = GClass532.LoadCoreByString(); + string text = GClass531.LoadCoreByString(); if (text == null) { core = null; __result = false; return false; } - core = GClass531.Create(text); + core = GClass530.Create(text); } if (MatchmakerAcceptPatches.IsServer) @@ -42,19 +42,19 @@ private static bool PatchPrefix(out GClass531 core, ref bool __result) botSettingsComponents = FikaPlugin.Instance.BotDifficulties.GetComponent((BotDifficulty)difficulty, (WildSpawnType)type); if (botSettingsComponents != null) { - if (!GClass532.AllSettings.ContainsKey((BotDifficulty)difficulty, (WildSpawnType)type)) + if (!GClass531.AllSettings.ContainsKey((BotDifficulty)difficulty, (WildSpawnType)type)) { - GClass532.AllSettings.Add((BotDifficulty)difficulty, (WildSpawnType)type, botSettingsComponents); + GClass531.AllSettings.Add((BotDifficulty)difficulty, (WildSpawnType)type, botSettingsComponents); } } else { - botSettingsComponents = GClass532.smethod_1(GClass532.CheckOnExclude((BotDifficulty)difficulty, (WildSpawnType)type), (WildSpawnType)type, false); + botSettingsComponents = GClass531.smethod_1(GClass531.CheckOnExclude((BotDifficulty)difficulty, (WildSpawnType)type), (WildSpawnType)type, false); if (botSettingsComponents != null) { - if (!GClass532.AllSettings.ContainsKey((BotDifficulty)difficulty, (WildSpawnType)type)) + if (!GClass531.AllSettings.ContainsKey((BotDifficulty)difficulty, (WildSpawnType)type)) { - GClass532.AllSettings.Add((BotDifficulty)difficulty, (WildSpawnType)type, botSettingsComponents); + GClass531.AllSettings.Add((BotDifficulty)difficulty, (WildSpawnType)type, botSettingsComponents); } } else diff --git a/Fika.Core/Coop/Patches/LocalGame/TarkovApplication_LocalGameCreator_Patch.cs b/Fika.Core/Coop/Patches/LocalGame/TarkovApplication_LocalGameCreator_Patch.cs index cd340717..00b6c8a0 100644 --- a/Fika.Core/Coop/Patches/LocalGame/TarkovApplication_LocalGameCreator_Patch.cs +++ b/Fika.Core/Coop/Patches/LocalGame/TarkovApplication_LocalGameCreator_Patch.cs @@ -23,7 +23,7 @@ namespace Fika.Core.Coop.Patches.LocalGame /// internal class TarkovApplication_LocalGameCreator_Patch : ModulePatch { - protected override MethodBase GetTargetMethod() => typeof(TarkovApplication).GetMethod(nameof(TarkovApplication.method_43)); + protected override MethodBase GetTargetMethod() => typeof(TarkovApplication).GetMethod(nameof(TarkovApplication.method_47)); static ISession CurrentSession { get; set; } @@ -48,8 +48,8 @@ public static bool Prefix(TarkovApplication __instance) } [PatchPostfix] - public static async Task Postfix(Task __result, TarkovApplication __instance, TimeAndWeatherSettings timeAndWeather, MatchmakerTimeHasCome.GClass3163 timeHasComeScreenController, - RaidSettings ____raidSettings, InputTree ____inputTree, GameDateTime ____localGameDateTime, float ____fixedDeltaTime, string ____backendUrl) + public static async Task Postfix(Task __result, TarkovApplication __instance, TimeAndWeatherSettings timeAndWeather, MatchmakerTimeHasCome.GClass3182 timeHasComeScreenController, + RaidSettings ____raidSettings, InputTree ____inputTree, GameDateTime ____localGameDateTime, float ____fixedDeltaTime, string ____backendUrl, EUpdateQueue __PlayerUpdateQueue) { if (MatchmakerAcceptPatches.IsSinglePlayer) { @@ -75,7 +75,7 @@ public static async Task Postfix(Task __result, TarkovApplication __instance, Ti LocationSettingsClass.Location location = ____raidSettings.SelectedLocation; - MatchmakerAcceptPatches.GClass3163 = timeHasComeScreenController; + MatchmakerAcceptPatches.GClass3182 = timeHasComeScreenController; if (Singleton.Instantiated) { @@ -111,16 +111,12 @@ public static async Task Postfix(Task __result, TarkovApplication __instance, Ti StartHandler startHandler = new(__instance, session.Profile, session.ProfileOfPet, ____raidSettings.SelectedLocation, timeHasComeScreenController); - CoopGame localGame = CoopGame.Create(____inputTree, profile, ____localGameDateTime, - session.InsuranceCompany, MonoBehaviourSingleton.Instance, - MonoBehaviourSingleton.Instance, MonoBehaviourSingleton.Instance, - MonoBehaviourSingleton.Instance, ____raidSettings.SelectedLocation, timeAndWeather, - ____raidSettings.WavesSettings, ____raidSettings.SelectedDateTime, new Callback(startHandler.HandleStart), - ____fixedDeltaTime, EUpdateQueue.Update, session, TimeSpan.FromSeconds(60 * ____raidSettings.SelectedLocation.EscapeTimeLimit), ____raidSettings - ); + CoopGame coopgAme = CoopGame.Create(____inputTree, profile, ____localGameDateTime, session.InsuranceCompany, MonoBehaviourSingleton.Instance, MonoBehaviourSingleton.Instance, + ____raidSettings.SelectedLocation, timeAndWeather, ____raidSettings.WavesSettings, ____raidSettings.SelectedDateTime, new Callback(startHandler.HandleStart), + ____fixedDeltaTime, __PlayerUpdateQueue, session, TimeSpan.FromSeconds(60 * ____raidSettings.SelectedLocation.EscapeTimeLimit), ____raidSettings); - Singleton.Create(localGame); - FikaEventDispatcher.DispatchEvent(new AbstractGameCreatedEvent(localGame)); + Singleton.Create(coopgAme); + FikaEventDispatcher.DispatchEvent(new AbstractGameCreatedEvent(coopgAme)); if (MatchmakerAcceptPatches.IsClient) { @@ -131,21 +127,21 @@ public static async Task Postfix(Task __result, TarkovApplication __instance, Ti timeHasComeScreenController.ChangeStatus("Created Coop Game"); } - Task finishTask = localGame.InitPlayer(____raidSettings.BotSettings, ____backendUrl, null, new Callback(startHandler.HandleLoadComplete)); + Task finishTask = coopgAme.InitPlayer(____raidSettings.BotSettings, ____backendUrl, null, new Callback(startHandler.HandleLoadComplete)); __result = Task.WhenAll(finishTask); } - private class StartHandler(TarkovApplication tarkovApplication, Profile pmcProfile, Profile scavProfile, LocationSettingsClass.Location location, MatchmakerTimeHasCome.GClass3163 timeHasComeScreenController) + private class StartHandler(TarkovApplication tarkovApplication, Profile pmcProfile, Profile scavProfile, LocationSettingsClass.Location location, MatchmakerTimeHasCome.GClass3182 timeHasComeScreenController) { private readonly TarkovApplication tarkovApplication = tarkovApplication; private readonly Profile pmcProfile = pmcProfile; private readonly Profile scavProfile = scavProfile; private readonly LocationSettingsClass.Location location = location; - private readonly MatchmakerTimeHasCome.GClass3163 timeHasComeScreenController = timeHasComeScreenController; + private readonly MatchmakerTimeHasCome.GClass3182 timeHasComeScreenController = timeHasComeScreenController; public void HandleStart(Result result) { - tarkovApplication.method_46(pmcProfile.Id, scavProfile, location, result, timeHasComeScreenController); + tarkovApplication.method_50(pmcProfile.Id, scavProfile, location, result, timeHasComeScreenController); } public void HandleLoadComplete(IResult error) diff --git a/Fika.Core/Coop/Patches/Minefield/Minefield_method_2_Patch.cs b/Fika.Core/Coop/Patches/Minefield/Minefield_method_2_Patch.cs index 386fcdaf..a619f362 100644 --- a/Fika.Core/Coop/Patches/Minefield/Minefield_method_2_Patch.cs +++ b/Fika.Core/Coop/Patches/Minefield/Minefield_method_2_Patch.cs @@ -65,7 +65,7 @@ private static void DoReplicatedMineDamage(IPlayer player, float distance, bool IEnumerable enumerable = isCollateral ? player.PlayerBones.BodyPartColliders.Where(new Func(minefield.method_4)) : player.PlayerBones.BodyPartColliders.Where(new Func(minefield.method_5)); - enumerable = enumerable.DistinctBy(new Func(Minefield.Class2286.class2286_0.method_0)).ToArray(); + enumerable = enumerable.DistinctBy(new Func(Minefield.Class2312.class2312_0.method_0)).ToArray(); enumerable = enumerable.Randomize(); int num3 = ((isCollateral || first) ? UnityEngine.Random.Range(2, enumerable.Count()) : int.MaxValue); diff --git a/Fika.Core/Coop/Players/CoopBot.cs b/Fika.Core/Coop/Players/CoopBot.cs index f414af6f..54e1bb3f 100644 --- a/Fika.Core/Coop/Players/CoopBot.cs +++ b/Fika.Core/Coop/Players/CoopBot.cs @@ -40,11 +40,11 @@ public static async Task CreateBot(int playerId, Vector3 position, string layerName, string prefix, EPointOfView pointOfView, Profile profile, bool aiControl, EUpdateQueue updateQueue, EUpdateMode armsUpdateMode, EUpdateMode bodyUpdateMode, CharacterControllerSpawner.Mode characterControllerMode, Func getSensitivity, - Func getAimingSensitivity, GInterface99 filter) + Func getAimingSensitivity, GInterface111 filter) { CoopBot player = null; - player = Create(GClass1388.PLAYER_BUNDLE_NAME, playerId, position, updateQueue, armsUpdateMode, + player = Create(GClass1398.PLAYER_BUNDLE_NAME, playerId, position, updateQueue, armsUpdateMode, bodyUpdateMode, characterControllerMode, getSensitivity, getAimingSensitivity, prefix, aiControl); player.IsYourPlayer = false; @@ -77,7 +77,7 @@ public override void OnVaulting() // Do nothing } - public override void OnSkillLevelChanged(GClass1766 skill) + public override void OnSkillLevelChanged(GClass1776 skill) { // Do nothing } @@ -101,7 +101,7 @@ public override void CreateMovementContext() base.ApplyDamageInfo(damageInfo, bodyPartType, colliderType, absorbed); }*/ - public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBodyPartColliderType colliderType, EArmorPlateCollider armorPlateCollider, GStruct390 shotId) + public override GClass1686 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBodyPartColliderType colliderType, EArmorPlateCollider armorPlateCollider, GStruct390 shotId) { if (damageInfo.Player != null && damageInfo.Player.iPlayer is ObservedCoopPlayer) { @@ -121,7 +121,7 @@ public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartTy float damage = damageInfo.Damage; List list = ProceedDamageThroughArmor(ref damageInfo, colliderType, armorPlateCollider, true); MaterialType materialType = (flag ? MaterialType.HelmetRicochet : ((list == null || list.Count < 1) ? MaterialType.Body : list[0].Material)); - GClass1676 hitInfo = new() + GClass1686 hitInfo = new() { PoV = PointOfView, Penetrated = (string.IsNullOrEmpty(damageInfo.BlockedBy) || string.IsNullOrEmpty(damageInfo.DeflectedBy)), diff --git a/Fika.Core/Coop/Players/CoopPlayer.cs b/Fika.Core/Coop/Players/CoopPlayer.cs index 5da9fe75..3d524f69 100644 --- a/Fika.Core/Coop/Players/CoopPlayer.cs +++ b/Fika.Core/Coop/Players/CoopPlayer.cs @@ -52,11 +52,11 @@ public static async Task Create(int playerId, Vector3 position, Qua string layerName, string prefix, EPointOfView pointOfView, Profile profile, bool aiControl, EUpdateQueue updateQueue, EUpdateMode armsUpdateMode, EUpdateMode bodyUpdateMode, CharacterControllerSpawner.Mode characterControllerMode, Func getSensitivity, - Func getAimingSensitivity, GInterface99 filter, int netId, IStatisticsManager statisticsManager) + Func getAimingSensitivity, GInterface111 filter, int netId, IStatisticsManager statisticsManager) { CoopPlayer player = null; - player = Create(GClass1388.PLAYER_BUNDLE_NAME, playerId, position, updateQueue, armsUpdateMode, + player = Create(GClass1398.PLAYER_BUNDLE_NAME, playerId, position, updateQueue, armsUpdateMode, bodyUpdateMode, characterControllerMode, getSensitivity, getAimingSensitivity, prefix, false); player.IsYourPlayer = true; @@ -66,7 +66,7 @@ public static async Task Create(int playerId, Vector3 position, Qua ISession session = Singleton>.Instance.GetClientBackEndSession(); - GClass3206 questController = new(profile, inventoryController, session, true); + GClass3223 questController = new(profile, inventoryController, session, true); questController.Init(); questController.Run(); @@ -92,11 +92,11 @@ await player.Init(rotation, layerName, pointOfView, profile, inventoryController foreach (MagazineClass magazineClass in player.Inventory.GetPlayerItems(EPlayerItems.NonQuestItems).OfType()) { - player.GClass2761_0.StrictCheckMagazine(magazineClass, true, player.Profile.MagDrillsMastering, false, false); + player.GClass2774_0.StrictCheckMagazine(magazineClass, true, player.Profile.MagDrillsMastering, false, false); } player._handsController = EmptyHandsController.smethod_5(player); - player._handsController.Spawn(1f, new Action(Class1500.class1500_0.method_0)); + player._handsController.Spawn(1f, new Action(Class1522.class1522_0.method_0)); player.AIData = new AIData(null, player); player.AggressorFound = false; player._animators[0].enabled = true; @@ -106,7 +106,7 @@ await player.Init(rotation, layerName, pointOfView, profile, inventoryController return player; } - public override void OnSkillLevelChanged(GClass1766 skill) + public override void OnSkillLevelChanged(GClass1776 skill) { NotificationManagerClass.DisplayMessageNotification(string.Format("SkillLevelUpMessage".Localized(null), skill.Id.ToString().Localized(null), @@ -214,7 +214,7 @@ public override void ApplyDamageInfo(DamageInfo damageInfo, EBodyPart bodyPartTy base.ApplyDamageInfo(damageInfo, bodyPartType, colliderType, absorbed); } - public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBodyPartColliderType colliderType, EArmorPlateCollider armorPlateCollider, GStruct390 shotId) + public override GClass1686 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBodyPartColliderType colliderType, EArmorPlateCollider armorPlateCollider, GStruct390 shotId) { if (damageInfo.DamageType is EDamageType.Sniper or EDamageType.Landmine) { @@ -229,7 +229,7 @@ public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartTy return null; } - public override void Proceed(bool withNetwork, Callback callback, bool scheduled = true) + public override void Proceed(bool withNetwork, Callback callback, bool scheduled = true) { base.Proceed(withNetwork, callback, scheduled); PacketSender.CommonPlayerPackets.Enqueue(new() @@ -243,7 +243,7 @@ public override void Proceed(bool withNetwork, Callback callback, }); } - public override void Proceed(FoodClass foodDrink, float amount, Callback callback, int animationVariant, bool scheduled = true) + public override void Proceed(FoodClass foodDrink, float amount, Callback callback, int animationVariant, bool scheduled = true) { FoodControllerHandler handler = new(this, foodDrink, amount, EBodyPart.Head, animationVariant); @@ -253,7 +253,7 @@ public override void Proceed(FoodClass foodDrink, float amount, Callback callback, bool scheduled = true) + public override void Proceed(Item item, Callback callback, bool scheduled = true) { QuickUseItemControllerHandler handler = new(this, item); @@ -273,7 +273,7 @@ public override void Proceed(KnifeComponent knife, Callback ca handler.process.method_0(new(handler.HandleResult), callback, scheduled); } - public override void Proceed(KnifeComponent knife, Callback callback, bool scheduled = true) + public override void Proceed(KnifeComponent knife, Callback callback, bool scheduled = true) { QuickKnifeControllerHandler handler = new(this, knife); @@ -283,7 +283,7 @@ public override void Proceed(KnifeComponent knife, Callback callb handler.process.method_0(new(handler.HandleResult), callback, scheduled); } - public override void Proceed(MedsClass meds, EBodyPart bodyPart, Callback callback, int animationVariant, bool scheduled = true) + public override void Proceed(MedsClass meds, EBodyPart bodyPart, Callback callback, int animationVariant, bool scheduled = true) { MedsControllerHandler handler = new(this, meds, bodyPart, animationVariant); @@ -328,7 +328,7 @@ public override void Proceed(Weapon weapon, Callback ca handler.process.method_0(new(handler.HandleResult), callback, scheduled); } - public override void Proceed(Item item, Callback callback, bool scheduled = true) + public override void Proceed(Item item, Callback callback, bool scheduled = true) { // what is this base.Proceed(item, callback, scheduled); @@ -387,7 +387,7 @@ public void ClientApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBody public override void SendHeadlightsPacket(bool isSilent) { - GStruct163[] lightStates = _helmetLightControllers.Select(new Func(ClientPlayer.Class1430.class1430_0.method_0)).ToArray(); + GStruct164[] lightStates = _helmetLightControllers.Select(new Func(ClientPlayer.Class1452.class1452_0.method_0)).ToArray(); if (PacketSender != null) { @@ -422,7 +422,7 @@ public override void OnPhraseTold(EPhraseTrigger @event, TaggedClip clip, TagBan } } - public override void OperateStationaryWeapon(StationaryWeapon stationaryWeapon, GStruct169.EStationaryCommand command) + public override void OperateStationaryWeapon(StationaryWeapon stationaryWeapon, GStruct170.EStationaryCommand command) { base.OperateStationaryWeapon(stationaryWeapon, command); PacketSender.CommonPlayerPackets.Enqueue(new() @@ -463,7 +463,7 @@ public override void vmethod_0(WorldInteractiveObject interactiveObject, Interac InteractiveId = interactiveObject.Id, InteractionType = interactionResult.InteractionType, InteractionStage = EInteractionStage.Start, - ItemId = (interactionResult is GClass2964 keyInteractionResult) ? keyInteractionResult.Key.Item.Id : string.Empty + ItemId = (interactionResult is GClass2981 keyInteractionResult) ? keyInteractionResult.Key.Item.Id : string.Empty } }; PacketSender.CommonPlayerPackets.Enqueue(packet); @@ -488,7 +488,7 @@ public override void vmethod_1(WorldInteractiveObject door, InteractionResult in InteractiveId = door.Id, InteractionType = interactionResult.InteractionType, InteractionStage = EInteractionStage.Execute, - ItemId = (interactionResult is GClass2964 keyInteractionResult) ? keyInteractionResult.Key.Item.Id : string.Empty + ItemId = (interactionResult is GClass2981 keyInteractionResult) ? keyInteractionResult.Key.Item.Id : string.Empty } }; PacketSender.CommonPlayerPackets.Enqueue(packet); @@ -510,7 +510,7 @@ public override void ApplyCorpseImpulse() Corpse.Ragdoll.ApplyImpulse(LastDamageInfo.HitCollider, LastDamageInfo.Direction, LastDamageInfo.HitPoint, _corpseAppliedForce); } - public HealthSyncPacket SetupDeathPacket(GStruct346 packet) + public HealthSyncPacket SetupDeathPacket(GStruct347 packet) { float num = EFTHardSettings.Instance.HIT_FORCE; num *= 0.3f + 0.7f * Mathf.InverseLerp(50f, 20f, LastDamageInfo.PenetrationPower); @@ -849,7 +849,7 @@ protected virtual void Start() { if (Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem != null) { - GStruct414 result = InteractionsHandlerClass.Remove(Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, _inventoryController, false, true); + GStruct414 result = InteractionsHandlerClass.Remove(Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, _inventoryController, false, true); if (result.Error != null) { FikaPlugin.Instance.FikaLogger.LogWarning("CoopPlayer::Start: Error removing dog tag!"); @@ -981,7 +981,7 @@ public virtual void HandleCommonPacket(in CommonPlayerPacket packet) if (packet.HasStationaryPacket) { StationaryWeapon stationaryWeapon = (packet.StationaryPacket.Command == StationaryPacket.EStationaryCommand.Occupy) ? Singleton.Instance.FindStationaryWeapon(packet.StationaryPacket.Id) : null; - base.OperateStationaryWeapon(stationaryWeapon, (GStruct169.EStationaryCommand)packet.StationaryPacket.Command); + base.OperateStationaryWeapon(stationaryWeapon, (GStruct170.EStationaryCommand)packet.StationaryPacket.Command); } if (packet.Pickup) @@ -1036,7 +1036,7 @@ public virtual void HandleInventoryPacket(in InventoryPacket packet) using BinaryReader binaryReader = new(memoryStream); try { - GStruct411 result = ToInventoryOperation(binaryReader.ReadPolymorph()); + GStruct411 result = ToInventoryOperation(binaryReader.ReadPolymorph()); InventoryOperationHandler opHandler = new(result); @@ -1044,9 +1044,9 @@ public virtual void HandleInventoryPacket(in InventoryPacket packet) // TODO: Hacky workaround to fix errors due to each client generating new IDs. Might need to find a more 'elegant' solution later. // Unknown what problems this might cause so far. - if (result.Value is GClass2861 unloadOperation) + if (result.Value is GClass2874 unloadOperation) { - if (unloadOperation.InternalOperation is GClass2872 internalSplitOperation) + if (unloadOperation.InternalOperation is GClass2885 internalSplitOperation) { Item item = internalSplitOperation.To.Item; if (item != null) @@ -1068,7 +1068,7 @@ public virtual void HandleInventoryPacket(in InventoryPacket packet) } // TODO: Same as above. - if (result.Value is GClass2872 splitOperation) + if (result.Value is GClass2885 splitOperation) { Item item = splitOperation.To.Item; if (item != null) @@ -1280,7 +1280,7 @@ public virtual void HandleDamagePacket(DamagePacket packet) if (!string.IsNullOrEmpty(packet.DamageInfo.ProfileId)) { - GInterface94 player = Singleton.Instance.GetAlivePlayerBridgeByProfileID(packet.DamageInfo.ProfileId); + GInterface106 player = Singleton.Instance.GetAlivePlayerBridgeByProfileID(packet.DamageInfo.ProfileId); if (player != null) { @@ -1418,7 +1418,7 @@ public Item FindItem(string itemId) private class KeyHandler(CoopPlayer player) { private readonly CoopPlayer player = player; - public GStruct416 unlockResult; + public GStruct416 unlockResult; internal void HandleKeyEvent() { @@ -1509,7 +1509,7 @@ private class QuickUseItemControllerHandler(CoopPlayer coopPlayer, Item item) { private readonly CoopPlayer coopPlayer = coopPlayer; private readonly Item item = item; - public Process process; + public Process process; public Action confirmCallback; internal QuickUseItemController ReturnController() @@ -1546,7 +1546,7 @@ private class MedsControllerHandler(CoopPlayer coopPlayer, MedsClass meds, EBody private readonly MedsClass meds = meds; private readonly EBodyPart bodyPart = bodyPart; private readonly int animationVariant = animationVariant; - public Process process; + public Process process; public Action confirmCallback; internal MedsController ReturnController() @@ -1586,7 +1586,7 @@ private class FoodControllerHandler(CoopPlayer coopPlayer, FoodClass foodDrink, private readonly float amount = amount; private readonly EBodyPart bodyPart = bodyPart; private readonly int animationVariant = animationVariant; - public Process process; + public Process process; public Action confirmCallback; internal MedsController ReturnController() @@ -1659,7 +1659,7 @@ private class QuickKnifeControllerHandler(CoopPlayer coopPlayer, KnifeComponent { private readonly CoopPlayer coopPlayer = coopPlayer; public readonly KnifeComponent knife = knife; - public Process process; + public Process process; public Action confirmCallback; internal QuickKnifeKickController ReturnController() diff --git a/Fika.Core/Coop/Players/ObservedCoopPlayer.cs b/Fika.Core/Coop/Players/ObservedCoopPlayer.cs index 0df67055..1064132c 100644 --- a/Fika.Core/Coop/Players/ObservedCoopPlayer.cs +++ b/Fika.Core/Coop/Players/ObservedCoopPlayer.cs @@ -38,11 +38,11 @@ public class ObservedCoopPlayer : CoopPlayer private float observedFixedTime = 0f; private FikaHealthBar healthBar = null; private Coroutine waitForStartRoutine; - public GClass2417 NetworkHealthController + public GClass2428 NetworkHealthController { - get => HealthController as GClass2417; + get => HealthController as GClass2428; } - private readonly GClass2156 ObservedVaultingParameters = new(); + private readonly GClass2167 ObservedVaultingParameters = new(); public override bool CanBeSnapped => false; public override EPointOfView PointOfView { get => EPointOfView.ThirdPerson; } public override AbstractHandsController HandsController @@ -120,11 +120,11 @@ public static async Task CreateObservedPlayer(int playerId, string layerName, string prefix, EPointOfView pointOfView, Profile profile, bool aiControl, EUpdateQueue updateQueue, EUpdateMode armsUpdateMode, EUpdateMode bodyUpdateMode, CharacterControllerSpawner.Mode characterControllerMode, Func getSensitivity, - Func getAimingSensitivity, GInterface99 filter) + Func getAimingSensitivity, GInterface111 filter) { ObservedCoopPlayer player = null; - player = Create(GClass1388.PLAYER_BUNDLE_NAME, playerId, position, updateQueue, + player = Create(GClass1398.PLAYER_BUNDLE_NAME, playerId, position, updateQueue, armsUpdateMode, bodyUpdateMode, characterControllerMode, getSensitivity, getAimingSensitivity, prefix, aiControl); @@ -165,12 +165,12 @@ public override bool CheckSurface() public override void PlayGroundedSound(float fallHeight, float jumpHeight) { - (bool hit, BaseBallistic.ESurfaceSound surfaceSound) values = method_53(); - method_54(values.hit, values.surfaceSound); + (bool hit, BaseBallistic.ESurfaceSound surfaceSound) values = method_57(); + method_58(values.hit, values.surfaceSound); base.PlayGroundedSound(fallHeight, jumpHeight); } - public override void OnSkillLevelChanged(GClass1766 skill) + public override void OnSkillLevelChanged(GClass1776 skill) { //base.OnSkillLevelChanged(skill); } @@ -241,7 +241,7 @@ public override void ManageAggressor(DamageInfo damageInfo, EBodyPart bodyPart, bool flag = damageInfo.DidBodyDamage / HealthController.GetBodyPartHealth(bodyPart, false).Maximum >= 0.6f && HealthController.FindExistingEffect(bodyPart) != null; player.StatisticsManager.OnEnemyDamage(damageInfo, bodyPart, - Profile.Info.Side, Profile.Info.Settings.Role.ToString(), + Profile.Info.Side, Profile.Info.Settings.Role, Profile.Info.GroupId, HealthController.GetBodyPartHealth(EBodyPart.Common, false).Maximum, flag, Vector3.Distance(player.Transform.position, Transform.position), CurrentHour, Inventory.EquippedInSlotsTemplateIds, @@ -329,7 +329,7 @@ public override void ApplyDamageInfo(DamageInfo damageInfo, EBodyPart bodyPartTy } }*/ - public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBodyPartColliderType colliderType, EArmorPlateCollider armorPlateCollider, GStruct390 shotId) + public override GClass1686 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBodyPartColliderType colliderType, EArmorPlateCollider armorPlateCollider, GStruct390 shotId) { if (damageInfo.DamageType == EDamageType.Sniper && MatchmakerAcceptPatches.IsServer) { @@ -380,7 +380,7 @@ public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartTy float damage = damageInfo.Damage; List list = ProceedDamageThroughArmor(ref damageInfo, colliderType, armorPlateCollider, true); MaterialType materialType = (flag ? MaterialType.HelmetRicochet : ((list == null || list.Count < 1) ? MaterialType.Body : list[0].Material)); - GClass1676 hitInfo = new() + GClass1686 hitInfo = new() { PoV = PointOfView, Penetrated = (string.IsNullOrEmpty(damageInfo.BlockedBy) || string.IsNullOrEmpty(damageInfo.DeflectedBy)), @@ -440,7 +440,7 @@ public override GClass1676 ApplyShot(DamageInfo damageInfo, EBodyPart bodyPartTy float damage = damageInfo.Damage; List list = ProceedDamageThroughArmor(ref damageInfo, colliderType, armorPlateCollider, true); MaterialType materialType = (flag ? MaterialType.HelmetRicochet : ((list == null || list.Count < 1) ? MaterialType.Body : list[0].Material)); - GClass1676 hitInfo = new() + GClass1686 hitInfo = new() { PoV = PointOfView, Penetrated = (string.IsNullOrEmpty(damageInfo.BlockedBy) || string.IsNullOrEmpty(damageInfo.DeflectedBy)), @@ -502,7 +502,7 @@ public override void SetControllerInsteadRemovedOne(Item removingItem, Callback { RemoveHandsControllerHandler handler = new(this, callback); _removeFromHandsCallback = callback; - Proceed(false, new Callback(handler.Handle), false); + Proceed(false, new Callback(handler.Handle), false); } public override Corpse CreateCorpse() @@ -528,7 +528,7 @@ public override void CreateMovementContext() public override void OnHealthEffectAdded(IEffect effect) { // Remember to check if classes increment - if (effect is GInterface245 && FractureSound != null && Singleton.Instantiated) + if (effect is GInterface269 && FractureSound != null && Singleton.Instantiated) { Singleton.Instance.PlayAtPoint(Position, FractureSound, CameraClass.Instance.Distance(Position), BetterAudio.AudioSourceGroupType.Impacts, 15, 0.7f, EOcclusionTest.Fast, null, false); @@ -571,7 +571,7 @@ public override void Proceed(Weapon weapon, Callback ca .method_0(null, callback, scheduled); } - public override void Proceed(MedsClass meds, EBodyPart bodyPart, Callback callback, int animationVariant, bool scheduled = true) + public override void Proceed(MedsClass meds, EBodyPart bodyPart, Callback callback, int animationVariant, bool scheduled = true) { HandsControllerFactory factory = new(this) { @@ -580,11 +580,11 @@ public override void Proceed(MedsClass meds, EBodyPart bodyPart, Callback func = new(factory.CreateObservedMedsController); - new Process(this, func, meds, false) + new Process(this, func, meds, false) .method_0(null, callback, scheduled); } - public override void Proceed(FoodClass foodDrink, float amount, Callback callback, int animationVariant, bool scheduled = true) + public override void Proceed(FoodClass foodDrink, float amount, Callback callback, int animationVariant, bool scheduled = true) { HandsControllerFactory factory = new(this) { @@ -593,7 +593,7 @@ public override void Proceed(FoodClass foodDrink, float amount, Callback func = new(factory.CreateObservedMedsController); - new Process(this, func, foodDrink, false) + new Process(this, func, foodDrink, false) .method_0(null, callback, scheduled); } #endregion @@ -633,12 +633,12 @@ public override void DropCurrentController(Action callback, bool fastDrop, Item public override void OnPhraseTold(EPhraseTrigger @event, TaggedClip clip, TagBank bank, PhraseSpeakerClass speaker) { - method_32(clip); + method_34(clip); } public PlayerStatePacket Interpolate(in PlayerStatePacket newState, in PlayerStatePacket lastState) { - method_54(newState.HasGround, newState.SurfaceSound); + method_58(newState.HasGround, newState.SurfaceSound); Rotation = new Vector2(Mathf.LerpAngle(MovementContext.Rotation.x, newState.Rotation.x, interpolationRatio), Mathf.Lerp(MovementContext.Rotation.y, newState.Rotation.y, interpolationRatio)); @@ -828,8 +828,8 @@ public override void SetInventory(EquipmentClass equipmentClass) { Transform slotBone = PlayerBody.GetSlotBone(equipmentSlot); Transform alternativeHolsterBone = PlayerBody.GetAlternativeHolsterBone(equipmentSlot); - PlayerBody.GClass1860 gclass = new(PlayerBody, Inventory.Equipment.GetSlot(equipmentSlot), slotBone, equipmentSlot, Inventory.Equipment.GetSlot(EquipmentSlot.Backpack), alternativeHolsterBone); - PlayerBody.GClass1860 gclass2 = PlayerBody.SlotViews.AddOrReplace(equipmentSlot, gclass); + PlayerBody.GClass1872 gclass = new(PlayerBody, Inventory.Equipment.GetSlot(equipmentSlot), slotBone, equipmentSlot, Inventory.Equipment.GetSlot(EquipmentSlot.Backpack), alternativeHolsterBone); + PlayerBody.GClass1872 gclass2 = PlayerBody.SlotViews.AddOrReplace(equipmentSlot, gclass); if (gclass2 != null) { gclass2.Dispose(); @@ -1285,7 +1285,7 @@ public void HandleProceedPacket(ProceedPacket packet) #region handControllers private void CreateHandsController(Func controllerFactory, Item item) { - CreateHandsControllerHandler handler = new((item != null) ? method_67(item) : null); + CreateHandsControllerHandler handler = new((item != null) ? method_71(item) : null); handler.setInHandsOperation?.Confirm(true); @@ -1451,7 +1451,7 @@ private class RemoveHandsControllerHandler(ObservedCoopPlayer coopPlayer, Callba private readonly ObservedCoopPlayer coopPlayer = coopPlayer; private readonly Callback callback = callback; - public void Handle(Result result) + public void Handle(Result result) { if (coopPlayer._removeFromHandsCallback == callback) { @@ -1461,13 +1461,13 @@ public void Handle(Result result) } } - private class CreateHandsControllerHandler(Class1059 setInHandsOperation) + private class CreateHandsControllerHandler(Class1079 setInHandsOperation) { - public readonly Class1059 setInHandsOperation = setInHandsOperation; + public readonly Class1079 setInHandsOperation = setInHandsOperation; internal void DisposeHandler() { - Class1059 handler = setInHandsOperation; + Class1079 handler = setInHandsOperation; if (handler == null) return; handler.Dispose(); diff --git a/Fika.Core/Fika.Core.csproj b/Fika.Core/Fika.Core.csproj index 7d7b9d12..717860f3 100644 --- a/Fika.Core/Fika.Core.csproj +++ b/Fika.Core/Fika.Core.csproj @@ -60,8 +60,7 @@ False - ..\References\hollowed.dll - False + ..\References\Assembly-CSharp.dll ..\References\bsg.componentace.compression.libs.zlib.dll diff --git a/Fika.Core/Models/BotDifficulties.cs b/Fika.Core/Models/BotDifficulties.cs index 24edd6fe..7ffb9b85 100644 --- a/Fika.Core/Models/BotDifficulties.cs +++ b/Fika.Core/Models/BotDifficulties.cs @@ -8,12 +8,12 @@ namespace Fika.Core.Models public class BotDifficulties : Dictionary { [JsonIgnore] - private GClass531 CoreSettings; + private GClass530 CoreSettings; public BotDifficulties() { string coreString = RequestHandler.GetJson("/singleplayer/settings/bot/difficulty/core/core"); - CoreSettings = JsonConvert.DeserializeObject(coreString); + CoreSettings = JsonConvert.DeserializeObject(coreString); } public BotSettingsComponents GetComponent(BotDifficulty botDifficulty, WildSpawnType role) @@ -31,7 +31,7 @@ public BotSettingsComponents GetComponent(BotDifficulty botDifficulty, WildSpawn return null; } - public GClass531 GetCoreSettings() + public GClass530 GetCoreSettings() { FikaPlugin.Instance.FikaLogger.LogInfo("Retrieving Core settings"); if (CoreSettings != null) diff --git a/Fika.Core/Networking/FikaClient.cs b/Fika.Core/Networking/FikaClient.cs index dce47735..8f6fb6d3 100644 --- a/Fika.Core/Networking/FikaClient.cs +++ b/Fika.Core/Networking/FikaClient.cs @@ -200,7 +200,7 @@ private void OnBorderZonePacketReceived(BorderZonePacket packet) { if (player.ProfileId == packet.ProfileId) { - GInterface94 playerBridge = Singleton.Instance.GetAlivePlayerBridgeByProfileID(player.ProfileId); + GInterface106 playerBridge = Singleton.Instance.GetAlivePlayerBridgeByProfileID(player.ProfileId); borderZone.ProcessIncomingPacket(playerBridge, true); } } @@ -214,7 +214,7 @@ private void OnMinePacketReceived(MinePacket packet) { if (Singleton.Instance.MineManager != null) { - NetworkGame.Class1381 mineSeeker = new() + NetworkGame.Class1403 mineSeeker = new() { minePosition = packet.MinePositon }; @@ -257,7 +257,7 @@ private void OnWeatherPacketReceived(WeatherPacket packet) { if (WeatherController.Instance != null) { - WeatherController.Instance.method_4(packet.WeatherClasses); + WeatherController.Instance.method_0(packet.WeatherClasses); } else { diff --git a/Fika.Core/Networking/FikaSerialization.cs b/Fika.Core/Networking/FikaSerialization.cs index 846c70dc..c978874e 100644 --- a/Fika.Core/Networking/FikaSerialization.cs +++ b/Fika.Core/Networking/FikaSerialization.cs @@ -17,14 +17,14 @@ public class FikaSerialization /*public class AddressUtils { - public static void SerializeGridItemAddressDescriptor(NetDataWriter writer, GClass1528 gridItemAddressDescriptor) + public static void SerializeGridItemAddressDescriptor(NetDataWriter writer, GClass1538 gridItemAddressDescriptor) { SerializeLocationInGrid(writer, gridItemAddressDescriptor.LocationInGrid); } - public static GClass1528 DeserializeGridItemAddressDescriptor(NetDataReader reader) + public static GClass1538 DeserializeGridItemAddressDescriptor(NetDataReader reader) { - return new GClass1528() + return new GClass1538() { LocationInGrid = DeserializeLocationInGrid(reader), Container = DeserializeContainerDescriptor(reader) @@ -227,13 +227,13 @@ public static void SerializeInventory(NetDataWriter writer, Inventory inventory) { GClass1489 inventoryDescriptor = new GClass1489() { - Equipment = GClass1524.SerializeItem(inventory.Equipment), - Stash = GClass1524.SerializeItem(inventory.Stash), - QuestRaidItems = GClass1524.SerializeItem(inventory.QuestRaidItems), - QuestStashItems = GClass1524.SerializeItem(inventory.QuestStashItems), - SortingTable = GClass1524.SerializeItem(inventory.SortingTable), - FastAccess = GClass1524.SerializeFastAccess(inventory.FastAccess), - DiscardLimits = GClass1524.SerializeDiscardLimits(inventory.DiscardLimits) + Equipment = GClass1534.SerializeItem(inventory.Equipment), + Stash = GClass1534.SerializeItem(inventory.Stash), + QuestRaidItems = GClass1534.SerializeItem(inventory.QuestRaidItems), + QuestStashItems = GClass1534.SerializeItem(inventory.QuestStashItems), + SortingTable = GClass1534.SerializeItem(inventory.SortingTable), + FastAccess = GClass1534.SerializeFastAccess(inventory.FastAccess), + DiscardLimits = GClass1534.SerializeDiscardLimits(inventory.DiscardLimits) }; GClass1081 polyWriter = new(); polyWriter.WriteEFTInventoryDescriptor(inventoryDescriptor); @@ -244,7 +244,7 @@ public static Inventory DeserializeInventory(byte[] inventoryBytes) { using MemoryStream memoryStream = new(inventoryBytes); BinaryReader polyReader = new(memoryStream); - Inventory inventory = GClass1524.DeserializeInventory(Singleton.Instance, polyReader.ReadEFTInventoryDescriptor()); + Inventory inventory = GClass1534.DeserializeInventory(Singleton.Instance, polyReader.ReadEFTInventoryDescriptor()); return inventory; } }*/ @@ -273,14 +273,14 @@ public static PlayerInfoPacket Deserialize(NetDataReader reader) public struct LightStatesPacket { public int Amount; - public GStruct163[] LightStates; + public GStruct164[] LightStates; public static LightStatesPacket Deserialize(NetDataReader reader) { LightStatesPacket packet = new(); packet.Amount = reader.GetInt(); if (packet.Amount > 0) { - packet.LightStates = new GStruct163[packet.Amount]; + packet.LightStates = new GStruct164[packet.Amount]; for (int i = 0; i < packet.Amount; i++) { packet.LightStates[i] = new() @@ -312,14 +312,14 @@ public static void Serialize(NetDataWriter writer, LightStatesPacket packet) public struct HeadLightsPacket { public int Amount; - public GStruct163[] LightStates; + public GStruct164[] LightStates; public static HeadLightsPacket Deserialize(NetDataReader reader) { HeadLightsPacket packet = new(); packet.Amount = reader.GetInt(); if (packet.Amount > 0) { - packet.LightStates = new GStruct163[packet.Amount]; + packet.LightStates = new GStruct164[packet.Amount]; for (int i = 0; i < packet.Amount; i++) { packet.LightStates[i] = new() @@ -351,17 +351,17 @@ public static void Serialize(NetDataWriter writer, HeadLightsPacket packet) public struct ScopeStatesPacket { public int Amount; - public GStruct164[] GStruct164; + public GStruct165[] GStruct165; public static ScopeStatesPacket Deserialize(NetDataReader reader) { ScopeStatesPacket packet = new(); packet.Amount = reader.GetInt(); if (packet.Amount > 0) { - packet.GStruct164 = new GStruct164[packet.Amount]; + packet.GStruct165 = new GStruct165[packet.Amount]; for (int i = 0; i < packet.Amount; i++) { - packet.GStruct164[i] = new() + packet.GStruct165[i] = new() { Id = reader.GetString(), ScopeMode = reader.GetInt(), @@ -380,10 +380,10 @@ public static void Serialize(NetDataWriter writer, ScopeStatesPacket packet) { for (int i = 0; i < packet.Amount; i++) { - writer.Put(packet.GStruct164[i].Id); - writer.Put(packet.GStruct164[i].ScopeMode); - writer.Put(packet.GStruct164[i].ScopeIndexInsideSight); - writer.Put(packet.GStruct164[i].ScopeCalibrationIndex); + writer.Put(packet.GStruct165[i].Id); + writer.Put(packet.GStruct165[i].ScopeMode); + writer.Put(packet.GStruct165[i].ScopeIndexInsideSight); + writer.Put(packet.GStruct165[i].ScopeCalibrationIndex); } } } @@ -1119,8 +1119,8 @@ public static BTRDataPacket Deserialize(NetDataReader reader) LeftSideState = reader.GetByte(), RouteState = reader.GetByte(), State = reader.GetByte(), - gunsBlockRotation = reader.GetQuaternion(), - turretRotation = reader.GetQuaternion(), + gunsBlockRotation = reader.GetFloat(), + turretRotation = reader.GetFloat(), rotation = reader.GetQuaternion() }; } diff --git a/Fika.Core/Networking/FikaSerializationExtensions.cs b/Fika.Core/Networking/FikaSerializationExtensions.cs index 2a3ce5b6..cfc0b2a7 100644 --- a/Fika.Core/Networking/FikaSerializationExtensions.cs +++ b/Fika.Core/Networking/FikaSerializationExtensions.cs @@ -107,11 +107,11 @@ public static Color GetColor(this NetDataReader reader) } /// - /// Serializes a (Physical) struct + /// Serializes a (Physical) struct /// /// /// - public static void Put(this NetDataWriter writer, GStruct35 physical) + public static void Put(this NetDataWriter writer, GStruct36 physical) { writer.Put(physical.StaminaExhausted); writer.Put(physical.OxygenExhausted); @@ -119,13 +119,13 @@ public static void Put(this NetDataWriter writer, GStruct35 physical) } /// - /// Deserializes a (Physical) struct + /// Deserializes a (Physical) struct /// /// - /// A (Physical) - public static GStruct35 GetPhysical(this NetDataReader reader) + /// A (Physical) + public static GStruct36 GetPhysical(this NetDataReader reader) { - return new GStruct35() { StaminaExhausted = reader.GetBool(), OxygenExhausted = reader.GetBool(), HandsExhausted = reader.GetBool() }; + return new GStruct36() { StaminaExhausted = reader.GetBool(), OxygenExhausted = reader.GetBool(), HandsExhausted = reader.GetBool() }; } /// @@ -188,7 +188,7 @@ public static void PutAirdropItem(this NetDataWriter writer, Item item) { using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.Write(GClass1524.SerializeItem(item)); + binaryWriter.Write(GClass1534.SerializeItem(item)); writer.PutByteArray(memoryStream.ToArray()); } @@ -202,12 +202,12 @@ public static Item GetAirdropItem(this NetDataReader reader) using MemoryStream memoryStream = new(reader.GetByteArray()); using BinaryReader binaryReader = new(memoryStream); - Item item = GClass1524.DeserializeItem(Singleton.Instance, [], binaryReader.ReadEFTItemDescriptor()); + Item item = GClass1534.DeserializeItem(Singleton.Instance, [], binaryReader.ReadEFTItemDescriptor()); ContainerCollection[] containerCollections = [item as ContainerCollection]; ResourceKey[] resourceKeys = containerCollections.GetAllItemsFromCollections() - .Concat(containerCollections.Where(new Func(AirdropSynchronizableObject.Class1802.class1802_0.method_2))) - .SelectMany(new Func>(AirdropSynchronizableObject.Class1802.class1802_0.method_3)) + .Concat(containerCollections.Where(new Func(AirdropSynchronizableObject.Class1828.class1828_0.method_2))) + .SelectMany(new Func>(AirdropSynchronizableObject.Class1828.class1828_0.method_3)) .ToArray(); Singleton.Instance.LoadBundlesAndCreatePools(PoolManager.PoolsCategory.Raid, PoolManager.AssemblyType.Online, resourceKeys, JobPriority.Immediate, null, default); @@ -223,7 +223,7 @@ public static void PutItem(this NetDataWriter writer, Item item) { using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.Write(GClass1524.SerializeItem(item)); + binaryWriter.Write(GClass1534.SerializeItem(item)); writer.PutByteArray(memoryStream.ToArray()); } @@ -237,7 +237,7 @@ public static Item GetItem(this NetDataReader reader) using MemoryStream memoryStream = new(reader.GetByteArray()); using BinaryReader binaryReader = new(memoryStream); - return GClass1524.DeserializeItem(Singleton.Instance, [], binaryReader.ReadEFTItemDescriptor()); + return GClass1534.DeserializeItem(Singleton.Instance, [], binaryReader.ReadEFTItemDescriptor()); } } } diff --git a/Fika.Core/Networking/FikaServer.cs b/Fika.Core/Networking/FikaServer.cs index 68da25bc..b13a4121 100644 --- a/Fika.Core/Networking/FikaServer.cs +++ b/Fika.Core/Networking/FikaServer.cs @@ -203,7 +203,7 @@ private void OnMinePacketReceived(MinePacket packet, NetPeer peer) { if (Singleton.Instance.MineManager != null) { - NetworkGame.Class1381 mineSeeker = new() + NetworkGame.Class1403 mineSeeker = new() { minePosition = packet.MinePositon }; @@ -504,9 +504,9 @@ private void OnInventoryPacketReceived(InventoryPacket packet, NetPeer peer) // TODO: Hacky workaround to fix errors due to each client generating new IDs. Might need to find a more 'elegant' solution later. // Unknown what problems this might cause so far. - if (result.Value is GClass2861 unloadOperation) + if (result.Value is GClass2874 unloadOperation) { - if (unloadOperation.InternalOperation is GClass2872 internalSplitOperation) + if (unloadOperation.InternalOperation is GClass2885 internalSplitOperation) { Item item = internalSplitOperation.To.Item; if (item != null) @@ -528,7 +528,7 @@ private void OnInventoryPacketReceived(InventoryPacket packet, NetPeer peer) } // TODO: Same as above. - if (result.Value is GClass2872 splitOperation) + if (result.Value is GClass2885 splitOperation) { Item item = splitOperation.To.Item; if (item != null) @@ -766,7 +766,7 @@ internal void HandleResult(IResult result) using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1632.FromInventoryOperation(opResult.Value, false)); + binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(opResult.Value, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { diff --git a/Fika.Core/Networking/Packets/Player/HealthSyncPacket.cs b/Fika.Core/Networking/Packets/Player/HealthSyncPacket.cs index c17ac483..28177c14 100644 --- a/Fika.Core/Networking/Packets/Player/HealthSyncPacket.cs +++ b/Fika.Core/Networking/Packets/Player/HealthSyncPacket.cs @@ -7,7 +7,7 @@ namespace Fika.Core.Networking public struct HealthSyncPacket(int netId) : INetSerializable { public int NetId = netId; - public GStruct346 Packet; + public GStruct347 Packet; public string KillerId; public string KillerWeaponId; public RagdollPacket RagdollPacket; @@ -16,13 +16,13 @@ public struct HealthSyncPacket(int netId) : INetSerializable public void Deserialize(NetDataReader reader) { NetId = reader.GetInt(); - GStruct346 packet = new() + GStruct347 packet = new() { - SyncType = (GStruct346.ESyncType)reader.GetInt() + SyncType = (GStruct347.ESyncType)reader.GetInt() }; switch (packet.SyncType) { - case GStruct346.ESyncType.AddEffect: + case GStruct347.ESyncType.AddEffect: { packet.Data.AddEffect = new() { @@ -34,11 +34,11 @@ public void Deserialize(NetDataReader reader) WorkTime = reader.GetFloat(), ResidueTime = reader.GetFloat(), Strength = reader.GetFloat(), - ExtraDataType = (GStruct346.GStruct347.EExtraDataType)reader.GetInt() + ExtraDataType = (GStruct347.GStruct348.EExtraDataType)reader.GetInt() }; switch (packet.Data.AddEffect.ExtraDataType) { - case GStruct346.GStruct347.EExtraDataType.MedEffect: + case GStruct347.GStruct348.EExtraDataType.MedEffect: { packet.Data.AddEffect.ExtraData = new() { @@ -50,7 +50,7 @@ public void Deserialize(NetDataReader reader) }; } break; - case GStruct346.GStruct347.EExtraDataType.Stimulator: + case GStruct347.GStruct348.EExtraDataType.Stimulator: { packet.Data.AddEffect.ExtraData = new() { @@ -64,7 +64,7 @@ public void Deserialize(NetDataReader reader) } break; } - case GStruct346.ESyncType.RemoveEffect: + case GStruct347.ESyncType.RemoveEffect: { packet.Data.RemoveEffect = new() { @@ -72,7 +72,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.EffectNextState: + case GStruct347.ESyncType.EffectNextState: { packet.Data.EffectNextState = new() { @@ -81,7 +81,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.EffectStateTime: + case GStruct347.ESyncType.EffectStateTime: { packet.Data.EffectStateTime = new() { @@ -90,7 +90,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.EffectStrength: + case GStruct347.ESyncType.EffectStrength: { packet.Data.EffectStrength = new() { @@ -99,7 +99,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.EffectMedResource: + case GStruct347.ESyncType.EffectMedResource: { packet.Data.EffectMedResource = new() { @@ -108,7 +108,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.EffectStimulatorBuff: + case GStruct347.ESyncType.EffectStimulatorBuff: { packet.Data.EffectStimulatorBuff = new() { @@ -125,7 +125,7 @@ public void Deserialize(NetDataReader reader) } break; } - case GStruct346.ESyncType.IsAlive: + case GStruct347.ESyncType.IsAlive: { packet.Data.IsAlive = new() { @@ -142,7 +142,7 @@ public void Deserialize(NetDataReader reader) } break; } - case GStruct346.ESyncType.BodyHealth: + case GStruct347.ESyncType.BodyHealth: { packet.Data.BodyHealth = new() { @@ -151,7 +151,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.Energy: + case GStruct347.ESyncType.Energy: { packet.Data.Energy = new() { @@ -159,7 +159,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.Hydration: + case GStruct347.ESyncType.Hydration: { packet.Data.Hydration = new() { @@ -167,7 +167,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.Temperature: + case GStruct347.ESyncType.Temperature: { packet.Data.Temperature = new() { @@ -175,7 +175,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.DamageCoeff: + case GStruct347.ESyncType.DamageCoeff: { packet.Data.DamageCoeff = new() { @@ -183,7 +183,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.ApplyDamage: + case GStruct347.ESyncType.ApplyDamage: { packet.Data.ApplyDamage = new() { @@ -193,7 +193,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.DestroyedBodyPart: + case GStruct347.ESyncType.DestroyedBodyPart: { packet.Data.DestroyedBodyPart = new() { @@ -208,7 +208,7 @@ public void Deserialize(NetDataReader reader) packet.Data.DestroyedBodyPart.HealthMaximum = reader.GetFloat(); break; } - case GStruct346.ESyncType.HealthRates: + case GStruct347.ESyncType.HealthRates: { packet.Data.HealthRates = new() { @@ -221,7 +221,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.HealerDone: + case GStruct347.ESyncType.HealerDone: { packet.Data.HealerDone = new() { @@ -229,7 +229,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.BurnEyes: + case GStruct347.ESyncType.BurnEyes: { packet.Data.BurnEyes = new() { @@ -239,7 +239,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.Poison: + case GStruct347.ESyncType.Poison: { packet.Data.Poison = new() { @@ -247,7 +247,7 @@ public void Deserialize(NetDataReader reader) }; break; } - case GStruct346.ESyncType.StaminaCoeff: + case GStruct347.ESyncType.StaminaCoeff: { packet.Data.StaminaCoeff = new() { @@ -263,11 +263,11 @@ public void Deserialize(NetDataReader reader) public void Serialize(NetDataWriter writer) { writer.Put(NetId); - GStruct346.GStruct365 packet = Packet.Data; + GStruct347.GStruct366 packet = Packet.Data; writer.Put((int)Packet.SyncType); switch (Packet.SyncType) { - case GStruct346.ESyncType.AddEffect: + case GStruct347.ESyncType.AddEffect: { writer.Put(packet.AddEffect.EffectId); writer.Put(packet.AddEffect.Type); @@ -280,15 +280,15 @@ public void Serialize(NetDataWriter writer) writer.Put((int)packet.AddEffect.ExtraDataType); switch (packet.AddEffect.ExtraDataType) { - case GStruct346.GStruct347.EExtraDataType.None: + case GStruct347.GStruct348.EExtraDataType.None: break; - case GStruct346.GStruct347.EExtraDataType.MedEffect: + case GStruct347.GStruct348.EExtraDataType.MedEffect: { writer.Put(packet.AddEffect.ExtraData.MedEffect.ItemId); writer.Put(packet.AddEffect.ExtraData.MedEffect.Amount); break; } - case GStruct346.GStruct347.EExtraDataType.Stimulator: + case GStruct347.GStruct348.EExtraDataType.Stimulator: { writer.Put(packet.AddEffect.ExtraData.Stimulator.BuffsName); break; @@ -296,36 +296,36 @@ public void Serialize(NetDataWriter writer) } break; } - case GStruct346.ESyncType.RemoveEffect: + case GStruct347.ESyncType.RemoveEffect: { writer.Put(packet.RemoveEffect.EffectId); break; } - case GStruct346.ESyncType.EffectNextState: + case GStruct347.ESyncType.EffectNextState: { writer.Put(packet.EffectNextState.EffectId); writer.Put(packet.EffectNextState.StateTime); break; } - case GStruct346.ESyncType.EffectStateTime: + case GStruct347.ESyncType.EffectStateTime: { writer.Put(packet.EffectStateTime.EffectId); writer.Put(packet.EffectStateTime.RemainingStateTime); break; } - case GStruct346.ESyncType.EffectStrength: + case GStruct347.ESyncType.EffectStrength: { writer.Put(packet.EffectStrength.EffectId); writer.Put(packet.EffectStrength.Strength); break; } - case GStruct346.ESyncType.EffectMedResource: + case GStruct347.ESyncType.EffectMedResource: { writer.Put(packet.EffectMedResource.EffectId); writer.Put(packet.EffectMedResource.Resource); break; } - case GStruct346.ESyncType.EffectStimulatorBuff: + case GStruct347.ESyncType.EffectStimulatorBuff: { writer.Put(packet.EffectStimulatorBuff.EffectId); writer.Put(packet.EffectStimulatorBuff.BuffIndex); @@ -339,7 +339,7 @@ public void Serialize(NetDataWriter writer) } break; } - case GStruct346.ESyncType.IsAlive: + case GStruct347.ESyncType.IsAlive: { writer.Put(packet.IsAlive.IsAlive); if (!packet.IsAlive.IsAlive) @@ -353,40 +353,40 @@ public void Serialize(NetDataWriter writer) } break; } - case GStruct346.ESyncType.BodyHealth: + case GStruct347.ESyncType.BodyHealth: { writer.Put((int)packet.BodyHealth.BodyPart); writer.Put(packet.BodyHealth.Value); break; } - case GStruct346.ESyncType.Energy: + case GStruct347.ESyncType.Energy: { writer.Put(packet.Energy.Value); break; } - case GStruct346.ESyncType.Hydration: + case GStruct347.ESyncType.Hydration: { writer.Put(packet.Hydration.Value); break; } - case GStruct346.ESyncType.Temperature: + case GStruct347.ESyncType.Temperature: { writer.Put(packet.Temperature.Value); break; } - case GStruct346.ESyncType.DamageCoeff: + case GStruct347.ESyncType.DamageCoeff: { writer.Put(packet.DamageCoeff.DamageCoeff); break; } - case GStruct346.ESyncType.ApplyDamage: + case GStruct347.ESyncType.ApplyDamage: { writer.Put((int)packet.ApplyDamage.BodyPart); writer.Put(packet.ApplyDamage.Damage); writer.Put((int)packet.ApplyDamage.DamageType); break; } - case GStruct346.ESyncType.DestroyedBodyPart: + case GStruct347.ESyncType.DestroyedBodyPart: { writer.Put((int)packet.DestroyedBodyPart.BodyPart); writer.Put(packet.DestroyedBodyPart.IsDestroyed); @@ -398,7 +398,7 @@ public void Serialize(NetDataWriter writer) writer.Put(packet.DestroyedBodyPart.HealthMaximum); break; } - case GStruct346.ESyncType.HealthRates: + case GStruct347.ESyncType.HealthRates: { writer.Put(packet.HealthRates.HealRate); writer.Put(packet.HealthRates.DamageRate); @@ -408,24 +408,24 @@ public void Serialize(NetDataWriter writer) writer.Put(packet.HealthRates.Temperature); break; } - case GStruct346.ESyncType.HealerDone: + case GStruct347.ESyncType.HealerDone: { writer.Put(packet.HealerDone.EffectId); break; } - case GStruct346.ESyncType.BurnEyes: + case GStruct347.ESyncType.BurnEyes: { writer.Put(packet.BurnEyes.Position); writer.Put(packet.BurnEyes.DistanceStrength); writer.Put(packet.BurnEyes.NormalTime); break; } - case GStruct346.ESyncType.Poison: + case GStruct347.ESyncType.Poison: { writer.Put(packet.Poison.Value); break; } - case GStruct346.ESyncType.StaminaCoeff: + case GStruct347.ESyncType.StaminaCoeff: { writer.Put(packet.StaminaCoeff.StaminaCoeff); break; diff --git a/Fika.Core/Networking/Packets/Player/PlayerStatePacket.cs b/Fika.Core/Networking/Packets/Player/PlayerStatePacket.cs index cf9ff22b..c81ee152 100644 --- a/Fika.Core/Networking/Packets/Player/PlayerStatePacket.cs +++ b/Fika.Core/Networking/Packets/Player/PlayerStatePacket.cs @@ -6,7 +6,7 @@ namespace Fika.Core.Networking { public struct PlayerStatePacket(int netId, Vector3 position, Vector2 rotation, Vector2 headRotation, Vector2 movementDirection, EPlayerState state, float tilt, int step, int animatorStateIndex, float characterMovementSpeed, - bool isProne, float poseLevel, bool isSprinting, GClass681.GStruct35 stamina, int blindfire, + bool isProne, float poseLevel, bool isSprinting, GClass681.GStruct36 stamina, int blindfire, float weaponOverlap, bool leftStanceDisabled, bool isGrounded, bool hasGround, ESurfaceSound surfaceSound, Vector3 surfaceNormal) : INetSerializable { public int NetId = netId; @@ -22,7 +22,7 @@ public struct PlayerStatePacket(int netId, Vector3 position, Vector2 rotation, V public bool IsProne = isProne; public float PoseLevel = poseLevel; public bool IsSprinting = isSprinting; - public GClass681.GStruct35 Stamina = stamina; + public GClass681.GStruct36 Stamina = stamina; public int Blindfire = blindfire; public float WeaponOverlap = weaponOverlap; public bool LeftStanceDisabled = leftStanceDisabled; diff --git a/Fika.Core/UI/FikaUIUtils.cs b/Fika.Core/UI/FikaUIUtils.cs index bbb6c72e..ab1ea6d7 100644 --- a/Fika.Core/UI/FikaUIUtils.cs +++ b/Fika.Core/UI/FikaUIUtils.cs @@ -39,12 +39,12 @@ public static TextMeshProUGUI CreateOverlayText(string overlayText) return text; } - public static GClass3085 ShowFikaMessage(this PreloaderUI preloaderUI, string header, string message, + public static GClass3102 ShowFikaMessage(this PreloaderUI preloaderUI, string header, string message, ErrorScreen.EButtonType buttonType, float waitingTime, Action acceptCallback, Action endTimeCallback) { Traverse preloaderUiTraverse = Traverse.Create(preloaderUI); - PreloaderUI.Class2561 messageHandler = new() + PreloaderUI.Class2590 messageHandler = new() { preloaderUI_0 = preloaderUI, acceptCallback = acceptCallback, @@ -54,7 +54,7 @@ public static GClass3085 ShowFikaMessage(this PreloaderUI preloaderUI, string he if (!AsyncWorker.CheckIsMainThread()) { FikaPlugin.Instance.FikaLogger.LogError("You are trying to show error screen from non-main thread!"); - return new GClass3085(); + return new GClass3102(); } ErrorScreen errorScreenTemplate = preloaderUiTraverse.Field("_criticalErrorScreenTemplate").GetValue(); @@ -65,19 +65,19 @@ public static GClass3085 ShowFikaMessage(this PreloaderUI preloaderUI, string he return messageHandler.errorScreen.ShowFikaMessage(header, message, new Action(messageHandler.method_1), waitingTime, new Action(messageHandler.method_2), buttonType, true); } - public static GClass3087 ShowFikaMessage(this ErrorScreen errorScreen, string title, string message, + public static GClass3104 ShowFikaMessage(this ErrorScreen errorScreen, string title, string message, Action closeManuallyCallback = null, float waitingTime = 0f, Action timeOutCallback = null, ErrorScreen.EButtonType buttonType = ErrorScreen.EButtonType.OkButton, bool removeHtml = true) { Traverse errorScreenTraverse = Traverse.Create(errorScreen); - ErrorScreen.Class2352 errorScreenHandler = new() + ErrorScreen.Class2378 errorScreenHandler = new() { errorScreen_0 = errorScreen }; if (!MonoBehaviourSingleton.Instance.CanShowErrorScreen) { - return new GClass3087(); + return new GClass3104(); } if (removeHtml) { @@ -89,7 +89,7 @@ public static GClass3087 ShowFikaMessage(this ErrorScreen errorScreen, string ti errorScreenTraverse.Field("action_1").SetValue(action_1); MethodBase baseShow = typeof(ErrorScreen).BaseType.GetMethod("Show"); - errorScreenHandler.context = (GClass3087)baseShow.Invoke(errorScreen, [closeManuallyCallback]); + errorScreenHandler.context = (GClass3104)baseShow.Invoke(errorScreen, [closeManuallyCallback]); errorScreenHandler.context.OnAccept += errorScreen.method_3; errorScreenHandler.context.OnDecline += errorScreen.method_4; errorScreenHandler.context.OnCloseSilent += errorScreen.method_4; @@ -125,7 +125,7 @@ public static GClass3087 ShowFikaMessage(this ErrorScreen errorScreen, string ti } if (waitingTime > 0f) { - errorScreenTraverse.Field("coroutine_0").SetValue(errorScreen.StartCoroutine(errorScreen.method_2(GClass1296.Now.AddSeconds((double)waitingTime)))); + errorScreenTraverse.Field("coroutine_0").SetValue(errorScreen.StartCoroutine(errorScreen.method_2(GClass1304.Now.AddSeconds((double)waitingTime)))); } return errorScreenHandler.context; } diff --git a/Fika.Core/UI/Patches/ItemContext_Patch.cs b/Fika.Core/UI/Patches/ItemContext_Patch.cs index e0aff788..22e8ff1b 100644 --- a/Fika.Core/UI/Patches/ItemContext_Patch.cs +++ b/Fika.Core/UI/Patches/ItemContext_Patch.cs @@ -27,7 +27,7 @@ protected override MethodBase GetTargetMethod() [PatchPrefix] private static void Prefix(ItemInfoInteractionsAbstractClass contextInteractions, Item item) { - if (contextInteractions is not GClass3021 gclass) + if (contextInteractions is not GClass3038 gclass) { return; } @@ -86,7 +86,7 @@ private static void Prefix(ItemInfoInteractionsAbstractClass co GameObject matchMakerUiPrefab = InternalBundleLoader.Instance.GetAssetBundle("senditemmenu").LoadAsset("SendItemMenu"); GameObject uiGameObj = Object.Instantiate(matchMakerUiPrefab); uiGameObj.transform.SetParent(GameObject.Find("Preloader UI/Preloader UI/UIContext/").transform); - InventoryScreen.GClass3116 screenController = Traverse.Create(CommonUI.Instance.InventoryScreen).Field("ScreenController").Value; + InventoryScreen.GClass3137 screenController = Traverse.Create(CommonUI.Instance.InventoryScreen).Field("ScreenController").Value; screenController.OnClose += () => { Object.Destroy(uiGameObj); }; SendItemUI sendItemUI = uiGameObj.GetComponent(); sendItemUI.PlayersDropdown.ClearOptions();