diff --git a/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs b/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs index 4b0a8269..8afa6310 100644 --- a/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs +++ b/Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs @@ -25,7 +25,7 @@ public override void Execute(GClass2854 operation, [CanBeNull] Callback callback using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(operation, false)); + binaryWriter.WritePolymorph(FromObjectAbstractClass.FromInventoryOperation(operation, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { diff --git a/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs b/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs index 8b9f19a5..5377f2b3 100644 --- a/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs +++ b/Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs @@ -68,7 +68,7 @@ public override void Execute(GClass2854 operation, [CanBeNull] Callback callback using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(operation, false)); + binaryWriter.WritePolymorph(FromObjectAbstractClass.FromInventoryOperation(operation, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { @@ -102,7 +102,7 @@ public override void Execute(GClass2854 operation, [CanBeNull] Callback callback using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(operation, false)); + binaryWriter.WritePolymorph(FromObjectAbstractClass.FromInventoryOperation(operation, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { diff --git a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs index 88433c20..1819f836 100644 --- a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs +++ b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs @@ -197,7 +197,7 @@ public override bool ExamineWeapon() return flag; } - public override void InitiateShot(GInterface337 weapon, BulletClass ammo, Vector3 shotPosition, Vector3 shotDirection, Vector3 fireportPosition, int chamberIndex, float overheat) + public override void InitiateShot(IWeapon weapon, BulletClass ammo, Vector3 shotPosition, Vector3 shotDirection, Vector3 fireportPosition, int chamberIndex, float overheat) { EShotType shotType = default; @@ -268,7 +268,7 @@ public override void QuickReloadMag(MagazineClass magazine, Callback callback) }); } - public override void ReloadBarrels(GClass2509 ammoPack, GClass2785 placeToPutContainedAmmoMagazine, Callback callback) + public override void ReloadBarrels(AmmoPackReloadingClass ammoPack, ItemAddressClass placeToPutContainedAmmoMagazine, Callback callback) { if (!CanStartReload() && ammoPack.AmmoCount < 1) { @@ -279,7 +279,7 @@ public override void ReloadBarrels(GClass2509 ammoPack, GClass2785 placeToPutCon CurrentOperation.ReloadBarrels(ammoPack, placeToPutContainedAmmoMagazine, callback, new Callback(handler.Process)); } - public override void ReloadCylinderMagazine(GClass2509 ammoPack, Callback callback, bool quickReload = false) + public override void ReloadCylinderMagazine(AmmoPackReloadingClass ammoPack, Callback callback, bool quickReload = false) { if (Blindfire) { @@ -299,7 +299,7 @@ public override void ReloadCylinderMagazine(GClass2509 ammoPack, Callback callba CurrentOperation.ReloadCylinderMagazine(ammoPack, callback, new Callback(handler.Process), handler.quickReload); } - public override void ReloadGrenadeLauncher(GClass2509 ammoPack, Callback callback) + public override void ReloadGrenadeLauncher(AmmoPackReloadingClass ammoPack, Callback callback) { if (!CanStartReload()) { @@ -320,7 +320,7 @@ public override void ReloadGrenadeLauncher(GClass2509 ammoPack, Callback callbac }); } - public override void ReloadMag(MagazineClass magazine, GClass2785 gridItemAddress, Callback callback) + public override void ReloadMag(MagazineClass magazine, ItemAddressClass gridItemAddress, Callback callback) { if (!CanStartReload() || Blindfire) { @@ -331,7 +331,7 @@ public override void ReloadMag(MagazineClass magazine, GClass2785 gridItemAddres CurrentOperation.ReloadMag(magazine, gridItemAddress, callback, new Callback(handler.Process)); } - public override void ReloadWithAmmo(GClass2509 ammoPack, Callback callback) + public override void ReloadWithAmmo(AmmoPackReloadingClass ammoPack, Callback callback) { if (Item.GetCurrentMagazine() == null) { @@ -346,7 +346,7 @@ public override void ReloadWithAmmo(GClass2509 ammoPack, Callback callback) CurrentOperation.ReloadWithAmmo(ammoPack, callback, new Callback(handler.Process)); } - public override void SetLightsState(GStruct164[] lightsStates, bool force = false) + public override void SetLightsState(FirearmLightStateStruct[] lightsStates, bool force = false) { if (force || CurrentOperation.CanChangeLightState(lightsStates)) { @@ -363,24 +363,24 @@ public override void SetLightsState(GStruct164[] lightsStates, bool force = fals base.SetLightsState(lightsStates, force); } - public override void SetScopeMode(GStruct165[] scopeStates) + public override void SetScopeMode(FirearmScopeStateStruct[] scopeStates) { SendScopeStates(scopeStates); base.SetScopeMode(scopeStates); } - public override void OpticCalibrationSwitchUp(GStruct165[] scopeStates) + public override void OpticCalibrationSwitchUp(FirearmScopeStateStruct[] scopeStates) { SendScopeStates(scopeStates); base.OpticCalibrationSwitchUp(scopeStates); } - public override void OpticCalibrationSwitchDown(GStruct165[] scopeStates) + public override void OpticCalibrationSwitchDown(FirearmScopeStateStruct[] scopeStates) { SendScopeStates(scopeStates); base.OpticCalibrationSwitchDown(scopeStates); } - private void SendScopeStates(GStruct165[] scopeStates) + private void SendScopeStates(FirearmScopeStateStruct[] scopeStates) { if (!CurrentOperation.CanChangeScopeStates(scopeStates)) { @@ -393,7 +393,7 @@ private void SendScopeStates(GStruct165[] scopeStates) ScopeStatesPacket = new() { Amount = scopeStates.Length, - GStruct165 = scopeStates + FirearmScopeStateStruct = scopeStates } }); } @@ -634,7 +634,7 @@ public override void SetInventoryOpened(bool opened) SendBoltActionReloadPacket(true); } - public override void ReloadMag(MagazineClass magazine, GClass2785 gridItemAddress, Callback finishCallback, Callback startCallback) + public override void ReloadMag(MagazineClass magazine, ItemAddressClass gridItemAddress, Callback finishCallback, Callback startCallback) { base.ReloadMag(magazine, gridItemAddress, finishCallback, startCallback); SendBoltActionReloadPacket(true); @@ -646,7 +646,7 @@ public override void QuickReloadMag(MagazineClass magazine, Callback finishCallb SendBoltActionReloadPacket(true); } - public override void ReloadWithAmmo(GClass2509 ammoPack, Callback finishCallback, Callback startCallback) + public override void ReloadWithAmmo(AmmoPackReloadingClass ammoPack, Callback finishCallback, Callback startCallback) { base.ReloadWithAmmo(ammoPack, finishCallback, startCallback); SendBoltActionReloadPacket(true); @@ -671,15 +671,15 @@ public override void Reset() private bool hasSent; } - private class ReloadMagHandler(CoopPlayer coopPlayer, GClass2785 gridItemAddress, MagazineClass magazine) + private class ReloadMagHandler(CoopPlayer coopPlayer, ItemAddressClass gridItemAddress, MagazineClass magazine) { private readonly CoopPlayer coopPlayer = coopPlayer; - private readonly GClass2785 gridItemAddress = gridItemAddress; + private readonly ItemAddressClass gridItemAddress = gridItemAddress; private readonly MagazineClass magazine = magazine; public void Process(IResult error) { - GClass1539 gridItemAddressDescriptor = (gridItemAddress == null) ? null : GClass1643.FromGridItemAddress(gridItemAddress); + GClass1539 gridItemAddressDescriptor = (gridItemAddress == null) ? null : FromObjectAbstractClass.FromGridItemAddress(gridItemAddress); using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); @@ -741,15 +741,15 @@ public void Process(IResult error) } } - private class ReloadBarrelsHandler(CoopPlayer coopPlayer, GClass2785 placeToPutContainedAmmoMagazine, GClass2509 ammoPack) + private class ReloadBarrelsHandler(CoopPlayer coopPlayer, ItemAddressClass placeToPutContainedAmmoMagazine, AmmoPackReloadingClass ammoPack) { private readonly CoopPlayer coopPlayer = coopPlayer; - private readonly GClass2785 placeToPutContainedAmmoMagazine = placeToPutContainedAmmoMagazine; - private readonly GClass2509 ammoPack = ammoPack; + private readonly ItemAddressClass placeToPutContainedAmmoMagazine = placeToPutContainedAmmoMagazine; + private readonly AmmoPackReloadingClass ammoPack = ammoPack; public void Process(IResult error) { - GClass1539 gridItemAddressDescriptor = (placeToPutContainedAmmoMagazine == null) ? null : GClass1643.FromGridItemAddress(placeToPutContainedAmmoMagazine); + GClass1539 gridItemAddressDescriptor = (placeToPutContainedAmmoMagazine == null) ? null : FromObjectAbstractClass.FromGridItemAddress(placeToPutContainedAmmoMagazine); string[] ammoIds = ammoPack.GetReloadingAmmoIds(); diff --git a/Fika.Core/Coop/Components/CoopHandler.cs b/Fika.Core/Coop/Components/CoopHandler.cs index 2abe947f..61be0a34 100644 --- a/Fika.Core/Coop/Components/CoopHandler.cs +++ b/Fika.Core/Coop/Components/CoopHandler.cs @@ -431,7 +431,7 @@ 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, GClass548.Config.CharacterController.ObservedPlayerMode, + Player.EUpdateMode.Auto, BackendConfigAbstractClass.Config.CharacterController.ObservedPlayerMode, () => Singleton.Instance.Control.Settings.MouseSensitivity, () => Singleton.Instance.Control.Settings.MouseAimingSensitivity, GClass1457.Default).Result; diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index c92c0875..5644eb99 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -390,7 +390,7 @@ 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, GClass548.Config.CharacterController.BotPlayerMode, () => 1f, + Player.EUpdateMode.Auto, BackendConfigAbstractClass.Config.CharacterController.BotPlayerMode, () => 1f, () => 1f, GClass1457.Default); localPlayer.Location = Location_0.Id; @@ -756,7 +756,7 @@ 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, - GClass548.Config.CharacterController.ClientPlayerMode, getSensitivity, + BackendConfigAbstractClass.Config.CharacterController.ClientPlayerMode, getSensitivity, getAimingSensitivity, new GClass1456(), isServer ? 0 : 1000, statisticsManager); await NetManagerUtils.InitNetManager(isServer); @@ -922,7 +922,7 @@ public async Task InitPlayer(BotControllerSettings botsSettings, string backendU Logger.LogError("Can't find event prefab in resources. Path : Prefabs/HALLOWEEN_CONTROLLER"); } } - GClass786 config = GClass548.Config; + ApplicationConfigClass config = BackendConfigAbstractClass.Config; if (config.FixedFrameRate > 0f) { FixedDeltaTime = 1f / config.FixedFrameRate; @@ -961,7 +961,7 @@ private async Task CreateLocalPlayer() int num = method_12(); Player.EUpdateMode eupdateMode = Player.EUpdateMode.Auto; - if (GClass548.Config.UseHandsFastAnimator) + if (BackendConfigAbstractClass.Config.UseHandsFastAnimator) { eupdateMode = Player.EUpdateMode.Manual; } @@ -990,7 +990,7 @@ 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, GClass548.Config.CharacterController.ClientPlayerMode, + UpdateQueue, eupdateMode, Player.EUpdateMode.Auto, BackendConfigAbstractClass.Config.CharacterController.ClientPlayerMode, new Func(Class1384.class1384_0.method_3), new Func(Class1384.class1384_0.method_4), statisticsManager, null, null); @@ -1752,7 +1752,7 @@ public override void Stop(string profileId, ExitStatus exitStatus, string exitNa EnvironmentManager.Instance.Stop(); } MonoBehaviourSingleton.Instance.StartBlackScreenShow(1f, 1f, new Action(stopManager.HandleExit)); - GClass548.Config.UseSpiritPlayer = false; + BackendConfigAbstractClass.Config.UseSpiritPlayer = false; } private Task SavePlayer(CoopPlayer player, ExitStatus exitStatus, string exitName, bool fromDeath) @@ -1886,7 +1886,7 @@ private void StopFromError(string profileId, ExitStatus exitStatus) EnvironmentManager.Instance.Stop(); } MonoBehaviourSingleton.Instance.StartBlackScreenShow(1f, 1f, new Action(stopManager.ExitOverride)); - GClass548.Config.UseSpiritPlayer = false; + BackendConfigAbstractClass.Config.UseSpiritPlayer = false; } public void ToggleDebug(bool enabled) diff --git a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs index 703066c9..19229cd0 100644 --- a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs +++ b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs @@ -158,7 +158,7 @@ private IEnumerator BreakFiringLoop() } } - public override void SetScopeMode(GStruct165[] scopeStates) + public override void SetScopeMode(FirearmScopeStateStruct[] scopeStates) { _player.ProceduralWeaponAnimation.ObservedCalibration(); base.SetScopeMode(scopeStates); @@ -418,7 +418,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ChangeSightMode) { - SetScopeMode(packet.ScopeStatesPacket.GStruct165); + SetScopeMode(packet.ScopeStatesPacket.FirearmScopeStateStruct); } if (packet.ToggleLauncher) @@ -454,7 +454,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; } - GClass2785 gridItemAddress = null; + ItemAddressClass gridItemAddress = null; if (packet.ReloadMagPacket.LocationDescription != null) { using MemoryStream memoryStream = new(packet.ReloadMagPacket.LocationDescription); @@ -520,7 +520,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ReloadWithAmmo.Status == FikaSerialization.ReloadWithAmmoPacket.EReloadWithAmmoStatus.StartReload) { List bullets = FindAmmoByIds(packet.ReloadWithAmmo.AmmoIds); - GClass2509 ammoPack = new(bullets); + AmmoPackReloadingClass ammoPack = new(bullets); if (!packet.HasCylinderMagPacket) { CurrentOperation.ReloadWithAmmo(ammoPack, null, null); @@ -546,7 +546,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ReloadWithAmmo.Status == FikaSerialization.ReloadWithAmmoPacket.EReloadWithAmmoStatus.StartReload) { List bullets = FindAmmoByIds(packet.ReloadWithAmmo.AmmoIds); - GClass2509 ammoPack = new(bullets); + AmmoPackReloadingClass ammoPack = new(bullets); ReloadCylinderMagazine(ammoPack, null); } } @@ -569,7 +569,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass if (packet.ReloadLauncher.Reload) { List ammo = FindAmmoByIds(packet.ReloadLauncher.AmmoIds); - GClass2509 ammoPack = new(ammo); + AmmoPackReloadingClass ammoPack = new(ammo); ReloadGrenadeLauncher(ammoPack, null); } } @@ -580,9 +580,9 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass { List ammo = FindAmmoByIds(packet.ReloadBarrels.AmmoIds); - GClass2509 ammoPack = new(ammo); + AmmoPackReloadingClass ammoPack = new(ammo); - GClass2785 gridItemAddress = null; + ItemAddressClass gridItemAddress = null; using MemoryStream memoryStream = new(packet.ReloadBarrels.LocationDescription); using BinaryReader binaryReader = new(memoryStream); diff --git a/Fika.Core/Coop/Players/CoopPlayer.cs b/Fika.Core/Coop/Players/CoopPlayer.cs index e3236f13..95647e38 100644 --- a/Fika.Core/Coop/Players/CoopPlayer.cs +++ b/Fika.Core/Coop/Players/CoopPlayer.cs @@ -390,7 +390,7 @@ public void ClientApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBody public override void SendHeadlightsPacket(bool isSilent) { - GStruct164[] lightStates = _helmetLightControllers.Select(new Func(ClientPlayer.Class1456.class1456_0.method_0)).ToArray(); + FirearmLightStateStruct[] lightStates = _helmetLightControllers.Select(new Func(ClientPlayer.Class1456.class1456_0.method_0)).ToArray(); if (PacketSender != null) { diff --git a/Fika.Core/Networking/FikaSerialization.cs b/Fika.Core/Networking/FikaSerialization.cs index d36212cc..558f02a5 100644 --- a/Fika.Core/Networking/FikaSerialization.cs +++ b/Fika.Core/Networking/FikaSerialization.cs @@ -270,14 +270,14 @@ public static PlayerInfoPacket Deserialize(NetDataReader reader) public struct LightStatesPacket { public int Amount; - public GStruct164[] LightStates; + public FirearmLightStateStruct[] LightStates; public static LightStatesPacket Deserialize(NetDataReader reader) { LightStatesPacket packet = new(); packet.Amount = reader.GetInt(); if (packet.Amount > 0) { - packet.LightStates = new GStruct164[packet.Amount]; + packet.LightStates = new FirearmLightStateStruct[packet.Amount]; for (int i = 0; i < packet.Amount; i++) { packet.LightStates[i] = new() @@ -309,14 +309,14 @@ public static void Serialize(NetDataWriter writer, LightStatesPacket packet) public struct HeadLightsPacket { public int Amount; - public GStruct164[] LightStates; + public FirearmLightStateStruct[] LightStates; public static HeadLightsPacket Deserialize(NetDataReader reader) { HeadLightsPacket packet = new(); packet.Amount = reader.GetInt(); if (packet.Amount > 0) { - packet.LightStates = new GStruct164[packet.Amount]; + packet.LightStates = new FirearmLightStateStruct[packet.Amount]; for (int i = 0; i < packet.Amount; i++) { packet.LightStates[i] = new() @@ -348,17 +348,17 @@ public static void Serialize(NetDataWriter writer, HeadLightsPacket packet) public struct ScopeStatesPacket { public int Amount; - public GStruct165[] GStruct165; + public FirearmScopeStateStruct[] FirearmScopeStateStruct; public static ScopeStatesPacket Deserialize(NetDataReader reader) { ScopeStatesPacket packet = new(); packet.Amount = reader.GetInt(); if (packet.Amount > 0) { - packet.GStruct165 = new GStruct165[packet.Amount]; + packet.FirearmScopeStateStruct = new FirearmScopeStateStruct[packet.Amount]; for (int i = 0; i < packet.Amount; i++) { - packet.GStruct165[i] = new() + packet.FirearmScopeStateStruct[i] = new() { Id = reader.GetString(), ScopeMode = reader.GetInt(), @@ -377,10 +377,10 @@ public static void Serialize(NetDataWriter writer, ScopeStatesPacket packet) { for (int i = 0; i < packet.Amount; i++) { - writer.Put(packet.GStruct165[i].Id); - writer.Put(packet.GStruct165[i].ScopeMode); - writer.Put(packet.GStruct165[i].ScopeIndexInsideSight); - writer.Put(packet.GStruct165[i].ScopeCalibrationIndex); + writer.Put(packet.FirearmScopeStateStruct[i].Id); + writer.Put(packet.FirearmScopeStateStruct[i].ScopeMode); + writer.Put(packet.FirearmScopeStateStruct[i].ScopeIndexInsideSight); + writer.Put(packet.FirearmScopeStateStruct[i].ScopeCalibrationIndex); } } } diff --git a/Fika.Core/Networking/FikaServer.cs b/Fika.Core/Networking/FikaServer.cs index 15a158ac..9b204127 100644 --- a/Fika.Core/Networking/FikaServer.cs +++ b/Fika.Core/Networking/FikaServer.cs @@ -808,7 +808,7 @@ internal void HandleResult(IResult result) using MemoryStream memoryStream = new(); using BinaryWriter binaryWriter = new(memoryStream); - binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(opResult.Value, false)); + binaryWriter.WritePolymorph(FromObjectAbstractClass.FromInventoryOperation(opResult.Value, false)); byte[] opBytes = memoryStream.ToArray(); packet.ItemControllerExecutePacket = new() { diff --git a/References/hollowed.dll b/References/hollowed.dll index ae1f44d2..4d938e1f 100644 Binary files a/References/hollowed.dll and b/References/hollowed.dll differ