Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev > main #95

Merged
merged 32 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
31f590c
Don't show cancel button as scav
Lacyway Jul 9, 2024
015582b
Update 'IsSingleplayer'
Lacyway Jul 9, 2024
8b0776e
Disable chat by default
Lacyway Jul 9, 2024
084846b
Improve inertia classes
Lacyway Jul 9, 2024
dd58015
Cleanup LocalGamePatch
Lacyway Jul 10, 2024
70b8465
Add SniperScav filter option to Dynamic AI
Lacyway Jul 10, 2024
48c87e4
Remove FasterInventoryScroll option
Lacyway Jul 10, 2024
7be690f
Remove warnings
Lacyway Jul 10, 2024
eabced7
Rework rep handling
Lacyway Jul 10, 2024
c746460
Fix 'ChangeStatus'
Lacyway Jul 10, 2024
1cf4e4b
Improve rep gains
Lacyway Jul 10, 2024
b3c4409
Fix fence penalty for scav kills as PMC
Lacyway Jul 10, 2024
3610280
Update 'OnSkillLevelChanged'
Lacyway Jul 11, 2024
9ff5aca
Update bool name
Lacyway Jul 11, 2024
ac84a41
Run SPT's AirdropBox instead of FikaAirdropBox
ArchangelWTF Jul 13, 2024
46515f9
Patch AirdropBox's AddNavMeshObstacle
ArchangelWTF Jul 13, 2024
cbcae35
Add logging when extract key is pressed to make it easier in support …
ArchangelWTF Jul 14, 2024
ab8d720
Add command to forcefully despawn all AI for debug purposes
ArchangelWTF Jul 14, 2024
87c49ca
Include all other private internet ranges as defined in RFC1918
ArchangelWTF Jul 14, 2024
f5a51fa
Add better checking for the 20 bit block defined in RFC1918
ArchangelWTF Jul 14, 2024
0a41a1f
Merge pull request #90 from ArchangelWTF/fix/airdrop_detection
Lacyway Jul 14, 2024
8e4dc07
Merge pull request #93 from ArchangelWTF/fix/small-changes
Lacyway Jul 14, 2024
de4e8f7
Only run rep on own profile
Lacyway Jul 14, 2024
053a583
Disable quest sharing after extracting
Lacyway Jul 14, 2024
3f5d0c9
Wait for host to be ready before counting down (mod compat)
Lacyway Jul 14, 2024
c4ae7bf
Fix boolean not being set when receiving packet
Lacyway Jul 14, 2024
63a6129
Fix scav rep
Lacyway Jul 14, 2024
47f473b
Update path when downloading profile
Lacyway Jul 15, 2024
0e7b387
Add quest sharing notification setting
Lacyway Jul 15, 2024
92e2f24
Change status from waiting for other players to finish loading to som…
ArchangelWTF Jul 15, 2024
f228201
Merge pull request #94 from ArchangelWTF/change/status-vmethod4
Lacyway Jul 15, 2024
f1b8567
Update mm text
Lacyway Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Fika.Core/Console/FikaCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Fika.Core.Coop.GameMode;
using Fika.Core.Coop.Players;
using Fika.Core.Coop.Utils;
using System.Collections.Generic;

namespace Fika.Core.Console
{
Expand Down Expand Up @@ -113,6 +114,36 @@ public static void Extract()

coopGame.Extract(localPlayer, null);
}

[ConsoleCommand("despawnallai", "", null, "Despawns all AI Bots", [])]
public static void DespawnAllAI()
{
if (Singleton<IFikaGame>.Instance is CoopGame game)
{
if (!FikaBackendUtils.IsServer)
{
ConsoleScreen.LogWarning("You are not the host.");
return;
}

CoopHandler.TryGetCoopHandler(out CoopHandler coopHandler);

List<IPlayer> Bots = new List<IPlayer>(game.BotsController.Players);

foreach (Player bot in Bots)
{
if (bot.AIData.BotOwner == null)
{
continue;
}

ConsoleScreen.Log($"Despawning: {bot.Profile.Nickname}");

game.DespawnBot(coopHandler, bot);
}
}
}

#endif

[ConsoleCommand("debug", "", null, "Toggle debug window", [])]
Expand Down
260 changes: 0 additions & 260 deletions Fika.Core/Coop/Airdrops/FikaAirdropBox.cs

This file was deleted.

