Skip to content

Commit

Permalink
Update to latest bins
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jun 14, 2024
1 parent 510bb1b commit aba1e79
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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())
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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))
{
Expand All @@ -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))
{
Expand All @@ -393,7 +393,7 @@ private void SendScopeStates(GStruct165[] scopeStates)
ScopeStatesPacket = new()
{
Amount = scopeStates.Length,
GStruct165 = scopeStates
FirearmScopeStateStruct = scopeStates
}
});
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion Fika.Core/Coop/Components/CoopHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SharedGameSettingsClass>.Instance.Control.Settings.MouseSensitivity,
() => Singleton<SharedGameSettingsClass>.Instance.Control.Settings.MouseAimingSensitivity,
GClass1457.Default).Result;
Expand Down
14 changes: 7 additions & 7 deletions Fika.Core/Coop/GameMode/CoopGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private async Task<LocalPlayer> 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;
Expand Down Expand Up @@ -756,7 +756,7 @@ public override async Task<LocalPlayer> 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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -961,7 +961,7 @@ private async Task<Player> CreateLocalPlayer()
int num = method_12();

Player.EUpdateMode eupdateMode = Player.EUpdateMode.Auto;
if (GClass548.Config.UseHandsFastAnimator)
if (BackendConfigAbstractClass.Config.UseHandsFastAnimator)
{
eupdateMode = Player.EUpdateMode.Manual;
}
Expand Down Expand Up @@ -990,7 +990,7 @@ private async Task<Player> 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<float>(Class1384.class1384_0.method_3), new Func<float>(Class1384.class1384_0.method_4),
statisticsManager, null, null);

Expand Down Expand Up @@ -1752,7 +1752,7 @@ public override void Stop(string profileId, ExitStatus exitStatus, string exitNa
EnvironmentManager.Instance.Stop();
}
MonoBehaviourSingleton<PreloaderUI>.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)
Expand Down Expand Up @@ -1886,7 +1886,7 @@ private void StopFromError(string profileId, ExitStatus exitStatus)
EnvironmentManager.Instance.Stop();
}
MonoBehaviourSingleton<PreloaderUI>.Instance.StartBlackScreenShow(1f, 1f, new Action(stopManager.ExitOverride));
GClass548.Config.UseSpiritPlayer = false;
BackendConfigAbstractClass.Config.UseSpiritPlayer = false;
}

public void ToggleDebug(bool enabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -520,7 +520,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass
if (packet.ReloadWithAmmo.Status == FikaSerialization.ReloadWithAmmoPacket.EReloadWithAmmoStatus.StartReload)
{
List<BulletClass> bullets = FindAmmoByIds(packet.ReloadWithAmmo.AmmoIds);
GClass2509 ammoPack = new(bullets);
AmmoPackReloadingClass ammoPack = new(bullets);
if (!packet.HasCylinderMagPacket)
{
CurrentOperation.ReloadWithAmmo(ammoPack, null, null);
Expand All @@ -546,7 +546,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass
if (packet.ReloadWithAmmo.Status == FikaSerialization.ReloadWithAmmoPacket.EReloadWithAmmoStatus.StartReload)
{
List<BulletClass> bullets = FindAmmoByIds(packet.ReloadWithAmmo.AmmoIds);
GClass2509 ammoPack = new(bullets);
AmmoPackReloadingClass ammoPack = new(bullets);
ReloadCylinderMagazine(ammoPack, null);
}
}
Expand All @@ -569,7 +569,7 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass
if (packet.ReloadLauncher.Reload)
{
List<BulletClass> ammo = FindAmmoByIds(packet.ReloadLauncher.AmmoIds);
GClass2509 ammoPack = new(ammo);
AmmoPackReloadingClass ammoPack = new(ammo);
ReloadGrenadeLauncher(ammoPack, null);
}
}
Expand All @@ -580,9 +580,9 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass
{
List<BulletClass> 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);
Expand Down
2 changes: 1 addition & 1 deletion Fika.Core/Coop/Players/CoopPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public void ClientApplyShot(DamageInfo damageInfo, EBodyPart bodyPartType, EBody

public override void SendHeadlightsPacket(bool isSilent)
{
GStruct164[] lightStates = _helmetLightControllers.Select(new Func<TacticalComboVisualController, GStruct164>(ClientPlayer.Class1456.class1456_0.method_0)).ToArray();
FirearmLightStateStruct[] lightStates = _helmetLightControllers.Select(new Func<TacticalComboVisualController, FirearmLightStateStruct>(ClientPlayer.Class1456.class1456_0.method_0)).ToArray();

if (PacketSender != null)
{
Expand Down
Loading

0 comments on commit aba1e79

Please sign in to comment.