Skip to content

Commit 088ba33

Browse files
authored
LabAPI Update (#435)
* No error for build * Fix Exiled * Fix RoundEnding * Now is fucking separated by default * CustomSubtitles * Missing IsCustomAnnouncement * Fix 3 patch & removal of CustomHealthStat * Fix UsingAndCancellingItemUse * Fix TogglingFlashlight * La Flemme ? * La flemme 2 * Fix ReservedSlotPatch * Fix PickingUpItem(PickingUpAmmo) * Fix Hurt event * Fix FlippingCoin & EscapingPocketDimension * Fix FailingEscapePocketDimension * EscapingAndEscaped fix patch * Fix UpgradingPlayer patch * Fix BeingObserved * Fix PlacingTantrum * Fix FinishingRecall * ChangingCamera (Not working) * putting again the event than i was lazzy to fix * Rework InteractingDoor Patch missing removing the Prefix part lol & SkillIssueFix * Remove useless using and warning disable * OUPS * if stupidity was me it's here (i am stupid) * Fixing Noclip with breakingchange * CustomHumeShieldStat * Fix InteractingGenerator * Fix ChangingCamera * Not finish * InteractingDoor swap CanInteract & IsAllowed back to normal * Player::Gravity * Gravity in wrong place * IHumeShieldRole for Human * Fix BlastDoors & add OpenBlastDoor * Fix SpawningRagdoll Scale & missing argument when modify * Now fix in LabAPI only * we will keep the funny Ragdoll scale * Fix Merge & Split Command * new workflow for LabAPI
1 parent 61c1c23 commit 088ba33

File tree

84 files changed

+589
-696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+589
-696
lines changed

.github/workflows/labapi.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Exiled Dev CI
2+
3+
on:
4+
push:
5+
branches:
6+
- LabAPI
7+
pull_request:
8+
branches:
9+
- LabAPI
10+
workflow_dispatch:
11+
12+
defaults:
13+
run:
14+
working-directory: ./EXILED
15+
16+
env:
17+
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/LabAPI.zip
18+
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
19+
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
20+
21+
jobs:
22+
23+
build:
24+
25+
runs-on: windows-latest
26+
# Prevent double running for push & pull_request events from the main repo
27+
if: github.event_name != 'push' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
28+
29+
steps:
30+
31+
- name: Setup .NET Core SDK
32+
uses: actions/setup-dotnet@v4.0.1
33+
34+
- name: Setup Nuget
35+
uses: nuget/setup-nuget@v2
36+
37+
- uses: actions/checkout@v4.1.7
38+
39+
- name: Get references
40+
shell: pwsh
41+
run: |
42+
Invoke-WebRequest -Uri ${{ env.EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/EXILED/References.zip
43+
Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES_PATH }}
44+
45+
- name: Build
46+
env:
47+
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}
48+
shell: pwsh
49+
run: |
50+
./build.ps1 -BuildNuGet
51+
$File = (Get-ChildItem -Path . -Include 'ExMod.Exiled.*.nupkg' -Recurse).Name
52+
Out-File -FilePath ${{ github.env }} -InputObject "PackageFile=$File" -Encoding utf-8 -Append
53+
54+
- name: Upload nuget package
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ env.PackageFile }}
58+
path: EXILED/${{ env.PackageFile }}
59+
60+
- name: Get references
61+
shell: pwsh
62+
run: |
63+
Invoke-WebRequest -Uri ${{ env.EXILED_DLL_ARCHIVER_URL }} -OutFile ${{ github.workspace }}/EXILED/EXILED-DLL-Archiver.exe
64+
65+
- name: Packaging results as tar.gz
66+
shell: pwsh
67+
run: ./packaging.ps1
68+
69+
- name: Upload artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: Build Result
73+
path: EXILED/bin/Release/Exiled.tar.gz
74+

