Skip to content

Commit

Permalink
Init branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 23, 2024
1 parent e2075c6 commit e566206
Show file tree
Hide file tree
Showing 37 changed files with 396 additions and 460 deletions.
2 changes: 1 addition & 1 deletion Fika.Core/AkiSupport/Airdrops/Utils/FikaItemFactoryUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GameWorld>.Instance.MainPlayer.GClass2761_0.NextId;
item.Id = Singleton<GameWorld>.Instance.MainPlayer.GClass2774_0.NextId;
LootItem.CreateLootContainer(container, item, "CRATE", Singleton<GameWorld>.Instance);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private static bool PatchPrefix(BotsController __instance, IPlayer aggressor, IP
}

BotZone botZone = groupOwner.AIData.BotOwner.BotsGroup.BotZone;
foreach (KeyValuePair<BotZone, GClass492> item in __instance.Groups())
foreach (KeyValuePair<BotZone, GClass491> item in __instance.Groups())
{
if (item.Key != botZone)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<BaseDropDownBox.Struct945> labelList = Traverse.Create(____playersSpawnPlaceDropdown).Field("list_0").GetValue<List<BaseDropDownBox.Struct945>>();
List<BaseDropDownBox.Struct966> labelList = Traverse.Create(____playersSpawnPlaceDropdown).Field("list_0").GetValue<List<BaseDropDownBox.Struct966>>();
labelList.Clear();
labelList.Add(new()
{
Expand Down
6 changes: 3 additions & 3 deletions 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.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;
Expand All @@ -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;
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(GClass2837 operation, [CanBeNull] Callback callback)
public override void Execute(GClass2850 operation, [CanBeNull] Callback callback)
{
base.Execute(operation, callback);

Expand All @@ -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()
{
Expand Down
6 changes: 3 additions & 3 deletions 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.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;
Expand All @@ -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;
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,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)
{
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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<EOperationStatus>(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()
{
Expand All @@ -116,17 +116,17 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback
}
}

private uint AddOperationCallback(GClass2837 operation, Callback<EOperationStatus> callback)
private uint AddOperationCallback(GClass2850 operation, Callback<EOperationStatus> 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)
Expand All @@ -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;

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) : GClass1790()
public sealed class CoopClientStatisticsManager(Profile profile) : GClass1800()
{
public Profile Profile = profile;

Expand All @@ -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));
}
}
}
Expand Down
Loading

0 comments on commit e566206

Please sign in to comment.