Skip to content

Commit

Permalink
Merge branch 'master' into modify-labeler
Browse files Browse the repository at this point in the history
  • Loading branch information
louis1706 authored Aug 4, 2024
2 parents c090d68 + 0b577df commit d5680a4
Show file tree
Hide file tree
Showing 40 changed files with 750 additions and 714 deletions.
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
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/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:
build:
Expand Down
13 changes: 13 additions & 0 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
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2728,8 +2728,8 @@ public void ResetInventory(IEnumerable<Item> newItems)
/// <seealso cref="DropItems()"/>
public void ClearInventory(bool destroy = true)
{
ClearItems(destroy);
ClearAmmo();
ClearItems(destroy);
}

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions EXILED/Exiled.API/Features/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ public static bool IsWhitelisted
set => ServerConsole.WhiteListEnabled = value;
}

/// <summary>
/// Gets the list of user IDs of players currently whitelisted.
/// </summary>
public static HashSet<string> WhitelistedPlayers => WhiteList.Users;

/// <summary>
/// Gets a value indicating whether or not this server is verified.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override ItemType Type
get => base.Type;
set
{
if (!value.IsArmor() && (value != ItemType.None))
if (value != ItemType.None && !value.IsArmor())
throw new ArgumentOutOfRangeException("Type", value, "Invalid armor type.");

base.Type = value;
Expand Down
11 changes: 10 additions & 1 deletion EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Exiled.Events.EventArgs.Item
{
using System;

using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
Expand All @@ -26,7 +28,9 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item
{
Player = Player.Get(player);
Item = Item.Get(swingItem);
#pragma warning disable CS0618
IsAllowed = isAllowed;
#pragma warning restore CS0618
}

/// <summary>
Expand All @@ -42,6 +46,11 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item
/// <summary>
/// Gets or sets a value indicating whether or not the Jailbird can be charged.
/// </summary>
public bool IsAllowed { get; set; }
public bool IsAllowed
{
get;
[Obsolete("This event cannot be denied as it will cause desync.")]
set;
}
}
}
5 changes: 1 addition & 4 deletions EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ private static bool HandleJailbird(JailbirdItem instance, JailbirdMessageType me
ChargingJailbirdEventArgs ev = new(instance.Owner, instance);

Item.OnChargingJailbird(ev);
if (ev.IsAllowed)
return true;
instance.SendRpc(JailbirdMessageType.ChargeFailed, null);
return false;
return true;
}

default:
Expand Down

This file was deleted.

Loading

0 comments on commit d5680a4

Please sign in to comment.