EXILED/Exiled.API/Exiled.API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
</Reference>
2828
<Reference Include="Assembly-CSharp-firstpass" HintPath="$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll" Private="false" />
2929
<Reference Include="CommandSystem.Core" HintPath="$(EXILED_REFERENCES)\CommandSystem.Core.dll" Private="false" />
30+
<Reference Include="LabApi" HintPath="$(EXILED_REFERENCES)\LabApi.dll" Private="false" />
3031
<Reference Include="Pooling" HintPath="$(EXILED_REFERENCES)\Pooling.dll" Private="false" />
3132
<Reference Include="Mirror" HintPath="$(EXILED_REFERENCES)\Mirror.dll" Private="false" />
3233
<Reference Include="NorthwoodLib" HintPath="$(EXILED_REFERENCES)\NorthwoodLib.dll" Private="false" />
33-
<Reference Include="PluginAPI" HintPath="$(EXILED_REFERENCES)\PluginAPI.dll" Private="false" />
3434
<Reference Include="Unity.TextMeshPro" HintPath="$(EXILED_REFERENCES)\Unity.TextMeshPro.dll" Private="false" />
3535
<Reference Include="UnityEngine" HintPath="$(EXILED_REFERENCES)\UnityEngine.dll" Private="false" />
3636
<Reference Include="UnityEngine.CoreModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll" Private="false" />

EXILED/Exiled.API/Extensions/UserGroupExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static bool EqualsTo(this UserGroup @this, UserGroup other)
3737
/// </summary>
3838
/// <param name="this">The <see cref="UserGroup"/>.</param>
3939
/// <returns>The key of that group, or <see langword="null"/> if not found.</returns>
40-
public static string GetKey(this UserGroup @this) => Server.PermissionsHandler._groups
40+
public static string GetKey(this UserGroup @this) => Server.PermissionsHandler.Groups
4141
.FirstOrDefault(pair => pair.Value.EqualsTo(@this)).Key;
4242

4343
/// <summary>
@@ -47,7 +47,7 @@ public static string GetKey(this UserGroup @this) => Server.PermissionsHandler._
4747
/// <returns>The value of that group, or <see langword="null"/> if not found.</returns>
4848
public static UserGroup GetValue(string groupName)
4949
{
50-
ServerStatic.GetPermissionsHandler().GetAllGroups().TryGetValue(groupName, out UserGroup userGroup);
50+
ServerStatic.PermissionsHandler.GetAllGroups().TryGetValue(groupName, out UserGroup userGroup);
5151
return userGroup;
5252
}
5353
}

EXILED/Exiled.API/Features/Camera.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ internal Camera(Scp079Camera camera079)
216216
/// </summary>
217217
public Quaternion Rotation
218218
{
219-
get => Base._cameraAnchor.rotation;
220-
set => Base._cameraAnchor.rotation = value;
219+
get => Base.CameraAnchor.rotation;
220+
set => Base.CameraAnchor.rotation = value;
221221
}
222222

223223
/// <summary>

EXILED/Exiled.API/Features/CustomHealthStat.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

