Skip to content

Commit

Permalink
Merge branch 'dev' into primitiveCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
louis1706 authored Aug 9, 2024
2 parents 5976086 + 03d6bd7 commit a449449
Show file tree
Hide file tree
Showing 114 changed files with 2,146 additions and 944 deletions.
3 changes: 2 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div align="center"><img src="https://github.com/user-attachments/assets/5ea95992-2aeb-47c3-bd29-c966285276e0" height=75 alt="Exiled SCPSL, SCP Secret Laboratory Exiled, Exiled SCP: Secret Laboratory, Modding Framework, Mods, Exiled Mod SCPSL"/></div>
<h1 align="center">Exiled</h1>
<h6 align="center">EXtended In-runtime Library for External Development</h6>
<div align="center">
Expand Down Expand Up @@ -111,5 +112,5 @@ Localized READMEs
</div>
</div>

<h5 align="center">This repo is a fork of <a href="https://github.com/Exiled-Team/EXILED">Exiled-Team/EXILED</a> after the old repository was taken hostage by the old lead developer.</h5>
<h5 align="center">This repo is a fork of <a href="https://github.com/Exiled-Team/EXILED">Exiled-Team/EXILED</a> after changes in project leadership.</h5>
<h6 align="center">You can access the commit this update was forked from <a href="https://github.com/Exiled-Team/EXILED/tree/8b03fe7d9d2fe7ebffd5e6d1d038fc3881cdeb70">here</a>.</h6>
15 changes: 7 additions & 8 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,28 @@ Scripts: # Add the 'Scripts' label

regarding-events: # Add the 'Events' label
- changed-files:
- any-glob-to-any-file: Exiled.Events/** # Any Modifications to events
- any-glob-to-any-file: EXILED/Exiled.Events/** # Any Modifications to events

regarding-api: # Add the 'API' label
- changed-files:
- any-glob-to-any-file: Exiled.API/** # Any modifications to the API
- any-glob-to-any-file: EXILED/Exiled.API/** # Any modifications to the API

regarding-transpiler: # Add the 'transpiler' label
- changed-files:
- any-glob-to-any-file: Exiled.Events/Patches/**/* # Any modifications to transpiler files
- any-glob-to-any-file: EXILED/Exiled.Events/Patches/**/* # Any modifications to transpiler files

