Skip to content

Commit

Permalink
Merge branch 'master' of github.com:themeldingwars/PIN
Browse files Browse the repository at this point in the history
  • Loading branch information
Xsear committed Sep 26, 2024
2 parents 9513db3 + f2a27ee commit ca9928e
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 139 deletions.
202 changes: 101 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
# PIN - Pirate Intelligence Network

The Accord may think their Shared Intelligence Network is unique and impenetrable, but not everyone agrees with their restricted access and constant surveillance. That's why PIN, the Pirate Intelligence Network, has been created.

*Fight the Accord - Kill the Chosen*

https://user-images.githubusercontent.com/920861/134824107-03e9f99c-b420-47c7-b742-efe68967161c.mp4

## Usage

**Note:** If you want to play around with the configuration, see the Development section below

1. [Install Firefall via Steam](steam://install/227700)
2. Edit the `firefall.ini` located in `steamapps\common\Firefall`
3. Add content from below
4. Download the [latest PIN release](https://github.com/themeldingwars/PIN/releases/latest)
5. Make a backup copy of the original `FirefallClient.exe` in `Firefall\system\bin`
6. Replace the `FirefallClient.exe` with the patched `FirefallClient.exe` from the PIN release
7. Make sure the [.NET 8 Runtime](https://dotnet.microsoft.com/download/dotnet/8.0) is installed
8. Trust self-signed development certificates by running `dotnet dev-certs https --trust`
9. Start all three applications:
- GameServer
- MatrixServer
- WebHostManager
10. Start Firefall
11. Login to the server:
- If Steam auto login has been enabled, you will directly be navigated to the character selection screen
- Otherwise, leave the login fields blank or enter anything you want and click "Login"
12. Load into the game by pressing the "Enter World" button

### firefall.ini

```ini
[Config]
OperatorHost = "localhost:4400"

[FilePaths]
AssetStreamPath = "http://localhost:4401/AssetStream/%ENVMNEMONIC%-%BUILDNUM%/"
VTRemotePath = "http://localhost:4401/vtex/%ENVMNEMONIC%-%BUILDNUM%/static.vtex"

[UI]
PlayIntroMovie = false
```

### Features

- Loading into any zone (WebHostManager)
- Basic character movement, including jetpacks and gliders
- Switch between battleframes with preconfigured loadouts
- Customize character appearance in NewYou (RIN.WebAPI)
- Call down vehicles and some deployables

### Limitations

- There is no combat, projectile or damage simulation
- Most of the UI doesn't work properly
- Most abilities are not fully working
- Vehicles only have physics if a player is driving it (client-side)
- No AI
- No Encounters
- No PvP

## Development

1. Install Visual Studio or JetBrains Rider
- Include the [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) component or install it separately
2. Recursive clone the repository `git clone --recurse-submodules https://github.com/themeldingwars/PIN.git`
3. Build the solution
4. Edit the `GameServer.dll.config` produced by the build in `UdpHosts\GameServer\bin\Release\net8.0` to ensure that `StaticDBPath` is correct.
5. Trust self-signed development certificates by running `dotnet dev-certs https --trust`
6. Start multiple targets at once
- Visual Studio: Create a `Multiple Startup Projects` target that start WebHostManager, GameServer and MatrixServer
- Rider: Create a `Compound` target that starts WebHostManager, GameServer and MatrixServer
7. Edit the `firefall.ini` located in `steamapps\common\Firefall`
8. Add content from above
9. Start Firefall

### Web Hosts

CatchAll (4499 / 44399) is used for now, until the specific APIs are implemented.

| Host | HTTP | HTTPS | Catch All |
|------------|------|-------|-----------|
| Operator | 4400 | 44300 ||
| WebAsset | 4401 | 44301 | ✔️ |
| ClientApi | 4402 | 44302 ||
| InGame | 4403 | 44303 ||
| WebAccount | 4404 | 44304 | ✔️ |
| Frontend | 4405 | 44305 | ✔️ |
| Store | 4406 | 44306 | ✔️ |
| Chat | 4407 | 44307 ||
| Replay | 4408 | 44308 | ✔️ |
| Web | 4409 | 44309 | ✔️ |
| Market | 4410 | 44310 | ✔️ |
| RedHanded | 4411 | 44311 | ✔️ |

### UDP Servers

| Host | UDP |
|---------------|-------|
| Matrix Server | 25000 |
# PIN - Pirate Intelligence Network

The Accord may think their Shared Intelligence Network is unique and impenetrable, but not everyone agrees with their restricted access and constant surveillance. That's why PIN, the Pirate Intelligence Network, has been created.

*Fight the Accord - Kill the Chosen*

https://user-images.githubusercontent.com/920861/134824107-03e9f99c-b420-47c7-b742-efe68967161c.mp4

## Usage

**Note:** If you want to play around with the configuration, see the Development section below

1. Install Firefall via Steam (paste `steam://install/227700` into address bar of web browser)
2. Edit the `firefall.ini` located in `steamapps\common\Firefall`
3. Add content from below
4. Download the [latest PIN release](https://github.com/themeldingwars/PIN/releases/latest)
5. Make a backup copy of the original `FirefallClient.exe` in `Firefall\system\bin`
6. Replace the `FirefallClient.exe` with the patched `FirefallClient.exe` from the PIN release
7. Make sure the [.NET 8 Runtime](https://dotnet.microsoft.com/download/dotnet/8.0) is installed
8. Trust self-signed development certificates by running `dotnet dev-certs https --trust`
9. Start all three applications:
- GameServer
- MatrixServer
- WebHostManager
10. Start Firefall
11. Login to the server:
- If Steam auto login has been enabled, you will directly be navigated to the character selection screen
- Otherwise, leave the login fields blank or enter anything you want and click "Login"
12. Load into the game by pressing the "Enter World" button

### firefall.ini

```ini
[Config]
OperatorHost = "localhost:4400"

[FilePaths]
AssetStreamPath = "http://localhost:4401/AssetStream/%ENVMNEMONIC%-%BUILDNUM%/"
VTRemotePath = "http://localhost:4401/vtex/%ENVMNEMONIC%-%BUILDNUM%/static.vtex"

[UI]
PlayIntroMovie = false
```

### Features

- Loading into any zone (WebHostManager)
- Basic character movement, including jetpacks and gliders
- Switch between battleframes with preconfigured loadouts
- Customize character appearance in NewYou (RIN.WebAPI)
- Call down vehicles and some deployables

### Limitations

- There is no combat, projectile or damage simulation
- Most of the UI doesn't work properly
- Most abilities are not fully working
- Vehicles only have physics if a player is driving it (client-side)
- No AI
- No Encounters
- No PvP

## Development

1. Install Visual Studio or JetBrains Rider
- Include the [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) component or install it separately
2. Recursive clone the repository `git clone --recurse-submodules https://github.com/themeldingwars/PIN.git`
3. Build the solution
4. Edit the `GameServer.dll.config` produced by the build in `UdpHosts\GameServer\bin\Release\net8.0` to ensure that `StaticDBPath` is correct.
5. Trust self-signed development certificates by running `dotnet dev-certs https --trust`
6. Start multiple targets at once
- Visual Studio: Create a `Multiple Startup Projects` target that start WebHostManager, GameServer and MatrixServer
- Rider: Create a `Compound` target that starts WebHostManager, GameServer and MatrixServer
7. Edit the `firefall.ini` located in `steamapps\common\Firefall`
8. Add content from above
9. Start Firefall

### Web Hosts

CatchAll (4499 / 44399) is used for now, until the specific APIs are implemented.

| Host | HTTP | HTTPS | Catch All |
|------------|------|-------|-----------|
| Operator | 4400 | 44300 ||
| WebAsset | 4401 | 44301 | ✔️ |
| ClientApi | 4402 | 44302 ||
| InGame | 4403 | 44303 ||
| WebAccount | 4404 | 44304 | ✔️ |
| Frontend | 4405 | 44305 | ✔️ |
| Store | 4406 | 44306 | ✔️ |
| Chat | 4407 | 44307 ||
| Replay | 4408 | 44308 | ✔️ |
| Web | 4409 | 44309 | ✔️ |
| Market | 4410 | 44310 | ✔️ |
| RedHanded | 4411 | 44311 | ✔️ |

### UDP Servers

| Host | UDP |
|---------------|-------|
| Matrix Server | 25000 |
| Game Server | 25001 |
5 changes: 4 additions & 1 deletion UdpHosts/GameServer/Entities/BaseAptitudeEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ public EffectState AddEffect(Effect effect, Context context)

if (ActiveEffects[i]?.Effect.Id == effect.Id)
{
// TODO: What to do?
if (ActiveEffects[i].Stacks < effect.MaxStackCount)
{
ActiveEffects[i].Stacks += 1;
}
else
{
return new EffectState() { MaxStacksExceeded = true };
}

return ActiveEffects[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,9 @@
},
{
"id": 271326,
"comment": "Triggered by Effect 2688 "
"comment": "Triggered by Effect 2688 ",
"effect_id": 2768,
"remove_from_self": true
},
{
"id": 271413,
Expand Down
26 changes: 21 additions & 5 deletions UdpHosts/GameServer/Systems/Aptitude/AbilitySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,33 @@ public void Tick(double deltaTime, ulong currentTime, CancellationToken ct)
{
if (entity is IAptitudeTarget target)
{
ProcessTarget(target);
ProcessTarget(target, currentTime);
}
}
}
}

public void ProcessTarget(IAptitudeTarget entity)
public void ProcessTarget(IAptitudeTarget entity, ulong currentTime)
{
var activeEffects = entity.GetActiveEffects();
foreach (var activeEffect in activeEffects)
{
if (activeEffect?.Effect.DurationChain != null)
if (activeEffect?.Effect.DurationChain != null
&& currentTime > activeEffect.LastUpdateTime + activeEffect.Effect.UpdateFrequency)
{
activeEffect.Context.ExecutionHint = ExecutionHint.DurationEffect;
bool durationResult = activeEffect.Effect.DurationChain.Execute(activeEffect.Context);
if (!durationResult)
activeEffect.LastUpdateTime = currentTime;

if (durationResult)
{
if (activeEffect.Effect.UpdateChain != null)
{
activeEffect.Context.ExecutionHint = ExecutionHint.UpdateEffect;
activeEffect.Effect.UpdateChain.Execute(activeEffect.Context);
}
}
else
{
DoRemoveEffect(activeEffect);
}
Expand Down Expand Up @@ -112,7 +123,12 @@ public void DoApplyEffect(uint effectId, IAptitudeTarget target, Context context
}
*/
target.AddEffect(effect, applyContext);
var effectState = target.AddEffect(effect, applyContext);

if (effectState.MaxStacksExceeded)
{
return;
}

effect.ApplyChain?.Execute(applyContext);

Expand Down
4 changes: 2 additions & 2 deletions UdpHosts/GameServer/Systems/Aptitude/Chain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public enum ExecutionMethod
OrChain
}

public bool Execute(Context context, ExecutionMethod method = ExecutionMethod.AndChain)
public bool Execute(Context context, ExecutionMethod method = ExecutionMethod.AndChain)
{
bool debug = context.ExecutionHint != ExecutionHint.DurationEffect;
bool debug = context.ExecutionHint is not(ExecutionHint.DurationEffect or ExecutionHint.UpdateEffect);

if (debug)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ public bool Execute(Context context)

if (target is CharacterEntity character)
{
result = character.MovementStateContainer.Movement;

// Params.Velocitytol // velocity tolerance
if (Params.CheckVelocity == 1)
{
if (Params.Velocitytol == 0)
{
result = !character.MovementStateContainer.Movement;
}
else
{
// todo
Console.WriteLine($"[RequireMovingCommand] velocity tolerance: {Params.Velocitytol}, negate: {Params.Negate}");
}
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public PushTargetsCommand(PushTargetsCommandDef par)
public bool Execute(Context context)
{
// todo aptitude: verify what to push
if (Params.Former == 1)
if (Params.Former == 1 && context.FormerTargets.Count > 0)
{
context.FormerTargets.Push(context.Targets.Peek());
}

if (Params.Current == 1)
if (Params.Current == 1 && context.Targets.Count > 0)
{
context.Targets.Push(context.Targets.Peek());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public bool Execute(Context context)
return false;
}

var distance = Vector3.DistanceSquared(origin, compatibleEntity.Position);
var distance = Vector3.Distance(origin, compatibleEntity.Position);
if (distance <= radius)
{
return true;
Expand Down
2 changes: 2 additions & 0 deletions UdpHosts/GameServer/Systems/Aptitude/EffectState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ public class EffectState
public Context Context;
public byte Index = 0;
public uint Time;
public ulong LastUpdateTime = 0;
public byte Stacks = 1;
public bool MaxStacksExceeded = false;
}
Loading

0 comments on commit ca9928e

Please sign in to comment.