EXILED/Exiled.API/Features/CustomStats/CustomHumeShieldStat.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// -----------------------------------------------------------------------
1+
// -----------------------------------------------------------------------
22
// <copyright file="CustomHumeShieldStat.cs" company="ExMod Team">
33
// Copyright (c) ExMod Team. All rights reserved.
44
// Licensed under the CC BY-SA 3.0 license.
@@ -18,25 +18,17 @@ namespace Exiled.API.Features.CustomStats
1818
/// </summary>
1919
public class CustomHumeShieldStat : HumeShieldStat
2020
{
21-
/// <inheritdoc />
22-
public override float MaxValue => CustomMaxValue == -1 ? base.MaxValue : CustomMaxValue;
23-
2421
/// <summary>
2522
/// Gets or sets the multiplier for gaining HumeShield.
2623
/// </summary>
2724
public float ShieldRegenerationMultiplier { get; set; } = 1;
2825

29-
/// <summary>
30-
/// Gets or sets the maximum amount of HumeShield the player can have.
31-
/// </summary>
32-
public float CustomMaxValue { get; set; } = -1;
33-
3426
private float ShieldRegeneration => TryGetHsModule(out HumeShieldModuleBase controller) ? controller.HsRegeneration * ShieldRegenerationMultiplier : 0;
3527

3628
/// <inheritdoc/>
3729
public override void Update()
3830
{
39-
if (MaxValue == -1 && ShieldRegenerationMultiplier is 1)
31+
if (ShieldRegenerationMultiplier is 1)
4032
{
4133
base.Update();
4234
return;
@@ -45,15 +37,15 @@ public override void Update()
4537
if (!NetworkServer.active)
4638
return;
4739

48-
if (_valueDirty)
40+
if (ValueDirty)
4941
{
5042
new SyncedStatMessages.StatMessage()
5143
{
5244
Stat = this,
5345
SyncedValue = CurValue,
5446
}.SendToHubsConditionally(CanReceive);
5547
_lastSent = CurValue;
56-
_valueDirty = false;
48+
ValueDirty = false;
5749
}
5850

5951
if (ShieldRegeneration == 0)

EXILED/Exiled.API/Features/Doors/CheckpointDoor.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,35 @@ internal CheckpointDoor(Interactables.Interobjects.CheckpointDoor door, List<Roo
4444
/// </summary>
4545
public Interactables.Interobjects.CheckpointDoor.CheckpointSequenceStage CurrentStage
4646
{
47-
get => Base._currentSequence;
48-
set => Base._currentSequence = value;
47+
get => Base.CurrentSequence;
48+
set => Base.CurrentSequence = value;
4949
}
5050

5151
/// <summary>
5252
/// Gets or sets a time in seconds for main timer.
5353
/// </summary>
5454
public float MainTimer
5555
{
56-
get => Base._mainTimer;
57-
set => Base._mainTimer = value;
56+
get => Base.MainTimer;
57+
set => Base.MainTimer = value;
5858
}
5959

6060
/// <summary>
6161
/// Gets or sets time before doors close.
6262
/// </summary>
6363
public float WaitTime
6464
{
65-
get => Base._waitTime;
66-
set => Base._waitTime = value;
65+
get => Base.WaitTime;
66+
set => Base.WaitTime = value;
6767
}
6868

6969
/// <summary>
7070
/// Gets or sets time in seconds when warning will be shown.
7171
/// </summary>
7272
public float WarningTime
7373
{
74-
get => Base._warningTime;
75-
set => Base._warningTime = value;
74+
get => Base.WarningTime;
75+
set => Base.WarningTime = value;
7676
}
7777

7878
/// <inheritdoc/>

EXILED/Exiled.API/Features/Hazards/TemporaryHazard.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public bool IsDestroyed
5656
/// </summary>
5757
public float Duration
5858
{
59-
get => Base._elapsed;
60-
set => Base._elapsed = value;
59+
get => Base.Elapsed;
60+
set => Base.Elapsed = value;
6161
}
6262

6363
/// <summary>

EXILED/Exiled.API/Features/Paths.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Exiled.API.Features
1111
using System.IO;
1212
using System.Linq;
1313

14+
using LabApi.Loader;
15+
1416
/// <summary>
1517
/// A set of useful paths.
1618
/// </summary>
@@ -106,7 +108,7 @@ public static void Reload(string rootDirectory = null)
106108
Dependencies = Path.Combine(Plugins, "dependencies");
107109
Configs = Path.Combine(Exiled, "Configs");
108110
IndividualConfigs = Path.Combine(Configs, "Plugins");
109-
LoaderConfig = PluginAPI.Loader.AssemblyLoader.InstalledPlugins.FirstOrDefault(x => x.PluginName == "Exiled Loader")?.MainConfigPath;
111+
LoaderConfig = LabApi.Loader.PluginLoader.EnabledPlugins.FirstOrDefault(x => x.Name == "Exiled Loader")?.GetConfigPath("Exiled Loader");
110112
Config = Path.Combine(Configs, $"{Server.Port}-config.yml");
111113
BackupConfig = Path.Combine(Configs, $"{Server.Port}-config.yml.old");
112114
IndividualTranslations = Path.Combine(Configs, "Translations");

0 commit comments

Comments
 (0)