Skip to content

Commit

Permalink
Merge branch 'dev' into MoveNetworkIdentity
Browse files Browse the repository at this point in the history
  • Loading branch information
NotZer0Two authored Aug 12, 2024
2 parents 69da7a0 + 0e2bea5 commit 290a886
Show file tree
Hide file tree
Showing 141 changed files with 2,450 additions and 1,093 deletions.
34 changes: 17 additions & 17 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

<div align="center">

[![Version](https://img.shields.io/github/v/release/Exiled-Official/EXILED?sort=semver&style=flat-square&color=8DBBE9&label=Version)]()
[![Version](https://img.shields.io/github/v/release/ExMod-Team/EXILED?sort=semver&style=flat-square&color=8DBBE9&label=Version)]()
[![License](https://img.shields.io/badge/License-CC%20BY%E2%80%93SA%203.0-df967f?style=flat-square)]()
[![Contributors](https://img.shields.io/github/contributors-anon/Exiled-Official/EXILED?color=90E59A&style=flat-square&label=Contributors)]()
[![GitHub Issues](https://img.shields.io/github/issues/Exiled-Official/EXILED.svg?style=flat-square&label=Issues&color=d77982)](https://github.com/Exiled-Official/EXILED/issues)
[![Contributors](https://img.shields.io/github/contributors-anon/ExMod-Team/EXILED?color=90E59A&style=flat-square&label=Contributors)]()
[![GitHub Issues](https://img.shields.io/github/issues/ExMod-Team/EXILED.svg?style=flat-square&label=Issues&color=d77982)](https://github.com/ExMod-Team/EXILED/issues)
[![Discord](https://img.shields.io/discord/656673194693885975?color=738adb&label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/PyUkWTg)

</div>
Expand All @@ -30,85 +30,85 @@ Localized READMEs
<div>
<img src="https://flagsapi.com/US/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/README.md">English</a>
<a href="documentation/README.md">English</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/RU/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-Русский.md">Русский</a>
<a href="documentation/localization/README-Русский.md">Русский</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/CN/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-中文.md">中文</a>
<a href="documentation/localization/README-中文.md">中文</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/ES/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-ES.md">Español</a>
<a href="documentation/localization/README-ES.md">Español</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/PL/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-PL.md">Polski</a>
<a href="documentation/localization/README-PL.md">Polski</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/BR/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-BR.md">Português-BR</a>
<a href="documentation/localization/README-BR.md">Português-BR</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/IT/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-IT.md">Italiano</a>
<a href="documentation/localization/README-IT.md">Italiano</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/CZ/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-CS.md">Čeština</a>
<a href="documentation/localization/README-CS.md">Čeština</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/DK/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-DK.md">Dansk</a>
<a href="documentation/localization/README-DK.md">Dansk</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/TR/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-TR.md">Türkçe</a>
<a href="documentation/localization/README-TR.md">Türkçe</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/DE/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-DE.md">German</a>
<a href="documentation/localization/README-DE.md">German</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/FR/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-FR.md">Français</a>
<a href="documentation/localization/README-FR.md">Français</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/KR/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-KR.md">한국어</a>
<a href="documentation/localization/README-KR.md">한국어</a>
</div>
<br>
<div>
<img src="https://flagsapi.com/TH/flat/64.png" height=30>
<br>
<a href="https://github.com/Exiled-Official/EXILED/blob/master/.github/documentation/localization/README-ไทย.md">ไทย</a>
<a href="documentation/localization/README-ไทย.md">ไทย</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ Localization: # Add the 'Localization' label
- changed-files:
- 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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
id-token: write

env:
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.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.
Expand Down
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 @@ -10,7 +10,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
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
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,
}
}
37 changes: 37 additions & 0 deletions EXILED/Exiled.API/Enums/HazardType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// -----------------------------------------------------------------------
// <copyright file="HazardType.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
using Exiled.API.Features.Hazards;

/// <summary>
/// Unique identifier for a <see cref="Hazard"/>.
/// </summary>
public enum HazardType
{
/// <summary>
/// SCP-939 amnestic cloud.
/// </summary>
AmnesticCloud,

/// <summary>
/// Sinkhole spawned at start of round.
/// </summary>
Sinkhole,

/// <summary>
/// SCP-173 tantrum.
/// </summary>
Tantrum,

/// <summary>
/// Should never happen
/// </summary>
Unknown,
}
}
30 changes: 30 additions & 0 deletions EXILED/Exiled.API/Enums/UncuffReason.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// -----------------------------------------------------------------------
// <copyright file="UncuffReason.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
/// <summary>
/// Reasons that player gets uncuffed.
/// </summary>
public enum UncuffReason
{
/// <summary>
/// Uncuffed by a player.
/// </summary>
Player,

/// <summary>
/// Uncuffed due to the distance between cuffer and target.
/// </summary>
OutOfRange,

/// <summary>
/// Uncuffed due to the cuffer no longer alive.
/// </summary>
CufferDied,
}
}
63 changes: 63 additions & 0 deletions EXILED/Exiled.API/Extensions/BitwiseExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// -----------------------------------------------------------------------
// <copyright file="BitwiseExtensions.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Extensions
{
using System;

/// <summary>
/// Extensions for bitwise operations.
/// </summary>
public static class BitwiseExtensions
{
/// <summary>
/// Adds the specified flags to the given enum value.
/// </summary>
/// <typeparam name="T">The type of the enum.</typeparam>
/// <param name="flags">The enum value to add flags to.</param>
/// <param name="newFlags">The flags to add.</param>
/// <returns>The enum value with the specified flags added.</returns>
public static T AddFlags<T>(this T flags, params T[] newFlags)
where T : Enum => flags.ModifyFlags(true, newFlags);

/// <summary>
/// Removes the specified flags from the given enum value.
/// </summary>
/// <typeparam name="T">The type of the enum.</typeparam>
/// <param name="flags">The enum value to remove flags from.</param>
/// <param name="oldFlags">The flags to remove.</param>
/// <returns>The enum value with the specified flags removed.</returns>
public static T RemoveFlags<T>(this T flags, params T[] oldFlags)
where T : Enum => flags.ModifyFlags(false, oldFlags);

/// <summary>
/// Sets the specified flag to the given value, default is true.
/// </summary>
/// <param name="flags">The flags enum to modify.</param>
/// <param name="value">The value to set the flag to.</param>
/// <param name="changeFlags">The flags to modify.</param>
/// <typeparam name="T">The type of the enum.</typeparam>
/// <returns>The flags enum with the flag set to the given value.</returns>
public static T ModifyFlags<T>(this T flags, bool value, params T[] changeFlags)
where T : Enum
{
long currentValue = Convert.ToInt64(flags);

foreach (T flag in changeFlags)
{
long flagValue = Convert.ToInt64(flag);

if (value)
currentValue |= flagValue;
else
currentValue &= ~flagValue;
}

return (T)Enum.ToObject(typeof(T), currentValue);
}
}
}
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 @@ -460,12 +473,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
Loading

0 comments on commit 290a886

Please sign in to comment.