35 changes: 18 additions & 17 deletions Fika.Core/Coop/Airdrops/FikaAirdropsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Fika.Core.Networking;
using LiteNetLib;
using LiteNetLib.Utils;
using SPT.Custom.Airdrops;
using System;
using System.Collections;
using UnityEngine;
Expand All @@ -25,7 +26,7 @@ namespace Coop.Airdrops
public class FikaAirdropsManager : MonoBehaviour
{
private FikaAirdropPlane airdropPlane;
private FikaAirdropBox AirdropBox;
private AirdropBox AirdropBox;
private FikaItemFactoryUtil factory;
public bool isFlareDrop;
public FikaAirdropParametersModel AirdropParameters { get; set; }
Expand Down Expand Up @@ -111,7 +112,7 @@ protected async void Start()
airdropPlane = await FikaAirdropPlane.Init(AirdropParameters.RandomAirdropPoint,
AirdropParameters.DropHeight, AirdropParameters.Config.PlaneVolume,
AirdropParameters.Config.PlaneSpeed);
AirdropBox = await FikaAirdropBox.Init(AirdropParameters.Config.CrateFallSpeed);
AirdropBox = await AirdropBox.Init(AirdropParameters.Config.CrateFallSpeed);
factory = new FikaItemFactoryUtil();
}
catch
Expand Down Expand Up @@ -177,18 +178,18 @@ protected async void FixedUpdate()
airdropPlane = await FikaAirdropPlane.Init(AirdropParameters.SpawnPoint, AirdropParameters.DropHeight, AirdropParameters.Config.PlaneVolume,
AirdropParameters.Config.PlaneSpeed, true, AirdropParameters.LookPoint);

AirdropBox = await FikaAirdropBox.Init(AirdropParameters.Config.CrateFallSpeed);
AirdropBox = await AirdropBox.Init(AirdropParameters.Config.CrateFallSpeed);
factory = new FikaItemFactoryUtil();

factory.BuildClientContainer(AirdropBox.Container, rootItem);
factory.BuildClientContainer(AirdropBox.container, rootItem);

if (AirdropBox.Container != null && CoopHandler.TryGetCoopHandler(out CoopHandler coopHandler))
if (AirdropBox.container != null && CoopHandler.TryGetCoopHandler(out CoopHandler coopHandler))
{
if (!string.IsNullOrEmpty(ContainerId))
{
AirdropBox.Container.Id = ContainerId;
coopHandler.ListOfInteractiveObjects.Add(ContainerId, AirdropBox.Container);
Logger.LogInfo($"Adding AirdropBox {AirdropBox.Container.Id} to interactive objects.");
AirdropBox.container.Id = ContainerId;
coopHandler.ListOfInteractiveObjects.Add(ContainerId, AirdropBox.container);
Logger.LogInfo($"Adding AirdropBox {AirdropBox.container.Id} to interactive objects.");
}
else
{
Expand Down Expand Up @@ -281,19 +282,19 @@ private void BuildLootContainer(FikaAirdropConfigModel config)
throw new Exception("Airdrops. Tried to BuildLootContainer without any Loot.");
}

factory.BuildContainer(AirdropBox.Container, config, lootData.DropType);
factory.AddLoot(AirdropBox.Container, lootData);
factory.BuildContainer(AirdropBox.container, config, lootData.DropType);
factory.AddLoot(AirdropBox.container, lootData);

if (AirdropBox.Container != null && CoopHandler.TryGetCoopHandler(out CoopHandler coopHandler))
if (AirdropBox.container != null && CoopHandler.TryGetCoopHandler(out CoopHandler coopHandler))
{
if (coopHandler.GetInteractiveObject(AirdropBox.Container.Id, out _))
if (coopHandler.GetInteractiveObject(AirdropBox.container.Id, out _))
{
Logger.LogInfo("Existing crate already exists, setting value to " + ContainerCount);
AirdropBox.Container.Id = AirdropBox.Container.Id + $"_{ContainerCount}";
AirdropBox.container.Id = AirdropBox.container.Id + $"_{ContainerCount}";
ContainerCount++;
}
coopHandler.ListOfInteractiveObjects.Add(AirdropBox.Container.Id, AirdropBox.Container);
Logger.LogInfo($"Adding AirdropBox {AirdropBox.Container.Id} to interactive objects.");
coopHandler.ListOfInteractiveObjects.Add(AirdropBox.container.Id, AirdropBox.container);
Logger.LogInfo($"Adding AirdropBox {AirdropBox.container.Id} to interactive objects.");
}

// Get the lootData. Send to clients.
Expand Down Expand Up @@ -343,12 +344,12 @@ private IEnumerator SendLootToClients(bool isFlare = false)

Logger.LogInfo("Sending Airdrop Loot to clients.");

Item rootItem = AirdropBox.Container.ItemOwner.RootItem;
Item rootItem = AirdropBox.container.ItemOwner.RootItem;

AirdropLootPacket lootPacket = new()
{
RootItem = rootItem,
ContainerId = AirdropBox.Container.Id
ContainerId = AirdropBox.container.Id
};

NetDataWriter writer = new();
Expand Down
Loading