Skip to content

Commit

Permalink
Merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 4, 2024
2 parents 499a83b + 4f5f13b commit 2129ce7
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 62 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: .NET Test

on:
workflow_dispatch:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'

jobs:
test:
runs-on: ubuntu-latest

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.FIKA_GITMODULES }}

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Install dependencies
run: dotnet restore --configfile Nuget.config

- name: Build
run: dotnet build --nologo --no-restore --configuration Debug

- name: Test
run: dotnet test --nologo --no-restore --no-build --blame-hang-timeout 1min

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,4 @@ FodyWeavers.xsd
# Fika
/Build
/Properties/private.snk
/Properties/public.snk
/References
/Properties/public.snk
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "References"]
path = References
url = https://github.com/project-fika/References.git
46 changes: 0 additions & 46 deletions .vscode/tasks.json

This file was deleted.

61 changes: 61 additions & 0 deletions Fika-Plugin.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"folders": [
{
"path": "."
}
],
"tasks": {
"version": "2.0.0",
"options": {
"env": {
"DOTNET_NOLOGO": "yes",
"DOTNET_CLI_TELEMETRY_OPTOUT": "yes"
}
},
"tasks": [
{
"label": "dotnet: restore",
"type": "shell",
"command": "dotnet restore --nologo",
},
{
"label": "dotnet: build debug",
"type": "shell",
"command": "dotnet build --nologo --no-restore --configuration Debug",
"dependsOrder": "sequence",
"dependsOn": "dotnet: restore",
"group": {
"kind": "build"
}
},
{
"label": "dotnet: build release",
"type": "shell",
"command": "dotnet build --nologo --no-restore --configuration Release",
"dependsOrder": "sequence",
"dependsOn": "dotnet: restore",
"group": {
"kind": "build"
}
},
{
"label": "dotnet: build gold-master",
"type": "shell",
"command": "dotnet build --nologo --no-restore --configuration GoldMaster",
"dependsOrder": "sequence",
"dependsOn": "dotnet: restore",
"group": {
"kind": "build"
}
}
]
},
"settings": {
"window.title": "Fika.Plugin"
},
"extensions": {
"recommendations": [
"ms-dotnettools.csharp"
]
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions Fika.Core/Coop/GameMode/CoopGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ private bool TryDespawnFurthest(Profile profile, Vector3 position, CoopHandler c
}

//Dont despawn inside of dynamic AI range
if (furthestDistance < FikaPlugin.DynamicAIRange.Value * FikaPlugin.DynamicAIRange.Value) //Square it because we use sqrMagnitude for distance calculation
if (furthestDistance < FikaPlugin.DespawnMinimumDistance.Value * FikaPlugin.DespawnMinimumDistance.Value) //Square it because we use sqrMagnitude for distance calculation
{
#if DEBUG
Logger.LogWarning($"We're not despawning anything. Furthest despawnable bot is inside DynamicAI range.");
Logger.LogWarning($"We're not despawning anything. Furthest despawnable bot is inside minimum despawn range.");
#endif
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion Fika.Core/Fika.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\References\Assembly-CSharp.dll</HintPath>
<HintPath>..\References\hollowed.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="bsg.componentace.compression.libs.zlib">
Expand Down
14 changes: 8 additions & 6 deletions Fika.Core/FikaPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ public class FikaPlugin : BaseUnityPlugin
public static ConfigEntry<KeyboardShortcut> FreeCamButton { get; set; }

// Performance
public static ConfigEntry<bool> EnforcedSpawnLimits { get; set; }
public static ConfigEntry<bool> DespawnFurthest { get; set; }
public static ConfigEntry<bool> DynamicAI { get; set; }
public static ConfigEntry<float> DynamicAIRange { get; set; }
public static ConfigEntry<DynamicAIRates> DynamicAIRate { get; set; }
public static ConfigEntry<bool> CullPlayers { get; set; }
public static ConfigEntry<float> CullingRange { get; set; }

// Bot Limits
// Performance | Bot Limits
public static ConfigEntry<bool> EnforcedSpawnLimits { get; set; }
public static ConfigEntry<bool> DespawnFurthest { get; set; }
public static ConfigEntry<float> DespawnMinimumDistance { get; set; }
public static ConfigEntry<int> MaxBotsFactory { get; set; }
public static ConfigEntry<int> MaxBotsCustoms { get; set; }
public static ConfigEntry<int> MaxBotsInterchange { get; set; }
Expand Down Expand Up @@ -295,9 +295,11 @@ private void SetupConfig()

// Performance | Max Bots

EnforcedSpawnLimits = Config.Bind("Performance | Max Bots", "Enforced Spawn Limits", false, new ConfigDescription("Enforces spawn limits when spawning bots, making sure to not go over the vanilla limits. This mainly takes affect when using spawn mods or anything that modifies the bot limits. Will not block spawns of special bots like bosses.", tags: new ConfigurationManagerAttributes() { Order = 13 }));
EnforcedSpawnLimits = Config.Bind("Performance | Max Bots", "Enforced Spawn Limits", false, new ConfigDescription("Enforces spawn limits when spawning bots, making sure to not go over the vanilla limits. This mainly takes affect when using spawn mods or anything that modifies the bot limits. Will not block spawns of special bots like bosses.", tags: new ConfigurationManagerAttributes() { Order = 14 }));

DespawnFurthest = Config.Bind("Performance | Max Bots", "Despawn Furthest", false, new ConfigDescription("When enforcing spawn limits, should the furthest bot be de-spawned instead of blocking the spawn. This will make for a much more active raid on a lower Max Bots count. Helpful for weaker PCs. Will only despawn pmcs and scavs. If you don't run a dynamic spawn mod, this will however quickly exhaust the spawns on the map, making the raid very dead instead.", tags: new ConfigurationManagerAttributes() { Order = 13 }));

DespawnFurthest = Config.Bind("Performance | Max Bots", "Despawn Furthest", false, new ConfigDescription("When enforcing spawn limits, should the furthest bot be de-spawned instead of blocking the spawn. This will make for a much more active raid on a lower Max Bots count. Helpful for weaker PCs. Will only despawn pmcs and scavs. If you don't run a dynamic spawn mod, this will however quickly exhaust the spawns on the map, making the raid very dead instead.", tags: new ConfigurationManagerAttributes() { Order = 12 }));
DespawnMinimumDistance = Config.Bind("Performance | Max Bots", "Despawn Minimum Distance", 200.0f, new ConfigDescription("Don't despawn bots within this distance.", new AcceptableValueRange<float>(50f, 750f), new ConfigurationManagerAttributes() { Order = 12 }));

MaxBotsFactory = Config.Bind("Performance | Max Bots", "Max Bots Factory", 0, new ConfigDescription("Max amount of bots that can be active at the same time on Factory. Useful if you have a weaker PC. Set to 0 to use vanilla limits.", new AcceptableValueRange<int>(0, 50), new ConfigurationManagerAttributes() { Order = 11 }));

Expand Down
File renamed without changes.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,37 @@

Client-side changes to make multiplayer work.

## /!\ **NOTICE** /!\

If you somehow ended up here while you just want to play a stable release,
please download the release from the discord [here](https://discord.gg/project-fika).

If you're interested to contribute, then you're at the right place!

## State of the project

There are few bugs left. The goal now is to look back and refactor old code to make it better, as a lot of it is not efficient or easy to read.
There are few bugs left. The goal now is to look back and refactor old code to
make it better, as a lot of it is not efficient or easy to read.

## Contributing

You are free to fork, improve and send PRs to improve the project. Please try to make your code coherent for the other developers.
You are free to fork, improve and send PRs to improve the project. Please try
to make your code coherent for the other developers.

## Requirements

- [Visual Studio Code](https://code.visualstudio.com/)
- [.NET SDK 8.0.x](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)

## Setup

- Fika developer: `git submodule update --init --recursive`
- Collaborator:
1. Copy-paste the contents of `EscapeFromTarkov_Data/Managed/` into
`References/`
2. Copy-paste from Aki.Modules `project/Shared/Hollowed/hollowed.dll` into
`References/`

## Build

### Debug / Release
Expand All @@ -24,7 +42,8 @@ You are free to fork, improve and send PRs to improve the project. Please try to
PowerShell | `dotnet build`
VSCode | `Terminal > Run Build Task...`

You have to create a `References` folder and populate it with the required dependencies from your game installation for the project to build.
You have to create a `References` folder and populate it with the required
dependencies from your game installation for the project to build.

### GoldMaster

Expand All @@ -37,11 +56,11 @@ You have to create a `References` folder and populate it with the required depen

This project is licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.en).

### Dependencies
### Credits

**Project** | **License**
----------- | -----------------------------------------------------------------------
Aki.Modules | [NCSA](https://dev.sp-tarkov.com/SPT-AKI/Modules/src/branch/master/LICENSE.md)
SIT | [NCSA](./LICENSE-SIT.md) (`SIT.Client master:9de30d8`)
SIT | [NCSA](./LICENSE-SIT.md) (`Forked from SIT.Client master:9de30d8`)
Open.NAT | [MIT](https://github.com/lontivero/Open.NAT/blob/master/LICENSE) (for UPnP implementation)
LiteNetLib | [MIT](https://github.com/RevenantX/LiteNetLib/blob/master/LICENSE.txt) (for P2P UDP implementation)
1 change: 1 addition & 0 deletions References
Submodule References added at c79307

0 comments on commit 2129ce7

Please sign in to comment.