CustomModules: # Add the 'CustomModules' label
- changed-files:
- any-glob-to-any-file: Exiled.CustomModules/** # Any modifications to CustomModules
- any-glob-to-any-file: EXILED/Exiled.CustomModules/** # Any modifications to CustomModules

Installer: # Add the 'Installer' label
- changed-files:
- any-glob-to-any-file: Exiled.Installer/** # Any modifications to the Installer
- any-glob-to-any-file: EXILED/Exiled.Installer/** # Any modifications to the Installer

Localization: # Add the 'Localization' label
- changed-files:
- any-glob-to-any-file: Localization/** # Any modifications to Localization
- any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization

GitHub_Actions: # Add the 'GitHub' label
GitHub: # Add the 'GitHub' label
- changed-files:
- any-glob-to-any-file: .github/** # Any modifications to github related files

35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Description
**Describe the changes**


**What is the current behavior?** (You can also link to an open issue here)


**What is the new behavior?** (if this is a feature change)


**Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)


**Other information**:

<br />

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentations
<br />

## Submission checklist
<!--- Put an `x` in all the boxes that apply: -->
- [ ] I have checked the project can be compiled
- [ ] I have tested my changes and it worked as expected

### Patches (if there are any changes related to Harmony patches)
- [ ] I have checked no IL patching errors in the console

### Other
- [ ] Still requires more testing
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ defaults:
working-directory: ./EXILED

env:
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe

jobs:

Expand Down
100 changes: 55 additions & 45 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,65 @@ on:
push:
branches:
- master
pull_request:
branches:
- master

defaults:
run:
working-directory: ./EXILED
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write

env:
EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Master.zip
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
# Important due to https://t.ly/5DZAy
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build_and_publish_docs:
runs-on: windows-latest

publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2

- name: Setup Nuget
uses: iRebbok/setup-nuget@master
- name: Get references
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/EXILED/References.zip
Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES_PATH }}
- name: Download DocFX
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install docfx --pre
- name: Run DocFX
env:
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}
run: docfx docfx.json; docfx docfx.json

- name: Deploy to GitHub Pages
if: github.event_name == 'push' && success() #Only publishes on push to master to avoid docs mishaps
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: _site
keep_history: true
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x

- run: dotnet tool update -g docfx

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2

- name: Setup Nuget
uses: iRebbok/setup-nuget@master

- name: Get references
shell: pwsh
run: |
Invoke-WebRequest -Uri $env:EXILED_REFERENCES_URL -OutFile $env:GITHUB_WORKSPACE/EXILED/References.zip
Expand-Archive -Path $env:GITHUB_WORKSPACE/EXILED/References.zip -DestinationPath $env:EXILED_REFERENCES_PATH
- run: docfx EXILED/docs/docfx.json
env:
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'EXILED/docs/_site'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defaults:
working-directory: ./EXILED

env:
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
sync-labels: true
assign-author:
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: toshimaru/auto-author-assign@v2.1.1
2 changes: 1 addition & 1 deletion .github/workflows/push_nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: Push NuGet
shell: pwsh
run: nuget push EXILED/${{ env.PackageFile }} -ApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json
run: nuget push ${{ env.PackageFile }} -ApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ defaults:
working-directory: ./EXILED

env:
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion EXILED/EXILED.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<PropertyGroup>
<!-- This is the global version and is used for all projects that don't have a version -->
<Version Condition="$(Version) == ''">8.10.1-pre</Version>
<Version Condition="$(Version) == ''">8.11.0</Version>
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
<PublicBeta>false</PublicBeta>

Expand Down
5 changes: 5 additions & 0 deletions EXILED/Exiled.API/Enums/AuthenticationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ public enum AuthenticationType
/// Indicates that the player has been authenticated as DedicatedServer.
/// </summary>
DedicatedServer,

/// <summary>
/// Indicates that the player has been authenticated during Offline mode.
/// </summary>
Offline,
}
}
22 changes: 17 additions & 5 deletions EXILED/Exiled.API/Extensions/MirrorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Exiled.API.Extensions
using PlayerRoles;
using PlayerRoles.FirstPersonControl;
using PlayerRoles.PlayableScps.Scp049.Zombies;
using PlayerRoles.Voice;
using RelativePositioning;

using Respawning;
Expand Down Expand Up @@ -181,6 +182,18 @@ public static void PlayGunSound(this Player player, Vector3 position, ItemType i
player.Connection.Send(message);
}

/// <summary>
/// Sets <see cref="Features.Intercom.DisplayText"/> that only the <paramref name="target"/> player can see.
/// </summary>
/// <param name="target">Only this player can see Display Text.</param>
/// <param name="text">Text displayed to the player.</param>
public static void SetIntercomDisplayTextForTargetOnly(this Player target, string text) => target.SendFakeSyncVar(IntercomDisplay._singleton.netIdentity, typeof(IntercomDisplay), nameof(IntercomDisplay.Network_overrideText), text);

/// <summary>
/// Resync <see cref="Features.Intercom.DisplayText"/>.
/// </summary>
public static void ResetIntercomDisplayText() => ResyncSyncVar(IntercomDisplay._singleton.netIdentity, typeof(IntercomDisplay), nameof(IntercomDisplay.Network_overrideText));

/// <summary>
/// Sets <see cref="Room.Color"/> of a <paramref name="room"/> that only the <paramref name="target"/> player can see.
/// </summary>
Expand Down Expand Up @@ -422,12 +435,11 @@ public static void SendFakeTargetRpc(Player target, NetworkIdentity behaviorOwne
/// <example>
/// EffectOnlySCP207.
/// <code>
/// MirrorExtensions.SendCustomSync(player, player.ReferenceHub.networkIdentity, typeof(PlayerEffectsController), (writer) => {
/// writer.WriteUInt64(1ul); // DirtyObjectsBit
/// writer.WriteUInt32(1); // DirtyIndexCount
/// MirrorExtensions.SendFakeSyncObject(player, player.NetworkIdentity, typeof(PlayerEffectsController), (writer) => {
/// writer.WriteULong(1ul); // DirtyObjectsBit
/// writer.WriteUInt(1); // DirtyIndexCount
/// writer.WriteByte((byte)SyncList&lt;byte&gt;.Operation.OP_SET); // Operations
/// writer.WriteUInt32(17); // EditIndex
/// writer.WriteByte(1); // Value
/// writer.WriteUInt(17); // EditIndex
/// });
/// </code>
/// </example>
Expand Down
6 changes: 5 additions & 1 deletion EXILED/Exiled.API/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ public static string GetBefore(this string input, char symbol)
/// </summary>
/// <param name="userId">The user id.</param>
/// <returns>Returns the raw user id.</returns>
public static string GetRawUserId(this string userId) => userId.Substring(0, userId.LastIndexOf('@'));
public static string GetRawUserId(this string userId)
{
int index = userId.IndexOf('@');
return index == -1 ? userId : userId.Substring(0, index);
}

/// <summary>
/// Gets a SHA256 hash of a player's user id without the authentication.
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Camera : IWrapper<Scp079Camera>, IWorldSpace
/// <summary>
/// A <see cref="Dictionary{TKey,TValue}"/> containing all known <see cref="Scp079Camera"/>s and their corresponding <see cref="Camera"/>.
/// </summary>
internal static readonly Dictionary<Scp079Camera, Camera> Camera079ToCamera = new(250);
internal static readonly Dictionary<Scp079Camera, Camera> Camera079ToCamera = new(250, new ComponentsEqualityComparer());

private static readonly Dictionary<string, CameraType> NameToCameraType = new()
{
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Doors/AirlockController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class AirlockController
/// <summary>
/// A <see cref="Dictionary{TKey,TValue}"/> containing all known <see cref="BaseController"/>'s and their corresponding <see cref="AirlockController"/>.
/// </summary>
internal static readonly Dictionary<BaseController, AirlockController> BaseToExiledControllers = new();
internal static readonly Dictionary<BaseController, AirlockController> BaseToExiledControllers = new(new ComponentsEqualityComparer());

/// <summary>
/// Initializes a new instance of the <see cref="AirlockController"/> class.
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Doors/Door.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Door : TypeCastObject<Door>, IWrapper<DoorVariant>, IWorldSpace
/// <summary>
/// A <see cref="Dictionary{TKey,TValue}"/> containing all known <see cref="DoorVariant"/>'s and their corresponding <see cref="Door"/>.
/// </summary>
internal static readonly Dictionary<DoorVariant, Door> DoorVariantToDoor = new();
internal static readonly Dictionary<DoorVariant, Door> DoorVariantToDoor = new(new ComponentsEqualityComparer());

/// <summary>
/// Initializes a new instance of the <see cref="Door"/> class.
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Generator : IWrapper<Scp079Generator>, IWorldSpace
/// <summary>
/// A <see cref="List{T}"/> of <see cref="Generator"/> on the map.
/// </summary>
internal static readonly Dictionary<Scp079Generator, Generator> Scp079GeneratorToGenerator = new();
internal static readonly Dictionary<Scp079Generator, Generator> Scp079GeneratorToGenerator = new(new ComponentsEqualityComparer());
private Room room;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Hazards/Hazard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Hazard : TypeCastObject<Hazard>, IWrapper<EnvironmentalHazard>
/// <summary>
/// <see cref="Dictionary{TKey,TValue}"/> with <see cref="EnvironmentalHazard"/> to it's <see cref="Hazard"/>.
/// </summary>
internal static readonly Dictionary<EnvironmentalHazard, Hazard> EnvironmentalHazardToHazard = new();
internal static readonly Dictionary<EnvironmentalHazard, Hazard> EnvironmentalHazardToHazard = new(new ComponentsEqualityComparer());

/// <summary>
/// Initializes a new instance of the <see cref="Hazard"/> class.
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Items/Ammo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Ammo : Item, IWrapper<AmmoItem>
/// <summary>
/// Gets the absolute maximum amount of ammo that may be held at one time, if ammo is forcefully given to the player (regardless of worn armor or server configuration).
/// <para>
/// For accessing the maximum amount of ammo that may be held based on worn armor and server settings, see <see cref="Player.GetAmmoLimit(AmmoType)"/>.
/// For accessing the maximum amount of ammo that may be held based on worn armor and server settings, see <see cref="Player.GetAmmoLimit(AmmoType, bool)"/>.
/// </para>
/// </summary>
public const ushort AmmoLimit = ushort.MaxValue;
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Items/Firearm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal Firearm(ItemType type)
if (Base.HasAdvantageFlag(AttachmentDescriptiveAdvantages.Flashlight))
firearmStatusFlags |= FirearmStatusFlags.FlashlightEnabled;

Base.Status = new FirearmStatus(Base.AmmoManagerModule.MaxAmmo, firearmStatusFlags, Base.Status.Attachments);
Base.Status = new FirearmStatus(MaxAmmo, firearmStatusFlags, Base.Status.Attachments);
}

/// <inheritdoc cref="BaseCodesValue"/>.
Expand Down
Loading

0 comments on commit a449449

Please sign in to comment.