Skip to content

Commit

Permalink
Update to 30449
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jun 6, 2024
1 parent 129868b commit e894a06
Show file tree
Hide file tree
Showing 28 changed files with 171 additions and 172 deletions.
2 changes: 1 addition & 1 deletion Fika.Core/Coop/Airdrops/Utils/FikaItemFactoryUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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<GameWorld>.Instance.MainPlayer.GClass2774_0.NextId;
item.Id = Singleton<GameWorld>.Instance.MainPlayer.GClass2776_0.NextId;
LootItem.CreateLootContainer(container, item, "CRATE", Singleton<GameWorld>.Instance);
}
else
Expand Down
2 changes: 1 addition & 1 deletion Fika.Core/Coop/BotClasses/CoopBotHealthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fika.Core.Coop.ClientClasses
{
public sealed class CoopBotHealthController(Profile.GClass1766 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth)
public sealed class CoopBotHealthController(Profile.GClass1767 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth)
: PlayerHealthController(healthInfo, player, inventoryController, skillManager, aiHealth)
{
private readonly CoopBot coopBot = (CoopBot)player;
Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Coop/BotClasses/CoopBotInventoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CoopBotInventoryController(Player player, Profile profile, bool exa
{
private readonly CoopBot CoopBot = (CoopBot)player;

public override void Execute(GClass2850 operation, [CanBeNull] Callback callback)
public override void Execute(GClass2853 operation, [CanBeNull] Callback callback)
{
base.Execute(operation, callback);

Expand All @@ -25,7 +25,7 @@ public override void Execute(GClass2850 operation, [CanBeNull] Callback callback

using MemoryStream memoryStream = new();
using BinaryWriter binaryWriter = new(memoryStream);
binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(operation, false));
binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(operation, false));
byte[] opBytes = memoryStream.ToArray();
packet.ItemControllerExecutePacket = new()
{
Expand Down
2 changes: 1 addition & 1 deletion Fika.Core/Coop/ClientClasses/CoopClientHealthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Fika.Core.Coop.ClientClasses
{
public sealed class CoopClientHealthController(Profile.GClass1766 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth)
public sealed class CoopClientHealthController(Profile.GClass1767 healthInfo, Player player, InventoryControllerClass inventoryController, SkillManager skillManager, bool aiHealth)
: PlayerHealthController(healthInfo, player, inventoryController, skillManager, aiHealth)
{
private readonly CoopPlayer coopPlayer = (CoopPlayer)player;
Expand Down
18 changes: 9 additions & 9 deletions Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public override void CallMalfunctionRepaired(Weapon weapon)
}
}

public override void Execute(GClass2850 operation, [CanBeNull] Callback callback)
public override void Execute(GClass2853 operation, [CanBeNull] Callback callback)
{
#if DEBUG
ConsoleScreen.Log("InvOperation: " + operation.GetType().Name);
#endif

// Do not replicate picking up quest items, throws an error on the other clients
if (operation is GClass2852 pickupOperation)
if (operation is GClass2855 pickupOperation)
{
if (pickupOperation.Item.Template.QuestItem)
{
Expand Down Expand Up @@ -67,7 +67,7 @@ public override void Execute(GClass2850 operation, [CanBeNull] Callback callback

using MemoryStream memoryStream = new();
using BinaryWriter binaryWriter = new(memoryStream);
binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(operation, false));
binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(operation, false));
byte[] opBytes = memoryStream.ToArray();
packet.ItemControllerExecutePacket = new()
{
Expand Down Expand Up @@ -103,12 +103,12 @@ public override void Execute(GClass2850 operation, [CanBeNull] Callback callback
inventoryController = this
};

clientOperationManager.callback ??= new Callback(ClientPlayer.Control0.Class1422.class1422_0.method_0);
clientOperationManager.callback ??= new Callback(ClientPlayer.Control0.Class1426.class1426_0.method_0);
uint operationNum = AddOperationCallback(operation, new Callback<EOperationStatus>(clientOperationManager.HandleResult));

using MemoryStream memoryStream = new();
using BinaryWriter binaryWriter = new(memoryStream);
binaryWriter.WritePolymorph(GClass1642.FromInventoryOperation(operation, false));
binaryWriter.WritePolymorph(GClass1643.FromInventoryOperation(operation, false));
byte[] opBytes = memoryStream.ToArray();
packet.ItemControllerExecutePacket = new()
{
Expand All @@ -120,17 +120,17 @@ public override void Execute(GClass2850 operation, [CanBeNull] Callback callback
}
}

private uint AddOperationCallback(GClass2850 operation, Callback<EOperationStatus> callback)
private uint AddOperationCallback(GClass2853 operation, Callback<EOperationStatus> callback)
{
ushort id = operation.Id;
CoopPlayer.OperationCallbacks.Add(id, callback);
return id;
}

private class HostInventoryOperationManager(CoopClientInventoryController inventoryController, GClass2850 operation, Callback callback)
private class HostInventoryOperationManager(CoopClientInventoryController inventoryController, GClass2853 operation, Callback callback)
{
public readonly CoopClientInventoryController inventoryController = inventoryController;
public GClass2850 operation = operation;
public GClass2853 operation = operation;
public readonly Callback callback = callback;

public void HandleResult(IResult result)
Expand All @@ -147,7 +147,7 @@ private class ClientInventoryOperationManager
{
public EOperationStatus? serverOperationStatus;
public EOperationStatus? localOperationStatus;
public GClass2850 operation;
public GClass2853 operation;
public Callback callback;
public CoopClientInventoryController inventoryController;

Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Coop/ClientClasses/CoopClientStatisticsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Fika.Core.Coop.ClientClasses
{
public sealed class CoopClientStatisticsManager(Profile profile) : GClass1800()
public sealed class CoopClientStatisticsManager(Profile profile) : GClass1802()
{
public Profile Profile = profile;

Expand All @@ -17,7 +17,7 @@ public override void ShowStatNotification(LocalizationKey localizationKey1, Loca
{
if (value > 0)
{
NotificationManagerClass.DisplayNotification(new GClass2053(localizationKey1, localizationKey2, value));
NotificationManagerClass.DisplayNotification(new GClass2055(localizationKey1, localizationKey2, value));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override Dictionary<Type, OperationFactoryDelegate> GetOperationFactoryDe
return operationFactoryDelegates;
}

public Player.GClass1593 Weapon1()
public Player.GClass1594 Weapon1()
{
if (Item.ReloadMode == Weapon.EReloadMode.InternalMagazine && Item.Chambers.Length == 0)
{
Expand All @@ -60,32 +60,32 @@ public Player.GClass1593 Weapon1()
return new FirearmClass2(this);
}

public Player.GClass1593 Weapon2()
public Player.GClass1594 Weapon2()
{
return new FirearmClass1(this);
}

public Player.GClass1593 Weapon3()
public Player.GClass1594 Weapon3()
{
if (Item.IsFlareGun)
{
return new GClass1615(this);
return new GClass1616(this);
}
if (Item.IsOneOff)
{
return new GClass1617(this);
return new GClass1618(this);
}
if (Item.ReloadMode == Weapon.EReloadMode.OnlyBarrel)
{
return new GClass1614(this);
return new GClass1615(this);
}
if (Item is GClass2708)
if (Item is GClass2710)
{
return new GClass1613(this);
return new GClass1614(this);
}
if (!Item.BoltAction)
{
return new GClass1611(this);
return new GClass1612(this);
}
return new FirearmClass4(this);
}
Expand Down Expand Up @@ -197,7 +197,7 @@ public override bool ExamineWeapon()
return flag;
}

public override void InitiateShot(GInterface336 weapon, BulletClass ammo, Vector3 shotPosition, Vector3 shotDirection, Vector3 fireportPosition, int chamberIndex, float overheat)
public override void InitiateShot(GInterface337 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(GClass2506 ammoPack, GClass2782 placeToPutContainedAmmoMagazine, Callback callback)
public override void ReloadBarrels(GClass2508 ammoPack, GClass2784 placeToPutContainedAmmoMagazine, Callback callback)
{
if (!CanStartReload() && ammoPack.AmmoCount < 1)
{
Expand All @@ -279,7 +279,7 @@ public override void ReloadBarrels(GClass2506 ammoPack, GClass2782 placeToPutCon
CurrentOperation.ReloadBarrels(ammoPack, placeToPutContainedAmmoMagazine, callback, new Callback(handler.Process));
}

public override void ReloadCylinderMagazine(GClass2506 ammoPack, Callback callback, bool quickReload = false)
public override void ReloadCylinderMagazine(GClass2508 ammoPack, Callback callback, bool quickReload = false)
{
if (Blindfire)
{
Expand All @@ -299,7 +299,7 @@ public override void ReloadCylinderMagazine(GClass2506 ammoPack, Callback callba
CurrentOperation.ReloadCylinderMagazine(ammoPack, callback, new Callback(handler.Process), handler.quickReload);
}

public override void ReloadGrenadeLauncher(GClass2506 ammoPack, Callback callback)
public override void ReloadGrenadeLauncher(GClass2508 ammoPack, Callback callback)
{
if (!CanStartReload())
{
Expand All @@ -320,7 +320,7 @@ public override void ReloadGrenadeLauncher(GClass2506 ammoPack, Callback callbac
});
}

public override void ReloadMag(MagazineClass magazine, GClass2782 gridItemAddress, Callback callback)
public override void ReloadMag(MagazineClass magazine, GClass2784 gridItemAddress, Callback callback)
{
if (!CanStartReload() || Blindfire)
{
Expand All @@ -331,7 +331,7 @@ public override void ReloadMag(MagazineClass magazine, GClass2782 gridItemAddres
CurrentOperation.ReloadMag(magazine, gridItemAddress, callback, new Callback(handler.Process));
}

public override void ReloadWithAmmo(GClass2506 ammoPack, Callback callback)
public override void ReloadWithAmmo(GClass2508 ammoPack, Callback callback)
{
if (Item.GetCurrentMagazine() == null)
{
Expand Down Expand Up @@ -550,7 +550,7 @@ private void SendBoltActionReloadPacket()
});
}

private class FirearmClass1(Player.FirearmController controller) : GClass1599(controller)
private class FirearmClass1(Player.FirearmController controller) : GClass1600(controller)
{
public override void SetTriggerPressed(bool pressed)
{
Expand Down Expand Up @@ -634,7 +634,7 @@ public override void SetInventoryOpened(bool opened)
SendBoltActionReloadPacket(true);
}

public override void ReloadMag(MagazineClass magazine, GClass2782 gridItemAddress, Callback finishCallback, Callback startCallback)
public override void ReloadMag(MagazineClass magazine, GClass2784 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(GClass2506 ammoPack, Callback finishCallback, Callback startCallback)
public override void ReloadWithAmmo(GClass2508 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, GClass2782 gridItemAddress, MagazineClass magazine)
private class ReloadMagHandler(CoopPlayer coopPlayer, GClass2784 gridItemAddress, MagazineClass magazine)
{
private readonly CoopPlayer coopPlayer = coopPlayer;
private readonly GClass2782 gridItemAddress = gridItemAddress;
private readonly GClass2784 gridItemAddress = gridItemAddress;
private readonly MagazineClass magazine = magazine;

public void Process(IResult error)
{
GClass1538 gridItemAddressDescriptor = (gridItemAddress == null) ? null : GClass1642.FromGridItemAddress(gridItemAddress);
GClass1539 gridItemAddressDescriptor = (gridItemAddress == null) ? null : GClass1643.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, GClass2782 placeToPutContainedAmmoMagazine, GClass2506 ammoPack)
private class ReloadBarrelsHandler(CoopPlayer coopPlayer, GClass2784 placeToPutContainedAmmoMagazine, GClass2508 ammoPack)
{
private readonly CoopPlayer coopPlayer = coopPlayer;
private readonly GClass2782 placeToPutContainedAmmoMagazine = placeToPutContainedAmmoMagazine;
private readonly GClass2506 ammoPack = ammoPack;
private readonly GClass2784 placeToPutContainedAmmoMagazine = placeToPutContainedAmmoMagazine;
private readonly GClass2508 ammoPack = ammoPack;

public void Process(IResult error)
{
GClass1538 gridItemAddressDescriptor = (placeToPutContainedAmmoMagazine == null) ? null : GClass1642.FromGridItemAddress(placeToPutContainedAmmoMagazine);
GClass1539 gridItemAddressDescriptor = (placeToPutContainedAmmoMagazine == null) ? null : GClass1643.FromGridItemAddress(placeToPutContainedAmmoMagazine);

string[] ammoIds = ammoPack.GetReloadingAmmoIds();

Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Coop/FreeCamera/FreeCameraController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ private void ClearEffects()
Destroy(bloodOnScreen);
}

List<EffectsController.Class572> effectsManagerList = effectsController.Field("list_0").GetValue<List<EffectsController.Class572>>();
List<EffectsController.Class576> effectsManagerList = effectsController.Field("list_0").GetValue<List<EffectsController.Class576>>();
if (effectsManagerList != null)
{
foreach (EffectsController.Class572 effectsManager in effectsManagerList)
foreach (EffectsController.Class576 effectsManager in effectsManagerList)
{
while (effectsManager.ActiveEffects.Count > 0)
{
Expand Down
Loading

0 comments on commit e894a06

Please sign in to comment.