From 6585b640c66b4b16f7d174e1c486f0dd5f692290 Mon Sep 17 00:00:00 2001
From: Mike <146554836+MikeSus1@users.noreply.github.com>
Date: Mon, 16 Feb 2026 15:15:04 +0100
Subject: [PATCH 01/39] refractor!: rename blindness effectype (#317)
* Fix EffectType
* fix: ref fix build
* Blinded -> Blurred
replace all blinded by blurred
* Docs
docs blindness effect
---
EXILED/Exiled.API/Enums/EffectType.cs | 6 +++---
.../Exiled.API/Extensions/EffectTypeExtension.cs | 4 ++--
EXILED/Exiled.API/Features/Items/FlashGrenade.cs | 14 +++++++-------
.../Features/Pickups/FlashGrenadePickup.cs | 10 +++++-----
.../Pickups/Projectiles/FlashbangProjectile.cs | 4 ++--
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/EXILED/Exiled.API/Enums/EffectType.cs b/EXILED/Exiled.API/Enums/EffectType.cs
index d2f0a1394b..dc79e7c481 100644
--- a/EXILED/Exiled.API/Enums/EffectType.cs
+++ b/EXILED/Exiled.API/Enums/EffectType.cs
@@ -44,9 +44,9 @@ public enum EffectType
Bleeding,
///
- /// Blurs the player's screen.
+ /// Make the player screen darker.
///
- Blinded,
+ Blindness,
///
/// Increases damage the player receives. Does not apply any standalone damage.
@@ -256,7 +256,7 @@ public enum EffectType
PitDeath,
///
- /// .
+ /// Blurs the player's screen.
///
Blurred,
diff --git a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
index 088438e085..69677e71c7 100644
--- a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
+++ b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
@@ -34,7 +34,7 @@ public static class EffectTypeExtension
{ EffectType.AmnesiaVision, typeof(AmnesiaVision) },
{ EffectType.Asphyxiated, typeof(Asphyxiated) },
{ EffectType.Bleeding, typeof(Bleeding) },
- { EffectType.Blinded, typeof(Blindness) },
+ { EffectType.Blindness, typeof(Blindness) },
{ EffectType.BodyshotReduction, typeof(BodyshotReduction) },
{ EffectType.Burned, typeof(Burned) },
{ EffectType.CardiacArrest, typeof(CardiacArrest) },
@@ -194,7 +194,7 @@ or EffectType.Corroding or EffectType.Decontaminating or EffectType.Hemorrhage o
/// Whether the effect is a negative effect.
///
public static bool IsNegative(this EffectType effect) => IsHarmful(effect) || effect is EffectType.AmnesiaItems
- or EffectType.AmnesiaVision or EffectType.Blinded or EffectType.Burned or EffectType.Concussed or EffectType.Deafened
+ or EffectType.AmnesiaVision or EffectType.Blindness or EffectType.Burned or EffectType.Concussed or EffectType.Deafened
or EffectType.Disabled or EffectType.Ensnared or EffectType.Exhausted or EffectType.Flashed or EffectType.SinkHole
or EffectType.Stained or EffectType.InsufficientLighting or EffectType.SoundtrackMute or EffectType.Scanned or EffectType.Slowness;
diff --git a/EXILED/Exiled.API/Features/Items/FlashGrenade.cs b/EXILED/Exiled.API/Features/Items/FlashGrenade.cs
index 867d11b3ad..88e9129fb0 100644
--- a/EXILED/Exiled.API/Features/Items/FlashGrenade.cs
+++ b/EXILED/Exiled.API/Features/Items/FlashGrenade.cs
@@ -59,12 +59,12 @@ public float MinimalDurationEffect
}
///
- /// Gets or sets the additional duration of the effect.
+ /// Gets or sets the additional duration of the effect.
///
- public float AdditionalBlindedEffect
+ public float AdditionalBlurredEffect
{
- get => Projectile.AdditionalBlindedEffect;
- set => Projectile.AdditionalBlindedEffect = value;
+ get => Projectile.AdditionalBlurredEffect;
+ set => Projectile.AdditionalBlurredEffect = value;
}
///
@@ -105,7 +105,7 @@ public FlashbangProjectile SpawnActive(Vector3 position, Player owner = null)
grenade.Base.gameObject.SetActive(true);
grenade.MinimalDurationEffect = MinimalDurationEffect;
- grenade.AdditionalBlindedEffect = AdditionalBlindedEffect;
+ grenade.AdditionalBlurredEffect = AdditionalBlurredEffect;
grenade.SurfaceDistanceIntensifier = SurfaceDistanceIntensifier;
grenade.FuseTime = FuseTime;
@@ -125,7 +125,7 @@ public FlashbangProjectile SpawnActive(Vector3 position, Player owner = null)
public override Item Clone() => new FlashGrenade()
{
MinimalDurationEffect = MinimalDurationEffect,
- AdditionalBlindedEffect = AdditionalBlindedEffect,
+ AdditionalBlurredEffect = AdditionalBlurredEffect,
SurfaceDistanceIntensifier = SurfaceDistanceIntensifier,
FuseTime = FuseTime,
Repickable = Repickable,
@@ -145,7 +145,7 @@ internal override void ReadPickupInfoBefore(Pickup pickup)
if (pickup is FlashGrenadePickup flashGrenadePickup)
{
MinimalDurationEffect = flashGrenadePickup.MinimalDurationEffect;
- AdditionalBlindedEffect = flashGrenadePickup.AdditionalBlindedEffect;
+ AdditionalBlurredEffect = flashGrenadePickup.AdditionalBlurredEffect;
SurfaceDistanceIntensifier = flashGrenadePickup.SurfaceDistanceIntensifier;
FuseTime = flashGrenadePickup.FuseTime;
}
diff --git a/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs b/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
index 3e4c979b50..3cdb59898e 100644
--- a/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
@@ -42,9 +42,9 @@ internal FlashGrenadePickup()
public float MinimalDurationEffect { get; set; }
///
- /// Gets or sets the additional duration of the effect.
+ /// Gets or sets the additional duration of the effect.
///
- public float AdditionalBlindedEffect { get; set; }
+ public float AdditionalBlurredEffect { get; set; }
///
/// Gets or sets the how mush the flash grenade going to be intensified when explode at .
@@ -58,7 +58,7 @@ internal override void ReadItemInfo(Item item)
if (item is FlashGrenade flashGrenadeitem)
{
MinimalDurationEffect = flashGrenadeitem.MinimalDurationEffect;
- AdditionalBlindedEffect = flashGrenadeitem.AdditionalBlindedEffect;
+ AdditionalBlurredEffect = flashGrenadeitem.AdditionalBlurredEffect;
SurfaceDistanceIntensifier = flashGrenadeitem.SurfaceDistanceIntensifier;
FuseTime = flashGrenadeitem.FuseTime;
}
@@ -70,7 +70,7 @@ internal override void WriteProjectileInfo(Projectile projectile)
if (projectile is FlashbangProjectile flashbangProjectile)
{
flashbangProjectile.MinimalDurationEffect = MinimalDurationEffect;
- flashbangProjectile.AdditionalBlindedEffect = AdditionalBlindedEffect;
+ flashbangProjectile.AdditionalBlurredEffect = AdditionalBlurredEffect;
flashbangProjectile.SurfaceDistanceIntensifier = SurfaceDistanceIntensifier;
flashbangProjectile.FuseTime = FuseTime;
}
@@ -83,7 +83,7 @@ protected override void InitializeProperties(ItemBase itemBase)
if (itemBase is ThrowableItem throwable && throwable.Projectile is FlashbangGrenade flashGrenade)
{
MinimalDurationEffect = flashGrenade._minimalEffectDuration;
- AdditionalBlindedEffect = flashGrenade._additionalBlurDuration;
+ AdditionalBlurredEffect = flashGrenade._additionalBlurDuration;
SurfaceDistanceIntensifier = flashGrenade._surfaceZoneDistanceIntensifier;
}
}
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
index 8c289c2840..8d30856743 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
@@ -51,9 +51,9 @@ public float MinimalDurationEffect
}
///
- /// Gets or sets the additional duration of the effect.
+ /// Gets or sets the additional duration of the effect.
///
- public float AdditionalBlindedEffect
+ public float AdditionalBlurredEffect
{
get => Base._additionalBlurDuration;
set => Base._additionalBlurDuration = value;
From d728d1b5737005d10c5bc1e8d96f454ce40131af Mon Sep 17 00:00:00 2001
From: TiBarification
Date: Mon, 16 Feb 2026 16:15:23 +0200
Subject: [PATCH 02/39] refactor!: ahp granting (#415)
* Return AhpStat.AhpProcess instance after adding AHp
* return
---
EXILED/Exiled.API/Features/Player.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs
index d91e703c01..bfac75fbe0 100644
--- a/EXILED/Exiled.API/Features/Player.cs
+++ b/EXILED/Exiled.API/Features/Player.cs
@@ -3705,9 +3705,10 @@ public void ChangeEffectIntensity(string effectName, byte intensity, float durat
/// Percent of incoming damage absorbed by this stat.
/// The number of seconds to delay the start of the decay.
/// Whether the process is removed when the value hits 0.
- public void AddAhp(float amount, float limit = 75f, float decay = 1.2f, float efficacy = 0.7f, float sustain = 0f, bool persistant = false)
+ /// The instance..
+ public AhpStat.AhpProcess AddAhp(float amount, float limit = 75f, float decay = 1.2f, float efficacy = 0.7f, float sustain = 0f, bool persistant = false)
{
- ReferenceHub.playerStats.GetModule()
+ return ReferenceHub.playerStats.GetModule()
.ServerAddProcess(amount, limit, decay, efficacy, sustain, persistant);
}
From 65a30336d7370b3428b83e20b2518a2b1a1239d1 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Mon, 16 Feb 2026 15:15:43 +0100
Subject: [PATCH 03/39] feat: Bump Lib.Harmony from 2.2.2 to 2.4.2 in /EXILED
(#755)
---
EXILED/EXILED.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/EXILED/EXILED.props b/EXILED/EXILED.props
index f5197ff43b..f2b9761486 100644
--- a/EXILED/EXILED.props
+++ b/EXILED/EXILED.props
@@ -19,7 +19,7 @@
false
- 2.2.2
+ 2.4.2
1.1.118
2.0.2
From f313ff933b5c53210309cdd3946d181587d6afff Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Mon, 16 Feb 2026 17:16:46 +0300
Subject: [PATCH 04/39] feat: Speaker Api (#711)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Speaker Toy Api
* .
* chore: trigger CI
* added missing doc
* Change default stream parameter to false in PlayWav
* Improve XML documentation for Channel property
Updated XML documentation for the Channel property to include a reference to Channels.
* Update WavStreamSource.cs
Update PreloadedPcmSource.cs
Update Speaker.cs
Create WavUtility.cs
Update WavStreamSource.cs
Update PreloadedPcmSource.cs
Change default stream parameter to false in PlayWav
Update PlayWav method to default stream to true
Change TargetPlayers from List to HashSet
* Update Speaker.cs
* Update Speaker.cs
* Update performance
* Update Speaker.cs
Update PreloadedPcmSource.cs
Added another constructor for public usages
Update PreloadedPcmSource.cs
* Implemented audio seeking, event system, and precision timing
- Introduced a full Event system to the Speaker class (Started, Finished, Stopped, Paused, Resumed).
- Implemented `Seek()` functionality and added `CurrentTime` / `TotalDuration` properties.
- Utilized `double` precision for all time related calculations to ensure accuracy.
- Updated `WavStreamSource` and `PreloadedPcmSource` to support the new seeking logic.
* Update Speaker.cs
* Update WavUtility.cs
* Update Speaker.cs
* Update Speaker.cs
* Update Speaker.cs
* Update Speaker.cs
* Added OnPlaybackLooped event
* Update Speaker.cs
Refactor: Optimize WavStreamSource with ArrayPool & dynamic buffering
Feat: Add Pitch (it can be reversed if you wish)
Update EXILED.props
* Update to c# lang version 14
* Update Speaker.cs
* Enum 4 byte to 1 byte
* -Replaced 'File.ReadAllBytes' with 'ArrayPool.Shared'
-Optimized WAV header skipping (string comparisons to direct uint32 hex checks)
* Refactor
* Initialize Channel property with ReliableOrdered2
* Refactor Speaker class properties
* Update Speaker.cs
* Update Speaker.cs
* ağhhh
* renamed method
* Added Target Player Play Mode
* .
* added lasttrack
* perf
* Gc halleder onları
* ö
* added lasttrack to finishedTrack
---
EXILED/EXILED.props | 2 +-
EXILED/Exiled.API/Enums/SpeakerPlayMode.cs | 35 ++
.../Features/Audio/PreloadedPcmSource.cs | 114 +++++
.../Features/Audio/WavStreamSource.cs | 144 ++++++
.../Exiled.API/Features/Audio/WavUtility.cs | 116 +++++
.../Features/Core/Generic/EnumClass.cs | 6 +-
.../Core/Generic/UnmanagedEnumClass.cs | 6 +-
EXILED/Exiled.API/Features/Toys/Speaker.cs | 431 +++++++++++++++++-
EXILED/Exiled.API/Interfaces/IPcmSource.cs | 52 +++
9 files changed, 894 insertions(+), 12 deletions(-)
create mode 100644 EXILED/Exiled.API/Enums/SpeakerPlayMode.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/WavStreamSource.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/WavUtility.cs
create mode 100644 EXILED/Exiled.API/Interfaces/IPcmSource.cs
diff --git a/EXILED/EXILED.props b/EXILED/EXILED.props
index f2b9761486..af916a48b3 100644
--- a/EXILED/EXILED.props
+++ b/EXILED/EXILED.props
@@ -7,7 +7,7 @@
net48
- 13.0
+ 14.0
x64
false
$(MSBuildThisFileDirectory)\bin\$(Configuration)\
diff --git a/EXILED/Exiled.API/Enums/SpeakerPlayMode.cs b/EXILED/Exiled.API/Enums/SpeakerPlayMode.cs
new file mode 100644
index 0000000000..9bafa513e1
--- /dev/null
+++ b/EXILED/Exiled.API/Enums/SpeakerPlayMode.cs
@@ -0,0 +1,35 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Enums
+{
+ ///
+ /// Specifies the available modes for playing audio through a speaker.
+ ///
+ public enum SpeakerPlayMode : byte
+ {
+ ///
+ /// Play audio globally to all players.
+ ///
+ Global = 0,
+
+ ///
+ /// Play audio to a specific player.
+ ///
+ Player = 1,
+
+ ///
+ /// Play audio to a specific list of players.
+ ///
+ PlayerList = 2,
+
+ ///
+ /// Play audio to players matching a predicate.
+ ///
+ Predicate = 3,
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs b/EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs
new file mode 100644
index 0000000000..7be9d09a30
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs
@@ -0,0 +1,114 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+
+ using Exiled.API.Interfaces;
+
+ using VoiceChat;
+
+ ///
+ /// Represents a preloaded PCM audio source.
+ ///
+ public sealed class PreloadedPcmSource : IPcmSource
+ {
+ ///
+ /// The PCM data buffer.
+ ///
+ private readonly float[] data;
+
+ ///
+ /// The current read position in the data buffer.
+ ///
+ private int pos;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The path to the audio file.
+ public PreloadedPcmSource(string path)
+ {
+ data = WavUtility.WavToPcm(path);
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The raw PCM float array.
+ public PreloadedPcmSource(float[] pcmData)
+ {
+ data = pcmData;
+ }
+
+ ///
+ /// Gets a value indicating whether the end of the PCM data buffer has been reached.
+ ///
+ public bool Ended => pos >= data.Length;
+
+ ///
+ /// Gets the total duration of the audio in seconds.
+ ///
+ public double TotalDuration => (double)data.Length / VoiceChatSettings.SampleRate;
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ public double CurrentTime
+ {
+ get => (double)pos / VoiceChatSettings.SampleRate;
+ set => Seek(value);
+ }
+
+ ///
+ /// Reads a sequence of PCM samples from the preloaded buffer into the specified array.
+ ///
+ /// The destination array to copy the samples into.
+ /// The zero-based index in at which to begin storing the data.
+ /// The maximum number of samples to read.
+ /// The number of samples read into .
+ public int Read(float[] buffer, int offset, int count)
+ {
+ int read = Math.Min(count, data.Length - pos);
+ Array.Copy(data, pos, buffer, offset, read);
+ pos += read;
+
+ return read;
+ }
+
+ ///
+ /// Seeks to the specified position in seconds.
+ ///
+ /// The target position in seconds.
+ public void Seek(double seconds)
+ {
+ long targetIndex = (long)(seconds * VoiceChatSettings.SampleRate);
+
+ if (targetIndex < 0)
+ targetIndex = 0;
+
+ if (targetIndex > data.Length)
+ targetIndex = data.Length;
+
+ pos = (int)targetIndex;
+ }
+
+ ///
+ /// Resets the read position to the beginning of the PCM data buffer.
+ ///
+ public void Reset()
+ {
+ pos = 0;
+ }
+
+ ///
+ public void Dispose()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/WavStreamSource.cs b/EXILED/Exiled.API/Features/Audio/WavStreamSource.cs
new file mode 100644
index 0000000000..d910093f1b
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/WavStreamSource.cs
@@ -0,0 +1,144 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+ using System.Buffers;
+ using System.IO;
+ using System.Runtime.InteropServices;
+
+ using Exiled.API.Interfaces;
+
+ using VoiceChat;
+
+ ///
+ /// Provides a PCM audio source from a WAV file stream.
+ ///
+ public sealed class WavStreamSource : IPcmSource
+ {
+ private const float Divide = 1f / 32768f;
+
+ private readonly long endPosition;
+ private readonly long startPosition;
+ private readonly FileStream stream;
+
+ private byte[] internalBuffer;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The path to the audio file.
+ public WavStreamSource(string path)
+ {
+ stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 64 * 1024, FileOptions.SequentialScan);
+ WavUtility.SkipHeader(stream);
+ startPosition = stream.Position;
+ endPosition = stream.Length;
+ internalBuffer = ArrayPool.Shared.Rent(VoiceChatSettings.PacketSizePerChannel * 2);
+ }
+
+ ///
+ /// Gets the total duration of the audio in seconds.
+ ///
+ public double TotalDuration => (endPosition - startPosition) / 2.0 / VoiceChatSettings.SampleRate;
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ public double CurrentTime
+ {
+ get => (stream.Position - startPosition) / 2.0 / VoiceChatSettings.SampleRate;
+ set => Seek(value);
+ }
+
+ ///
+ /// Gets a value indicating whether the end of the stream has been reached.
+ ///
+ public bool Ended => stream.Position >= endPosition;
+
+ ///
+ /// Reads PCM data from the stream into the specified buffer.
+ ///
+ /// The buffer to fill with PCM data.
+ /// The offset in the buffer at which to begin writing.
+ /// The maximum number of samples to read.
+ /// The number of samples read.
+ public int Read(float[] buffer, int offset, int count)
+ {
+ int bytesNeeded = count * 2;
+
+ if (internalBuffer.Length < bytesNeeded)
+ {
+ ArrayPool.Shared.Return(internalBuffer);
+ internalBuffer = ArrayPool.Shared.Rent(bytesNeeded);
+ }
+
+ int bytesRead = stream.Read(internalBuffer, 0, bytesNeeded);
+
+ if (bytesRead == 0)
+ return 0;
+
+ if (bytesRead % 2 != 0)
+ bytesRead--;
+
+ Span byteSpan = internalBuffer.AsSpan(0, bytesRead);
+ Span shortSpan = MemoryMarshal.Cast(byteSpan);
+
+ int samplesInDestination = buffer.Length - offset;
+ int samplesToWrite = Math.Min(shortSpan.Length, samplesInDestination);
+
+ for (int i = 0; i < samplesToWrite; i++)
+ buffer[offset + i] = shortSpan[i] * Divide;
+
+ return samplesToWrite;
+ }
+
+ ///
+ /// Seeks to the specified position in the stream.
+ ///
+ /// The position in seconds to seek to.
+ public void Seek(double seconds)
+ {
+ long targetSample = (long)(seconds * VoiceChatSettings.SampleRate);
+ long targetByte = targetSample * 2;
+
+ long newPos = startPosition + targetByte;
+ if (newPos > endPosition)
+ newPos = endPosition;
+
+ if (newPos < startPosition)
+ newPos = startPosition;
+
+ if (newPos % 2 != 0)
+ newPos--;
+
+ stream.Position = newPos;
+ }
+
+ ///
+ /// Resets the stream position to the start.
+ ///
+ public void Reset()
+ {
+ stream.Position = startPosition;
+ }
+
+ ///
+ /// Releases all resources used by the .
+ ///
+ public void Dispose()
+ {
+ stream?.Dispose();
+ if (internalBuffer != null)
+ {
+ ArrayPool.Shared.Return(internalBuffer);
+ internalBuffer = null;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/WavUtility.cs b/EXILED/Exiled.API/Features/Audio/WavUtility.cs
new file mode 100644
index 0000000000..c1b1bc3f73
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/WavUtility.cs
@@ -0,0 +1,116 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+ using System.Buffers;
+ using System.Buffers.Binary;
+ using System.IO;
+ using System.Runtime.InteropServices;
+
+ using VoiceChat;
+
+ ///
+ /// Provides utility methods for working with WAV audio files.
+ ///
+ public static class WavUtility
+ {
+ private const float Divide = 1f / 32768f;
+
+ ///
+ /// Converts a WAV file at the specified path to a PCM float array.
+ ///
+ /// The file path of the WAV file to convert.
+ /// An array of floats representing the PCM data.
+ public static float[] WavToPcm(string path)
+ {
+ using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read);
+ int length = (int)fs.Length;
+
+ byte[] rentedBuffer = ArrayPool.Shared.Rent(length);
+
+ try
+ {
+ int bytesRead = fs.Read(rentedBuffer, 0, length);
+
+ using MemoryStream ms = new(rentedBuffer, 0, bytesRead);
+
+ SkipHeader(ms);
+
+ int headerOffset = (int)ms.Position;
+ int dataLength = bytesRead - headerOffset;
+
+ Span audioDataSpan = rentedBuffer.AsSpan(headerOffset, dataLength);
+ Span samples = MemoryMarshal.Cast(audioDataSpan);
+
+ float[] pcm = new float[samples.Length];
+
+ for (int i = 0; i < samples.Length; i++)
+ pcm[i] = samples[i] * Divide;
+
+ return pcm;
+ }
+ finally
+ {
+ ArrayPool.Shared.Return(rentedBuffer);
+ }
+ }
+
+ ///
+ /// Skips the WAV file header and validates that the format is PCM16 mono with the specified sample rate.
+ ///
+ /// The to read from.
+ public static void SkipHeader(Stream stream)
+ {
+ Span headerBuffer = stackalloc byte[12];
+ stream.Read(headerBuffer);
+
+ Span chunkHeader = stackalloc byte[8];
+ while (true)
+ {
+ int read = stream.Read(chunkHeader);
+ if (read < 8)
+ break;
+
+ uint chunkId = BinaryPrimitives.ReadUInt32LittleEndian(chunkHeader[..4]);
+ int chunkSize = BinaryPrimitives.ReadInt32LittleEndian(chunkHeader.Slice(4, 4));
+
+ // 'fmt ' chunk
+ if (chunkId == 0x20746D66)
+ {
+ Span fmtData = stackalloc byte[16];
+ stream.Read(fmtData);
+
+ short format = BinaryPrimitives.ReadInt16LittleEndian(fmtData[..2]);
+ short channels = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(2, 2));
+ int rate = BinaryPrimitives.ReadInt32LittleEndian(fmtData.Slice(4, 4));
+ short bits = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(14, 2));
+
+ if (format != 1 || channels != 1 || rate != VoiceChatSettings.SampleRate || bits != 16)
+ throw new InvalidDataException($"Invalid WAV format (format={format}, channels={channels}, rate={rate}, bits={bits}). Expected PCM16, mono and {VoiceChatSettings.SampleRate}Hz.");
+
+ if (chunkSize > 16)
+ stream.Seek(chunkSize - 16, SeekOrigin.Current);
+ }
+
+ // 'data' chunk
+ else if (chunkId == 0x61746164)
+ {
+ return;
+ }
+ else
+ {
+ stream.Seek(chunkSize, SeekOrigin.Current);
+ }
+
+ if (stream.Position >= stream.Length)
+ throw new InvalidDataException("WAV file does not contain a 'data' chunk.");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs b/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs
index 5f883d0bcf..0f3077d874 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs
@@ -67,10 +67,10 @@ public string Name
.GetFields(BindingFlags.Static | BindingFlags.GetField | BindingFlags.Public)
.Where(t => t.FieldType == typeof(TObject));
- foreach (FieldInfo field in fields)
+ foreach (FieldInfo @field in fields)
{
- TObject instance = (TObject)field.GetValue(null);
- instance.name = field.Name;
+ TObject instance = (TObject)@field.GetValue(null);
+ instance.name = @field.Name;
}
isDefined = true;
diff --git a/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs b/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs
index 7928f38783..ce82315efa 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs
@@ -67,10 +67,10 @@ public string Name
.GetFields(BindingFlags.Static | BindingFlags.GetField | BindingFlags.Public)
.Where(t => t.FieldType == typeof(TObject));
- foreach (FieldInfo field in fields)
+ foreach (FieldInfo @field in fields)
{
- TObject instance = (TObject)field.GetValue(null);
- instance.name = field.Name;
+ TObject instance = (TObject)@field.GetValue(null);
+ instance.name = @field.Name;
}
isDefined = true;
diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs
index 8b0af6bd79..4478c1143b 100644
--- a/EXILED/Exiled.API/Features/Toys/Speaker.cs
+++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs
@@ -7,20 +7,53 @@
namespace Exiled.API.Features.Toys
{
+ using System;
using System.Collections.Generic;
+ using System.IO;
using AdminToys;
+
using Enums;
- using Exiled.API.Interfaces;
+
+ using Exiled.API.Features.Audio;
+
+ using Interfaces;
+
+ using MEC;
+
+ using Mirror;
+
using UnityEngine;
+
+ using VoiceChat;
+ using VoiceChat.Codec;
+ using VoiceChat.Codec.Enums;
using VoiceChat.Networking;
- using VoiceChat.Playbacks;
+
+ using Object = UnityEngine.Object;
///
/// A wrapper class for .
///
public class Speaker : AdminToy, IWrapper
{
+ private const int FrameSize = VoiceChatSettings.PacketSizePerChannel;
+ private const float FrameTime = (float)FrameSize / VoiceChatSettings.SampleRate;
+
+ private float[] frame;
+ private byte[] encoded;
+ private float[] resampleBuffer;
+
+ private double resampleTime;
+ private int resampleBufferFilled;
+
+ private IPcmSource source;
+ private OpusEncoder encoder;
+ private CoroutineHandle playBackRoutine;
+
+ private bool isPitchDefault = true;
+ private bool isPlayBackInitialized = false;
+
///
/// Initializes a new instance of the class.
///
@@ -28,6 +61,37 @@ public class Speaker : AdminToy, IWrapper
internal Speaker(SpeakerToy speakerToy)
: base(speakerToy, AdminToyType.Speaker) => Base = speakerToy;
+ ///
+ /// Invoked when the audio playback starts.
+ ///
+ public event Action OnPlaybackStarted;
+
+ ///
+ /// Invoked when the audio playback is paused.
+ ///
+ public event Action OnPlaybackPaused;
+
+ ///
+ /// Invoked when the audio playback is resumed from a paused state.
+ ///
+ public event Action OnPlaybackResumed;
+
+ ///
+ /// Invoked when the audio playback loops back to the beginning.
+ ///
+ public event Action OnPlaybackLooped;
+
+ ///
+ /// Invoked when the audio track finishes playing.
+ /// If looping is enabled, this triggers every time the track finished.
+ ///
+ public event Action OnPlaybackFinished;
+
+ ///
+ /// Invoked when the audio playback stops completely (either manually or end of file).
+ ///
+ public event Action OnPlaybackStopped;
+
///
/// Gets the prefab.
///
@@ -38,6 +102,123 @@ internal Speaker(SpeakerToy speakerToy)
///
public SpeakerToy Base { get; }
+ ///
+ /// Gets or sets the network channel used for sending audio packets from this speaker .
+ ///
+ public int Channel { get; set; } = Channels.ReliableOrdered2;
+
+ ///
+ /// Gets or sets a value indicating whether the audio playback should loop when it reaches the end.
+ ///
+ public bool Loop { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the speaker should be destroyed after playback finishes.
+ ///
+ public bool DestroyAfter { get; set; }
+
+ ///
+ /// Gets or sets the play mode for this speaker, determining how audio is sent to players.
+ ///
+ public SpeakerPlayMode PlayMode { get; set; }
+
+ ///
+ /// Gets or sets the target player who will hear the audio played by this speaker when is set to .
+ ///
+ public Player TargetPlayer { get; set; }
+
+ ///
+ /// Gets or sets the list of target players who will hear the audio played by this speaker when is set to .
+ ///
+ public HashSet TargetPlayers { get; set; }
+
+ ///
+ /// Gets or sets the predicate used to determine which players will hear the audio when is set to .
+ /// The predicate should return true for players who should receive the audio.
+ ///
+ public Func Predicate { get; set; }
+
+ ///
+ /// Gets a value indicating whether gets is a sound playing on this speaker or not.
+ ///
+ public bool IsPlaying => playBackRoutine.IsRunning && !IsPaused;
+
+ ///
+ /// Gets or sets a value indicating whether the playback is paused.
+ ///
+ ///
+ /// A where true means the playback is paused; false means it is not paused.
+ ///
+ public bool IsPaused
+ {
+ get => playBackRoutine.IsAliveAndPaused;
+ set
+ {
+ if (!playBackRoutine.IsRunning)
+ return;
+
+ if (playBackRoutine.IsAliveAndPaused == value)
+ return;
+
+ playBackRoutine.IsAliveAndPaused = value;
+ if (value)
+ OnPlaybackPaused?.Invoke();
+ else
+ OnPlaybackResumed?.Invoke();
+ }
+ }
+
+ ///
+ /// Gets or sets the current playback time in seconds.
+ /// Returns 0 if not playing.
+ ///
+ public double CurrentTime
+ {
+ get => source?.CurrentTime ?? 0.0;
+ set
+ {
+ if (source != null)
+ {
+ source.CurrentTime = value;
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+ }
+ }
+ }
+
+ ///
+ /// Gets the total duration of the current track in seconds.
+ /// Returns 0 if not playing.
+ ///
+ public double TotalDuration => source?.TotalDuration ?? 0.0;
+
+ ///
+ /// Gets the path to the last audio file played on this speaker.
+ ///
+ public string LastTrack { get; private set; }
+
+ ///
+ /// Gets or sets the playback pitch.
+ ///
+ ///
+ /// A representing the pitch level of the audio source,
+ /// where 1.0 is normal pitch, less than 1.0 is lower pitch (slower), and greater than 1.0 is higher pitch (faster).
+ ///
+ public float Pitch
+ {
+ get;
+ set
+ {
+ field = Mathf.Max(0.1f, Mathf.Abs(value));
+ isPitchDefault = Mathf.Abs(field - 1.0f) < 0.0001f;
+ if (isPitchDefault)
+ {
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+ }
+ }
+ }
+
///
/// Gets or sets the volume of the audio source.
///
@@ -109,7 +290,7 @@ public byte ControllerId
/// The new .
public static Speaker Create(Vector3? position, Vector3? rotation, Vector3? scale, bool spawn)
{
- Speaker speaker = new(UnityEngine.Object.Instantiate(Prefab))
+ Speaker speaker = new(Object.Instantiate(Prefab))
{
Position = position ?? Vector3.zero,
Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
@@ -138,7 +319,7 @@ public static Speaker Create(Transform transform, bool spawn, bool worldPosition
Scale = transform.localScale.normalized,
};
- if(spawn)
+ if (spawn)
speaker.Spawn();
return speaker;
@@ -162,5 +343,245 @@ public static void Play(AudioMessage message, IEnumerable targets = null
/// The length of the samples array.
/// Targets who will hear the audio. If null, audio will be sent to all players.
public void Play(byte[] samples, int? length = null, IEnumerable targets = null) => Play(new AudioMessage(ControllerId, samples, length ?? samples.Length), targets);
+
+ ///
+ /// Plays a wav file through this speaker.(File must be 16 bit, mono and 48khz.)
+ ///
+ /// The path to the wav file.
+ /// Whether to stream the audio or preload it.
+ /// Whether to destroy the speaker after playback.
+ /// Whether to loop the audio.
+ public void Play(string path, bool stream = false, bool destroyAfter = false, bool loop = false)
+ {
+ if (!File.Exists(path))
+ throw new FileNotFoundException("The specified file does not exist.", path);
+
+ if (!path.EndsWith(".wav", StringComparison.OrdinalIgnoreCase))
+ throw new NotSupportedException($"The file type '{Path.GetExtension(path)}' is not supported. Please use .wav file.");
+
+ TryInitializePlayBack();
+ Stop();
+
+ Loop = loop;
+ LastTrack = path;
+ DestroyAfter = destroyAfter;
+ source = stream ? new WavStreamSource(path) : new PreloadedPcmSource(path);
+ playBackRoutine = Timing.RunCoroutine(PlayBackCoroutine().CancelWith(GameObject));
+ }
+
+ ///
+ /// Stops playback.
+ ///
+ public void Stop()
+ {
+ if (playBackRoutine.IsRunning)
+ {
+ Timing.KillCoroutines(playBackRoutine);
+ OnPlaybackStopped?.Invoke();
+ }
+
+ source?.Dispose();
+ source = null;
+ }
+
+ private void TryInitializePlayBack()
+ {
+ if (isPlayBackInitialized)
+ return;
+
+ isPlayBackInitialized = true;
+
+ frame = new float[FrameSize];
+ resampleBuffer = Array.Empty();
+ encoder = new(OpusApplicationType.Audio);
+ encoded = new byte[VoiceChatSettings.MaxEncodedSize];
+
+ AdminToyBase.OnRemoved += OnToyRemoved;
+ }
+
+ private IEnumerator PlayBackCoroutine()
+ {
+ OnPlaybackStarted?.Invoke();
+
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+
+ float timeAccumulator = 0f;
+
+ while (true)
+ {
+ timeAccumulator += Time.deltaTime;
+
+ while (timeAccumulator >= FrameTime)
+ {
+ timeAccumulator -= FrameTime;
+
+ if (isPitchDefault)
+ {
+ int read = source.Read(frame, 0, FrameSize);
+ if (read < FrameSize)
+ Array.Clear(frame, read, FrameSize - read);
+ }
+ else
+ {
+ ResampleFrame();
+ }
+
+ int len = encoder.Encode(frame, encoded);
+
+ if (len > 2)
+ SendPacket(len);
+
+ if (!source.Ended)
+ continue;
+
+ OnPlaybackFinished?.Invoke(LastTrack);
+
+ if (Loop)
+ {
+ source.Reset();
+ OnPlaybackLooped?.Invoke();
+ resampleTime = resampleBufferFilled = 0;
+ continue;
+ }
+
+ if (DestroyAfter)
+ Destroy();
+ else
+ Stop();
+
+ yield break;
+ }
+
+ yield return Timing.WaitForOneFrame;
+ }
+ }
+
+ private void ResampleFrame()
+ {
+ int requiredSize = (int)(FrameSize * Mathf.Abs(Pitch) * 2) + 10;
+
+ if (resampleBuffer.Length < requiredSize)
+ {
+ resampleBuffer = new float[requiredSize];
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+ }
+
+ int outputIdx = 0;
+
+ while (outputIdx < FrameSize)
+ {
+ if (resampleBufferFilled == 0)
+ {
+ int toRead = resampleBuffer.Length - 4;
+ int actualRead = source.Read(resampleBuffer, 0, toRead);
+
+ if (actualRead == 0)
+ {
+ while (outputIdx < FrameSize)
+ frame[outputIdx++] = 0f;
+ return;
+ }
+
+ resampleBufferFilled = actualRead;
+ resampleTime = 0.0;
+ }
+
+ int currentSample = (int)resampleTime;
+
+ if (currentSample >= resampleBufferFilled - 1)
+ {
+ if (resampleBufferFilled > 0)
+ {
+ resampleBuffer[0] = resampleBuffer[resampleBufferFilled - 1];
+
+ int toRead = resampleBuffer.Length - 5;
+ int actualRead = source.Read(resampleBuffer, 1, toRead);
+
+ if (actualRead == 0)
+ {
+ while (outputIdx < FrameSize)
+ frame[outputIdx++] = 0f;
+ return;
+ }
+
+ resampleBufferFilled = actualRead + 1;
+ resampleTime -= currentSample;
+ }
+ else
+ {
+ resampleBufferFilled = 0;
+ }
+
+ continue;
+ }
+
+ double frac = resampleTime - currentSample;
+ float sample1 = resampleBuffer[currentSample];
+ float sample2 = resampleBuffer[currentSample + 1];
+
+ frame[outputIdx++] = (float)(sample1 + ((sample2 - sample1) * frac));
+
+ resampleTime += Pitch;
+ }
+ }
+
+ private void SendPacket(int len)
+ {
+ AudioMessage msg = new(ControllerId, encoded, len);
+
+ switch (PlayMode)
+ {
+ case SpeakerPlayMode.Global:
+ NetworkServer.SendToReady(msg, Channel);
+ break;
+
+ case SpeakerPlayMode.Player:
+ TargetPlayer?.Connection.Send(msg, Channel);
+ break;
+
+ case SpeakerPlayMode.PlayerList:
+ using (NetworkWriterPooled writer = NetworkWriterPool.Get())
+ {
+ NetworkMessages.Pack(msg, writer);
+ ArraySegment segment = writer.ToArraySegment();
+
+ foreach (Player ply in TargetPlayers)
+ {
+ ply?.Connection.Send(segment, Channel);
+ }
+ }
+
+ break;
+
+ case SpeakerPlayMode.Predicate:
+ using (NetworkWriterPooled writer = NetworkWriterPool.Get())
+ {
+ NetworkMessages.Pack(msg, writer);
+ ArraySegment segment = writer.ToArraySegment();
+
+ foreach (Player ply in Player.List)
+ {
+ if (Predicate(ply))
+ ply.Connection.Send(segment, Channel);
+ }
+ }
+
+ break;
+ }
+ }
+
+ private void OnToyRemoved(AdminToyBase toy)
+ {
+ if (toy != Base)
+ return;
+
+ AdminToyBase.OnRemoved -= OnToyRemoved;
+
+ Stop();
+
+ encoder?.Dispose();
+ }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/IPcmSource.cs b/EXILED/Exiled.API/Interfaces/IPcmSource.cs
new file mode 100644
index 0000000000..680f568410
--- /dev/null
+++ b/EXILED/Exiled.API/Interfaces/IPcmSource.cs
@@ -0,0 +1,52 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Interfaces
+{
+ using System;
+
+ ///
+ /// Represents a source of PCM audio data.
+ ///
+ public interface IPcmSource : IDisposable
+ {
+ ///
+ /// Gets a value indicating whether the end of the PCM source has been reached.
+ ///
+ bool Ended { get; }
+
+ ///
+ /// Gets the total duration of the audio in seconds.
+ ///
+ double TotalDuration { get; }
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ double CurrentTime { get; set; }
+
+ ///
+ /// Reads a sequence of PCM samples into the specified buffer.
+ ///
+ /// The buffer to read the samples into.
+ /// The zero-based index in the buffer at which to begin storing the data read from the source.
+ /// The maximum number of samples to read.
+ /// The total number of samples read into the buffer.
+ int Read(float[] buffer, int offset, int count);
+
+ ///
+ /// Seeks to the specified position in the PCM source.
+ ///
+ /// The position in seconds to seek to.
+ void Seek(double seconds);
+
+ ///
+ /// Resets the PCM source to its initial state, allowing reading from the beginning.
+ ///
+ void Reset();
+ }
+}
From 1c829c94432723f4c4075bd72efe5249478fb8e3 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Mon, 16 Feb 2026 15:28:38 +0100
Subject: [PATCH 05/39] fix: Blinded -> Blindness
---
EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs b/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs
index 769f5ad936..ca4fbdd32d 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs
@@ -180,7 +180,7 @@ private void InternalRemove(Player player, Scp1344 goggles)
if (CanBeRemoveSafely)
{
- player.DisableEffect(EffectType.Blinded);
+ player.DisableEffect(EffectType.Blindness);
player.ReferenceHub?.DisableWearables(WearableElements.Scp1344Goggles);
}
From 59645fcec0f7fbe99cb8e190d6e9c88cddb6d10f Mon Sep 17 00:00:00 2001
From: michcio <89903081+michcio15@users.noreply.github.com>
Date: Thu, 19 Feb 2026 12:01:50 +0100
Subject: [PATCH 06/39] feat: add setter `Usable::IsUsing` (#753)
* Adds a event that is called after player stops talking with 1576
* Simplify initialization of TransmissionEnded event.
* should be no more warnings when build
* Apply suggestions from code review
Co-authored-by: @Someone <45270312+Someone-193@users.noreply.github.com>
* added the suggestions to make it more exiled like
* Moved to Player Handler
* Update Scp1576TransmissionEnded.cs
Change comments
* Add `StartUsing` method to force item usage
* adds very professional comment
* Adds stop using
* Refactor `IsUsing` property to include setter and remove redundant usage methods
---------
Co-authored-by: @Someone <45270312+Someone-193@users.noreply.github.com>
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
---
EXILED/Exiled.API/Features/Items/Usable.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Items/Usable.cs b/EXILED/Exiled.API/Features/Items/Usable.cs
index b58f6b8dd9..efdff0c2ff 100644
--- a/EXILED/Exiled.API/Features/Items/Usable.cs
+++ b/EXILED/Exiled.API/Features/Items/Usable.cs
@@ -67,9 +67,13 @@ internal Usable(ItemType type)
}
///
- /// Gets a value indicating whether the item is currently being used.
+ /// Gets or sets a value indicating whether the item is currently being used.
///
- public bool IsUsing => Base.IsUsing;
+ public bool IsUsing
+ {
+ get => Base.IsUsing;
+ set => UsableItemsController.ServerEmulateMessage(Serial, value ? StatusMessage.StatusType.Start : StatusMessage.StatusType.Cancel);
+ }
///
/// Gets or sets how long it takes to use the item.
From 0ef3c68c8b084d748a11c8f03d77cbcb3ee22069 Mon Sep 17 00:00:00 2001
From: michcio <89903081+michcio15@users.noreply.github.com>
Date: Thu, 19 Feb 2026 12:02:25 +0100
Subject: [PATCH 07/39] feat: buttons array (#752)
* Adds a event that is called after player stops talking with 1576
* Simplify initialization of TransmissionEnded event.
* should be no more warnings when build
* Apply suggestions from code review
Co-authored-by: @Someone <45270312+Someone-193@users.noreply.github.com>
* added the suggestions to make it more exiled like
* Moved to Player Handler
* Update Scp1576TransmissionEnded.cs
Change comments
* Expose Buttons property in Door class to access door button variants
---------
Co-authored-by: @Someone <45270312+Someone-193@users.noreply.github.com>
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
---
EXILED/Exiled.API/Features/Doors/Door.cs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index a8163f207c..81dcb427f4 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -16,6 +16,7 @@ namespace Exiled.API.Features.Doors
using Exiled.API.Features.Core;
using Exiled.API.Interfaces;
using Interactables.Interobjects;
+ using Interactables.Interobjects.DoorButtons;
using Interactables.Interobjects.DoorUtils;
using MEC;
using Mirror;
@@ -298,6 +299,11 @@ public Vector3 Scale
///
public ZoneType Zone => Room?.Zone ?? ZoneType.Unspecified;
+ ///
+ /// Gets the door's .
+ ///
+ public ButtonVariant[] Buttons => Base.Buttons;
+
///
/// Gets a containing all 's that are connected with .
///
From be6d92d0bc356da0a9334fe93ab7cb4ffbf2a3b2 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Fri, 20 Feb 2026 21:56:36 +0100
Subject: [PATCH 08/39] feat!: More more c#14 (#756)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Speaker Toy Api
* .
* chore: trigger CI
* added missing doc
* Change default stream parameter to false in PlayWav
* Improve XML documentation for Channel property
Updated XML documentation for the Channel property to include a reference to Channels.
* Update WavStreamSource.cs
Update PreloadedPcmSource.cs
Update Speaker.cs
Create WavUtility.cs
Update WavStreamSource.cs
Update PreloadedPcmSource.cs
Change default stream parameter to false in PlayWav
Update PlayWav method to default stream to true
Change TargetPlayers from List to HashSet
* Update Speaker.cs
* Update Speaker.cs
* Update performance
* Update Speaker.cs
Update PreloadedPcmSource.cs
Added another constructor for public usages
Update PreloadedPcmSource.cs
* Implemented audio seeking, event system, and precision timing
- Introduced a full Event system to the Speaker class (Started, Finished, Stopped, Paused, Resumed).
- Implemented `Seek()` functionality and added `CurrentTime` / `TotalDuration` properties.
- Utilized `double` precision for all time related calculations to ensure accuracy.
- Updated `WavStreamSource` and `PreloadedPcmSource` to support the new seeking logic.
* Update Speaker.cs
* Update WavUtility.cs
* Update Speaker.cs
* Update Speaker.cs
* Update Speaker.cs
* Update Speaker.cs
* Added OnPlaybackLooped event
* Update Speaker.cs
Refactor: Optimize WavStreamSource with ArrayPool & dynamic buffering
Feat: Add Pitch (it can be reversed if you wish)
Update EXILED.props
* Update to c# lang version 14
* Update Speaker.cs
* Enum 4 byte to 1 byte
* -Replaced 'File.ReadAllBytes' with 'ArrayPool.Shared'
-Optimized WAV header skipping (string comparisons to direct uint32 hex checks)
* Refactor
* Initialize Channel property with ReliableOrdered2
* Refactor Speaker class properties
* Update Speaker.cs
* Update Speaker.cs
* ağhhh
* renamed method
* Added Target Player Play Mode
* C# 14
BreakingChange for LeftPlayerEvent
* i miss that part :3
* Oups
* fix: EffectType.Blinded -> EffectType.Blindness
* Apply suggestions from code review
* Revert "Apply suggestions from code review"
This reverts commit 449bc275bdaa9c0b8333314547bfbe868762e802.
---------
Co-authored-by: MS-crew <100300664+MS-crew@users.noreply.github.com>
Co-authored-by: Mustafa SAVAŞ
---
.../Exiled.API/Extensions/MirrorExtensions.cs | 9 ++----
EXILED/Exiled.API/Features/Camera.cs | 4 +--
EXILED/Exiled.API/Features/Core/EActor.cs | 18 +++++------
.../Core/StateMachine/StateController.cs | 11 ++++---
.../DamageHandlers/DamageHandlerBase.cs | 17 +++++------
EXILED/Exiled.API/Features/Generator.cs | 3 +-
.../Features/Hazards/AmnesticCloudHazard.cs | 8 ++---
.../Features/Hazards/TantrumHazard.cs | 8 ++---
EXILED/Exiled.API/Features/Map.cs | 8 ++---
.../Features/Pickups/BodyArmorPickup.cs | 23 ++++----------
EXILED/Exiled.API/Features/Player.cs | 30 ++++++++-----------
EXILED/Exiled.API/Features/Respawn.cs | 15 ++++------
EXILED/Exiled.API/Features/Roles/FpcRole.cs | 6 ++--
EXILED/Exiled.API/Features/Server.cs | 4 +--
EXILED/Exiled.API/Features/Warhead.cs | 4 +--
.../AggregateExpectationTypeResolver.cs | 2 +-
.../Cassie/SendingCassieMessageEventArgs.cs | 19 +++++-------
.../Map/ExplodingGrenadeEventArgs.cs | 6 ++--
.../EventArgs/Player/BanningEventArgs.cs | 10 +++----
.../EventArgs/Player/ChangingItemEventArgs.cs | 8 ++---
.../EventArgs/Player/ChangingRoleEventArgs.cs | 6 ++--
.../EventArgs/Player/DroppingAmmoEventArgs.cs | 14 ++-------
.../EventArgs/Player/DroppingItemEventArgs.cs | 15 +++-------
.../EventArgs/Player/EscapingEventArgs.cs | 6 ++--
.../InteractingShootingTargetEventArgs.cs | 15 ++++------
.../EventArgs/Player/KickingEventArgs.cs | 29 ++++++++----------
.../EventArgs/Player/LeftEventArgs.cs | 13 ++++----
.../Player/ReservedSlotsCheckEventArgs.cs | 7 ++---
.../EventArgs/Player/RevokingMuteEventArgs.cs | 22 ++++++++++++--
.../Scp914/ChangingKnobSettingEventArgs.cs | 6 ++--
.../Server/RespawningTeamEventArgs.cs | 8 ++---
.../EventArgs/Warhead/StartingEventArgs.cs | 16 ++++++++--
EXILED/Exiled.Events/Events.cs | 6 ++--
.../Patches/Generic/AirlockListAdd.cs | 2 +-
.../Patches/Generic/CoffeeListAdd.cs | 2 +-
.../Patches/Generic/HazardList.cs | 2 +-
.../Exiled.Events/Patches/Generic/LiftList.cs | 2 +-
37 files changed, 166 insertions(+), 218 deletions(-)
diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
index 9fb9e47409..20f5b1a376 100644
--- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
@@ -56,9 +56,6 @@ public static class MirrorExtensions
private static readonly ReadOnlyDictionary ReadOnlyWriterExtensionsValue = new(WriterExtensionsValue);
private static readonly ReadOnlyDictionary ReadOnlySyncVarDirtyBitsValue = new(SyncVarDirtyBitsValue);
private static readonly ReadOnlyDictionary ReadOnlyRpcFullNamesValue = new(RpcFullNamesValue);
- private static MethodInfo setDirtyBitsMethodInfoValue;
- private static MethodInfo sendSpawnMessageMethodInfoValue;
- private static string[] adminToyBaseSyncVarsValue;
///
/// Gets corresponding to .
@@ -153,17 +150,17 @@ public static ReadOnlyDictionary RpcFullNames
///
/// Gets a 's .
///
- public static MethodInfo SetDirtyBitsMethodInfo => setDirtyBitsMethodInfoValue ??= typeof(NetworkBehaviour).GetMethod(nameof(NetworkBehaviour.SetSyncVarDirtyBit));
+ public static MethodInfo SetDirtyBitsMethodInfo => field ??= typeof(NetworkBehaviour).GetMethod(nameof(NetworkBehaviour.SetSyncVarDirtyBit));
///
/// Gets a NetworkServer.SendSpawnMessage's .
///
- public static MethodInfo SendSpawnMessageMethodInfo => sendSpawnMessageMethodInfoValue ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static);
+ public static MethodInfo SendSpawnMessageMethodInfo => field ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static);
///
/// Gets all sync var names.
///
- public static string[] AdminToyBaseSyncVars => adminToyBaseSyncVarsValue ??= typeof(AdminToyBase).GetProperties().Where(property => property.Name.Contains("Network")).Select(property => property.Name).ToArray();
+ public static string[] AdminToyBaseSyncVars => field ??= typeof(AdminToyBase).GetProperties().Where(property => property.Name.Contains("Network")).Select(property => property.Name).ToArray();
///
/// Plays a beep sound that only the target can hear.
diff --git a/EXILED/Exiled.API/Features/Camera.cs b/EXILED/Exiled.API/Features/Camera.cs
index fa17a77540..4eedc693dd 100644
--- a/EXILED/Exiled.API/Features/Camera.cs
+++ b/EXILED/Exiled.API/Features/Camera.cs
@@ -157,8 +157,6 @@ public class Camera : IWrapper, IWorldSpace
["SZ CAMERA TOY"] = CameraType.SzCameraToy,
};
- private Room room;
-
///
/// Initializes a new instance of the class.
///
@@ -220,7 +218,7 @@ internal Camera(Scp079Camera camera079)
///
/// Gets the camera's .
///
- public Room Room => room ??= Room.Get(Base.Room);
+ public Room Room => field ??= Room.Get(Base.Room);
///
/// Gets the camera's .
diff --git a/EXILED/Exiled.API/Features/Core/EActor.cs b/EXILED/Exiled.API/Features/Core/EActor.cs
index f7f6beca77..b051974788 100644
--- a/EXILED/Exiled.API/Features/Core/EActor.cs
+++ b/EXILED/Exiled.API/Features/Core/EActor.cs
@@ -31,8 +31,6 @@ public abstract class EActor : EObject, IEntity, IWorldSpace
private readonly HashSet componentsInChildren = HashSetPool.Pool.Get();
private CoroutineHandle serverTick;
- private bool canEverTick;
- private float fixedTickRate;
///
/// Initializes a new instance of the class.
@@ -42,10 +40,10 @@ protected EActor()
{
IsEditable = true;
CanEverTick = true;
- fixedTickRate = DefaultFixedTickRate;
+ FixedTickRate = DefaultFixedTickRate;
PostInitialize();
- Timing.CallDelayed(fixedTickRate, () => OnBeginPlay());
- Timing.CallDelayed(fixedTickRate * 2, () => serverTick = Timing.RunCoroutine(ServerTick()));
+ Timing.CallDelayed(FixedTickRate, OnBeginPlay);
+ Timing.CallDelayed(FixedTickRate * 2, () => serverTick = Timing.RunCoroutine(ServerTick()));
}
///
@@ -99,15 +97,15 @@ public virtual Vector3 Scale
///
public virtual bool CanEverTick
{
- get => canEverTick;
+ get;
set
{
if (!IsEditable)
return;
- canEverTick = value;
+ field = value;
- if (canEverTick)
+ if (field)
{
Timing.ResumeCoroutines(serverTick);
return;
@@ -122,13 +120,13 @@ public virtual bool CanEverTick
///
public virtual float FixedTickRate
{
- get => fixedTickRate;
+ get;
set
{
if (!IsEditable)
return;
- fixedTickRate = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs b/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs
index bce10ed688..ce193ec7a5 100644
--- a/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs
+++ b/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs
@@ -19,7 +19,6 @@ namespace Exiled.API.Features.Core.StateMachine
public abstract class StateController : EActor
{
private readonly List states = new();
- private State currentState;
///
/// Gets all handled states.
@@ -31,14 +30,14 @@ public abstract class StateController : EActor
///
public State CurrentState
{
- get => currentState;
+ get;
set
{
- if (currentState.Id == value.Id)
+ if (field.Id == value.Id)
return;
- (PreviousState = currentState).OnExit(this);
- (currentState = value).OnEnter(this);
+ (PreviousState = field).OnExit(this);
+ (field = value).OnEnter(this);
OnStateChanged();
}
@@ -75,7 +74,7 @@ public virtual void StateUpdate(State state)
protected virtual void OnStateChanged()
{
EndStateMulticastDispatcher.InvokeAll(PreviousState);
- BeginStateMulticastDispatcher.InvokeAll(currentState);
+ BeginStateMulticastDispatcher.InvokeAll(CurrentState);
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
index 248e89452b..6a9b8f4562 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
@@ -28,9 +28,6 @@ namespace Exiled.API.Features.DamageHandlers
///
public abstract class DamageHandlerBase
{
- private DamageType damageType;
- private CassieAnnouncement cassieAnnouncement;
-
///
/// Initializes a new instance of the class.
///
@@ -78,8 +75,8 @@ public enum Action : byte
///
public virtual CassieAnnouncement CassieDeathAnnouncement
{
- get => cassieAnnouncement ?? Base.CassieDeathAnnouncement;
- protected set => cassieAnnouncement = value;
+ get => field ?? Base.CassieDeathAnnouncement;
+ protected set;
}
///
@@ -94,11 +91,11 @@ public virtual DamageType Type
{
get
{
- if (damageType != DamageType.Unknown)
- return damageType;
+ if (field != DamageType.Unknown)
+ return field;
- damageType = GetDamageType();
- return damageType;
+ field = GetDamageType();
+ return field;
}
protected set
@@ -106,7 +103,7 @@ protected set
if (!Enum.IsDefined(typeof(DamageType), value))
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(DamageType));
- damageType = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.API/Features/Generator.cs b/EXILED/Exiled.API/Features/Generator.cs
index 125bdd347b..8f3d6f41be 100644
--- a/EXILED/Exiled.API/Features/Generator.cs
+++ b/EXILED/Exiled.API/Features/Generator.cs
@@ -27,7 +27,6 @@ public class Generator : IWrapper, IWorldSpace, IStructureSync
/// A of on the map.
///
internal static readonly Dictionary Scp079GeneratorToGenerator = new(new ComponentsEqualityComparer());
- private Room room;
///
/// Initializes a new instance of the class.
@@ -63,7 +62,7 @@ internal Generator(Scp079Generator scp079Generator)
///
/// Gets the generator's .
///
- public Room Room => room ??= Room.FindParentRoom(GameObject);
+ public Room Room => field ??= Room.FindParentRoom(GameObject);
///
/// Gets or sets the generator' state.
diff --git a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
index cc9bff8d67..3c2a982ab7 100644
--- a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
@@ -15,8 +15,6 @@ namespace Exiled.API.Features.Hazards
///
public class AmnesticCloudHazard : TemporaryHazard
{
- private static Scp939AmnesticCloudInstance amnesticCloudPrefab;
-
///
/// Initializes a new instance of the class.
///
@@ -36,10 +34,10 @@ public static Scp939AmnesticCloudInstance AmnesticCloudPrefab
{
get
{
- if (amnesticCloudPrefab == null)
- amnesticCloudPrefab = PrefabHelper.GetPrefab(PrefabType.AmnesticCloudHazard);
+ if (field == null)
+ field = PrefabHelper.GetPrefab(PrefabType.AmnesticCloudHazard);
- return amnesticCloudPrefab;
+ return field;
}
}
diff --git a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
index 2e36627d8b..1660ba4dc9 100644
--- a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
@@ -18,8 +18,6 @@ namespace Exiled.API.Features.Hazards
///
public class TantrumHazard : TemporaryHazard
{
- private static TantrumEnvironmentalHazard tantrumPrefab;
-
///
/// Initializes a new instance of the class.
///
@@ -37,10 +35,10 @@ public static TantrumEnvironmentalHazard TantrumPrefab
{
get
{
- if (tantrumPrefab == null)
- tantrumPrefab = PrefabHelper.GetPrefab(PrefabType.TantrumObj);
+ if (field == null)
+ field = PrefabHelper.GetPrefab(PrefabType.TantrumObj);
- return tantrumPrefab;
+ return field;
}
}
diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs
index c4feacd0cb..4e8b3547ed 100644
--- a/EXILED/Exiled.API/Features/Map.cs
+++ b/EXILED/Exiled.API/Features/Map.cs
@@ -46,10 +46,6 @@ public static class Map
///
internal static List TeleportsValue = new();
- private static AmbientSoundPlayer ambientSoundPlayer;
-
- private static SqueakSpawner squeakSpawner;
-
///
/// Gets a value indicating whether decontamination has begun in the light containment zone.
///
@@ -123,12 +119,12 @@ public static bool IsDecontaminationEnabled
///
/// Gets the .
///
- public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub._hostHub.GetComponent();
+ public static AmbientSoundPlayer AmbientSoundPlayer => field ??= ReferenceHub._hostHub.GetComponent();
///
/// Gets the .
///
- public static SqueakSpawner SqueakSpawner => squeakSpawner ??= Object.FindFirstObjectByType();
+ public static SqueakSpawner SqueakSpawner => field ??= Object.FindFirstObjectByType();
///
/// Sends a staff message to all players online with permission.
diff --git a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
index 1b63763531..3de6897413 100644
--- a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
@@ -27,9 +27,6 @@ namespace Exiled.API.Features.Pickups
///
public class BodyArmorPickup : Pickup, IWrapper
{
- private int helmetEfficacy;
- private int vestEfficacy;
-
///
/// Initializes a new instance of the class.
///
@@ -79,20 +76,12 @@ internal BodyArmorPickup(ItemType type)
///
/// Gets or sets how strong the helmet on the armor is.
///
- public int HelmetEfficacy
- {
- get => helmetEfficacy;
- set => helmetEfficacy = value;
- }
+ public int HelmetEfficacy { get; set; }
///
/// Gets or sets how strong the vest on the armor is.
///
- public int VestEfficacy
- {
- get => vestEfficacy;
- set => vestEfficacy = value;
- }
+ public int VestEfficacy { get; set; }
///
/// Gets or sets how much faster stamina will drain when wearing this armor.
@@ -131,8 +120,8 @@ internal override void ReadItemInfo(Item item)
base.ReadItemInfo(item);
if (item is Armor armoritem)
{
- helmetEfficacy = armoritem.HelmetEfficacy;
- vestEfficacy = armoritem.VestEfficacy;
+ HelmetEfficacy = armoritem.HelmetEfficacy;
+ VestEfficacy = armoritem.VestEfficacy;
StaminaUseMultiplier = armoritem.StaminaUseMultiplier;
StaminaRegenMultiplier = armoritem.StaminaRegenMultiplier;
AmmoLimits = armoritem.AmmoLimits;
@@ -146,8 +135,8 @@ protected override void InitializeProperties(ItemBase itemBase)
base.InitializeProperties(itemBase);
if (itemBase is BodyArmor armoritem)
{
- helmetEfficacy = armoritem.HelmetEfficacy;
- vestEfficacy = armoritem.VestEfficacy;
+ HelmetEfficacy = armoritem.HelmetEfficacy;
+ VestEfficacy = armoritem.VestEfficacy;
StaminaUseMultiplier = armoritem._staminaUseMultiplier;
StaminaRegenMultiplier = armoritem.StaminaRegenMultiplier;
AmmoLimits = armoritem.AmmoLimits.Select(limit => (ArmorAmmoLimit)limit);
diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs
index bfac75fbe0..522a0a2113 100644
--- a/EXILED/Exiled.API/Features/Player.cs
+++ b/EXILED/Exiled.API/Features/Player.cs
@@ -95,10 +95,6 @@ public class Player : TypeCastObject, IEntity, IWorldSpace
private readonly HashSet componentsInChildren = new();
- private ReferenceHub referenceHub;
-
- private Role role;
-
///
/// Initializes a new instance of the class.
///
@@ -192,10 +188,10 @@ public Player(GameObject gameObject)
///
public ReferenceHub ReferenceHub
{
- get => referenceHub;
+ get;
private set
{
- referenceHub = value ?? throw new NullReferenceException("Player's ReferenceHub cannot be null!");
+ field = value ?? throw new NullReferenceException("Player's ReferenceHub cannot be null!");
GameObject = value.gameObject;
HintDisplay = value.hints;
Inventory = value.inventory;
@@ -278,7 +274,7 @@ public int Id
///
/// Gets the player's user id.
///
- public string UserId => referenceHub.authManager.UserId;
+ public string UserId => ReferenceHub.authManager.UserId;
///
/// Gets the player's user id without the authentication.
@@ -599,11 +595,11 @@ public PlayerPermissions RemoteAdminPermissions
///
public Role Role
{
- get => role ??= Role.Create(RoleManager.CurrentRole);
+ get => field ??= Role.Create(RoleManager.CurrentRole);
internal set
{
- PreviousRole = role?.Type ?? RoleTypeId.None;
- role = value;
+ PreviousRole = field?.Type ?? RoleTypeId.None;
+ field = value;
}
}
@@ -654,7 +650,7 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences
public bool IsJumping
{
get => Role is FpcRole fpc && fpc.FirstPersonController.FpcModule.Motor.JumpController.IsJumping;
- set => _ = Role is FpcRole fpc ? fpc.FirstPersonController.FpcModule.Motor.JumpController.IsJumping = value : _ = value;
+ set => (Role as FpcRole)?.FirstPersonController.FpcModule.Motor.JumpController.IsJumping = value;
}
///
@@ -863,7 +859,7 @@ public bool IsGodModeEnabled
public byte UnitId
{
get => Role.Base is PlayerRoles.HumanRole humanRole ? humanRole.UnitNameId : byte.MinValue;
- set => _ = Role.Base is PlayerRoles.HumanRole humanRole ? humanRole.UnitNameId = value : _ = value;
+ set => (Role.Base as PlayerRoles.HumanRole)?.UnitNameId = value;
}
///
@@ -1074,7 +1070,7 @@ public string GroupName
///
///
///
- public IEnumerable ActiveEffects => referenceHub.playerEffectsController.AllEffects.Where(effect => effect.Intensity > 0);
+ public IEnumerable ActiveEffects => ReferenceHub.playerEffectsController.AllEffects.Where(effect => effect.Intensity > 0);
///
/// Gets or sets the player's group.
@@ -1962,7 +1958,7 @@ public void Handcuff()
{
ReferenceHub.inventory.SetDisarmedStatus(null);
- DisarmedPlayers.Entries.Add(new DisarmedPlayers.DisarmedEntry(referenceHub.networkIdentity.netId, 0U));
+ DisarmedPlayers.Entries.Add(new DisarmedPlayers.DisarmedEntry(ReferenceHub.networkIdentity.netId, 0U));
new DisarmedPlayersListMessage(DisarmedPlayers.Entries).SendToAuthenticated(0);
}
@@ -2183,7 +2179,7 @@ public int RemoveItem(Func- predicate, bool destroy = true)
///
/// The message to be sent.
/// The message color.
- public void SendConsoleMessage(string message, string color) => referenceHub.gameConsoleTransmission.SendToClient(message, color);
+ public void SendConsoleMessage(string message, string color) => ReferenceHub.gameConsoleTransmission.SendToClient(message, color);
///
/// Disconnects the player.
@@ -2590,7 +2586,7 @@ public ushort GetAmmoLimit(AmmoType type, bool ignoreArmor = false)
return ServerConfigSynchronizer.Singleton.AmmoLimitsSync.FirstOrDefault(x => x.AmmoType == itemType).Limit;
}
- return InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), referenceHub);
+ return InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), ReferenceHub);
}
///
@@ -2666,7 +2662,7 @@ public sbyte GetCategoryLimit(ItemCategory category, bool ignoreArmor = false)
return ServerConfigSynchronizer.Singleton.CategoryLimits[index];
}
- sbyte limit = InventorySystem.Configs.InventoryLimits.GetCategoryLimit(category, referenceHub);
+ sbyte limit = InventorySystem.Configs.InventoryLimits.GetCategoryLimit(category, ReferenceHub);
return limit == -1 ? (sbyte)1 : limit;
}
diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs
index 0f34495520..fba56ca96d 100644
--- a/EXILED/Exiled.API/Features/Respawn.cs
+++ b/EXILED/Exiled.API/Features/Respawn.cs
@@ -25,9 +25,6 @@ namespace Exiled.API.Features
///
public static class Respawn
{
- private static GameObject ntfHelicopterGameObject;
- private static GameObject chaosCarGameObject;
-
///
/// Gets the of paused 's.
///
@@ -45,10 +42,10 @@ public static GameObject NtfHelicopter
{
get
{
- if (ntfHelicopterGameObject == null)
- ntfHelicopterGameObject = GameObject.Find("Chopper");
+ if (field == null)
+ field = GameObject.Find("Chopper");
- return ntfHelicopterGameObject;
+ return field;
}
}
@@ -59,10 +56,10 @@ public static GameObject ChaosVan
{
get
{
- if (chaosCarGameObject == null)
- chaosCarGameObject = GameObject.Find("CIVanArrive");
+ if (field == null)
+ field = GameObject.Find("CIVanArrive");
- return chaosCarGameObject;
+ return field;
}
}
diff --git a/EXILED/Exiled.API/Features/Roles/FpcRole.cs b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
index 9a1156833e..cf0cdae5c1 100644
--- a/EXILED/Exiled.API/Features/Roles/FpcRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
@@ -27,8 +27,6 @@ namespace Exiled.API.Features.Roles
///
public abstract class FpcRole : Role, IVoiceRole
{
- private bool isUsingStamina = true;
-
///
/// Initializes a new instance of the class.
///
@@ -190,12 +188,12 @@ public bool MovementDetected
///
public bool IsUsingStamina
{
- get => isUsingStamina;
+ get;
set
{
if (!value)
Owner.ResetStamina();
- isUsingStamina = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs
index 825cfb3566..0d5809912e 100644
--- a/EXILED/Exiled.API/Features/Server.cs
+++ b/EXILED/Exiled.API/Features/Server.cs
@@ -32,8 +32,6 @@ namespace Exiled.API.Features
///
public static class Server
{
- private static MethodInfo sendSpawnMessage;
-
///
/// Gets a dictionary that pairs assemblies with their associated plugins.
///
@@ -53,7 +51,7 @@ public static class Server
///
/// Gets the cached .
///
- public static MethodInfo SendSpawnMessage => sendSpawnMessage ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static);
+ public static MethodInfo SendSpawnMessage => field ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static);
///
/// Gets or sets the name of the server.
diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs
index f261577770..3f1e12c516 100644
--- a/EXILED/Exiled.API/Features/Warhead.cs
+++ b/EXILED/Exiled.API/Features/Warhead.cs
@@ -20,8 +20,6 @@ namespace Exiled.API.Features
///
public static class Warhead
{
- private static AlphaWarheadOutsitePanel alphaWarheadOutsitePanel;
-
///
/// Gets the cached component.
///
@@ -35,7 +33,7 @@ public static class Warhead
///
/// Gets the cached component.
///
- public static AlphaWarheadOutsitePanel OutsitePanel => alphaWarheadOutsitePanel != null ? alphaWarheadOutsitePanel : (alphaWarheadOutsitePanel = UnityEngine.Object.FindFirstObjectByType());
+ public static AlphaWarheadOutsitePanel OutsitePanel => field != null ? field : (field = Object.FindFirstObjectByType());
///
/// Gets the of the warhead lever.
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs
index 646c34bb50..8f701628a3 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs
@@ -52,7 +52,7 @@ public AggregateExpectationTypeResolver(INamingConvention namingConvention)
}
///
- public Type BaseType => typeof(CustomAbility);
+ public Type BaseType => field ??= typeof(CustomAbility);
///
public bool TryResolve(ParsingEventBuffer buffer, out Type? suggestedType)
diff --git a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
index abd2f4877f..d5dbbef859 100644
--- a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
@@ -20,12 +20,8 @@ namespace Exiled.Events.EventArgs.Cassie
///
public class SendingCassieMessageEventArgs : IDeniableEvent
{
- private readonly CassieAnnouncement announcement;
private readonly CassieTtsPayload payload;
- private string customSubtitles;
- private float glitchScale;
-
///
/// Initializes a new instance of the class.
///
@@ -35,7 +31,7 @@ public class SendingCassieMessageEventArgs : IDeniableEvent
///
public SendingCassieMessageEventArgs(CassieAnnouncement annc, bool isAllowed = true)
{
- announcement = annc;
+ Announcement = annc;
payload = annc.Payload;
Words = payload.Content;
@@ -84,13 +80,13 @@ public SendingCassieMessageEventArgs(CassieAnnouncement annc, bool isAllowed = t
///
public string CustomSubtitles
{
- get => customSubtitles;
+ get;
set
{
- if (customSubtitles != value)
+ if (field != value)
SubtitleSource = CassieTtsPayload.SubtitleMode.Custom;
- customSubtitles = value;
+ field = value;
}
}
@@ -104,13 +100,13 @@ public string CustomSubtitles
///
public float GlitchScale
{
- get => glitchScale;
+ get;
set
{
if (!MakeNoise && value is not 0)
MakeNoise = true;
- glitchScale = value;
+ field = value;
}
}
@@ -157,7 +153,7 @@ public CassieAnnouncement Announcement
newPayload = new CassieTtsPayload(Words, CustomSubtitles, MakeHold);
}
- return announcement switch
+ return field switch
{
CassieScpTerminationAnnouncement =>
@@ -169,6 +165,7 @@ public CassieAnnouncement Announcement
_ => new CassieAnnouncement(newPayload, 0, GlitchScale / (API.Features.Warhead.IsDetonated ? 2F : 1F) * (MakeNoise ? 1F : 0F)),
};
}
+ private set;
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
index a0bba7e674..474995b3b8 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
@@ -27,8 +27,6 @@ namespace Exiled.Events.EventArgs.Map
///
public class ExplodingGrenadeEventArgs : IPlayerEvent, IDeniableEvent, IPickupEvent
{
- private ExplosionType explosionType;
-
///
/// Initializes a new instance of the class.
///
@@ -125,8 +123,8 @@ public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, HashSet<
/// Explosion that are not from will return and can't be modified.
public ExplosionType ExplosionType
{
- get => explosionType;
- set => explosionType = Projectile is ExplosionGrenadeProjectile ? value : ExplosionType.Custom;
+ get;
+ set => field = Projectile is ExplosionGrenadeProjectile ? value : ExplosionType.Custom;
}
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
index 86d15bf8d8..5679b15f76 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
@@ -17,8 +17,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class BanningEventArgs : KickingEventArgs
{
- private long duration;
-
///
/// Initializes a new instance of the class.
///
@@ -40,16 +38,16 @@ public BanningEventArgs(Player target, Player issuer, ICommandSender commandSend
///
public long Duration
{
- get => duration;
+ get;
set
{
- if (duration == value)
+ if (field == value)
return;
if (Events.Instance.Config.ShouldLogBans)
- LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed Ban duration: {duration} to {value} for ID: {Target.UserId}");
+ LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed Ban duration: {field} to {value} for ID: {Target.UserId}");
- duration = value;
+ field = value;
}
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
index 6978172b54..ee305c7ada 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
@@ -21,8 +21,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class ChangingItemEventArgs : IPlayerEvent, IDeniableEvent, IItemEvent
{
- private Item newItem;
-
///
/// Initializes a new instance of the class.
///
@@ -35,7 +33,7 @@ public class ChangingItemEventArgs : IPlayerEvent, IDeniableEvent, IItemEvent
public ChangingItemEventArgs(Player player, ItemBase newItem)
{
Player = player;
- this.newItem = Item.Get(newItem);
+ Item = Item.Get(newItem);
}
///
@@ -43,13 +41,13 @@ public ChangingItemEventArgs(Player player, ItemBase newItem)
///
public Item Item
{
- get => newItem;
+ get;
set
{
if (value != null && !Player.Inventory.UserInventory.Items.TryGetValue(value.Serial, out _))
throw new InvalidOperationException("ev.NewItem cannot be set to an item they do not have.");
- newItem = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
index 898ab9fcd6..052fff48c6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
@@ -22,8 +22,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class ChangingRoleEventArgs : IPlayerEvent, IDeniableEvent
{
- private RoleTypeId newRole;
-
///
/// Initializes a new instance of the class.
///
@@ -66,7 +64,7 @@ public ChangingRoleEventArgs(Player player, RoleTypeId newRole, RoleChangeReason
///
public RoleTypeId NewRole
{
- get => newRole;
+ get;
set
{
InventoryRoleInfo inventory = value.GetInventory();
@@ -80,7 +78,7 @@ public RoleTypeId NewRole
foreach (KeyValuePair ammoPair in inventory.Ammo)
Ammo.Add(ammoPair.Key, ammoPair.Value);
- newRole = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
index 0b379c903a..999516aef2 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
@@ -19,8 +19,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class DroppingAmmoEventArgs : IPlayerEvent, IDeniableEvent
{
- private bool isAllowed = true;
-
///
/// Initializes a new instance of the class.
///
@@ -66,18 +64,12 @@ public DroppingAmmoEventArgs(Player player, ItemType itemType, ushort amount, bo
///
public bool IsAllowed
{
- get
- {
- if (Player.Role == RoleTypeId.Spectator)
- isAllowed = true;
- return isAllowed;
- }
-
+ get;
set
{
if (Player.Role == RoleTypeId.Spectator)
- value = true;
- isAllowed = value;
+ return;
+ field = value;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
index cf15df90d3..16006c8164 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
@@ -21,8 +21,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class DroppingItemEventArgs : IItemEvent, IDeniableEvent
{
- private bool isAllowed = true;
-
///
/// Initializes a new instance of the class.
///
@@ -44,6 +42,7 @@ public DroppingItemEventArgs(Player player, ItemBase item, bool isThrown, bool i
Item = Item.Get(item);
IsAllowed = isAllowed;
IsThrown = isThrown;
+ IsAllowed = isAllowed;
}
///
@@ -56,18 +55,12 @@ public DroppingItemEventArgs(Player player, ItemBase item, bool isThrown, bool i
///
public bool IsAllowed
{
- get
- {
- if (Player.Role == RoleTypeId.Spectator)
- isAllowed = true;
- return isAllowed;
- }
-
+ get;
set
{
if (Player.Role == RoleTypeId.Spectator)
- value = true;
- isAllowed = value;
+ return;
+ field = value;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
index 2e94fd0e6d..7333b3b3f8 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
@@ -18,8 +18,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class EscapingEventArgs : IPlayerEvent, IDeniableEvent
{
- private EscapeScenario escapeScenario;
-
///
/// Initializes a new instance of the class.
///
@@ -55,8 +53,8 @@ public EscapingEventArgs(ReferenceHub referenceHub, RoleTypeId newRole, EscapeSc
///
public EscapeScenario EscapeScenario
{
- get => (escapeScenario is EscapeScenario.None && IsAllowed) ? EscapeScenario.CustomEscape : escapeScenario;
- set => escapeScenario = value;
+ get => (field is EscapeScenario.None && IsAllowed) ? EscapeScenario.CustomEscape : field;
+ set;
}
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
index 086dd409bc..9555a12861 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
@@ -24,9 +24,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class InteractingShootingTargetEventArgs : IPlayerEvent, IDeniableEvent
{
- private int autoResetTime;
- private int maxHp;
-
///
/// Initializes a new instance of the class.
///
@@ -54,8 +51,8 @@ public InteractingShootingTargetEventArgs(Player player, ShootingTarget shooting
ShootingTarget = ShootingTargetToy.Get(shootingTarget);
TargetButton = targetButton;
IsAllowed = isAllowed;
- this.maxHp = maxHp;
- this.autoResetTime = autoResetTime;
+ NewMaxHp = maxHp;
+ NewAutoResetTime = autoResetTime;
}
///
@@ -73,12 +70,12 @@ public InteractingShootingTargetEventArgs(Player player, ShootingTarget shooting
///
public int NewMaxHp
{
- get => maxHp;
+ get;
set
{
if (!ShootingTarget.IsSynced)
throw new InvalidOperationException("Attempted to set MaxHp while target is in local mode. Set target's IsSynced to true before setting IsAllowed.");
- maxHp = Mathf.Clamp(value, 1, 256);
+ field = Mathf.Clamp(value, 1, 256);
}
}
@@ -87,12 +84,12 @@ public int NewMaxHp
///
public int NewAutoResetTime
{
- get => autoResetTime;
+ get;
set
{
if (!ShootingTarget.IsSynced)
throw new InvalidOperationException("Attempted to set AutoResetTime while target is in local mode. Set target's IsSynced to true before setting IsAllowed.");
- autoResetTime = Mathf.Clamp(value, 0, 10);
+ field = Mathf.Clamp(value, 0, 10);
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
index cfa2864b85..3fc6c1221d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
@@ -19,9 +19,6 @@ namespace Exiled.Events.EventArgs.Player
public class KickingEventArgs : IPlayerEvent, IDeniableEvent
{
private readonly string startkickmessage;
- private bool isAllowed;
- private Player issuer;
- private Player target;
///
/// Initializes a new instance of the class.
@@ -59,16 +56,16 @@ public KickingEventArgs(Player target, Player issuer, ICommandSender commandSend
///
public Player Target
{
- get => target;
+ get;
set
{
- if (value is null || target == value)
+ if (value is null || field == value)
return;
- if (Events.Instance.Config.ShouldLogBans && target is not null)
- LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the banned player from user {target.Nickname} ({target.UserId}) to {value.Nickname} ({value.UserId})");
+ if (Events.Instance.Config.ShouldLogBans && field is not null)
+ LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the banned player from user {field.Nickname} ({field.UserId}) to {value.Nickname} ({value.UserId})");
- target = value;
+ field = value;
}
}
@@ -87,16 +84,16 @@ public Player Target
///
public bool IsAllowed
{
- get => isAllowed;
+ get;
set
{
- if (isAllowed == value)
+ if (field == value)
return;
if (Events.Instance.Config.ShouldLogBans)
LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" {(value ? "allowed" : "denied")} banning user with ID: {Target.UserId}");
- isAllowed = value;
+ field = value;
}
}
@@ -105,16 +102,16 @@ public bool IsAllowed
///
public Player Player
{
- get => issuer;
+ get;
set
{
- if (value is null || issuer == value)
+ if (value is null || field == value)
return;
- if (Events.Instance.Config.ShouldLogBans && issuer is not null)
- LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the ban issuer from user {issuer.Nickname} ({issuer.UserId}) to {value.Nickname} ({value.UserId})");
+ if (Events.Instance.Config.ShouldLogBans && field is not null)
+ LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the ban issuer from user {field.Nickname} ({field.UserId}) to {value.Nickname} ({value.UserId})");
- issuer = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
index 419a185713..84e5e8735a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
@@ -8,19 +8,22 @@
namespace Exiled.Events.EventArgs.Player
{
using API.Features;
+ using Exiled.Events.EventArgs.Interfaces;
///
/// Contains all information after a disconnects from the server.
///
- public class LeftEventArgs : JoinedEventArgs
+ public class LeftEventArgs : IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
/// The player who left the server.
- public LeftEventArgs(Player player)
- : base(player)
- {
- }
+ public LeftEventArgs(Player player) => Player = player;
+
+ ///
+ /// Gets the left player.
+ ///
+ public Player Player { get; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
index ebb22cf345..cb949391ca 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
@@ -15,8 +15,6 @@ namespace Exiled.Events.EventArgs.Player
///
public class ReservedSlotsCheckEventArgs : IExiledEvent, IDeniableEvent
{
- private ReservedSlotEventResult reservedSlotEventResult = ReservedSlotEventResult.UseBaseGameSystem;
-
///
/// Initializes a new instance of the class.
///
@@ -31,6 +29,7 @@ public ReservedSlotsCheckEventArgs(bool hasReservedSlot, string userId)
UserId = userId;
HasReservedSlot = hasReservedSlot;
IsAllowed = hasReservedSlot;
+ Result = ReservedSlotEventResult.UseBaseGameSystem;
}
///
@@ -53,7 +52,7 @@ public ReservedSlotsCheckEventArgs(bool hasReservedSlot, string userId)
///
public ReservedSlotEventResult Result
{
- get => reservedSlotEventResult;
+ get;
set
{
switch (value)
@@ -71,7 +70,7 @@ public ReservedSlotEventResult Result
return;
}
- reservedSlotEventResult = value;
+ field = value;
}
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
index eb3251599a..599ac864bf 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
@@ -8,11 +8,12 @@
namespace Exiled.Events.EventArgs.Player
{
using API.Features;
+ using Exiled.Events.EventArgs.Interfaces;
///
/// Contains all information before unmuting a player.
///
- public class RevokingMuteEventArgs : IssuingMuteEventArgs
+ public class RevokingMuteEventArgs : IPlayerEvent, IDeniableEvent
{
///
/// Initializes a new instance of the class.
@@ -27,8 +28,25 @@ public class RevokingMuteEventArgs : IssuingMuteEventArgs
/// Indicates whether the player can be unmuted.
///
public RevokingMuteEventArgs(Player player, bool isIntercom, bool isAllowed = true)
- : base(player, isIntercom, isAllowed)
{
+ Player = player;
+ IsIntercom = isIntercom;
+ IsAllowed = isAllowed;
}
+
+ ///
+ /// Gets the player who's being revoking the mute.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the player is being revoking intercom muted.
+ ///
+ public bool IsIntercom { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the player can be revoked muted.
+ ///
+ public bool IsAllowed { get; set; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
index b7af91e658..4874f9de7b 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
@@ -18,8 +18,6 @@ namespace Exiled.Events.EventArgs.Scp914
///
public class ChangingKnobSettingEventArgs : IPlayerEvent, IDeniableEvent
{
- private Scp914KnobSetting knobSetting;
-
///
/// Initializes a new instance of the class.
///
@@ -44,8 +42,8 @@ public ChangingKnobSettingEventArgs(Player player, Scp914KnobSetting knobSetting
///
public Scp914KnobSetting KnobSetting
{
- get => knobSetting;
- set => knobSetting = value > Scp914KnobSetting.VeryFine ? Scp914KnobSetting.Coarse : value;
+ get;
+ set => field = value > Scp914KnobSetting.VeryFine ? Scp914KnobSetting.Coarse : value;
}
///
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
index df999d90dd..6e017b2816 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
@@ -24,8 +24,6 @@ namespace Exiled.Events.EventArgs.Server
///
public class RespawningTeamEventArgs : IDeniableEvent
{
- private int maximumRespawnAmount;
-
///
/// Initializes a new instance of the class.
///
@@ -69,16 +67,16 @@ public RespawningTeamEventArgs(List players, int maxRespawn, SpawnableWa
///
public int MaximumRespawnAmount
{
- get => maximumRespawnAmount;
+ get;
set
{
- if (value < maximumRespawnAmount)
+ if (value < field)
{
if (Players.Count > value)
Players.RemoveRange(value, Players.Count - value);
}
- maximumRespawnAmount = value;
+ field = value;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs
index 6f006c5299..214c8f8c2b 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs
@@ -8,11 +8,12 @@
namespace Exiled.Events.EventArgs.Warhead
{
using Exiled.API.Features;
+ using Exiled.Events.EventArgs.Interfaces;
///
/// Contains all information before starting the warhead.
///
- public class StartingEventArgs : StoppingEventArgs
+ public class StartingEventArgs : IPlayerEvent, IDeniableEvent
{
///
/// Initializes a new instance of the class.
@@ -21,14 +22,25 @@ public class StartingEventArgs : StoppingEventArgs
/// Indicating whether the nuke was set off automatically.
/// Indicating whether the event can be executed.
public StartingEventArgs(Player player, bool isAuto, bool isAllowed = true)
- : base(player, isAllowed)
{
IsAuto = isAuto;
+ Player = player ?? Server.Host;
+ IsAllowed = isAllowed;
}
///
/// Gets or sets a value indicating whether the nuke was set off automatically.
///
public bool IsAuto { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the warhead can be started.
+ ///
+ public bool IsAllowed { get; set; }
+
+ ///
+ /// Gets the player who's going to start the warhead.
+ ///
+ public Player Player { get; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Events.cs b/EXILED/Exiled.Events/Events.cs
index c941abd7ca..f01919aff5 100644
--- a/EXILED/Exiled.Events/Events.cs
+++ b/EXILED/Exiled.Events/Events.cs
@@ -30,12 +30,10 @@ namespace Exiled.Events
///
public sealed class Events : Plugin
{
- private static Events instance;
-
///
/// Gets the plugin instance.
///
- public static Events Instance => instance;
+ public static Events Instance { get; private set; }
///
public override PluginPriority Priority { get; } = PluginPriority.First;
@@ -48,7 +46,7 @@ public sealed class Events : Plugin
///
public override void OnEnabled()
{
- instance = this;
+ Instance = this;
base.OnEnabled();
Stopwatch watch = Stopwatch.StartNew();
diff --git a/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs b/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs
index d8cab19b53..6da34a65eb 100644
--- a/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs
+++ b/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs
@@ -21,7 +21,7 @@ internal class AirlockListAdd
{
private static void Postfix(AirlockController __instance)
{
- _ = new API.Features.Doors.AirlockController(__instance);
+ new API.Features.Doors.AirlockController(__instance);
}
}
diff --git a/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs b/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs
index 1761e27416..d7eb560618 100644
--- a/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs
+++ b/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs
@@ -19,7 +19,7 @@ internal class CoffeeListAdd
{
private static void Postfix(global::Coffee __instance)
{
- _ = new Coffee(__instance);
+ new Coffee(__instance);
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Generic/HazardList.cs b/EXILED/Exiled.Events/Patches/Generic/HazardList.cs
index 34aacf25d1..db16697730 100644
--- a/EXILED/Exiled.Events/Patches/Generic/HazardList.cs
+++ b/EXILED/Exiled.Events/Patches/Generic/HazardList.cs
@@ -21,7 +21,7 @@ internal class HazardList
{
[HarmonyPatch(typeof(EnvironmentalHazard), nameof(EnvironmentalHazard.Start))]
[HarmonyPostfix]
- private static void Adding(EnvironmentalHazard __instance) => _ = Hazard.Get(__instance);
+ private static void Adding(EnvironmentalHazard __instance) => Hazard.Get(__instance);
[HarmonyPatch(typeof(EnvironmentalHazard), nameof(EnvironmentalHazard.OnDestroy))]
[HarmonyPostfix]
diff --git a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs
index d4b212dcd5..d088dbe3ab 100644
--- a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs
+++ b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs
@@ -21,7 +21,7 @@ internal class LiftList
{
[HarmonyPatch(typeof(ElevatorChamber), nameof(ElevatorChamber.Start))]
[HarmonyPostfix]
- private static void Adding(ElevatorChamber __instance) => _ = new Lift(__instance);
+ private static void Adding(ElevatorChamber __instance) => new Lift(__instance);
[HarmonyPatch(typeof(ElevatorChamber), nameof(ElevatorChamber.OnDestroy))]
[HarmonyPostfix]
From 690222436b05e763ba6fda34d1984cfad83b1f24 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Thu, 5 Mar 2026 21:11:10 +0100
Subject: [PATCH 09/39] fix: IsUsingStamina missing default set to True
---
EXILED/Exiled.API/Features/Roles/FpcRole.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/EXILED/Exiled.API/Features/Roles/FpcRole.cs b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
index cf0cdae5c1..e61e866ea7 100644
--- a/EXILED/Exiled.API/Features/Roles/FpcRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
@@ -35,6 +35,7 @@ protected FpcRole(FpcStandardRoleBase baseRole)
: base(baseRole)
{
FirstPersonController = baseRole;
+ IsUsingStamina = true;
}
///
From adfa2fb27b9f5f111f64861a5c31c24543f53dba Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Sat, 7 Mar 2026 00:03:24 +0300
Subject: [PATCH 10/39] fix: Players base Category Limits (#764)
* fix
* someonefix
* set reset validaiton
---
EXILED/Exiled.API/Features/Player.cs | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs
index 522a0a2113..6f4f500e65 100644
--- a/EXILED/Exiled.API/Features/Player.cs
+++ b/EXILED/Exiled.API/Features/Player.cs
@@ -2652,9 +2652,9 @@ public void ResetAmmoLimit(AmmoType ammoType)
/// The maximum amount of items in the category that the player can hold.
public sbyte GetCategoryLimit(ItemCategory category, bool ignoreArmor = false)
{
- int index = InventorySystem.Configs.InventoryLimits.StandardCategoryLimits.Where(x => x.Value >= 0).OrderBy(x => x.Key).ToList().FindIndex(x => x.Key == category);
+ int index = (int)category;
- if (ignoreArmor && index != -1)
+ if (ignoreArmor)
{
if (CustomCategoryLimits.TryGetValue(category, out sbyte customLimit))
return customLimit;
@@ -2676,11 +2676,11 @@ public sbyte GetCategoryLimit(ItemCategory category, bool ignoreArmor = false)
/// The number that will define the new limit.
public void SetCategoryLimit(ItemCategory category, sbyte limit)
{
- int index = InventorySystem.Configs.InventoryLimits.StandardCategoryLimits.Where(x => x.Value >= 0).OrderBy(x => x.Key).ToList().FindIndex(x => x.Key == category);
+ int index = (int)category;
- if (index == -1)
+ if (index < 0 || index >= ServerConfigSynchronizer.Singleton.CategoryLimits.Count)
{
- Log.Error($"{nameof(Player)}.{nameof(SetCategoryLimit)}(ItemCategory, sbyte): Cannot set category limit for ItemCategory.{category}.");
+ Log.Error($"{nameof(Player)}.{nameof(SetCategoryLimit)}(ItemCategory, sbyte): Cannot set category limit for ItemCategory.{category}. Index out of bounds.");
return;
}
@@ -2702,18 +2702,16 @@ public void SetCategoryLimit(ItemCategory category, sbyte limit)
/// The of the category to reset.
public void ResetCategoryLimit(ItemCategory category)
{
- int index = InventorySystem.Configs.InventoryLimits.StandardCategoryLimits.Where(x => x.Value >= 0).OrderBy(x => x.Key).ToList().FindIndex(x => x.Key == category);
+ int index = (int)category;
- if (index == -1)
+ if (index < 0 || index >= ServerConfigSynchronizer.Singleton.CategoryLimits.Count)
{
- Log.Error($"{nameof(Player)}.{nameof(ResetCategoryLimit)}(ItemCategory, sbyte): Cannot reset category limit for ItemCategory.{category}.");
+ Log.Error($"{nameof(Player)}.{nameof(ResetCategoryLimit)}(ItemCategory, sbyte): Cannot reset category limit for ItemCategory.{category}. Index out of bounds.");
return;
}
if (!HasCustomCategoryLimit(category))
- {
return;
- }
CustomCategoryLimits.Remove(category);
@@ -4051,4 +4049,4 @@ public override int GetHashCode()
/// A string containing Player-related data.
public override string ToString() => $"{Id} ({Nickname}) [{UserId}] *{(Role is null ? "No role" : Role)}*";
}
-}
+}
\ No newline at end of file
From ab1f433e26fd4c72f575b43764b1f30ac480c9b5 Mon Sep 17 00:00:00 2001
From: Unbistrackted <112902220+Unbistrackted@users.noreply.github.com>
Date: Mon, 23 Feb 2026 02:45:15 -0300
Subject: [PATCH 11/39] feat(warhead): Add ``IsOnCooldown`` property (#757)
---
EXILED/Exiled.API/Features/Warhead.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs
index 3f1e12c516..d26cf33e84 100644
--- a/EXILED/Exiled.API/Features/Warhead.cs
+++ b/EXILED/Exiled.API/Features/Warhead.cs
@@ -127,6 +127,11 @@ public static WarheadStatus Status
///
public static bool IsInProgress => Controller.Info.InProgress;
+ ///
+ /// Gets a value indicating whether the warhead detonation is on cooldown.
+ ///
+ public static bool IsOnCooldown => Controller.CooldownEndTime > NetworkTime.time;
+
///
/// Gets or sets the warhead detonation timer.
///
@@ -162,7 +167,7 @@ public static int Kills
///
/// Gets a value indicating whether the warhead can be started.
///
- public static bool CanBeStarted => !IsInProgress && !IsDetonated && Controller.CooldownEndTime <= NetworkTime.time;
+ public static bool CanBeStarted => !IsInProgress && !IsDetonated && !IsOnCooldown;
///
/// Closes the surface blast doors.
From bec65a3de67671d95cd586183112b3e8df9cfce2 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Sun, 8 Mar 2026 16:16:46 +0100
Subject: [PATCH 12/39] AllowsScp106 setter use C# 14
---
EXILED/Exiled.API/Features/Doors/Door.cs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index 81dcb427f4..e1e09eb659 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -203,11 +203,7 @@ public Vector3 Position
public bool AllowsScp106
{
get => Base is IScp106PassableDoor door && door.IsScp106Passable;
- set
- {
- if (Base is IScp106PassableDoor door)
- door.IsScp106Passable = value;
- }
+ set => (Base as IScp106PassableDoor)?.IsScp106Passable = value;
}
///
From 41e9132874354b3533c9cb6595f632d6a975df17 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Sun, 8 Mar 2026 16:17:54 +0100
Subject: [PATCH 13/39] fix: `Door.AllowsScp106`
---
EXILED/Exiled.API/Features/Doors/Door.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index e1e09eb659..09865ab206 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -202,7 +202,7 @@ public Vector3 Position
///
public bool AllowsScp106
{
- get => Base is IScp106PassableDoor door && door.IsScp106Passable;
+ get => Base is not IScp106PassableDoor door || door.IsScp106Passable;
set => (Base as IScp106PassableDoor)?.IsScp106Passable = value;
}
From 0b968a75633720f7d640c4ebbe4bd1deb65f7090 Mon Sep 17 00:00:00 2001
From: Banalny-Banan <133122450+Banalny-Banan@users.noreply.github.com>
Date: Mon, 16 Mar 2026 22:07:21 +0200
Subject: [PATCH 14/39] fix: AdminToy.Position & Rotation ignoring parenting
(#687)
fix AdminToy.Position & Rotation ignoring parenting
---
EXILED/Exiled.API/Features/Toys/AdminToy.cs | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
index c93cee110e..15cbc0ab72 100644
--- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs
+++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
@@ -79,11 +79,11 @@ public Footprint Footprint
///
public Vector3 Position
{
- get => AdminToyBase.transform.position;
+ get => Transform.position;
set
{
- AdminToyBase.transform.position = value;
- AdminToyBase.NetworkPosition = value;
+ Transform.position = value;
+ AdminToyBase.NetworkPosition = Transform.localPosition;
}
}
@@ -92,11 +92,11 @@ public Vector3 Position
///
public Quaternion Rotation
{
- get => AdminToyBase.transform.rotation;
+ get => Transform.rotation;
set
{
- AdminToyBase.transform.rotation = value;
- AdminToyBase.NetworkRotation = value;
+ Transform.rotation = value;
+ AdminToyBase.NetworkRotation = Transform.localRotation;
}
}
@@ -105,10 +105,10 @@ public Quaternion Rotation
///
public Vector3 Scale
{
- get => AdminToyBase.transform.localScale;
+ get => Transform.localScale;
set
{
- AdminToyBase.transform.localScale = value;
+ Transform.localScale = value;
AdminToyBase.NetworkScale = value;
}
}
From 3eea13e49b1e97051cde8bf9efb9b54a23b5a220 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Wed, 18 Mar 2026 19:38:47 +0100
Subject: [PATCH 15/39] nothing: Is this check better ? (#777)
is it better ?
---
EXILED/Exiled.API/Features/Doors/Door.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index 09865ab206..960c9c48c0 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -638,7 +638,7 @@ private DoorType GetDoorType()
},
"Cargo Elevator Door" => DoorType.ElevatorServerRoom,
"Nuke Elevator Door" => DoorType.ElevatorNuke,
- "Elevator Door" or "Elevator Door 02" or "Elevator Door 01" => (Base as Interactables.Interobjects.ElevatorDoor)?.Group switch
+ not null when Base is Interactables.Interobjects.ElevatorDoor elevatorGroup => elevatorGroup?.Group switch
{
ElevatorGroup.Scp049 => DoorType.ElevatorScp049,
ElevatorGroup.GateB => DoorType.ElevatorGateB,
From d82093d3b80b1aa377fd8918163b385450377aab Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Wed, 18 Mar 2026 21:39:53 +0300
Subject: [PATCH 16/39] fix: Replace new Locker instance creation with Get
method (#779)
Replace new Locker instance creation with Get method
---
EXILED/Exiled.Events/Patches/Generic/LockerList.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/EXILED/Exiled.Events/Patches/Generic/LockerList.cs b/EXILED/Exiled.Events/Patches/Generic/LockerList.cs
index f76ac47c51..b0bd8af1de 100644
--- a/EXILED/Exiled.Events/Patches/Generic/LockerList.cs
+++ b/EXILED/Exiled.Events/Patches/Generic/LockerList.cs
@@ -40,7 +40,7 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions);
}
}
-}
\ No newline at end of file
+}
From 053e328c51c62666069b19e4adb1245b379c6527 Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Wed, 18 Mar 2026 21:40:12 +0300
Subject: [PATCH 17/39] feat: Add New Gate Type & Fix Some door not Gate (#776)
* f'x
* Update DoorTypeExtensions.cs
* ordering
---
EXILED/Exiled.API/Enums/DoorType.cs | 5 +++++
EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs | 2 +-
EXILED/Exiled.API/Features/Doors/Door.cs | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/EXILED/Exiled.API/Enums/DoorType.cs b/EXILED/Exiled.API/Enums/DoorType.cs
index 5863d6e79a..5e99c32a22 100644
--- a/EXILED/Exiled.API/Enums/DoorType.cs
+++ b/EXILED/Exiled.API/Enums/DoorType.cs
@@ -374,5 +374,10 @@ public enum DoorType
/// Represents the door in .
///
HczLoadingBay,
+
+ ///
+ /// Represents a spawnable unsecured gate.
+ ///
+ SpawnableUnsecuredGate,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs
index a4380d81cf..1124771480 100644
--- a/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs
@@ -20,7 +20,7 @@ public static class DoorTypeExtensions
/// The door to be checked.
/// Returns whether the is a gate.
public static bool IsGate(this DoorType door) => door is DoorType.GateA or DoorType.GateB or DoorType.Scp914Gate or
- DoorType.Scp049Gate or DoorType.GR18Gate or DoorType.SurfaceGate or DoorType.Scp173Gate;
+ DoorType.Scp049Gate or DoorType.GR18Gate or DoorType.SurfaceGate or DoorType.Scp173Gate or DoorType.Scp173NewGate or DoorType.CheckpointGateA or DoorType.CheckpointGateB or DoorType.SpawnableUnsecuredGate or DoorType.UnknownGate;
///
/// Checks if a door type is a checkpoint.
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index 960c9c48c0..0e27b6daae 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -647,6 +647,7 @@ private DoorType GetDoorType()
ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => DoorType.ElevatorLczB,
_ => DoorType.UnknownElevator,
},
+ "Spawnable Unsecured Pryable GateDoor" => DoorType.SpawnableUnsecuredGate,
_ => DoorType.UnknownDoor,
};
}
From eca6029bd4834004bd59eb52ae0a52d70d5f4a47 Mon Sep 17 00:00:00 2001
From: Unbistrackted <112902220+Unbistrackted@users.noreply.github.com>
Date: Sat, 28 Mar 2026 18:03:11 -0300
Subject: [PATCH 18/39] feat(warhead)!: ``Warhead.RemainingCooldown`` and
``WarheadStatus.OnCooldown`` (#759)
* feat(warhead): Add ``IsOnCooldown`` property (#757)
* feat(warhead): Add WarheadStatus.OnCooldown
* feat(warhead): Add ``RemainingCooldown`` property
Change from ternary operators for readability
Add case for ``WarheadStatus.OnCooldown``
* fix(warhead): Use ``Warhead.RemainingCooldown`` instead
* feat(warhead): ``WarheadStatus`` as Flag
As per @louis1706 recommendation
* fix(warhead): Add the byte values cause my visual studio didn't saved
* fix(warhead): change status setter to use flags
* fix(warhead): add more logic to the nuke status setter
* fix: Build Error
---------
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
---
EXILED/Exiled.API/Enums/WarheadStatus.cs | 16 ++++--
EXILED/Exiled.API/Features/Warhead.cs | 67 +++++++++++++++++-------
2 files changed, 59 insertions(+), 24 deletions(-)
diff --git a/EXILED/Exiled.API/Enums/WarheadStatus.cs b/EXILED/Exiled.API/Enums/WarheadStatus.cs
index e839c0b8dc..ed6f7d5a6d 100644
--- a/EXILED/Exiled.API/Enums/WarheadStatus.cs
+++ b/EXILED/Exiled.API/Enums/WarheadStatus.cs
@@ -7,30 +7,38 @@
namespace Exiled.API.Enums
{
+ using System;
+
///
/// All the available warhead statuses.
///
///
+ [Flags]
public enum WarheadStatus
{
///
/// The warhead is not armed.
///
- NotArmed,
+ NotArmed = 0,
///
/// The warhead is armed.
///
- Armed,
+ Armed = 1,
///
/// The warhead detonation is in progress.
///
- InProgress,
+ InProgress = 2,
///
/// The warhead has detonated.
///
- Detonated,
+ Detonated = 4,
+
+ ///
+ /// The warhead is on cooldown.
+ ///
+ OnCooldown = 8,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs
index d26cf33e84..f765905410 100644
--- a/EXILED/Exiled.API/Features/Warhead.cs
+++ b/EXILED/Exiled.API/Features/Warhead.cs
@@ -7,12 +7,13 @@
namespace Exiled.API.Features
{
+ using System;
using System.Collections.Generic;
using Enums;
+ using Exiled.API.Extensions;
using Interactables.Interobjects.DoorUtils;
using Mirror;
-
using UnityEngine;
///
@@ -33,7 +34,7 @@ public static class Warhead
///
/// Gets the cached component.
///
- public static AlphaWarheadOutsitePanel OutsitePanel => field != null ? field : (field = Object.FindFirstObjectByType());
+ public static AlphaWarheadOutsitePanel OutsitePanel => field != null ? field : (field = UnityEngine.Object.FindFirstObjectByType());
///
/// Gets the of the warhead lever.
@@ -67,6 +68,15 @@ public static bool OpenDoors
set => Controller._openDoors = value;
}
+ ///
+ /// Gets or sets the remaining cooldown before the nuke can be triggered again.
+ ///
+ public static double RemainingCooldown
+ {
+ get => Math.Max(0, Controller.NetworkCooldownEndTime - NetworkTime.time);
+ set => Controller.NetworkCooldownEndTime = NetworkTime.time + Math.Max(0, value);
+ }
+
///
/// Gets all of the warhead blast doors.
///
@@ -95,25 +105,42 @@ public static bool IsKeycardActivated
///
public static WarheadStatus Status
{
- get => IsInProgress ? IsDetonated ? WarheadStatus.Detonated : WarheadStatus.InProgress : LeverStatus ? WarheadStatus.Armed : WarheadStatus.NotArmed;
+ get
+ {
+ WarheadStatus status = WarheadStatus.NotArmed;
+
+ if (IsDetonated)
+ status |= WarheadStatus.Detonated;
+
+ if (IsInProgress)
+ status |= WarheadStatus.InProgress;
+
+ if (IsOnCooldown)
+ status |= WarheadStatus.OnCooldown;
+
+ if (LeverStatus)
+ status |= WarheadStatus.Armed;
+
+ return status;
+ }
+
set
{
- switch (value)
- {
- case WarheadStatus.NotArmed:
- case WarheadStatus.Armed:
- Stop();
- LeverStatus = value is WarheadStatus.Armed;
- break;
-
- case WarheadStatus.InProgress:
- Start();
- break;
-
- case WarheadStatus.Detonated:
- Detonate();
- break;
- }
+ if (IsDetonated)
+ return;
+
+ LeverStatus = value.HasFlagFast(WarheadStatus.Armed);
+
+ if (!IsInProgress && value.HasFlagFast(WarheadStatus.InProgress))
+ Start();
+ else if (!value.HasFlagFast(WarheadStatus.InProgress))
+ Stop();
+
+ if (value.HasFlagFast(WarheadStatus.Detonated))
+ Detonate();
+
+ if (!IsOnCooldown && value.HasFlagFast(WarheadStatus.OnCooldown))
+ RemainingCooldown = Controller._cooldown;
}
}
@@ -130,7 +157,7 @@ public static WarheadStatus Status
///
/// Gets a value indicating whether the warhead detonation is on cooldown.
///
- public static bool IsOnCooldown => Controller.CooldownEndTime > NetworkTime.time;
+ public static bool IsOnCooldown => RemainingCooldown > 0;
///
/// Gets or sets the warhead detonation timer.
From 63c4f69dd90deba86a20039cce22aa76e50ab726 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Sat, 28 Mar 2026 22:07:31 +0100
Subject: [PATCH 19/39] fix: PrefabHelper HczOneSided / HczTwoSided /
HczBreakableDoor (#767)
feat: PrefabHelper HczOneSided / HczTwoSided / HczBreakableDoor
---
EXILED/Exiled.API/Enums/PrefabType.cs | 1 +
EXILED/Exiled.API/Features/PrefabHelper.cs | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/EXILED/Exiled.API/Enums/PrefabType.cs b/EXILED/Exiled.API/Enums/PrefabType.cs
index 43936f1d80..c3ce00898d 100644
--- a/EXILED/Exiled.API/Enums/PrefabType.cs
+++ b/EXILED/Exiled.API/Enums/PrefabType.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Enums
///
/// Type of prefab.
///
+ ///
public enum PrefabType
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
diff --git a/EXILED/Exiled.API/Features/PrefabHelper.cs b/EXILED/Exiled.API/Features/PrefabHelper.cs
index 179991e635..22579651ac 100644
--- a/EXILED/Exiled.API/Features/PrefabHelper.cs
+++ b/EXILED/Exiled.API/Features/PrefabHelper.cs
@@ -14,8 +14,8 @@ namespace Exiled.API.Features
using Exiled.API.Enums;
using Exiled.API.Features.Attributes;
-
using MapGeneration.Distributors;
+ using MapGeneration.RoomConnectors;
using Mirror;
using UnityEngine;
@@ -57,6 +57,11 @@ public static PrefabAttribute GetPrefabAttribute(this PrefabType prefabType)
/// Returns the .
public static GameObject GetPrefab(PrefabType prefabType)
{
+ if (prefabType is PrefabType.HCZOneSided or PrefabType.HCZTwoSided)
+ {
+ prefabType = PrefabType.HCZBreakableDoor;
+ }
+
if (Prefabs.TryGetValue(prefabType, out (GameObject, Component) prefab))
return prefab.Item1;
@@ -112,6 +117,17 @@ public static GameObject Spawn(PrefabType prefabType, Vector3 position = default
positionSync.Network_rotationY = (sbyte)Mathf.RoundToInt(rotation.Value.eulerAngles.y / 5.625F);
}
+ if (prefabType is PrefabType.HCZOneSided or PrefabType.HCZTwoSided or PrefabType.HCZBreakableDoor)
+ {
+ newGameObject.GetComponent().Network_syncBitmask = prefabType switch
+ {
+ PrefabType.HCZTwoSided => 0b00000000,
+ PrefabType.HCZOneSided => 0b00000001,
+ PrefabType.HCZBreakableDoor => 0b00000011,
+ _ => 0
+ };
+ }
+
NetworkServer.Spawn(newGameObject);
return newGameObject;
From 8f544a0f6e588ce045ece1c21f54d8e9ddc9d0bd Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Sun, 29 Mar 2026 00:10:07 +0300
Subject: [PATCH 20/39] fix: Item leaks (#763)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Fix major memory leaks in Items and optimize custom item spawning
* fix armors to
* more
* ,.
* f'x f'x
* ö
* ,
* someonefix
* fix someone
* someonesafe
* somefix
* Update EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
* Update EXILED/Exiled.API/Features/Player.cs
Yeah right
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
* fix: naming broke because of Yamato Code Review
---------
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
---
.../DamageHandlers/GenericDamageHandler.cs | 86 ++++++++++++-------
EXILED/Exiled.API/Features/Items/Item.cs | 14 ++-
EXILED/Exiled.API/Features/Player.cs | 15 +++-
.../API/Features/CustomArmor.cs | 2 +-
.../API/Features/CustomGrenade.cs | 36 +++++---
.../API/Features/CustomItem.cs | 3 +-
.../API/Features/CustomWeapon.cs | 23 +++--
.../Patches/Generic/StaminaRegenArmor.cs | 7 +-
8 files changed, 132 insertions(+), 54 deletions(-)
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
index d55324798e..4ea1909b72 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
@@ -10,19 +10,33 @@ namespace Exiled.API.Features.DamageHandlers
using System;
using Enums;
+
+ using Exiled.API.Extensions;
using Exiled.API.Features.Pickups.Projectiles;
using Footprinting;
+
+ using InventorySystem;
+ using InventorySystem.Items;
+ using InventorySystem.Items.Firearms;
+ using InventorySystem.Items.Firearms.Modules;
+ using InventorySystem.Items.Firearms.ShotEvents;
using InventorySystem.Items.Scp1509;
+
using Items;
+
using PlayerRoles;
using PlayerRoles.PlayableScps.Scp096;
using PlayerRoles.PlayableScps.Scp1507;
using PlayerRoles.PlayableScps.Scp3114;
using PlayerRoles.PlayableScps.Scp939;
+
using PlayerStatsSystem;
+
using UnityEngine;
+ using Object = UnityEngine.Object;
+
///
/// Allows generic damage to a player.
///
@@ -59,7 +73,7 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
if (customCassieAnnouncement is not null)
customCassieAnnouncement.Announcement ??= $"{player.Nickname} killed by {attacker.Nickname} utilizing {damageType}";
- Attacker = attacker.Footprint;
+ Attacker = attacker != null ? attacker.Footprint : Server.Host.Footprint;
AllowSelfDamage = true;
Damage = damage;
ServerLogsText = $"GenericDamageHandler damage processing";
@@ -123,55 +137,57 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
Base = new GrayCandyDamageHandler(Attacker.Hub, damage);
break;
case DamageType.MicroHid:
- InventorySystem.Items.MicroHID.MicroHIDItem microHidOwner = new();
- microHidOwner.Owner = attacker.ReferenceHub;
+ InventorySystem.Items.MicroHID.MicroHIDItem microHidOwner = new()
+ {
+ Owner = attacker.ReferenceHub,
+ };
Base = new MicroHidDamageHandler(damage, microHidOwner);
break;
case DamageType.Explosion:
- Base = new ExplosionDamageHandler(attacker.Footprint, UnityEngine.Vector3.zero, damage, 0, ExplosionType.Grenade);
+ Base = new ExplosionDamageHandler(attacker.Footprint, Vector3.zero, damage, 0, ExplosionType.Grenade);
break;
case DamageType.Firearm:
case DamageType.AK:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunAK);
+ GenericFirearm(damage, ItemType.GunAK);
break;
case DamageType.Crossvec:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunCrossvec);
+ GenericFirearm(damage, ItemType.GunCrossvec);
break;
case DamageType.Logicer:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunLogicer);
+ GenericFirearm(damage, ItemType.GunLogicer);
break;
case DamageType.Revolver:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunRevolver);
+ GenericFirearm(damage, ItemType.GunRevolver);
break;
case DamageType.Shotgun:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunShotgun);
+ GenericFirearm(damage, ItemType.GunShotgun);
break;
case DamageType.Com15:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunCOM15);
+ GenericFirearm(damage, ItemType.GunCOM15);
break;
case DamageType.Com18:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunCOM18);
+ GenericFirearm(damage, ItemType.GunCOM18);
break;
case DamageType.Fsp9:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunFSP9);
+ GenericFirearm(damage, ItemType.GunFSP9);
break;
case DamageType.E11Sr:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunE11SR);
+ GenericFirearm(damage, ItemType.GunE11SR);
break;
case DamageType.Com45:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunCom45);
+ GenericFirearm(damage, ItemType.GunCom45);
break;
case DamageType.Frmg0:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunFRMG0);
+ GenericFirearm(damage, ItemType.GunFRMG0);
break;
case DamageType.A7:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunA7);
+ GenericFirearm(damage, ItemType.GunA7);
break;
case DamageType.Scp127:
- GenericFirearm(player, attacker, damage, damageType, ItemType.GunSCP127);
+ GenericFirearm(damage, ItemType.GunSCP127);
break;
case DamageType.ParticleDisruptor:
- Base = new DisruptorDamageHandler(new (Item.Create(ItemType.ParticleDisruptor, attacker).Base as InventorySystem.Items.Firearms.Firearm, InventorySystem.Items.Firearms.Modules.DisruptorActionModule.FiringState.FiringSingle), Vector3.up, damage);
+ Base = new DisruptorDamageHandler(new DisruptorShotEvent(default, Attacker, InventorySystem.Items.Firearms.Modules.DisruptorActionModule.FiringState.FiringSingle), Vector3.up, damage);
break;
case DamageType.Scp096:
Scp096Role curr096 = attacker.ReferenceHub.roleManager.CurrentRole as Scp096Role ?? new Scp096Role();
@@ -193,9 +209,12 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
Base = new PlayerStatsSystem.ScpDamageHandler(attacker.ReferenceHub, damage, DeathTranslations.Unknown);
break;
case DamageType.Scp018:
- Scp018Projectile scp018Projectile = Projectile.Create(ProjectileType.Scp018);
- scp018Projectile.PreviousOwner = attacker;
- Base = new Scp018DamageHandler(scp018Projectile.Base, damage, true);
+ InventorySystem.Items.ThrowableProjectiles.Scp018Projectile dummy018 = new()
+ {
+ PreviousOwner = Attacker,
+ };
+
+ Base = new Scp018DamageHandler(dummy018, damage, true);
break;
case DamageType.Scp207:
Base = new PlayerStatsSystem.ScpDamageHandler(attacker.ReferenceHub, damage, DeathTranslations.Scp207);
@@ -303,21 +322,26 @@ public override HandlerOutput ApplyDamage(ReferenceHub ply)
///
/// Generic firearm path for handle type.
///
- /// Current player.
- /// Current attacker.
/// Damage amount.
- /// Damage type.
/// ItemType.
- private void GenericFirearm(Player player, Player attacker, float amount, DamageType damageType, ItemType itemType)
+ private void GenericFirearm(float amount, ItemType itemType)
{
- Firearm firearm = new(itemType)
+ ItemType ammoType = ItemType.None;
+
+ if (InventoryItemLoader.TryGetItem(itemType, out InventorySystem.Items.Firearms.Firearm firearmTemplate))
{
- Base =
- {
- Owner = attacker.ReferenceHub,
- },
+ Items.Firearm firearm = new(firearmTemplate);
+ ammoType = firearm.AmmoType.GetItemType();
+ }
+
+ Base = new PlayerStatsSystem.FirearmDamageHandler
+ {
+ Damage = amount,
+ Attacker = Attacker,
+ AmmoType = ammoType,
+ WeaponType = itemType,
+ Firearm = firearmTemplate,
};
- Base = new PlayerStatsSystem.FirearmDamageHandler() { Firearm = firearm.Base, Damage = amount };
}
}
}
diff --git a/EXILED/Exiled.API/Features/Items/Item.cs b/EXILED/Exiled.API/Features/Items/Item.cs
index 89bb189c42..6e9a20d66f 100644
--- a/EXILED/Exiled.API/Features/Items/Item.cs
+++ b/EXILED/Exiled.API/Features/Items/Item.cs
@@ -414,7 +414,19 @@ public static T Create(ItemType type, Player owner = null)
///
/// Destroy this item.
///
- public void Destroy() => Owner.RemoveItem(this);
+ public void Destroy()
+ {
+ if (Owner.RemoveItem(this))
+ return;
+
+ if (Base != null)
+ {
+ BaseToItem.Remove(Base);
+
+ if (Base.gameObject != null)
+ Object.Destroy(Base.gameObject);
+ }
+ }
///
/// Creates the that based on this .
diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs
index 6f4f500e65..88c0693232 100644
--- a/EXILED/Exiled.API/Features/Player.cs
+++ b/EXILED/Exiled.API/Features/Player.cs
@@ -2324,7 +2324,17 @@ public void Heal(float amount, bool overrideMaxHealth = false)
///
/// The ItemType to be used.
/// if item was used successfully. Otherwise, .
- public bool UseItem(ItemType usableItem) => UseItem(Item.Create(usableItem));
+ public bool UseItem(ItemType usableItem)
+ {
+ if (usableItem.GetTemplate() is not UsableItem)
+ return false;
+
+ Item usable = Item.Create(usableItem);
+
+ UseItem(usable);
+ usable.Destroy();
+ return true;
+ }
///
/// Forces the player to use an item.
@@ -2388,7 +2398,8 @@ public void Vaporize(Player attacker = null, string cassieAnnouncement = "")
if ((Role.Side != Side.Scp) && !string.IsNullOrEmpty(cassieAnnouncement))
Cassie.Message(cassieAnnouncement);
- Kill(new DisruptorDamageHandler(new DisruptorShotEvent(Item.Create(ItemType.ParticleDisruptor, attacker).Base as InventorySystem.Items.Firearms.Firearm, DisruptorActionModule.FiringState.FiringSingle), Vector3.up, -1));
+ Footprint footprint = attacker != null ? attacker.Footprint : Server.Host.Footprint;
+ Kill(new DisruptorDamageHandler(new DisruptorShotEvent(default, footprint, DisruptorActionModule.FiringState.FiringSingle), Vector3.up, -1));
}
///
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
index e6f1932905..c1a77f6351 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
@@ -82,7 +82,7 @@ public override void Give(Player player, bool displayMessage = true)
if (AmmoLimits.Count != 0)
armor.AmmoLimits = AmmoLimits;
- if (AmmoLimits.Count != 0)
+ if (CategoryLimits.Count != 0)
armor.CategoryLimits = CategoryLimits;
player.AddItem(armor);
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs b/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
index 48d725ce7e..feafdae9c2 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
@@ -19,10 +19,14 @@ namespace Exiled.CustomItems.API.Features
using Exiled.Events.EventArgs.Player;
using Footprinting;
+
+ using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.ThrowableProjectiles;
+
using Mirror;
+
using UnityEngine;
using Object = UnityEngine.Object;
@@ -70,31 +74,43 @@ public override ItemType Type
/// The spawned.
public virtual Pickup Throw(Vector3 position, float force, float weight, float fuseTime = 3f, ItemType grenadeType = ItemType.GrenadeHE, Player? player = null)
{
- if (player is null)
- player = Server.Host;
+ player ??= Server.Host;
- player.Role.Is(out FpcRole fpcRole);
- Vector3 velocity = fpcRole.FirstPersonController.FpcModule.Motor.Velocity;
+ Vector3 velocity = Vector3.zero;
+ Quaternion rotation = Quaternion.identity;
- Throwable throwable = (Throwable)Item.Create(grenadeType, player);
+ if (player != Server.Host)
+ {
+ if (player.Role.Is(out FpcRole fpcRole))
+ velocity = fpcRole.FirstPersonController.FpcModule.Motor.Velocity;
+
+ if (player.CameraTransform != null)
+ rotation = player.CameraTransform.rotation;
+ }
- ThrownProjectile thrownProjectile = Object.Instantiate(throwable.Base.Projectile, position, throwable.Owner.CameraTransform.rotation);
+ InventoryItemLoader.TryGetItem(grenadeType, out ThrowableItem template);
+
+ ThrownProjectile thrownProjectile = Object.Instantiate(template.Projectile, position, rotation);
PickupSyncInfo newInfo = new()
{
- ItemId = throwable.Type,
- Locked = !throwable.Base._repickupable,
+ ItemId = grenadeType,
+ Locked = !template._repickupable,
Serial = ItemSerialGenerator.GenerateNext(),
WeightKg = weight,
};
+
if (thrownProjectile is TimeGrenade time)
time._fuseTime = fuseTime;
+
thrownProjectile.NetworkInfo = newInfo;
- thrownProjectile.PreviousOwner = new Footprint(throwable.Owner.ReferenceHub);
+ thrownProjectile.PreviousOwner = player.Footprint;
NetworkServer.Spawn(thrownProjectile.gameObject);
thrownProjectile.InfoReceivedHook(default, newInfo);
+
if (thrownProjectile.TryGetComponent(out Rigidbody component))
- throwable.Base.PropelBody(component, throwable.Base.FullThrowSettings.StartTorque, ThrowableNetworkHandler.GetLimitedVelocity(velocity));
+ template.PropelBody(component, template.FullThrowSettings.StartTorque, ThrowableNetworkHandler.GetLimitedVelocity(velocity));
+
thrownProjectile.ServerActivate();
return Pickup.Get(thrownProjectile);
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
index 789fd25ceb..e131db7086 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
@@ -540,7 +540,7 @@ public static IEnumerable UnregisterItems(IEnumerable targetTy
Pickup? pickup = Spawn(position, item, previousOwner);
- UnityEngine.Object.Destroy(item.Base);
+ item.Destroy();
return pickup;
}
@@ -554,6 +554,7 @@ public static IEnumerable UnregisterItems(IEnumerable targetTy
public virtual Pickup? Spawn(Vector3 position, Item item, Player? previousOwner = null)
{
Pickup? pickup = item.CreatePickup(position);
+
pickup.Scale = Scale;
pickup.Weight = Weight;
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
index 9053cf2d66..cc2e7f25bc 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
@@ -18,9 +18,11 @@ namespace Exiled.CustomItems.API.Features
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Item;
using Exiled.Events.EventArgs.Player;
+
using InventorySystem.Items.Firearms.Attachments;
using InventorySystem.Items.Firearms.Attachments.Components;
using InventorySystem.Items.Firearms.Modules;
+
using UnityEngine;
using Firearm = Exiled.API.Features.Items.Firearm;
@@ -69,16 +71,22 @@ public override ItemType Type
///
public override Pickup? Spawn(Vector3 position, Player? previousOwner = null)
{
- if (Item.Create(Type) is not Firearm firearm)
+ if (Type.IsWeapon(false))
{
- Log.Debug($"{nameof(Spawn)}: Item is not Firearm.");
+ Log.Warn($"{nameof(Spawn)}: Item is not Firearm.");
return null;
}
+ Firearm firearm = Item.Create(Type);
+
if (!Attachments.IsEmpty())
firearm.AddAttachment(Attachments);
- Pickup? pickup = firearm.CreatePickup(position);
+ if (ClipSize > 0)
+ firearm.MagazineAmmo = ClipSize;
+
+ FirearmPickup? pickup = (FirearmPickup?)firearm.CreatePickup(position, spawn: false);
+ firearm.Destroy();
if (pickup is null)
{
@@ -86,15 +94,16 @@ public override ItemType Type
return null;
}
- if (ClipSize > 0)
- firearm.MagazineAmmo = ClipSize;
-
pickup.Weight = Weight;
pickup.Scale = Scale;
+
if (previousOwner is not null)
pickup.PreviousOwner = previousOwner;
+ pickup.Spawn();
+
TrackedSerials.Add(pickup.Serial);
+
return pickup;
}
@@ -108,9 +117,11 @@ public override ItemType Type
if (ClipSize > 0)
firearm.MagazineAmmo = ClipSize;
+
int ammo = firearm.MagazineAmmo;
Log.Debug($"{nameof(Name)}.{nameof(Spawn)}: Spawning weapon with {ammo} ammo.");
Pickup? pickup = firearm.CreatePickup(position);
+
pickup.Scale = Scale;
if (previousOwner is not null)
diff --git a/EXILED/Exiled.Events/Patches/Generic/StaminaRegenArmor.cs b/EXILED/Exiled.Events/Patches/Generic/StaminaRegenArmor.cs
index 96441e17e9..38ad7536e2 100644
--- a/EXILED/Exiled.Events/Patches/Generic/StaminaRegenArmor.cs
+++ b/EXILED/Exiled.Events/Patches/Generic/StaminaRegenArmor.cs
@@ -16,14 +16,17 @@ namespace Exiled.Events.Patches.Generic
///
/// Patches .
- /// Implements .
+ /// Implements .
///
[HarmonyPatch(typeof(BodyArmor), nameof(BodyArmor.StaminaRegenMultiplier), MethodType.Getter)]
internal class StaminaRegenArmor
{
private static void Postfix(BodyArmor __instance, ref float __result)
{
- if(Item.Get(__instance) is Armor armor)
+ if (__instance.ItemSerial == 0)
+ return;
+
+ if (Item.Get(__instance) is Armor armor)
__result *= armor.StaminaRegenMultiplier;
}
}
From 1cf9683468ab3a0cd2626d30eac9a146a7a57255 Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Sun, 29 Mar 2026 05:27:10 +0300
Subject: [PATCH 21/39] fix: SavingByAntiScp207 refactor the current game code
& event not saving (#771)
* fix & refactor
* removed denied damage multiplayer prop
* hj
* cmmon get fixed git
---
.../Player/SavingByAntiScp207EventArgs.cs | 13 +++--------
.../Events/Player/SavingByAntiScp207.cs | 22 +++++++++----------
2 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs
index 71cd25905b..47b568d667 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs
@@ -31,8 +31,6 @@ public SavingByAntiScp207EventArgs(ReferenceHub player, float damageAmount, Dama
Handler = handler;
HitboxType = hitboxType;
DamageAmount = damageAmount;
- DamageMultiplier = (Player.Health + Player.ArtificialHealth - AntiScp207.DeathSaveHealth) / damageAmount;
- IsAllowed = true;
}
///
@@ -46,14 +44,9 @@ public SavingByAntiScp207EventArgs(ReferenceHub player, float damageAmount, Dama
public float DamageAmount { get; }
///
- /// Gets or sets the multiplier for the damage that is applied when the event is allowed.
+ /// Gets or sets the health amount the player will have after being saved from death.
///
- public float DamageMultiplier { get; set; }
-
- ///
- /// Gets or sets the multiplier for the damage that if event denied.
- ///
- public float DeniedDamageMultiplier { get; set; } = 1;
+ public float DeathSaveHealth { get; set; } = AntiScp207.DeathSaveHealth;
///
/// Gets the damage handler that describes the incoming damage.
@@ -69,6 +62,6 @@ public SavingByAntiScp207EventArgs(ReferenceHub player, float damageAmount, Dama
/// Gets or sets a value indicating whether the event is allowed.
/// If set to false, the event will be denied.
///
- public bool IsAllowed { get; set; }
+ public bool IsAllowed { get; set; } = true;
}
}
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/SavingByAntiScp207.cs b/EXILED/Exiled.Events/Patches/Events/Player/SavingByAntiScp207.cs
index ac4157b7ce..daa9f0c6fb 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/SavingByAntiScp207.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/SavingByAntiScp207.cs
@@ -31,19 +31,19 @@ private static IEnumerable Transpiler(IEnumerable newInstructions = ListPool.Pool.Get(instructions);
+ Label skipLabel = generator.DefineLabel();
LocalBuilder ev = generator.DeclareLocal(typeof(SavingByAntiScp207EventArgs));
int index = newInstructions.FindLastIndex(x => x.opcode == OpCodes.Ldloc_1);
- Label skipLabel = generator.DefineLabel();
- Label gotoEventLabel = newInstructions[index].labels[0];
+ List
public static void OnWaitingForPlayers() => WaitingForPlayers.InvokeSafely();
+ ///
+ /// Called before the start of a new round.
+ ///
+ /// The instance.
+ public static void OnRoundStarting(RoundStartingEventArgs ev) => RoundStarting.InvokeSafely(ev);
+
///
/// Called after the start of a new round.
///
diff --git a/EXILED/Exiled.Events/Patches/Events/Server/RoundStarting.cs b/EXILED/Exiled.Events/Patches/Events/Server/RoundStarting.cs
new file mode 100644
index 0000000000..ec5e68b953
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Server/RoundStarting.cs
@@ -0,0 +1,118 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Server
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Reflection;
+ using System.Reflection.Emit;
+
+ using Exiled.API.Features;
+ using Exiled.API.Features.Pools;
+ using Exiled.Events.EventArgs.Server;
+ using HarmonyLib;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches .
+ /// Adds the event.
+ ///
+ [HarmonyPatch]
+ internal class RoundStarting
+ {
+ #pragma warning disable SA1600 // Elements should be documented
+ public static Type PrivateType { get; internal set; }
+
+ private static MethodInfo TargetMethod()
+ {
+ PrivateType = typeof(CharacterClassManager).GetNestedTypes(all)
+ .FirstOrDefault(currentType => currentType.Name.Contains("Init"));
+ if (PrivateType == null)
+ throw new Exception("State machine type for Init not found.");
+ MethodInfo moveNextMethod = PrivateType.GetMethod("MoveNext", all);
+
+ if (moveNextMethod == null)
+ throw new Exception("MoveNext method not found in the state machine type.");
+ return moveNextMethod;
+ }
+
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ const string TimeLeft = "5__3";
+ const string OriginalTimeLeft = "5__2";
+ const string TopPlayer = "5__4";
+
+ LocalBuilder ev = generator.DeclareLocal(typeof(RoundStartingEventArgs));
+ int offset = -4;
+ int index = newInstructions.FindLastIndex(x => x.Calls(Method(typeof(CharacterClassManager), nameof(CharacterClassManager.ForceRoundStart)))) + offset;
+
+ List labels = newInstructions[index].ExtractLabels();
+ Label skip = (Label)newInstructions[index + 3].operand;
+ newInstructions.RemoveRange(index, 4);
+
+ newInstructions.InsertRange(index, new[]
+ {
+ // this.TimeLeft
+ new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels),
+ new(OpCodes.Ldfld, Field(PrivateType, TimeLeft)),
+
+ // this.OriginalTimeLeft
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Ldfld, Field(PrivateType, OriginalTimeLeft)),
+
+ // this.TopPlayer
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Ldfld, Field(PrivateType, TopPlayer)),
+
+ // playerCount
+ new(OpCodes.Ldloc_2),
+
+ // RoundStartingEventArgs ev = new(short, short, int, int)
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(RoundStartingEventArgs))[0]),
+ new(OpCodes.Dup),
+ new(OpCodes.Stloc_S, ev.LocalIndex),
+
+ // Handlers.Server.OnRoundStarting(ev)
+ new(OpCodes.Call, Method(typeof(Handlers.Server), nameof(Handlers.Server.OnRoundStarting))),
+
+ // this.TimeLeft = ev.TimeLeft
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Ldloc_S, ev.LocalIndex),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(RoundStartingEventArgs), nameof(RoundStartingEventArgs.TimeLeft))),
+ new(OpCodes.Stfld, Field(PrivateType, TimeLeft)),
+
+ // this.OriginalTimeLeft = ev.OriginalTimeLeft
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Ldloc_S, ev.LocalIndex),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(RoundStartingEventArgs), nameof(RoundStartingEventArgs.OriginalTimeLeft))),
+ new(OpCodes.Stfld, Field(PrivateType, OriginalTimeLeft)),
+
+ // this.TopPlayer = ev.TopPlayer
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Ldloc_S, ev.LocalIndex),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(RoundStartingEventArgs), nameof(RoundStartingEventArgs.TopPlayer))),
+ new(OpCodes.Stfld, Field(PrivateType, TopPlayer)),
+
+ // if (!ev.IsAllowed)
+ // skip;
+ new(OpCodes.Ldloc_S, ev.LocalIndex),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(RoundStartingEventArgs), nameof(RoundStartingEventArgs.IsAllowed))),
+ new(OpCodes.Brfalse_S, skip),
+ });
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+ }
From b7698cda033f2a5d330f4986b5e21f4a336afd60 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Wed, 1 Apr 2026 22:01:11 +0200
Subject: [PATCH 29/39] fix: nw bug 1560 and 1816 (#774)
* fix: https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/1560
* fix: SpawnProtect
* Fix 1560
* update Using
* fix: build error of using
* fix: 2816
* Revert "fix: SpawnProtect"
This reverts commit d938486db635cc57cd9cc2979258a6c43e2524c2.
* removed fix by NW
* fix: this wasn't fixed
.
---
EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs | 3 +++
EXILED/Exiled.Events/Handlers/Internal/Round.cs | 10 ++++++----
.../Exiled.Events/Patches/Fixes/Fix106ItemManager.cs | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
index eaaf77cb7a..93c18ff7bf 100644
--- a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
@@ -109,6 +109,9 @@ internal override void ReadItemInfo(Item item)
if (item is Jailbird jailBirditem)
{
+ // TODO: Remove if this is fixed https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/2816
+ jailBirditem.Base._deterioration.RecheckUsage();
+
MeleeDamage = jailBirditem.MeleeDamage;
ChargeDamage = jailBirditem.ChargeDamage;
FlashDuration = jailBirditem.FlashDuration;
diff --git a/EXILED/Exiled.Events/Handlers/Internal/Round.cs b/EXILED/Exiled.Events/Handlers/Internal/Round.cs
index 4ec235db18..ac058b4629 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/Round.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/Round.cs
@@ -15,6 +15,7 @@ namespace Exiled.Events.Handlers.Internal
using Exiled.API.Extensions;
using Exiled.API.Features;
using Exiled.API.Features.Core.UserSettings;
+ using Exiled.API.Features.Doors;
using Exiled.API.Features.Items;
using Exiled.API.Features.Pools;
using Exiled.API.Features.Roles;
@@ -23,17 +24,14 @@ namespace Exiled.Events.Handlers.Internal
using Exiled.Events.EventArgs.Scp049;
using Exiled.Loader;
using Exiled.Loader.Features;
+ using Interactables.Interobjects.DoorUtils;
using InventorySystem;
using InventorySystem.Items.Firearms.Attachments;
using InventorySystem.Items.Firearms.Attachments.Components;
using InventorySystem.Items.Usables;
- using InventorySystem.Items.Usables.Scp244.Hypothermia;
using InventorySystem.Items.Usables.Scp330;
using PlayerRoles;
- using PlayerRoles.FirstPersonControl;
using PlayerRoles.RoleAssign;
- using UnityEngine;
- using Utils.Networking;
using Utils.NonAllocLINQ;
///
@@ -60,6 +58,10 @@ public static void OnWaitingForPlayers()
if (Events.Instance.Config.Debug)
Patches.Events.Map.Generating.Benchmark();
+
+ // TODO: Remove when this has been fixed https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/1560
+ Door door = Door.Get(DoorType.Scp079Armory);
+ door.AllowsScp106 = false;
}
///
diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs
index c082edbedb..53ed989ed9 100644
--- a/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs
+++ b/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
From a1f8bf27ed870b23db56b283d5a1d43dcb67851c Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Tue, 14 Apr 2026 16:23:05 +0300
Subject: [PATCH 30/39] feat: Consuming Item Event (#805)
* one shot
* fix doc
* d
---
.../EventArgs/Interfaces/IConsumableEvent.cs | 22 ++++++
.../Player/ConsumingItemEventArgs.cs | 49 ++++++++++++
EXILED/Exiled.Events/Handlers/Player.cs | 11 +++
.../Patches/Events/Player/ConsumingItem.cs | 78 +++++++++++++++++++
4 files changed, 160 insertions(+)
create mode 100644 EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs
create mode 100644 EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs
create mode 100644 EXILED/Exiled.Events/Patches/Events/Player/ConsumingItem.cs
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs
new file mode 100644
index 0000000000..eaa1babdcc
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs
@@ -0,0 +1,22 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Interfaces
+{
+ using Exiled.API.Features.Items;
+
+ ///
+ /// Event args used for all related events.
+ ///
+ public interface IConsumableEvent : IItemEvent
+ {
+ ///
+ /// Gets the triggering the event.
+ ///
+ public Consumable Consumable { get; }
+ }
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs
new file mode 100644
index 0000000000..0e48f83a8b
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs
@@ -0,0 +1,49 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Player
+{
+ using API.Features;
+ using API.Features.Items;
+
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all information before a player's consumable item effects are applied.
+ ///
+ public class ConsumingItemEventArgs : IPlayerEvent, IDeniableEvent, IConsumableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who is consuming the item.
+ /// The consumable item to be consumed.
+ public ConsumingItemEventArgs(ReferenceHub hub, InventorySystem.Items.Usables.Consumable item)
+ {
+ Player = Player.Get(hub);
+ Consumable = Item.Get(item) as Consumable;
+ }
+
+ ///
+ /// Gets the consumable item to be consumed.
+ ///
+ public Consumable Consumable { get; }
+
+ ///
+ public Item Item => Consumable;
+
+ ///
+ /// Gets the player who is consuming the item.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the item's being consumed should be allowed or not.
+ ///
+ public bool IsAllowed { get; set; } = true;
+ }
+}
diff --git a/EXILED/Exiled.Events/Handlers/Player.cs b/EXILED/Exiled.Events/Handlers/Player.cs
index c03bcebebf..9ef0015750 100644
--- a/EXILED/Exiled.Events/Handlers/Player.cs
+++ b/EXILED/Exiled.Events/Handlers/Player.cs
@@ -98,6 +98,11 @@ public class Player
///
public static Event UsedItem { get; set; } = new();
+ ///
+ /// Invoked before a consumes an . In other words, it is invoked before the consumable item logic are applied.
+ ///
+ public static Event ConsumingItem { get; set; } = new();
+
///
/// Invoked before a has stopped the use of a .
///
@@ -723,6 +728,12 @@ public class Player
/// The instance.
public static void OnUsedItem(UsedItemEventArgs ev) => UsedItem.InvokeSafely(ev);
+ ///
+ /// Called before a consumes a item.
+ ///
+ /// The instance.
+ public static void OnConsumingItem(ConsumingItemEventArgs ev) => ConsumingItem.InvokeSafely(ev);
+
///
/// Called before a has stopped the use of a item.
///
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ConsumingItem.cs b/EXILED/Exiled.Events/Patches/Events/Player/ConsumingItem.cs
new file mode 100644
index 0000000000..85e9f6698f
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ConsumingItem.cs
@@ -0,0 +1,78 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Player
+{
+ using System.Collections.Generic;
+ using System.Reflection.Emit;
+
+ using Exiled.API.Features.Pools;
+ using Exiled.Events.Attributes;
+ using Exiled.Events.EventArgs.Player;
+
+ using HarmonyLib;
+
+ using InventorySystem.Items.Usables;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches .
+ /// Adds the event.
+ ///
+ [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.ConsumingItem))]
+ [HarmonyPatch(typeof(Consumable), nameof(Consumable.ActivateEffects))]
+ internal static class ConsumingItem
+ {
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ Label skip = generator.DefineLabel();
+
+ int offset = -1;
+ int index = newInstructions.FindIndex(instruction => instruction.Calls(Method(typeof(Consumable), nameof(Consumable.OnEffectsActivated)))) + offset;
+
+ List mainLabels = newInstructions[index].ExtractLabels();
+ newInstructions[index].WithLabels(skip);
+
+ newInstructions.InsertRange(0, new CodeInstruction[]
+ {
+ // this.Owner;
+ new CodeInstruction(OpCodes.Ldarg_0).WithLabels(mainLabels),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(Consumable), nameof(Consumable.Owner))),
+
+ // this;
+ new(OpCodes.Ldarg_0),
+
+ // ConsumingItemEventArgs ev = new(this.Owner, this);
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(ConsumingItemEventArgs))[0]),
+ new(OpCodes.Dup),
+
+ // Player.OnConsumingItem(ev);
+ new(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnConsumingItem))),
+
+ // if (!ev.IsAllowed)
+ // this._alreadyActivated = true;
+ // return;
+ new(OpCodes.Callvirt, PropertyGetter(typeof(ConsumingItemEventArgs), nameof(ConsumingItemEventArgs.IsAllowed))),
+ new(OpCodes.Brtrue_S, skip),
+
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Ldc_I4_1),
+ new(OpCodes.Stfld, Field(typeof(Consumable), nameof(Consumable._alreadyActivated))),
+
+ new(OpCodes.Ret),
+ });
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
From 696013de03629a3cf6426f8df6e92ffd1ae30d63 Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Wed, 29 Apr 2026 20:18:19 +0300
Subject: [PATCH 31/39] feat: add generic singleton Instance pattern for
CustomItem and CustomRole (#775)
* generic singleton instance pattern
* Update CustomItem{T}.cs
* new for someone
---
.../API/Features/CustomItem{T}.cs | 180 ++++++++++++++++++
.../API/Features/CustomRole{T}.cs | 39 ++++
2 files changed, 219 insertions(+)
create mode 100644 EXILED/Exiled.CustomItems/API/Features/CustomItem{T}.cs
create mode 100644 EXILED/Exiled.CustomRoles/API/Features/CustomRole{T}.cs
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomItem{T}.cs b/EXILED/Exiled.CustomItems/API/Features/CustomItem{T}.cs
new file mode 100644
index 0000000000..65fd3bd07f
--- /dev/null
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomItem{T}.cs
@@ -0,0 +1,180 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+#pragma warning disable SA1402 // File may only contain a single type
+namespace Exiled.CustomItems.API.Features
+{
+ using YamlDotNet.Serialization;
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomItem : CustomItem
+ where T : CustomItem, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomWeapon : CustomWeapon
+ where T : CustomWeapon, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomKeycard : CustomKeycard
+ where T : CustomKeycard, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomGrenade : CustomGrenade
+ where T : CustomGrenade, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomArmor : CustomArmor
+ where T : CustomArmor, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomGoggles : CustomGoggles
+ where T : CustomGoggles, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+}
+#pragma warning restore SA1402 // File may only contain a single type
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomRoles/API/Features/CustomRole{T}.cs b/EXILED/Exiled.CustomRoles/API/Features/CustomRole{T}.cs
new file mode 100644
index 0000000000..5d4149e8c5
--- /dev/null
+++ b/EXILED/Exiled.CustomRoles/API/Features/CustomRole{T}.cs
@@ -0,0 +1,39 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.CustomRoles.API.Features
+{
+ using YamlDotNet.Serialization;
+
+ ///
+ /// A generic base class for that provides a typed singleton .
+ ///
+ /// The concrete type.
+ public abstract class CustomRole : CustomRole
+ where T : CustomRole, new()
+ {
+ ///
+ /// Gets the singleton instance of this .
+ ///
+ [YamlIgnore]
+ public static T? Instance { get; private set; }
+
+ ///
+ public override void Init()
+ {
+ base.Init();
+ Instance = this as T;
+ }
+
+ ///
+ public override void Destroy()
+ {
+ Instance = null;
+ base.Destroy();
+ }
+ }
+}
\ No newline at end of file
From 5ad144e1f70f222a220331754eec8bf4031fdb36 Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Wed, 29 Apr 2026 20:23:12 +0300
Subject: [PATCH 32/39] feat: Speaker Api: Part Two (#762)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Automatic id / throwing errors changed to log error
* f
* .
* s
* gf
* eğH
* added new özellik
* update
* update log
* color on wrong order
* wwait i will fix
* finished
* fix
* pool clear
* fAHH!
* Fahh
* better and more functionally
* Return to pool doc
* Cleanup & Breaking Changes for exiled 10
Fck this old useless things
* Update Speaker.cs
* Update Speaker.cs
* Update Speaker.cs
* little refactor
* Performance improvement & fix Architectural problems in pooling
* wth
* .
* fix return pool
* .
* d
* removed Hard Coded values
* Update Speaker.cs
* fAHHHHH
* fix
* f
* izabel
* Release controller ID on pool return to prevent ID exhaustion
* remove network chechks
* for another pr
* locals
* fix: prevent controller ID conflicts by removing pooled speakers from AllInstances
* s
* base check for return pool
* ffff
* NOT MY CHANGES
* Added Fade Volume Method, Time left property & setter for PlaybackProgress
* fade in for play
* TrackData & fade in for Play from pool
* encoder clean for current time setter
* Queue Track
* added Static Events
* Audio Time Events
* fix Action errors break corrutine
* Action id
* more more C#18 YOLOOOOOOO
* reorder
* lazy instance for lists
* shuffle
* give credit to Fisher-Yates
* i forgot to delete this
* natural Fade
* add linear fade option
* Fix after fade volume stuck 0
* fixes
* squash
fix
* fade corrutine fix maybe, im drowing help me
is it OverApi idk?
* Update Speaker.cs
* Update Speaker.cs
* simplify api & null safety & fix fade & add stop fade function
* Remove Fade out because its doing api dirty and complicated
* Clean Api & new Event
* remove thing which im added
* remeove old arg
* doc
* f
* renameing
* Standalone System
* remove useles using which is i added
* bool return
* Add Filter
* Open Modular Api + Url play + Player play
* \
* add filter samples
* nh
* .
* fix: 14.2.6 update (#781)
* update
* remove MarshmallowFF fix
* Update doc 14.2.0.6
* fix footprint ctor for after player leaves
tbh the error itself might come from whenever mirror decides to remove peers and stuff cuz async
* I committed the commented out version when I was trying to recreate the bug 💔
* add docs + TryRaycastRoom fix
---------
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
* Bump to v9.13.3
* t
* directorys
magic struct to struct
* cache logic#
* fix file name
* pcm method
* helper for url
* refactor cache & add Playbacksettings class for too long param
* It seems to get more complicated each time.
* d
* change ai filter to more optimized ai filter
* simplfy playervoicesource
* Update Speaker.cs
* old way tasks maybe later
* filter reset + change useless Concurrent
* class to struct
* fix slient crash probablty, memory leak, neww sources
* add multiple key support for bypass free usage limit
* renames
* update,more task , more fix
* i forgot this
* i forgıt it
* fixed index out of
* task error protection & audio delaying 1 frame for nothing
* private pool + get
* delete summary
* shit
* you cant see me
* Last touchs of mr selim
* Change channel
* new prop for asyncpcmsoruce
* j
---------
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
Co-authored-by: @Someone <45270312+Someone-193@users.noreply.github.com>
---
EXILED/Exiled.API/Exiled.API.csproj | 1 +
.../Features/Audio/AudioDataStorage.cs | 213 +++
.../Features/Audio/Filters/EchoFilter.cs | 181 +++
.../Audio/Filters/PitchShiftFilter.cs | 300 ++++
.../Audio/PcmSources/CachedPcmSource.cs | 176 +++
.../Features/Audio/PcmSources/MixerSource.cs | 168 +++
.../Audio/PcmSources/PlayerVoiceSource.cs | 152 ++
.../{ => PcmSources}/PreloadedPcmSource.cs | 81 +-
.../Audio/PcmSources/VoiceRssTtsSource.cs | 268 ++++
.../Audio/{ => PcmSources}/WavStreamSource.cs | 37 +-
.../Audio/PcmSources/WebWavPcmSource.cs | 184 +++
.../Features/Audio/PlaybackSettings.cs | 98 ++
.../Features/Audio/ScheduledEvent.cs | 52 +
.../Features/Audio/SpeakerEvents.cs | 99 ++
.../Exiled.API/Features/Audio/WavUtility.cs | 215 ++-
EXILED/Exiled.API/Features/Toys/AdminToy.cs | 28 +-
EXILED/Exiled.API/Features/Toys/Light.cs | 3 +-
EXILED/Exiled.API/Features/Toys/Speaker.cs | 1240 ++++++++++++++---
.../Interfaces/Audio/IAsyncPcmSource.cs | 25 +
.../Interfaces/Audio/IAudioFilter.cs | 26 +
.../Interfaces/Audio/ILiveSource.cs | 16 +
.../Interfaces/{ => Audio}/IPcmSource.cs | 9 +-
EXILED/Exiled.API/Structs/Audio/AudioData.cs | 36 +
.../Exiled.API/Structs/Audio/QueuedTrack.cs | 40 +
EXILED/Exiled.API/Structs/Audio/TrackData.cs | 74 +
25 files changed, 3467 insertions(+), 255 deletions(-)
create mode 100644 EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/Filters/EchoFilter.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/Filters/PitchShiftFilter.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/PcmSources/CachedPcmSource.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/PcmSources/MixerSource.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/PcmSources/PlayerVoiceSource.cs
rename EXILED/Exiled.API/Features/Audio/{ => PcmSources}/PreloadedPcmSource.cs (58%)
create mode 100644 EXILED/Exiled.API/Features/Audio/PcmSources/VoiceRssTtsSource.cs
rename EXILED/Exiled.API/Features/Audio/{ => PcmSources}/WavStreamSource.cs (84%)
create mode 100644 EXILED/Exiled.API/Features/Audio/PcmSources/WebWavPcmSource.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/PlaybackSettings.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/ScheduledEvent.cs
create mode 100644 EXILED/Exiled.API/Features/Audio/SpeakerEvents.cs
create mode 100644 EXILED/Exiled.API/Interfaces/Audio/IAsyncPcmSource.cs
create mode 100644 EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs
create mode 100644 EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs
rename EXILED/Exiled.API/Interfaces/{ => Audio}/IPcmSource.cs (89%)
create mode 100644 EXILED/Exiled.API/Structs/Audio/AudioData.cs
create mode 100644 EXILED/Exiled.API/Structs/Audio/QueuedTrack.cs
create mode 100644 EXILED/Exiled.API/Structs/Audio/TrackData.cs
diff --git a/EXILED/Exiled.API/Exiled.API.csproj b/EXILED/Exiled.API/Exiled.API.csproj
index 70f81bf0d1..6dea6426ae 100644
--- a/EXILED/Exiled.API/Exiled.API.csproj
+++ b/EXILED/Exiled.API/Exiled.API.csproj
@@ -40,6 +40,7 @@
+
diff --git a/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs b/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs
new file mode 100644
index 0000000000..17ea91b02f
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs
@@ -0,0 +1,213 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
+ using System.IO;
+
+ using Exiled.API.Structs.Audio;
+
+ using MEC;
+
+ using RoundRestarting;
+
+ using UnityEngine.Networking;
+
+ ///
+ /// Manages a global in-memory storage of decoded PCM audio data. Once stored, audio can be played using .
+ ///
+ public static class AudioDataStorage
+ {
+ static AudioDataStorage()
+ {
+ AudioStorage = new();
+ RoundRestart.OnRestartTriggered += OnRoundRestart;
+ }
+
+ ///
+ /// Gets the underlying storage, keyed by name.
+ ///
+ public static Dictionary AudioStorage { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the storage is automatically cleared when a round restart is triggered.
+ ///
+ public static bool ClearOnRoundRestart { get; set; } = true;
+
+ ///
+ /// Loads and stores a local .wav file under the specified name.
+ ///
+ /// The unique storage key to assign to this audio.
+ /// The absolute path to the local .wav file.
+ /// true if the file was successfully loaded and stored; otherwise, false.
+ public static bool AddWav(string name, string path)
+ {
+ if (!ValidateName(name))
+ return false;
+
+ if (AudioStorage.ContainsKey(name))
+ {
+ Log.Warn($"[AudioDataStorage] An entry with the key '{name}' already exists. Skipping add.");
+ return false;
+ }
+
+ if (path.StartsWith("http"))
+ {
+ Log.Error($"[AudioDataStorage] '{path}' is a URL. Use AudioDataStorage.AddUrl() for web sources.");
+ return false;
+ }
+
+ if (!File.Exists(path))
+ {
+ Log.Error($"[AudioDataStorage] Local file not found: '{path}'");
+ return false;
+ }
+
+ try
+ {
+ AudioData parsed = WavUtility.WavToPcm(path);
+ return AudioStorage.TryAdd(name, parsed);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[AudioDataStorage] Failed to load '{path}' into storage:\n{ex}");
+ return false;
+ }
+ }
+
+ ///
+ /// Stores raw PCM audio samples under the specified name.
+ ///
+ /// The unique storage key to assign.
+ /// The raw PCM float array to store.
+ /// true if successfully added; otherwise, false.
+ public static bool Add(string name, float[] pcm)
+ {
+ if (pcm == null)
+ {
+ Log.Error($"[AudioDataStorage] Cannot store null array for key '{name}'.");
+ return false;
+ }
+
+ TrackData trackInfo = new()
+ {
+ Title = name,
+ Duration = (double)pcm.Length / VoiceChat.VoiceChatSettings.SampleRate,
+ };
+
+ return Add(name, new AudioData(pcm, trackInfo));
+ }
+
+ ///
+ /// Stores a fully constructed under the specified name.
+ ///
+ /// The unique storage key to assign.
+ /// The to store.
+ /// true if successfully added; otherwise, false.
+ public static bool Add(string name, AudioData audioData)
+ {
+ if (!ValidateName(name))
+ return false;
+
+ if (audioData.Pcm == null || audioData.Pcm.Length == 0)
+ {
+ Log.Error($"[AudioDataStorage] AudioData for key '{name}' has null or empty PCM.");
+ return false;
+ }
+
+ if (AudioStorage.ContainsKey(name))
+ {
+ Log.Warn($"[AudioDataStorage] An entry with the key '{name}' already exists. Skipping add.");
+ return false;
+ }
+
+ return AudioStorage.TryAdd(name, audioData);
+ }
+
+ ///
+ /// Starts an asynchronous download of a .wav file from the specified URL and adds it to the storage.
+ ///
+ /// The unique storage key to assign.
+ /// The HTTP or HTTPS URL pointing to a valid .wav file.
+ /// A for the running download coroutine.
+ public static CoroutineHandle AddWavUrl(string name, string url) => Timing.RunCoroutine(AddUrlCoroutine(name, url));
+
+ ///
+ /// Starts an asynchronous download of a .wav file from the specified URL and adds it to the storage.
+ ///
+ /// The unique storage key to assign.
+ /// The HTTP or HTTPS URL pointing to a valid .wav file.
+ /// A MEC-compatible of .
+ public static IEnumerator AddUrlCoroutine(string name, string url)
+ {
+ if (!ValidateName(name))
+ yield break;
+
+ if (string.IsNullOrEmpty(url) || !url.StartsWith("http"))
+ {
+ Log.Error($"[AudioDataStorage] Invalid URL for key '{name}': '{url}'. Must start with http/https.");
+ yield break;
+ }
+
+ if (AudioStorage.ContainsKey(name))
+ {
+ Log.Warn($"[AudioDataStorage] An entry with the key '{name}' already exists. Skipping download.");
+ yield break;
+ }
+
+ using UnityWebRequest www = UnityWebRequest.Get(url);
+ yield return Timing.WaitUntilDone(www.SendWebRequest());
+
+ if (www.result != UnityWebRequest.Result.Success)
+ {
+ Log.Error($"[AudioDataStorage] Download failed for '{url}': {www.error}");
+ yield break;
+ }
+
+ try
+ {
+ AudioData parsed = WavUtility.WavToPcm(www.downloadHandler.data);
+ parsed.TrackInfo.Path = url;
+ AudioStorage.TryAdd(name, parsed);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[AudioDataStorage] Failed to parse downloaded WAV from '{url}':\n{ex}");
+ }
+ }
+
+ ///
+ /// Removes a stored audio entry by name.
+ ///
+ /// The storage name/key to remove.
+ /// true if the entry was found and removed; otherwise, false.
+ public static bool Remove(string name) => AudioStorage.Remove(name, out _);
+
+ ///
+ /// Clears all entries from the audio storage, freeing all associated memory.
+ ///
+ public static void Clear() => AudioStorage.Clear();
+
+ private static bool ValidateName(string name)
+ {
+ if (!string.IsNullOrEmpty(name))
+ return true;
+
+ Log.Error("[AudioDataStorage] Storage name (key) cannot be null or empty.");
+ return false;
+ }
+
+ private static void OnRoundRestart()
+ {
+ if (ClearOnRoundRestart)
+ Clear();
+ }
+ }
+}
diff --git a/EXILED/Exiled.API/Features/Audio/Filters/EchoFilter.cs b/EXILED/Exiled.API/Features/Audio/Filters/EchoFilter.cs
new file mode 100644
index 0000000000..6cdcee5c0f
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/Filters/EchoFilter.cs
@@ -0,0 +1,181 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.Filters
+{
+ using System;
+
+ using Exiled.API.Interfaces.Audio;
+
+ using UnityEngine;
+
+ ///
+ /// A true DSP Fractional Delay Filter equipped with an RBJ Butterworth Biquad Filter.
+ ///
+ public sealed class EchoFilter : IAudioFilter
+ {
+ private const float MaxDelayMs = 10000f;
+ private readonly float[] delayBuffer;
+ private readonly int maxBufferLength;
+
+ private int writeIndex;
+
+ private float b0;
+ private float b1;
+ private float b2;
+ private float a1;
+ private float a2;
+ private float x1;
+ private float x2;
+ private float y1;
+ private float y2;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The delay time in milliseconds (10 - 10000).
+ /// The feedback multiplier determining how long the echo lasts.
+ /// The volume of the original sound.
+ /// The volume of the echoed sound.
+ /// How much high-frequency is absorbed each bounce (0 = pure digital ring, 1 = heavy muffled echo).
+ public EchoFilter(float delayMs = 300f, float decay = 0.5f, float dry = 1.0f, float wet = 0.5f, float damp = 0.3f)
+ {
+ maxBufferLength = (int)(VoiceChat.VoiceChatSettings.SampleRate * (MaxDelayMs / 1000f));
+ delayBuffer = new float[maxBufferLength];
+
+ writeIndex = 0;
+ x1 = x2 = y1 = y2 = 0f;
+
+ Delay = delayMs;
+ Feedback = decay;
+ DryMix = dry;
+ WetMix = wet;
+ Damping = damp;
+ }
+
+ ///
+ /// Gets or sets the delay time in milliseconds. Dynamically adjusts the read head.
+ ///
+ public float Delay
+ {
+ get;
+ set => field = Mathf.Clamp(value, 10f, MaxDelayMs);
+ }
+
+ ///
+ /// Gets or sets the feedback multiplier. Determines how many times the echo repeats before dying out.
+ ///
+ public float Feedback
+ {
+ get;
+ set => field = Mathf.Clamp01(value);
+ }
+
+ ///
+ /// Gets or sets the volume of the original (dry) unaffected sound.
+ ///
+ public float DryMix
+ {
+ get;
+ set => field = Mathf.Clamp01(value);
+ }
+
+ ///
+ /// Gets or sets the volume of the delayed (wet) echoed sound.
+ ///
+ public float WetMix
+ {
+ get;
+ set => field = Mathf.Clamp01(value);
+ }
+
+ ///
+ /// Gets or sets the damping coefficient. Automatically recalculates the RBJ Biquad coefficients.
+ ///
+ public float Damping
+ {
+ get;
+ set
+ {
+ field = Mathf.Clamp01(value);
+ CalculateBiquad(field);
+ }
+ }
+
+ ///
+ /// Processes the raw PCM audio frame directly before it is encoded and sending.
+ ///
+ /// The array of PCM audio samples.
+ public void Process(float[] frame)
+ {
+ float currentDelayMs = Delay;
+ float currentFeedback = Feedback;
+ float currentDry = DryMix;
+ float currentWet = WetMix;
+
+ float delaySamples = VoiceChat.VoiceChatSettings.SampleRate * (currentDelayMs / 1000f);
+
+ for (int i = 0; i < frame.Length; i++)
+ {
+ float input = frame[i];
+ float readPos = writeIndex - delaySamples;
+ if (readPos < 0)
+ readPos += maxBufferLength;
+
+ int index1 = (int)readPos;
+ int index2 = (index1 + 1) % maxBufferLength;
+ float frac = readPos - index1;
+
+ float delayedSample = (delayBuffer[index1] * (1f - frac)) + (delayBuffer[index2] * frac);
+ float filteredSample = (b0 * delayedSample) + (b1 * x1) + (b2 * x2) - (a1 * y1) - (a2 * y2);
+
+ x2 = x1;
+ x1 = delayedSample;
+ y2 = y1;
+ y1 = filteredSample;
+
+ float output = (input * currentDry) + (filteredSample * currentWet);
+ delayBuffer[writeIndex] = input + (filteredSample * currentFeedback);
+
+ writeIndex++;
+ if (writeIndex >= maxBufferLength)
+ writeIndex = 0;
+
+ frame[i] = output / (1f + Mathf.Abs(output));
+ }
+ }
+
+ ///
+ public void Reset()
+ {
+ Array.Clear(delayBuffer, 0, delayBuffer.Length);
+ writeIndex = 0;
+ x1 = x2 = y1 = y2 = 0f;
+ }
+
+ ///
+ /// Calculates the Robert Bristow-Johnson (RBJ) Audio EQ parameters for the low-pass filter.
+ ///
+ private void CalculateBiquad(float dampValue)
+ {
+ float cutoffFrequency = Mathf.Lerp(20000f, 500f, dampValue);
+
+ if (cutoffFrequency >= VoiceChat.VoiceChatSettings.SampleRate / 2f)
+ cutoffFrequency = (VoiceChat.VoiceChatSettings.SampleRate / 2f) - 100f;
+
+ float w0 = 2f * Mathf.PI * cutoffFrequency / VoiceChat.VoiceChatSettings.SampleRate;
+ float alpha = Mathf.Sin(w0) / (2f * 0.7071f);
+
+ float a0 = 1f + alpha;
+ b0 = ((1f - Mathf.Cos(w0)) / 2f) / a0;
+ b1 = (1f - Mathf.Cos(w0)) / a0;
+ b2 = ((1f - Mathf.Cos(w0)) / 2f) / a0;
+ a1 = (-2f * Mathf.Cos(w0)) / a0;
+ a2 = (1f - alpha) / a0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/Filters/PitchShiftFilter.cs b/EXILED/Exiled.API/Features/Audio/Filters/PitchShiftFilter.cs
new file mode 100644
index 0000000000..e013d9fae0
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/Filters/PitchShiftFilter.cs
@@ -0,0 +1,300 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.Filters
+{
+ using System;
+
+ using Exiled.API.Interfaces.Audio;
+
+ using UnityEngine;
+
+ ///
+ /// A true DSP Granular Pitch Shifter based on the smbPitchShift algorithm.
+ ///
+ public sealed class PitchShiftFilter : IAudioFilter
+ {
+ private const int FftFrameSize = 2048;
+ private const int FftFrameSize2 = FftFrameSize / 2;
+ private const int MaxFrameLength = 8192;
+
+ private static readonly float[] HannWindow = BuildHannWindow();
+
+ private readonly float[] gInFIFO = new float[MaxFrameLength];
+ private readonly float[] gOutFIFO = new float[MaxFrameLength];
+ private readonly float[] gFFTworksp = new float[2 * FftFrameSize];
+ private readonly float[] gLastPhase = new float[FftFrameSize2 + 1];
+ private readonly float[] gSumPhase = new float[FftFrameSize2 + 1];
+ private readonly float[] gOutputAccum = new float[2 * FftFrameSize];
+ private readonly float[] gAnaFreq = new float[FftFrameSize];
+ private readonly float[] gAnaMagn = new float[FftFrameSize];
+ private readonly float[] gSynFreq = new float[FftFrameSize];
+ private readonly float[] gSynMagn = new float[FftFrameSize];
+
+ private readonly float[] outputBuffer = new float[MaxFrameLength];
+
+ private readonly float[] twiddleCos;
+ private readonly float[] twiddleSin;
+
+ private long gRover = 0;
+
+ private int cachedOversample = -1;
+ private long stepSize;
+ private long inFifoLatency;
+ private float expct;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The pitch multiplier. Above 1.0 for higher pitch, below 1.0 for lower pitch.
+ ///
+ /// The overlap factor controlling quality vs CPU usage. Higher values produce better quality but require more CPU. Must be a power of 2. Typical values: 2 (low CPU), 4 (default, balanced), 8 (high quality).
+ ///
+ public PitchShiftFilter(float pitch = 1.5f, int oversample = 4)
+ {
+ twiddleCos = new float[FftFrameSize];
+ twiddleSin = new float[FftFrameSize];
+ PrecomputeTwiddleFactors();
+
+ Pitch = pitch;
+ Oversample = oversample;
+ }
+
+ ///
+ /// Gets or sets the pitch multiplier applied during playback.
+ /// Values above 1.0 produce a higher (thinner) pitch; values below 1.0 produce a lower (deeper) pitch.
+ ///
+ public float Pitch
+ {
+ get;
+ set => field = Mathf.Clamp(value, 0.1f, 4.0f);
+ }
+
+ ///
+ /// Gets or sets the overlap factor controlling quality versus CPU usage.
+ /// Higher values improve quality but increase processing cost. Must be a power of 2.
+ /// Typical values: 2 (low CPU), 4 (balanced, default), 8 (high quality).
+ ///
+ public int Oversample
+ {
+ get;
+ set
+ {
+ field = Mathf.Clamp(value, 2, 32);
+ cachedOversample = -1;
+ }
+ }
+
+ ///
+ public void Process(float[] frame)
+ {
+ if (Mathf.Abs(Pitch - 1.0f) < 0.001f)
+ return;
+
+ EnsureOversampleConstants();
+ SmbPitchShift(Pitch, frame.Length, frame, outputBuffer);
+
+ Array.Copy(outputBuffer, frame, frame.Length);
+ }
+
+ ///
+ public void Reset()
+ {
+ Array.Clear(gInFIFO, 0, gInFIFO.Length);
+ Array.Clear(gOutFIFO, 0, gOutFIFO.Length);
+ Array.Clear(gFFTworksp, 0, gFFTworksp.Length);
+ Array.Clear(gLastPhase, 0, gLastPhase.Length);
+ Array.Clear(gSumPhase, 0, gSumPhase.Length);
+ Array.Clear(gOutputAccum, 0, gOutputAccum.Length);
+ Array.Clear(gAnaFreq, 0, gAnaFreq.Length);
+ Array.Clear(gAnaMagn, 0, gAnaMagn.Length);
+ Array.Clear(gSynFreq, 0, gSynFreq.Length);
+ Array.Clear(gSynMagn, 0, gSynMagn.Length);
+ Array.Clear(outputBuffer, 0, outputBuffer.Length);
+
+ gRover = 0;
+ cachedOversample = -1;
+ }
+
+ private static float[] BuildHannWindow()
+ {
+ float[] window = new float[FftFrameSize];
+ for (int i = 0; i < FftFrameSize; i++)
+ window[i] = 0.5f - (0.5f * Mathf.Cos(2.0f * Mathf.PI * i / FftFrameSize));
+
+ return window;
+ }
+
+ private void PrecomputeTwiddleFactors()
+ {
+ for (int le = 4, k = 0; le <= FftFrameSize * 2; le <<= 1, k++)
+ {
+ int le2 = le >> 1;
+ float arg = Mathf.PI / (le2 >> 1);
+ twiddleCos[k] = Mathf.Cos(arg);
+ twiddleSin[k] = Mathf.Sin(arg);
+ }
+ }
+
+ private void EnsureOversampleConstants()
+ {
+ if (cachedOversample == Oversample)
+ return;
+
+ cachedOversample = Oversample;
+ stepSize = FftFrameSize / Oversample;
+ inFifoLatency = FftFrameSize - stepSize;
+ expct = 2.0f * Mathf.PI * stepSize / FftFrameSize;
+
+ if (gRover == 0)
+ gRover = inFifoLatency;
+ }
+
+ private void SmbPitchShift(float pitchShift, int numSampsToProcess, float[] indata, float[] outdata)
+ {
+ float freqPerBin = VoiceChat.VoiceChatSettings.SampleRate / (float)FftFrameSize;
+
+ for (int i = 0; i < numSampsToProcess; i++)
+ {
+ gInFIFO[gRover] = indata[i];
+ outdata[i] = gOutFIFO[gRover - inFifoLatency];
+ gRover++;
+
+ if (gRover < FftFrameSize)
+ continue;
+
+ gRover = inFifoLatency;
+
+ for (int k = 0; k < FftFrameSize; k++)
+ {
+ gFFTworksp[2 * k] = gInFIFO[k] * HannWindow[k];
+ gFFTworksp[(2 * k) + 1] = 0.0f;
+ }
+
+ SmbFft(gFFTworksp, -1);
+
+ for (int k = 0; k <= FftFrameSize2; k++)
+ {
+ float real = gFFTworksp[2 * k];
+ float imag = gFFTworksp[(2 * k) + 1];
+
+ float magn = 2.0f * Mathf.Sqrt((real * real) + (imag * imag));
+ float phase = Mathf.Atan2(imag, real);
+
+ float tmp = phase - gLastPhase[k];
+ gLastPhase[k] = phase;
+
+ tmp -= k * expct;
+
+ long qpd = (long)(tmp / Mathf.PI);
+ if (qpd >= 0)
+ qpd += qpd & 1;
+ else
+ qpd -= qpd & 1;
+
+ tmp -= Mathf.PI * qpd;
+
+ tmp = Oversample * tmp / (2.0f * Mathf.PI);
+ tmp = (k * freqPerBin) + (tmp * freqPerBin);
+
+ gAnaMagn[k] = magn;
+ gAnaFreq[k] = tmp;
+ }
+
+ Array.Clear(gSynMagn, 0, FftFrameSize);
+ Array.Clear(gSynFreq, 0, FftFrameSize);
+
+ for (int k = 0; k <= FftFrameSize2; k++)
+ {
+ long index = (long)(k * pitchShift);
+ if (index <= FftFrameSize2)
+ {
+ gSynMagn[index] += gAnaMagn[k];
+ gSynFreq[index] = gAnaFreq[k] * pitchShift;
+ }
+ }
+
+ for (int k = 0; k <= FftFrameSize2; k++)
+ {
+ float magn = gSynMagn[k];
+ float tmp = gSynFreq[k];
+
+ tmp -= k * freqPerBin;
+ tmp /= freqPerBin;
+ tmp = 2.0f * Mathf.PI * tmp / Oversample;
+ tmp += k * expct;
+
+ gSumPhase[k] += tmp;
+
+ gFFTworksp[2 * k] = magn * Mathf.Cos(gSumPhase[k]);
+ gFFTworksp[(2 * k) + 1] = magn * Mathf.Sin(gSumPhase[k]);
+ }
+
+ Array.Clear(gFFTworksp, FftFrameSize + 2, FftFrameSize - 2);
+
+ SmbFft(gFFTworksp, 1);
+
+ for (int k = 0; k < FftFrameSize; k++)
+ gOutputAccum[k] += 2.0f * HannWindow[k] * gFFTworksp[2 * k] / (FftFrameSize2 * Oversample);
+
+ for (int k = 0; k < stepSize; k++)
+ gOutFIFO[k] = gOutputAccum[k];
+
+ Array.Copy(gOutputAccum, stepSize, gOutputAccum, 0, FftFrameSize);
+ Array.Clear(gOutputAccum, FftFrameSize, (int)stepSize);
+
+ Array.Copy(gInFIFO, stepSize, gInFIFO, 0, inFifoLatency);
+ }
+ }
+
+ private void SmbFft(float[] fftBuffer, int sign)
+ {
+ for (int i = 2; i < (2 * FftFrameSize) - 2; i += 2)
+ {
+ int j = 0;
+ for (int bitm = 2; bitm < 2 * FftFrameSize; bitm <<= 1)
+ {
+ if ((i & bitm) != 0)
+ j++;
+ j <<= 1;
+ }
+
+ if (i < j)
+ {
+ (fftBuffer[j], fftBuffer[i]) = (fftBuffer[i], fftBuffer[j]);
+ (fftBuffer[j + 1], fftBuffer[i + 1]) = (fftBuffer[i + 1], fftBuffer[j + 1]);
+ }
+ }
+
+ int stageIndex = 0;
+ for (int le = 4; le <= FftFrameSize * 2; le <<= 1, stageIndex++)
+ {
+ int le2 = le >> 1;
+ float wr = twiddleCos[stageIndex];
+ float wi = twiddleSin[stageIndex] * sign;
+ float ur = 1.0f, ui = 0.0f;
+
+ for (int j = 0; j < le2; j += 2)
+ {
+ for (int i = j; i < 2 * FftFrameSize; i += le)
+ {
+ float tr = (fftBuffer[i + le2] * ur) - (fftBuffer[i + le2 + 1] * ui);
+ float ti = (fftBuffer[i + le2] * ui) + (fftBuffer[i + le2 + 1] * ur);
+ fftBuffer[i + le2] = fftBuffer[i] - tr;
+ fftBuffer[i + le2 + 1] = fftBuffer[i + 1] - ti;
+ fftBuffer[i] += tr;
+ fftBuffer[i + 1] += ti;
+ }
+
+ float newUr = (ur * wr) - (ui * wi);
+ ui = (ur * wi) + (ui * wr);
+ ur = newUr;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/PcmSources/CachedPcmSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/CachedPcmSource.cs
new file mode 100644
index 0000000000..c9b8c94430
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/CachedPcmSource.cs
@@ -0,0 +1,176 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.PcmSources
+{
+ using System;
+ using System.IO;
+
+ using Exiled.API.Features.Audio;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
+
+ using VoiceChat;
+
+ ///
+ /// Provides an that plays audio data directly from the for optimized, repeated playback.
+ ///
+ public sealed class CachedPcmSource : IPcmSource
+ {
+ private readonly float[] data;
+ private int pos;
+
+ ///
+ /// Initializes a new instance of the class by fetching already cached audio using its name.
+ ///
+ /// The name/key of the audio in the cache.
+ public CachedPcmSource(string name)
+ {
+ if (string.IsNullOrEmpty(name))
+ {
+ Log.Error("[CachedPcmSource] Cannot initialize CachedPcmSource. Cache name cannot be null or empty.");
+ throw new ArgumentException("Cache name cannot be null or empty.", nameof(name));
+ }
+
+ if (!AudioDataStorage.AudioStorage.TryGetValue(name, out AudioData cachedAudio))
+ {
+ Log.Error($"[CachedPcmSource] Audio with name '{name}' not found in AudioDataStorage.");
+ throw new FileNotFoundException($"Audio '{name}' is not cached. Please cache it first using AudioDataStorage");
+ }
+
+ data = cachedAudio.Pcm;
+ TrackInfo = cachedAudio.TrackInfo;
+ }
+
+ ///
+ /// Initializes a new instance of the class. Fetches cached audio or loads a local WAV file into the cache if not present.
+ ///
+ /// The custom name/key to assign to this audio in the cache.
+ /// The absolute path to the local audio file.
+ public CachedPcmSource(string name, string path)
+ {
+ if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(path))
+ {
+ Log.Error($"[CachedPcmSource] Cannot initialize CachedPcmSource. Invalid name: '{name}' or path: '{path}'.");
+ throw new ArgumentException("Name or path cannot be null or empty.");
+ }
+
+ if (!AudioDataStorage.AudioStorage.ContainsKey(name))
+ {
+ if (!AudioDataStorage.AddWav(name, path))
+ {
+ Log.Error($"[CachedPcmSource] Failed to load local file '{path}' into cache under the name '{name}'.");
+ throw new FileNotFoundException($"Failed to cache and load '{path}'.");
+ }
+ }
+
+ if (!AudioDataStorage.AudioStorage.TryGetValue(name, out AudioData cachedAudio))
+ {
+ Log.Error($"[CachedPcmSource] Audio with name '{name}' could not be retrieved from storage after adding.");
+ throw new InvalidOperationException($"Failed to retrieve '{name}' from storage after caching.");
+ }
+
+ data = cachedAudio.Pcm;
+ TrackInfo = cachedAudio.TrackInfo;
+ }
+
+ ///
+ /// Initializes a new instance of the class by fetching cached audio or injecting raw PCM samples into the cache if not present.
+ ///
+ /// The custom name/key to assign to this audio in the cache.
+ /// The raw PCM audio samples (float array).
+ public CachedPcmSource(string name, float[] pcm)
+ {
+ if (string.IsNullOrEmpty(name) || pcm == null || pcm.Length == 0)
+ {
+ Log.Error($"[CachedPcmSource] Cannot initialize CachedPcmSource. Invalid name or empty PCM data for '{name}'.");
+ throw new ArgumentException("Name or PCM data cannot be null.");
+ }
+
+ if (!AudioDataStorage.AudioStorage.ContainsKey(name))
+ {
+ if (!AudioDataStorage.Add(name, pcm))
+ {
+ Log.Error($"[CachedPcmSource] Failed to load raw PCM data into cache under the name '{name}'.");
+ throw new InvalidOperationException($"Failed to cache PCM data for '{name}'.");
+ }
+ }
+
+ if (!AudioDataStorage.AudioStorage.TryGetValue(name, out AudioData cachedAudio))
+ {
+ Log.Error($"[CachedPcmSource] Audio with name '{name}' could not be retrieved from storage after adding.");
+ throw new InvalidOperationException($"Failed to retrieve '{name}' from storage after caching.");
+ }
+
+ data = cachedAudio.Pcm;
+ TrackInfo = cachedAudio.TrackInfo;
+ }
+
+ ///
+ /// Gets the metadata of the loaded track.
+ ///
+ public TrackData TrackInfo { get; }
+
+ ///
+ /// Gets a value indicating whether the end of the PCM data buffer has been reached.
+ ///
+ public bool Ended => pos >= data.Length;
+
+ ///
+ /// Gets the total duration of the audio in seconds.
+ ///
+ public double TotalDuration => (double)data.Length / VoiceChatSettings.SampleRate;
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ public double CurrentTime
+ {
+ get => (double)pos / VoiceChatSettings.SampleRate;
+ set => Seek(value);
+ }
+
+ ///
+ /// Reads a sequence of PCM samples from the cached buffer into the specified array.
+ ///
+ /// The destination array.
+ /// The index to start writing.
+ /// The maximum number of samples to read.
+ /// The actual number of samples read.
+ public int Read(float[] buffer, int offset, int count)
+ {
+ int read = Math.Min(count, data.Length - pos);
+ Array.Copy(data, pos, buffer, offset, read);
+ pos += read;
+
+ return read;
+ }
+
+ ///
+ /// Seeks to the specified position in seconds.
+ ///
+ /// The target position in seconds.
+ public void Seek(double seconds)
+ {
+ long targetIndex = (long)(seconds * VoiceChatSettings.SampleRate);
+ pos = (int)Math.Max(0, Math.Min(targetIndex, data.Length));
+ }
+
+ ///
+ /// Resets the read position to the beginning of the PCM data buffer.
+ ///
+ public void Reset()
+ {
+ pos = 0;
+ }
+
+ ///
+ public void Dispose()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/PcmSources/MixerSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/MixerSource.cs
new file mode 100644
index 0000000000..b97d3181a3
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/MixerSource.cs
@@ -0,0 +1,168 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.PcmSources
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
+
+ using UnityEngine;
+
+ ///
+ /// Provides an that dynamically mixes multiple audio sources together in real-time.
+ ///
+ /// This allows playing overlapping sounds (e.g., background music + voice announcements) simultaneously
+ /// through a single speaker without needing multiple Voice Controller IDs.
+ ///
+ ///
+ public sealed class MixerSource : IPcmSource
+ {
+ private readonly List sources = new();
+ private float[] tempBuffer;
+
+ ///
+ /// Initializes a new instance of the class with the specified initial sources.
+ ///
+ /// An array of instances to mix.
+ public MixerSource(IEnumerable initialSources)
+ {
+ if (initialSources != null)
+ sources.AddRange(initialSources.Where(s => s != null));
+
+ TrackInfo = new TrackData { Path = "Audio Mixer", Duration = 0 };
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the mixer should stay alive and output silence even when all internal sources have finished playing.
+ ///
+ public bool KeepAlive { get; set; } = false;
+
+ ///
+ /// Gets the metadata of the mixer track.
+ ///
+ public TrackData TrackInfo { get; }
+
+ ///
+ /// Gets the maximum total duration of all active sources in the mixer, in seconds.
+ ///
+ public double TotalDuration => sources.Count > 0 ? sources.Max(x => x.TotalDuration) : 0.0;
+
+ ///
+ /// Gets or sets the current playback position in seconds across all active sources.
+ ///
+ public double CurrentTime
+ {
+ get => sources.Count > 0 ? sources.Max(x => x.CurrentTime) : 0.0;
+ set => Seek(value);
+ }
+
+ ///
+ /// Gets a value indicating whether all internal sources have ended and is set to false.
+ ///
+ public bool Ended => !KeepAlive && (sources.Count == 0 || sources.All(x => x.Ended));
+
+ ///
+ /// Reads a sequence of mixed PCM samples from all active sources into the specified buffer.
+ ///
+ /// The destination buffer to fill with mixed PCM data.
+ /// The zero-based index in at which to begin writing.
+ /// The maximum number of samples to read and mix.
+ /// The number of samples written to the .
+ public int Read(float[] buffer, int offset, int count)
+ {
+ if (tempBuffer == null || tempBuffer.Length < count)
+ tempBuffer = new float[count];
+
+ Array.Clear(buffer, offset, count);
+ int maxRead = 0;
+
+ for (int i = sources.Count - 1; i >= 0; i--)
+ {
+ IPcmSource src = sources[i];
+
+ if (src.Ended)
+ {
+ src.Dispose();
+ sources.RemoveAt(i);
+ continue;
+ }
+
+ int read = src.Read(tempBuffer, 0, count);
+ if (read > maxRead)
+ maxRead = read;
+
+ for (int j = 0; j < read; j++)
+ buffer[offset + j] += tempBuffer[j];
+ }
+
+ for (int i = 0; i < maxRead; i++)
+ buffer[offset + i] = Mathf.Clamp(buffer[offset + i], -1f, 1f);
+
+ return KeepAlive ? count : maxRead;
+ }
+
+ ///
+ /// Seeks to the specified position in seconds for all active sources in the mixer.
+ ///
+ /// The target position in seconds.
+ public void Seek(double seconds)
+ {
+ foreach (IPcmSource pcmSource in sources)
+ pcmSource.Seek(seconds);
+ }
+
+ ///
+ /// Resets the playback position to the start for all active sources in the mixer.
+ ///
+ public void Reset()
+ {
+ foreach (IPcmSource pcmSource in sources)
+ pcmSource.Reset();
+ }
+
+ ///
+ /// Releases all resources used by the and automatically disposes of all internal sources.
+ ///
+ public void Dispose()
+ {
+ foreach (IPcmSource pcmSource in sources)
+ pcmSource?.Dispose();
+
+ sources.Clear();
+ }
+
+ ///
+ /// Dynamically adds a new to the mixer while it is playing.
+ ///
+ /// The audio source to add.
+ public void AddSource(IPcmSource source)
+ {
+ if (source != null)
+ sources.Add(source);
+ }
+
+ ///
+ /// Dynamically removes an existing from the mixer.
+ ///
+ /// The audio source to remove.
+ /// If true, automatically calls Dispose on the removed source.
+ public void RemoveSource(IPcmSource source, bool dispose = true)
+ {
+ if (source == null)
+ return;
+
+ if (dispose)
+ source.Dispose();
+
+ sources.Remove(source);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/PcmSources/PlayerVoiceSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/PlayerVoiceSource.cs
new file mode 100644
index 0000000000..ae70e5a103
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/PlayerVoiceSource.cs
@@ -0,0 +1,152 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.PcmSources
+{
+ using System.Buffers;
+ using System.Collections.Generic;
+
+ using Exiled.API.Features;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
+
+ using LabApi.Events.Arguments.PlayerEvents;
+
+ using VoiceChat;
+ using VoiceChat.Codec;
+
+ ///
+ /// Provides a that captures and decodes live microphone input from a specific player.
+ ///
+ public sealed class PlayerVoiceSource : IPcmSource, ILiveSource
+ {
+ private readonly Player sourcePlayer;
+ private readonly OpusDecoder decoder;
+ private readonly Queue pcmQueue;
+
+ private float[] decodeBuffer;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player whose voice will be captured.
+ /// If true, prevents the player's original voice message's from being heard while broadcasting.
+ public PlayerVoiceSource(Player player, bool blockOriginalVoice = false)
+ {
+ sourcePlayer = player;
+ BlockOriginalVoice = blockOriginalVoice;
+
+ decoder = new OpusDecoder();
+ pcmQueue = new Queue();
+ decodeBuffer = ArrayPool.Shared.Rent(VoiceChatSettings.PacketSizePerChannel);
+
+ TrackInfo = new TrackData
+ {
+ Path = $"{player.Nickname}-Mic",
+ Duration = double.PositiveInfinity,
+ };
+
+ LabApi.Events.Handlers.PlayerEvents.SendingVoiceMessage += OnVoiceChatting;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the player's original voice chat should be blocked while being broadcasted by this source.
+ ///
+ public bool BlockOriginalVoice { get; set; } = false;
+
+ ///
+ /// Gets the metadata of the streaming track.
+ ///
+ public TrackData TrackInfo { get; }
+
+ ///
+ /// Gets the total duration of the audio in seconds.
+ ///
+ public double TotalDuration => double.PositiveInfinity;
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ public double CurrentTime
+ {
+ get => 0.0;
+ set => Seek(value);
+ }
+
+ ///
+ /// Gets a value indicating whether the end of the stream has been reached.
+ ///
+ public bool Ended => sourcePlayer?.GameObject == null;
+
+ ///
+ /// Reads PCM data from the stream into the specified buffer.
+ ///
+ /// The buffer to fill with PCM data.
+ /// The offset in the buffer at which to begin writing.
+ /// The maximum number of samples to read.
+ /// The number of samples read.
+ public int Read(float[] buffer, int offset, int count)
+ {
+ if (Ended)
+ return 0;
+
+ int read = 0;
+ while (read < count && pcmQueue.TryDequeue(out float sample))
+ {
+ buffer[offset + read] = sample;
+ read++;
+ }
+
+ return read;
+ }
+
+ ///
+ public void Seek(double seconds)
+ {
+ Log.Info("[PlayerVoiceSource] Seeking is not supported for live player voice streams.");
+ }
+
+ ///
+ public void Reset()
+ {
+ Log.Info("[PlayerVoiceSource] Resetting is not supported for live player voice streams.");
+ }
+
+ ///
+ /// Releases all resources used by the .
+ ///
+ public void Dispose()
+ {
+ LabApi.Events.Handlers.PlayerEvents.SendingVoiceMessage -= OnVoiceChatting;
+ decoder?.Dispose();
+ if (decodeBuffer != null)
+ {
+ ArrayPool.Shared.Return(decodeBuffer);
+ decodeBuffer = null;
+ }
+ }
+
+ private void OnVoiceChatting(PlayerSendingVoiceMessageEventArgs ev)
+ {
+ if (ev.Player != sourcePlayer)
+ return;
+
+ if (ev.Message.DataLength <= 2)
+ return;
+
+ if (BlockOriginalVoice)
+ ev.IsAllowed = false;
+
+ int decodedSamples = decoder.Decode(ev.Message.Data, ev.Message.DataLength, decodeBuffer);
+
+ for (int i = 0; i < decodedSamples; i++)
+ {
+ pcmQueue.Enqueue(decodeBuffer[i]);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/PreloadedPcmSource.cs
similarity index 58%
rename from EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs
rename to EXILED/Exiled.API/Features/Audio/PcmSources/PreloadedPcmSource.cs
index 7be9d09a30..ea1855a9ef 100644
--- a/EXILED/Exiled.API/Features/Audio/PreloadedPcmSource.cs
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/PreloadedPcmSource.cs
@@ -5,36 +5,51 @@
//
// -----------------------------------------------------------------------
-namespace Exiled.API.Features.Audio
+namespace Exiled.API.Features.Audio.PcmSources
{
using System;
+ using System.Threading.Tasks;
- using Exiled.API.Interfaces;
+ using Exiled.API.Features.Audio;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
using VoiceChat;
///
- /// Represents a preloaded PCM audio source.
+ /// Provides a preloaded with Pcm data or file.
///
- public sealed class PreloadedPcmSource : IPcmSource
+ public sealed class PreloadedPcmSource : IPcmSource, IAsyncPcmSource
{
- ///
- /// The PCM data buffer.
- ///
- private readonly float[] data;
-
- ///
- /// The current read position in the data buffer.
- ///
+ private float[] data;
private int pos;
+ private volatile bool isReady = false;
+ private volatile bool isFailed = false;
+
///
/// Initializes a new instance of the class.
///
/// The path to the audio file.
public PreloadedPcmSource(string path)
{
- data = WavUtility.WavToPcm(path);
+ TrackInfo = new TrackData { Path = path, Duration = 0.0 };
+
+ Task.Run(() =>
+ {
+ try
+ {
+ AudioData result = WavUtility.WavToPcm(path);
+ data = result.Pcm;
+ TrackInfo = result.TrackInfo;
+ isReady = true;
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[PreloadedPcmSource] Failed to load audio from path: {path} | Error: {ex.Message}");
+ isFailed = true;
+ }
+ });
}
///
@@ -44,27 +59,40 @@ public PreloadedPcmSource(string path)
public PreloadedPcmSource(float[] pcmData)
{
data = pcmData;
+ isReady = true;
+ TrackInfo = new TrackData { Duration = TotalDuration };
}
+ ///
+ /// Gets the metadata of the loaded track.
+ ///
+ public TrackData TrackInfo { get; private set; }
+
///
/// Gets a value indicating whether the end of the PCM data buffer has been reached.
///
- public bool Ended => pos >= data.Length;
+ public bool Ended => isFailed || (isReady && pos >= data.Length);
///
/// Gets the total duration of the audio in seconds.
///
- public double TotalDuration => (double)data.Length / VoiceChatSettings.SampleRate;
+ public double TotalDuration => isReady && data != null ? (double)data.Length / VoiceChatSettings.SampleRate : 0.0;
///
/// Gets or sets the current playback position in seconds.
///
public double CurrentTime
{
- get => (double)pos / VoiceChatSettings.SampleRate;
+ get => isReady ? (double)pos / VoiceChatSettings.SampleRate : 0.0;
set => Seek(value);
}
+ ///
+ public bool IsFailed => isFailed;
+
+ ///
+ public bool IsReady => isReady;
+
///
/// Reads a sequence of PCM samples from the preloaded buffer into the specified array.
///
@@ -74,6 +102,15 @@ public double CurrentTime
/// The number of samples read into .
public int Read(float[] buffer, int offset, int count)
{
+ if (isFailed)
+ return 0;
+
+ if (!isReady || data == null)
+ {
+ Array.Clear(buffer, offset, count);
+ return count;
+ }
+
int read = Math.Min(count, data.Length - pos);
Array.Copy(data, pos, buffer, offset, read);
pos += read;
@@ -87,15 +124,11 @@ public int Read(float[] buffer, int offset, int count)
/// The target position in seconds.
public void Seek(double seconds)
{
- long targetIndex = (long)(seconds * VoiceChatSettings.SampleRate);
-
- if (targetIndex < 0)
- targetIndex = 0;
+ if (!isReady || data == null)
+ return;
- if (targetIndex > data.Length)
- targetIndex = data.Length;
-
- pos = (int)targetIndex;
+ long targetIndex = (long)(seconds * VoiceChatSettings.SampleRate);
+ pos = (int)Math.Max(0, Math.Min(targetIndex, data.Length));
}
///
diff --git a/EXILED/Exiled.API/Features/Audio/PcmSources/VoiceRssTtsSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/VoiceRssTtsSource.cs
new file mode 100644
index 0000000000..e6a26803d8
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/VoiceRssTtsSource.cs
@@ -0,0 +1,268 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.PcmSources
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Threading.Tasks;
+
+ using Exiled.API.Features;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
+
+ using MEC;
+
+ using UnityEngine.Networking;
+
+ ///
+ /// Provides a that converts text to speech using the VoiceRSS Text-to-Speech API.
+ ///
+ public sealed class VoiceRssTtsSource : IPcmSource, IAsyncPcmSource
+ {
+ private const string ApiEndpoint = "https://api.voicerss.org/";
+ private const string AudioFormat = "48khz_16bit_mono";
+
+ private static readonly Dictionary BlacklistKeys = new();
+
+ private IPcmSource internalSource;
+ private UnityWebRequest webRequest;
+ private CoroutineHandle downloadRoutine;
+
+ private volatile bool isReady = false;
+ private volatile bool isFailed = false;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The text to convert to speech.(Length limited by 100KB).
+ /// Your VoiceRSS API key. Get a free key at .
+ /// The language and locale code for the TTS voice. See for all supported language codes.
+ /// Optional specific voice name for the selected language.(See for available voices per language.)
+ /// Speech rate from -10 (slowest) to 10 (fastest). Defaults to 0 (normal speed).
+ public VoiceRssTtsSource(string text, string apiKey, string language = "en-us", string voice = null, int rate = 0)
+ : this(text, new[] { apiKey }, language, voice, rate)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The text to convert to speech.(Length limited by 100KB).
+ /// Your VoiceRSS API keys. Get a free key at .
+ /// The language and locale code for the TTS voice. See for all supported language codes.
+ /// Optional specific voice name for the selected language.(See for available voices per language.)
+ /// Speech rate from -10 (slowest) to 10 (fastest). Defaults to 0 (normal speed).
+ public VoiceRssTtsSource(string text, IEnumerable apiKeys, string language = "en-us", string voice = null, int rate = 0)
+ {
+ if (string.IsNullOrEmpty(text))
+ {
+ isFailed = true;
+ Log.Error("[VoiceRssTtsSource] Text cannot be null or empty.");
+ throw new ArgumentException("Text cannot be null or empty.", nameof(text));
+ }
+
+ if (apiKeys == null || !apiKeys.Any())
+ {
+ isFailed = true;
+ Log.Error("[VoiceRssTtsSource] At least one API key must be provided.");
+ throw new ArgumentException("API key collection cannot be null or empty.", nameof(apiKeys));
+ }
+
+ TrackInfo = new TrackData { Path = $"VoiceRssTts: {text}", Duration = 0.0 };
+ downloadRoutine = Timing.RunCoroutine(DownloadRoutine(text, apiKeys, language, voice, rate));
+ }
+
+ ///
+ /// Gets the metadata of the loaded track.
+ ///
+ public TrackData TrackInfo { get; private set; }
+
+ ///
+ /// Gets the total duration of the audio in seconds. Returns 0 while the download is in progress.
+ ///
+ public double TotalDuration => isReady && internalSource != null ? internalSource.TotalDuration : 0.0;
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ public double CurrentTime
+ {
+ get => isReady && internalSource != null ? internalSource.CurrentTime : 0.0;
+ set => Seek(value);
+ }
+
+ ///
+ /// Gets a value indicating whether playback has ended or the download has failed.
+ ///
+ public bool Ended => isFailed || (isReady && internalSource != null && internalSource.Ended);
+
+ ///
+ public bool IsFailed => isFailed;
+
+ ///
+ public bool IsReady => isReady;
+
+ ///
+ /// Reads PCM data from the audio source into the specified buffer.
+ ///
+ /// The buffer to fill with PCM data.
+ /// The offset in the buffer at which to begin writing.
+ /// The maximum number of samples to read.
+ /// The number of samples read.
+ public int Read(float[] buffer, int offset, int count)
+ {
+ if (isFailed)
+ return 0;
+
+ if (!isReady || internalSource == null)
+ {
+ Array.Clear(buffer, offset, count);
+ return count;
+ }
+
+ return internalSource.Read(buffer, offset, count);
+ }
+
+ ///
+ /// Seeks to the specified position in seconds.
+ ///
+ /// The target position in seconds.
+ public void Seek(double seconds)
+ {
+ if (isReady && internalSource != null)
+ internalSource.Seek(seconds);
+ }
+
+ ///
+ /// Resets playback to the beginning.
+ ///
+ public void Reset()
+ {
+ if (isReady && internalSource != null)
+ internalSource.Reset();
+ }
+
+ ///
+ /// Releases all resources used by the .
+ ///
+ public void Dispose()
+ {
+ if (downloadRoutine.IsRunning)
+ downloadRoutine.IsRunning = false;
+
+ webRequest?.Abort();
+ webRequest?.Dispose();
+ internalSource?.Dispose();
+ }
+
+ private IEnumerator DownloadRoutine(string text, IEnumerable apiKeys, string language, string voice, int rate)
+ {
+ string clampedRate = Math.Clamp(rate, -10, 10).ToString();
+ string textEscaped = Uri.EscapeDataString(text);
+ string langEscaped = Uri.EscapeDataString(language);
+ string voiceEscaped = string.IsNullOrEmpty(voice) ? string.Empty : $"&v={Uri.EscapeDataString(voice)}";
+
+ bool successfulDownload = false;
+
+ foreach (string apiKey in apiKeys)
+ {
+ if (string.IsNullOrWhiteSpace(apiKey))
+ continue;
+
+ if (BlacklistKeys.TryGetValue(apiKey, out DateTime exhaustedAt))
+ {
+ if (DateTime.UtcNow.Day == exhaustedAt.Day)
+ continue;
+
+ BlacklistKeys.Remove(apiKey);
+ }
+
+ string url = $"{ApiEndpoint}?key={Uri.EscapeDataString(apiKey)}&hl={langEscaped}&c=WAV&f={AudioFormat}&r={clampedRate}&src={textEscaped}{voiceEscaped}";
+
+ webRequest?.Dispose();
+ try
+ {
+ webRequest = UnityWebRequest.Get(url);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[VoiceRssTtsSource] Failed to get Url '{url}. Error: {ex.Message}");
+ break;
+ }
+
+ yield return Timing.WaitUntilDone(webRequest.SendWebRequest());
+
+ if (webRequest.result != UnityWebRequest.Result.Success)
+ {
+ Log.Error($"[VoiceRssTtsSource] Network Error: {webRequest.error}.");
+ break;
+ }
+
+ string responseText = webRequest.downloadHandler.text;
+ if (!string.IsNullOrEmpty(responseText) && responseText.StartsWith("ERROR: "))
+ {
+ string errorMessage = responseText[7..].Trim();
+
+ if (errorMessage.Contains("limit") || errorMessage.Contains("expired") || errorMessage.Contains("inactive") || errorMessage.Contains("API key"))
+ {
+ Log.Warn($"[VoiceRssTtsSource] Key issue, key: '{apiKey}', Error : {errorMessage}. Switching to another key...");
+ BlacklistKeys[apiKey] = DateTime.UtcNow;
+ continue;
+ }
+ else
+ {
+ Log.Error($"[VoiceRssTtsSource] API Error: {errorMessage}");
+ break;
+ }
+ }
+
+ successfulDownload = true;
+ break;
+ }
+
+ if (!successfulDownload)
+ {
+ isFailed = true;
+ webRequest?.Dispose();
+ webRequest = null;
+ yield break;
+ }
+
+ byte[] rawBytes = webRequest.downloadHandler.data;
+ webRequest.Dispose();
+ webRequest = null;
+
+ Task toPcmTask = Task.Run(() => WavUtility.WavToPcm(rawBytes));
+
+ yield return Timing.WaitUntilTrue(() => toPcmTask.IsCompleted);
+
+ if (toPcmTask.IsFaulted)
+ {
+ Log.Error($"[VoiceRssTtsSource] Error read the downloaded file! \nError: {toPcmTask.Exception?.InnerException?.Message ?? toPcmTask.Exception?.Message}");
+ isFailed = true;
+ yield break;
+ }
+
+ AudioData audioData = toPcmTask.Result;
+ audioData.TrackInfo.Path = $"VoiceRSS: {text}";
+
+ try
+ {
+ internalSource = new PreloadedPcmSource(audioData.Pcm);
+ TrackInfo = audioData.TrackInfo;
+ isReady = true;
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[VoiceRssTtsSource] Failed to create internal source! \nError: {ex.InnerException?.Message ?? ex.Message}");
+ isFailed = true;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/WavStreamSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/WavStreamSource.cs
similarity index 84%
rename from EXILED/Exiled.API/Features/Audio/WavStreamSource.cs
rename to EXILED/Exiled.API/Features/Audio/PcmSources/WavStreamSource.cs
index d910093f1b..32a219a2b8 100644
--- a/EXILED/Exiled.API/Features/Audio/WavStreamSource.cs
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/WavStreamSource.cs
@@ -5,19 +5,21 @@
//
// -----------------------------------------------------------------------
-namespace Exiled.API.Features.Audio
+namespace Exiled.API.Features.Audio.PcmSources
{
using System;
using System.Buffers;
using System.IO;
using System.Runtime.InteropServices;
- using Exiled.API.Interfaces;
+ using Exiled.API.Features.Audio;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
using VoiceChat;
///
- /// Provides a PCM audio source from a WAV file stream.
+ /// Provides a from a WAV file stream.
///
public sealed class WavStreamSource : IPcmSource
{
@@ -36,12 +38,17 @@ public sealed class WavStreamSource : IPcmSource
public WavStreamSource(string path)
{
stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 64 * 1024, FileOptions.SequentialScan);
- WavUtility.SkipHeader(stream);
+ TrackInfo = WavUtility.SkipHeader(stream);
startPosition = stream.Position;
endPosition = stream.Length;
internalBuffer = ArrayPool.Shared.Rent(VoiceChatSettings.PacketSizePerChannel * 2);
}
+ ///
+ /// Gets the metadata of the streaming track.
+ ///
+ public TrackData TrackInfo { get; }
+
///
/// Gets the total duration of the audio in seconds.
///
@@ -70,6 +77,11 @@ public double CurrentTime
/// The number of samples read.
public int Read(float[] buffer, int offset, int count)
{
+ count = Math.Min(count, buffer.Length - offset);
+
+ if (count <= 0)
+ return 0;
+
int bytesNeeded = count * 2;
if (internalBuffer.Length < bytesNeeded)
@@ -89,13 +101,10 @@ public int Read(float[] buffer, int offset, int count)
Span byteSpan = internalBuffer.AsSpan(0, bytesRead);
Span shortSpan = MemoryMarshal.Cast(byteSpan);
- int samplesInDestination = buffer.Length - offset;
- int samplesToWrite = Math.Min(shortSpan.Length, samplesInDestination);
-
- for (int i = 0; i < samplesToWrite; i++)
+ for (int i = 0; i < shortSpan.Length; i++)
buffer[offset + i] = shortSpan[i] * Divide;
- return samplesToWrite;
+ return shortSpan.Length;
}
///
@@ -104,15 +113,7 @@ public int Read(float[] buffer, int offset, int count)
/// The position in seconds to seek to.
public void Seek(double seconds)
{
- long targetSample = (long)(seconds * VoiceChatSettings.SampleRate);
- long targetByte = targetSample * 2;
-
- long newPos = startPosition + targetByte;
- if (newPos > endPosition)
- newPos = endPosition;
-
- if (newPos < startPosition)
- newPos = startPosition;
+ long newPos = Math.Clamp(startPosition + ((long)(seconds * VoiceChatSettings.SampleRate) * 2), startPosition, endPosition);
if (newPos % 2 != 0)
newPos--;
diff --git a/EXILED/Exiled.API/Features/Audio/PcmSources/WebWavPcmSource.cs b/EXILED/Exiled.API/Features/Audio/PcmSources/WebWavPcmSource.cs
new file mode 100644
index 0000000000..64f6fff699
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PcmSources/WebWavPcmSource.cs
@@ -0,0 +1,184 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio.PcmSources
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Threading.Tasks;
+
+ using Exiled.API.Features;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
+
+ using MEC;
+
+ using UnityEngine.Networking;
+
+ ///
+ /// Provides a that downloads a .wav file from a URL and preloads it for playback.
+ ///
+ public sealed class WebWavPcmSource : IPcmSource, IAsyncPcmSource
+ {
+ private IPcmSource internalSource;
+ private UnityWebRequest webRequest;
+ private CoroutineHandle downloadRoutine;
+
+ private volatile bool isReady = false;
+ private volatile bool isFailed = false;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The direct URL to the .wav file.
+ public WebWavPcmSource(string url)
+ {
+ TrackInfo = default;
+ downloadRoutine = Timing.RunCoroutine(Download(url));
+ }
+
+ ///
+ /// Gets the metadata of the preloaded track.
+ ///
+ public TrackData TrackInfo { get; private set; }
+
+ ///
+ /// Gets the total duration of the audio in seconds.
+ ///
+ public double TotalDuration => isReady && internalSource != null ? internalSource.TotalDuration : 0.0;
+
+ ///
+ /// Gets or sets the current playback position in seconds.
+ ///
+ public double CurrentTime
+ {
+ get => isReady && internalSource != null ? internalSource.CurrentTime : 0.0;
+ set => Seek(value);
+ }
+
+ ///
+ /// Gets a value indicating whether the end of the playback has been reached.
+ ///
+ public bool Ended => isFailed || (isReady && internalSource != null && internalSource.Ended);
+
+ ///
+ public bool IsFailed => isFailed;
+
+ ///
+ public bool IsReady => isReady;
+
+ ///
+ /// Reads PCM data from the audio source into the specified buffer.
+ ///
+ /// The buffer to fill with PCM data.
+ /// The offset in the buffer at which to begin writing.
+ /// The maximum number of samples to read.
+ /// The number of samples read.
+ public int Read(float[] buffer, int offset, int count)
+ {
+ if (isFailed)
+ return 0;
+
+ if (!isReady || internalSource == null)
+ {
+ Array.Clear(buffer, offset, count);
+ return count;
+ }
+
+ return internalSource.Read(buffer, offset, count);
+ }
+
+ ///
+ /// Seeks to the specified position in the playback.
+ ///
+ /// The position in seconds to seek to.
+ public void Seek(double seconds)
+ {
+ if (isReady && internalSource != null)
+ internalSource.CurrentTime = seconds;
+ }
+
+ ///
+ /// Resets the playback position to the start.
+ ///
+ public void Reset()
+ {
+ if (isReady && internalSource != null)
+ internalSource.Reset();
+ }
+
+ ///
+ /// Releases all resources used by the .
+ ///
+ public void Dispose()
+ {
+ if (downloadRoutine.IsRunning)
+ downloadRoutine.IsRunning = false;
+
+ webRequest?.Abort();
+ webRequest?.Dispose();
+ internalSource?.Dispose();
+ }
+
+ private IEnumerator Download(string url)
+ {
+ try
+ {
+ webRequest = UnityWebRequest.Get(url);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[WebWavPcmSource] Failed to download audio! URL: {url} | Error: {ex.Message}");
+ isFailed = true;
+ webRequest?.Dispose();
+ webRequest = null;
+ yield break;
+ }
+
+ yield return Timing.WaitUntilDone(webRequest.SendWebRequest());
+
+ if (webRequest.result != UnityWebRequest.Result.Success)
+ {
+ Log.Error($"[WebWavPcmSource] Failed to download audio! URL: {url} | Error: {webRequest.error}");
+ isFailed = true;
+ webRequest?.Dispose();
+ webRequest = null;
+ yield break;
+ }
+
+ byte[] rawBytes = webRequest.downloadHandler.data;
+ webRequest.Dispose();
+ webRequest = null;
+
+ Task toPcmTask = Task.Run(() => WavUtility.WavToPcm(rawBytes));
+
+ yield return Timing.WaitUntilTrue(() => toPcmTask.IsCompleted);
+
+ if (toPcmTask.IsFaulted)
+ {
+ Log.Error($"[WebPreloadWavPcmSource] Failed to read the downloaded file! Ensure the link points to a valid .WAV file. Error: {toPcmTask.Exception?.InnerException?.Message ?? toPcmTask.Exception?.Message}");
+ isFailed = true;
+ yield break;
+ }
+
+ AudioData audioData = toPcmTask.Result;
+ audioData.TrackInfo.Path = url;
+
+ try
+ {
+ internalSource = new PreloadedPcmSource(audioData.Pcm);
+ TrackInfo = audioData.TrackInfo;
+ isReady = true;
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[WebPreloadWavPcmSource] Failed to read the downloaded file! Ensure the link points to a valid .WAV file. Error: {ex.InnerException?.Message ?? ex.Message}");
+ isFailed = true;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/PlaybackSettings.cs b/EXILED/Exiled.API/Features/Audio/PlaybackSettings.cs
new file mode 100644
index 0000000000..6ca303970e
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/PlaybackSettings.cs
@@ -0,0 +1,98 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+ using System.Collections.Generic;
+
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Toys;
+ using Exiled.API.Interfaces.Audio;
+
+ using Mirror;
+
+ ///
+ /// Represents all configurable audio and network settings for play from pool method.
+ ///
+ public struct PlaybackSettings
+ {
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ public PlaybackSettings()
+ {
+ }
+
+ ///
+ /// Gets or sets the volume level.
+ ///
+ public float Volume { get; set; } = Speaker.DefaultVolume;
+
+ ///
+ /// Gets or sets the playback pitch.
+ ///
+ public float Pitch { get; set; } = 1f;
+
+ ///
+ /// Gets or sets a value indicating whether the audio source is spatialized (3D sound).
+ ///
+ public bool IsSpatial { get; set; } = Speaker.DefaultSpatial;
+
+ ///
+ /// Gets or sets the minimum distance at which the audio reaches full volume.
+ ///
+ public float MinDistance { get; set; } = Speaker.DefaultMinDistance;
+
+ ///
+ /// Gets or sets the maximum distance at which the audio can be heard.
+ ///
+ public float MaxDistance { get; set; } = Speaker.DefaultMaxDistance;
+
+ ///
+ /// Gets or sets a value indicating whether the file should be streamed from disk.
+ /// Ignored for web URLs and cached sources.
+ ///
+ public bool Stream { get; set; } = false;
+
+ ///
+ /// Gets or sets a value indicating whether to load the audio via the storage Manager for optimized playback.
+ ///
+ public bool UseCache { get; set; } = false;
+
+ ///
+ /// Gets or sets the Mirror network channel used for sending audio packets.
+ ///
+ public int Channel { get; set; } = Channels.ReliableOrdered2;
+
+ ///
+ /// Gets or sets the play mode determining how the audio is sent to players.
+ ///
+ public SpeakerPlayMode PlayMode { get; set; } = SpeakerPlayMode.Global;
+
+ ///
+ /// Gets or sets the target player (used when is ).
+ ///
+ public Player TargetPlayer { get; set; } = null;
+
+ ///
+ /// Gets or sets the list of target players (used when is ).
+ ///
+ public HashSet TargetPlayers { get; set; } = null;
+
+ ///
+ /// Gets or sets the condition used to determine which players hear the audio (used when is ).
+ ///
+ public Func Predicate { get; set; } = null;
+
+ ///
+ /// Gets or sets an optional custom audio filter to apply to the PCM data.
+ ///
+ public IAudioFilter Filter { get; set; } = null;
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/ScheduledEvent.cs b/EXILED/Exiled.API/Features/Audio/ScheduledEvent.cs
new file mode 100644
index 0000000000..a87768f3c8
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/ScheduledEvent.cs
@@ -0,0 +1,52 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+
+ ///
+ /// Represents a time-based action for audio playback.
+ ///
+ public class ScheduledEvent : IComparable
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The exact time in seconds to trigger the action.
+ /// The action to execute.
+ /// The optional unique identifier for the event. If null, a random GUID will be generated automatically.
+ public ScheduledEvent(double time, Action action, string id = null)
+ {
+ Time = time;
+ Action = action;
+ Id = id ?? Guid.NewGuid().ToString();
+ }
+
+ ///
+ /// Gets the specific time in seconds at which the event should trigger.
+ ///
+ public double Time { get; }
+
+ ///
+ /// Gets the action to be invoked when the specified time is reached.
+ ///
+ public Action Action { get; }
+
+ ///
+ /// Gets the unique identifier for this time event.
+ ///
+ public string Id { get; }
+
+ ///
+ /// Compares this instance to another based on their trigger times.
+ ///
+ /// The other to compare to.
+ /// A value that indicates the relative order of the events being compared.
+ public int CompareTo(ScheduledEvent other) => Time.CompareTo(other.Time);
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/SpeakerEvents.cs b/EXILED/Exiled.API/Features/Audio/SpeakerEvents.cs
new file mode 100644
index 0000000000..da580416f9
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Audio/SpeakerEvents.cs
@@ -0,0 +1,99 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Audio
+{
+ using System;
+
+ using Exiled.API.Structs.Audio;
+
+ using Toys;
+
+ ///
+ /// Contains global event handlers related to the audio system.
+ ///
+ public static class SpeakerEvents
+ {
+ ///
+ /// Invoked when a speaker starts playing an audio track.
+ ///
+ public static event Action PlaybackStarted;
+
+ ///
+ /// Invoked when the audio playback of a speaker is paused.
+ ///
+ public static event Action PlaybackPaused;
+
+ ///
+ /// Invoked when the audio playback of a speaker is resumed from a paused state.
+ ///
+ public static event Action PlaybackResumed;
+
+ ///
+ /// Invoked when the audio playback of a speaker loops back to the beginning.
+ ///
+ public static event Action PlaybackLooped;
+
+ ///
+ /// Invoked just before the speaker switches to the next track in the queue.
+ ///
+ public static event Action TrackSwitching;
+
+ ///
+ /// Invoked when a speaker finishes playing its current audio track.
+ ///
+ public static event Action PlaybackFinished;
+
+ ///
+ /// Invoked when a speaker's audio playback is completely stopped.
+ ///
+ public static event Action PlaybackStopped;
+
+ ///
+ /// Called when a speaker starts playing an audio track.
+ ///
+ /// The instance.
+ internal static void OnPlaybackStarted(Speaker speaker) => PlaybackStarted?.Invoke(speaker);
+
+ ///
+ /// Called when the audio playback of a speaker is paused.
+ ///
+ /// The instance.
+ internal static void OnPlaybackPaused(Speaker speaker) => PlaybackPaused?.Invoke(speaker);
+
+ ///
+ /// Called when the audio playback of a speaker is resumed from a paused state.
+ ///
+ /// The instance.
+ internal static void OnPlaybackResumed(Speaker speaker) => PlaybackResumed?.Invoke(speaker);
+
+ ///
+ /// Called when the audio playback of a speaker loops back to the beginning.
+ ///
+ /// The instance.
+ internal static void OnPlaybackLooped(Speaker speaker) => PlaybackLooped?.Invoke(speaker);
+
+ ///
+ /// Called just before the speaker switches to the next track in the queue.
+ ///
+ /// The instance.
+ /// The upcoming to be played.
+ internal static void OnTrackSwitching(Speaker speaker, QueuedTrack nextTrack) => TrackSwitching?.Invoke(speaker, nextTrack);
+
+ ///
+ /// Called when a speaker finishes playing its current audio track.
+ ///
+ /// The instance.
+ internal static void OnPlaybackFinished(Speaker speaker) => PlaybackFinished?.Invoke(speaker);
+
+ ///
+ /// Called when a speaker's audio playback is completely stopped.
+ ///
+ /// The instance.
+ internal static void OnPlaybackStopped(Speaker speaker) => PlaybackStopped?.Invoke(speaker);
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/WavUtility.cs b/EXILED/Exiled.API/Features/Audio/WavUtility.cs
index c1b1bc3f73..9be12fa6b8 100644
--- a/EXILED/Exiled.API/Features/Audio/WavUtility.cs
+++ b/EXILED/Exiled.API/Features/Audio/WavUtility.cs
@@ -13,6 +13,10 @@ namespace Exiled.API.Features.Audio
using System.IO;
using System.Runtime.InteropServices;
+ using Exiled.API.Features.Audio.PcmSources;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
+
using VoiceChat;
///
@@ -22,13 +26,46 @@ public static class WavUtility
{
private const float Divide = 1f / 32768f;
+ ///
+ /// Evaluates the given local path or URL and returns the appropriate for .wav playback.
+ ///
+ /// The local file path or web URL of the .wav file.
+ /// If true, streams local files directly from disk. If false, preloads them into memory (Ignored for web URLs).
+ /// If true, loads the audio via for zero-latency memory playback.
+ /// An initialized .
+ public static IPcmSource CreatePcmSource(string path, bool stream = false, bool cache = false)
+ {
+ if (cache)
+ return new CachedPcmSource(path, path);
+
+ if (path.StartsWith("http"))
+ return new WebWavPcmSource(path);
+
+ if (stream)
+ return new WavStreamSource(path);
+
+ return new PreloadedPcmSource(path);
+ }
+
///
/// Converts a WAV file at the specified path to a PCM float array.
///
/// The file path of the WAV file to convert.
- /// An array of floats representing the PCM data.
- public static float[] WavToPcm(string path)
+ /// A containing an array of floats representing the PCM data and its TrackData.
+ public static AudioData WavToPcm(string path)
{
+ if (!File.Exists(path))
+ {
+ Log.Error($"[WavUtility] The specified local file does not exist, path: `{path}`");
+ throw new FileNotFoundException("File does not exist");
+ }
+
+ if (!path.EndsWith(".wav", StringComparison.OrdinalIgnoreCase))
+ {
+ Log.Error($"[WavUtility] The file type '{Path.GetExtension(path)}' is not supported for wav utility. Please use .wav file.");
+ throw new InvalidDataException("Unsupported WAV format.");
+ }
+
using FileStream fs = new(path, FileMode.Open, FileAccess.Read, FileShare.Read);
int length = (int)fs.Length;
@@ -37,23 +74,12 @@ public static float[] WavToPcm(string path)
try
{
int bytesRead = fs.Read(rentedBuffer, 0, length);
-
using MemoryStream ms = new(rentedBuffer, 0, bytesRead);
- SkipHeader(ms);
-
- int headerOffset = (int)ms.Position;
- int dataLength = bytesRead - headerOffset;
-
- Span audioDataSpan = rentedBuffer.AsSpan(headerOffset, dataLength);
- Span samples = MemoryMarshal.Cast(audioDataSpan);
+ AudioData result = ParseWavSpanToPcm(ms, rentedBuffer.AsSpan(0, bytesRead));
+ result.TrackInfo.Path = path;
- float[] pcm = new float[samples.Length];
-
- for (int i = 0; i < samples.Length; i++)
- pcm[i] = samples[i] * Divide;
-
- return pcm;
+ return result;
}
finally
{
@@ -61,18 +87,72 @@ public static float[] WavToPcm(string path)
}
}
+ ///
+ /// Converts a WAV byte array to a PCM float array.
+ ///
+ /// The raw bytes of the WAV file.
+ /// A containing an array of floats representing the PCM data and its TrackData.
+ public static AudioData WavToPcm(byte[] data)
+ {
+ using MemoryStream ms = new(data, 0, data.Length);
+
+ return ParseWavSpanToPcm(ms, data.AsSpan());
+ }
+
+ ///
+ /// Parses the WAV header from the provided stream and converts the remaining audio data span into a PCM float array.
+ ///
+ /// The stream used to read and skip the WAV header.
+ /// The complete span of WAV audio data including the header.
+ /// A tuple containing an array of floats representing the PCM data and its TrackData.
+ public static AudioData ParseWavSpanToPcm(Stream stream, ReadOnlySpan audioData)
+ {
+ TrackData metaData = SkipHeader(stream);
+
+ int headerOffset = (int)stream.Position;
+ int dataLength = audioData.Length - headerOffset;
+
+ ReadOnlySpan samples = MemoryMarshal.Cast(audioData.Slice(headerOffset, dataLength));
+
+ float[] pcm = new float[samples.Length];
+
+ for (int i = 0; i < samples.Length; i++)
+ pcm[i] = samples[i] * Divide;
+
+ return new(pcm, metaData);
+ }
+
///
/// Skips the WAV file header and validates that the format is PCM16 mono with the specified sample rate.
///
/// The to read from.
- public static void SkipHeader(Stream stream)
+ /// A struct containing the parsed file information.
+ public static TrackData SkipHeader(Stream stream)
{
+ TrackData trackData = new();
+
+ if (stream.Length < 12)
+ {
+ Log.Error("[WavUtility] WAV file is too short to contain a valid header.");
+ throw new InvalidDataException("WAV file is too short to contain a valid header.");
+ }
+
Span headerBuffer = stackalloc byte[12];
stream.Read(headerBuffer);
+ int rate = 0;
+ int bits = 0;
+ int channels = 0;
+
Span chunkHeader = stackalloc byte[8];
while (true)
{
+ if (stream.Position + 8 > stream.Length)
+ {
+ Log.Error("[WavUtility] WAV file ended prematurely while parsing chunks.");
+ throw new InvalidDataException("WAV file ended prematurely while parsing chunks.");
+ }
+
int read = stream.Read(chunkHeader);
if (read < 8)
break;
@@ -87,21 +167,72 @@ public static void SkipHeader(Stream stream)
stream.Read(fmtData);
short format = BinaryPrimitives.ReadInt16LittleEndian(fmtData[..2]);
- short channels = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(2, 2));
- int rate = BinaryPrimitives.ReadInt32LittleEndian(fmtData.Slice(4, 4));
- short bits = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(14, 2));
+ channels = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(2, 2));
+ rate = BinaryPrimitives.ReadInt32LittleEndian(fmtData.Slice(4, 4));
+ bits = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(14, 2));
if (format != 1 || channels != 1 || rate != VoiceChatSettings.SampleRate || bits != 16)
- throw new InvalidDataException($"Invalid WAV format (format={format}, channels={channels}, rate={rate}, bits={bits}). Expected PCM16, mono and {VoiceChatSettings.SampleRate}Hz.");
+ {
+ Log.Error($"[WavUtility] Invalid WAV format (format={format}, channels={channels}, rate={rate}, bits={bits}). Expected PCM16, mono and {VoiceChatSettings.SampleRate}Hz.");
+ throw new InvalidDataException("Unsupported WAV format.");
+ }
if (chunkSize > 16)
stream.Seek(chunkSize - 16, SeekOrigin.Current);
}
+ // 'LIST' chunk
+ else if (chunkId == 0x5453494C)
+ {
+ Span listType = stackalloc byte[4];
+ stream.Read(listType);
+ uint type = BinaryPrimitives.ReadUInt32LittleEndian(listType);
+
+ // 'INFO' chunk
+ if (type == 0x4F464E49)
+ {
+ int bytesToRead = chunkSize - 4;
+ byte[] infoBytes = ArrayPool.Shared.Rent(bytesToRead);
+ stream.Read(infoBytes, 0, bytesToRead);
+
+ int offset = 0;
+ while (offset < bytesToRead - 8)
+ {
+ uint infoId = BinaryPrimitives.ReadUInt32LittleEndian(infoBytes.AsSpan(offset, 4));
+ int infoSize = BinaryPrimitives.ReadInt32LittleEndian(infoBytes.AsSpan(offset + 4, 4));
+ offset += 8;
+
+ if (infoSize > 0 && offset + infoSize <= bytesToRead)
+ {
+ string value = System.Text.Encoding.UTF8.GetString(infoBytes, offset, infoSize).TrimEnd('\0');
+
+ if (infoId == 0x4D414E49)
+ trackData.Title = value;
+ else if (infoId == 0x54524149)
+ trackData.Artist = value;
+ }
+
+ offset += infoSize;
+ if (infoSize % 2 != 0)
+ offset++;
+ }
+
+ ArrayPool.Shared.Return(infoBytes);
+ }
+ else
+ {
+ stream.Seek(chunkSize - 4, SeekOrigin.Current);
+ }
+ }
+
// 'data' chunk
else if (chunkId == 0x61746164)
{
- return;
+ int bytesPerSample = bits / 8;
+ if (bytesPerSample > 0 && channels > 0 && rate > 0)
+ trackData.Duration = (double)chunkSize / (rate * channels * bytesPerSample);
+
+ return trackData;
}
else
{
@@ -109,8 +240,46 @@ public static void SkipHeader(Stream stream)
}
if (stream.Position >= stream.Length)
- throw new InvalidDataException("WAV file does not contain a 'data' chunk.");
+ {
+ Log.Error("[WavUtility] WAV file does not contain a 'data' chunk.");
+ throw new InvalidDataException("Missing 'data' chunk in WAV file.");
+ }
+ }
+
+ return trackData;
+ }
+
+ ///
+ /// Validates a given local file path or web URL to ensure it is suitable for WAV processing.
+ ///
+ /// The local file path or web URL to validate.
+ /// Outputs a specific error message explaining why the validation failed. Returns if successful.
+ /// true if the path is valid and safe to process; otherwise, false.
+ public static bool TryValidatePath(string path, out string errorMessage)
+ {
+ errorMessage = string.Empty;
+ if (string.IsNullOrWhiteSpace(path))
+ {
+ errorMessage = "Provided path or URL cannot be null or empty!";
+ return false;
+ }
+
+ if (path.StartsWith("http"))
+ return true;
+
+ if (!File.Exists(path))
+ {
+ errorMessage = $"The specified local file does not exist. Path: `{path}`";
+ return false;
}
+
+ if (!path.EndsWith(".wav", StringComparison.OrdinalIgnoreCase))
+ {
+ errorMessage = $"Unsupported file format! Only .wav files are allowed. Path: `{path}`";
+ return false;
+ }
+
+ return true;
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
index 15cbc0ab72..6f8fe5555a 100644
--- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs
+++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
@@ -101,7 +101,33 @@ public Quaternion Rotation
}
///
- /// Gets or sets the scale of the toy.
+ /// Gets or sets the local position of the toy relative to its parent.
+ ///
+ public Vector3 LocalPosition
+ {
+ get => Transform.localPosition;
+ set
+ {
+ Transform.localPosition = value;
+ AdminToyBase.NetworkPosition = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the local rotation of the toy relative to its parent.
+ ///
+ public Quaternion LocalRotation
+ {
+ get => Transform.localRotation;
+ set
+ {
+ Transform.localRotation = value;
+ AdminToyBase.NetworkRotation = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the local scale of the toy.
///
public Vector3 Scale
{
diff --git a/EXILED/Exiled.API/Features/Toys/Light.cs b/EXILED/Exiled.API/Features/Toys/Light.cs
index 9e167d1bb5..4dad774de2 100644
--- a/EXILED/Exiled.API/Features/Toys/Light.cs
+++ b/EXILED/Exiled.API/Features/Toys/Light.cs
@@ -151,13 +151,12 @@ public static Light Create(Vector3? position /*= null*/, Vector3? rotation /*= n
Position = position ?? Vector3.zero,
Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
Scale = scale ?? Vector3.one,
+ Color = color ?? Color.gray,
};
if (spawn)
light.Spawn();
- light.Color = color ?? Color.gray;
-
return light;
}
diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs
index 4478c1143b..40201e9aa9 100644
--- a/EXILED/Exiled.API/Features/Toys/Speaker.cs
+++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs
@@ -5,17 +5,22 @@
//
// -----------------------------------------------------------------------
+#pragma warning disable SA1129 // Do not use default value type constructor
namespace Exiled.API.Features.Toys
{
using System;
using System.Collections.Generic;
- using System.IO;
+ using System.Linq;
+ using System.Threading.Tasks;
using AdminToys;
using Enums;
using Exiled.API.Features.Audio;
+ using Exiled.API.Features.Audio.PcmSources;
+ using Exiled.API.Interfaces.Audio;
+ using Exiled.API.Structs.Audio;
using Interfaces;
@@ -23,36 +28,82 @@ namespace Exiled.API.Features.Toys
using Mirror;
+ using NorthwoodLib.Pools;
+
+ using RoundRestarting;
+
using UnityEngine;
using VoiceChat;
using VoiceChat.Codec;
using VoiceChat.Codec.Enums;
using VoiceChat.Networking;
+ using VoiceChat.Playbacks;
using Object = UnityEngine.Object;
+ using Random = UnityEngine.Random;
///
/// A wrapper class for .
///
public class Speaker : AdminToy, IWrapper
{
+ ///
+ /// The default volume level of the base SpeakerToy prefab.
+ ///
+ public const float DefaultVolume = 1f;
+
+ ///
+ /// The default minimum spatial distance of the base SpeakerToy prefab.
+ ///
+ public const float DefaultMinDistance = 1f;
+
+ ///
+ /// The default maximum spatial distance of the base SpeakerToy prefab.
+ ///
+ public const float DefaultMaxDistance = 15f;
+
+ ///
+ /// The default network controller ID of the base SpeakerToy prefab.
+ ///
+ public const byte DefaultControllerId = 0;
+
+ ///
+ /// The default spatialization setting of the base SpeakerToy prefab.
+ ///
+ public const bool DefaultSpatial = true;
+
private const int FrameSize = VoiceChatSettings.PacketSizePerChannel;
private const float FrameTime = (float)FrameSize / VoiceChatSettings.SampleRate;
+ private static readonly Queue Pool;
+
+ private static readonly Vector3 SpeakerParkPosition = Vector3.down * 999;
+
+ private OpusEncoder encoder;
+
private float[] frame;
private byte[] encoded;
private float[] resampleBuffer;
+ private Func processNextFrame;
+
+ private CoroutineHandle playBackRoutine;
+ private CoroutineHandle fadeRoutine;
private double resampleTime;
private int resampleBufferFilled;
+ private int nextScheduledEventIndex = 0;
+ private int idChangeFrame;
- private IPcmSource source;
- private OpusEncoder encoder;
- private CoroutineHandle playBackRoutine;
-
- private bool isPitchDefault = true;
private bool isPlayBackInitialized = false;
+ private bool isPitchDefault = true;
+ private bool needsSyncWait = false;
+
+ static Speaker()
+ {
+ Pool = new();
+ RoundRestart.OnRestartTriggered += Pool.Clear;
+ }
///
/// Initializes a new instance of the class.
@@ -85,13 +136,19 @@ internal Speaker(SpeakerToy speakerToy)
/// Invoked when the audio track finishes playing.
/// If looping is enabled, this triggers every time the track finished.
///
- public event Action OnPlaybackFinished;
+ public event Action OnPlaybackFinished;
///
/// Invoked when the audio playback stops completely (either manually or end of file).
///
public event Action OnPlaybackStopped;
+ ///
+ /// Invoked just before the speaker switches to the next track in the queue.
+ /// Passes the upcoming as an argument.
+ ///
+ public event Action OnTrackSwitching;
+
///
/// Gets the prefab.
///
@@ -105,7 +162,7 @@ internal Speaker(SpeakerToy speakerToy)
///
/// Gets or sets the network channel used for sending audio packets from this speaker .
///
- public int Channel { get; set; } = Channels.ReliableOrdered2;
+ public int Channel { get; set; } = Channels.Unreliable;
///
/// Gets or sets a value indicating whether the audio playback should loop when it reaches the end.
@@ -117,6 +174,11 @@ internal Speaker(SpeakerToy speakerToy)
///
public bool DestroyAfter { get; set; }
+ ///
+ /// Gets or sets a value indicating whether the speaker should return to the pool after playback finishes.
+ ///
+ public bool ReturnToPoolAfter { get; set; }
+
///
/// Gets or sets the play mode for this speaker, determining how audio is sent to players.
///
@@ -139,7 +201,7 @@ internal Speaker(SpeakerToy speakerToy)
public Func Predicate { get; set; }
///
- /// Gets a value indicating whether gets is a sound playing on this speaker or not.
+ /// Gets a value indicating whether a sound is currently playing on this speaker.
///
public bool IsPlaying => playBackRoutine.IsRunning && !IsPaused;
@@ -162,9 +224,15 @@ public bool IsPaused
playBackRoutine.IsAliveAndPaused = value;
if (value)
+ {
OnPlaybackPaused?.Invoke();
+ SpeakerEvents.OnPlaybackPaused(this);
+ }
else
+ {
OnPlaybackResumed?.Invoke();
+ SpeakerEvents.OnPlaybackResumed(this);
+ }
}
}
@@ -174,15 +242,19 @@ public bool IsPaused
///
public double CurrentTime
{
- get => source?.CurrentTime ?? 0.0;
+ get => CurrentSource?.CurrentTime ?? 0.0;
set
{
- if (source != null)
- {
- source.CurrentTime = value;
- resampleTime = 0.0;
- resampleBufferFilled = 0;
- }
+ if (CurrentSource == null)
+ return;
+
+ CurrentSource.CurrentTime = value;
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+
+ ResetEncoder();
+ Filter?.Reset();
+ UpdateNextScheduledEventIndex();
}
}
@@ -190,12 +262,52 @@ public double CurrentTime
/// Gets the total duration of the current track in seconds.
/// Returns 0 if not playing.
///
- public double TotalDuration => source?.TotalDuration ?? 0.0;
+ public double TotalDuration => CurrentSource?.TotalDuration ?? 0.0;
+
+ ///
+ /// Gets the remaining playback time in seconds.
+ ///
+ public double TimeLeft => Math.Max(0.0, TotalDuration - CurrentTime);
+
+ ///
+ /// Gets or sets the current playback progress as a value between 0.0 and 1.0.
+ /// Returns 0 if not playing.
+ ///
+ public float PlaybackProgress
+ {
+ get => TotalDuration > 0.0 ? (float)(CurrentTime / TotalDuration) : 0f;
+ set
+ {
+ if (TotalDuration > 0.0)
+ CurrentTime = TotalDuration * Mathf.Clamp01(value);
+ }
+ }
+
+ ///
+ /// Gets the currently playing audio source.
+ /// Pre-made filters are available in the namespace.
+ ///
+ public IPcmSource CurrentSource { get; private set; }
+
+ ///
+ /// Gets the metadata information (Title, Artist, Duration) of the last played audio track.
+ ///
+ public TrackData LastTrackInfo { get; private set; }
+
+ ///
+ /// Gets or sets the custom audio filter applied to the PCM data right before encoding.
+ ///
+ public IAudioFilter Filter { get; set; }
+
+ ///
+ /// Gets the queue of audio tracks to be played sequentially.
+ ///
+ public List TrackQueue => field ??= new();
///
- /// Gets the path to the last audio file played on this speaker.
+ /// Gets the list of time-based events for the current audio track.
///
- public string LastTrack { get; private set; }
+ public List ScheduledEvents => field ??= new();
///
/// Gets or sets the playback pitch.
@@ -209,6 +321,19 @@ public float Pitch
get;
set
{
+ if (field == value)
+ return;
+
+ if (Mathf.Abs(value - 1f) > 0.0001f && CurrentSource is ILiveSource)
+ {
+ field = 1f;
+ isPitchDefault = true;
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+ Log.Warn("[Speaker] Pitch adjustment is not supported for live sources. Pitch has been reset to default (1.0).");
+ return;
+ }
+
field = Mathf.Max(0.1f, Mathf.Abs(value));
isPitchDefault = Mathf.Abs(field - 1.0f) < 0.0001f;
if (isPitchDefault)
@@ -219,6 +344,8 @@ public float Pitch
}
}
+ = 1f;
+
///
/// Gets or sets the volume of the audio source.
///
@@ -229,7 +356,11 @@ public float Pitch
public float Volume
{
get => Base.NetworkVolume;
- set => Base.NetworkVolume = value;
+ set
+ {
+ StopFade();
+ Base.NetworkVolume = value;
+ }
}
///
@@ -277,24 +408,39 @@ public float MinDistance
public byte ControllerId
{
get => Base.NetworkControllerId;
- set => Base.NetworkControllerId = value;
+ set
+ {
+ if (Base.NetworkControllerId == value)
+ return;
+
+ Base.NetworkControllerId = value;
+ needsSyncWait = true;
+ idChangeFrame = Time.frameCount;
+ }
}
///
/// Creates a new .
///
- /// The position of the .
- /// The rotation of the .
- /// The scale of the .
+ /// The parent transform to attach the to.
+ /// The local position of the .
+ /// The volume level of the audio source.
+ /// Whether the audio source is spatialized (3D sound).
+ /// The minimum distance at which the audio reaches full volume.
+ /// The maximum distance at which the audio can be heard.
+ /// The specific controller ID to assign. If null, the next available ID is used.
/// Whether the should be initially spawned.
/// The new .
- public static Speaker Create(Vector3? position, Vector3? rotation, Vector3? scale, bool spawn)
+ public static Speaker Create(Transform parent = null, Vector3? position = null, float volume = DefaultVolume, bool isSpatial = DefaultSpatial, float minDistance = DefaultMinDistance, float maxDistance = DefaultMaxDistance, byte? controllerId = null, bool spawn = true)
{
- Speaker speaker = new(Object.Instantiate(Prefab))
+ Speaker speaker = new(Object.Instantiate(Prefab, parent))
{
- Position = position ?? Vector3.zero,
- Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
- Scale = scale ?? Vector3.one,
+ Volume = volume,
+ IsSpatial = isSpatial,
+ MinDistance = minDistance,
+ MaxDistance = maxDistance,
+ ControllerId = controllerId ?? GetNextFreeControllerId(),
+ LocalPosition = position ?? Vector3.zero,
};
if (spawn)
@@ -304,267 +450,690 @@ public static Speaker Create(Vector3? position, Vector3? rotation, Vector3? scal
}
///
- /// Creates a new .
+ /// Rents an available speaker from the pool or creates a new one if the pool is empty.
///
- /// The transform to create this on.
- /// Whether the should be initially spawned.
- /// Whether the should keep the same world position.
- /// The new .
- public static Speaker Create(Transform transform, bool spawn, bool worldPositionStays = true)
+ /// The parent transform to attach the to.
+ /// The local position of the .
+ /// A clean instance ready for use.
+ public static Speaker Rent(Transform parent = null, Vector3? position = null)
{
- Speaker speaker = new(Object.Instantiate(Prefab, transform, worldPositionStays))
+ Speaker speaker = null;
+
+ while (Pool.Count > 0)
{
- Position = transform.position,
- Rotation = transform.rotation,
- Scale = transform.localScale.normalized,
- };
+ speaker = Pool.Dequeue();
- if (spawn)
- speaker.Spawn();
+ if (speaker != null && speaker.Base != null)
+ break;
+
+ speaker = null;
+ }
+
+ if (speaker == null)
+ {
+ speaker = Create(parent, position);
+ }
+ else
+ {
+ speaker.IsStatic = false;
+
+ if (parent != null)
+ speaker.Transform.parent = parent;
+
+ speaker.LocalPosition = position ?? Vector3.zero;
+ speaker.ControllerId = GetNextFreeControllerId(speaker.ControllerId);
+ SpeakerToyPlaybackBase.AllInstances.Add(speaker.Base.Playback);
+ }
return speaker;
}
///
- /// Plays audio through this speaker.
+ /// Rents a speaker from the pool, plays a local wav file or web stream one time, and automatically returns it to the pool afterwards. (File must be 16 bit, mono and 48khz.)
///
- /// An instance.
- /// Targets who will hear the audio. If null, audio will be sent to all players.
- public static void Play(AudioMessage message, IEnumerable targets = null)
+ /// The path/url or custom name/key (if has set to true) to the wav file.
+ /// The parent transform, if any.
+ /// The local position of the speaker.
+ /// The optional audio and network settings. If null, default settings are used.
+ /// true if the audio file was successfully found, loaded, and playback started; otherwise, false.
+ public static bool PlayWavFromPool(string path, Transform parent = null, Vector3? position = null, in PlaybackSettings? settings = null)
{
- foreach (Player target in targets ?? Player.List)
- target.Connection.Send(message);
+ if (string.IsNullOrEmpty(path))
+ {
+ Log.Error("[Speaker] Provided path/url or name cannot be null or empty!");
+ return false;
+ }
+
+ PlaybackSettings settingsFull = settings ?? new PlaybackSettings();
+ if (!settingsFull.UseCache && !WavUtility.TryValidatePath(path, out string errorMessage))
+ {
+ Log.Error($"[Speaker] {errorMessage}");
+ return false;
+ }
+
+ IPcmSource source;
+ try
+ {
+ source = WavUtility.CreatePcmSource(path, settingsFull.Stream, settingsFull.UseCache);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Failed to initialize audio source for PlayFromPool. Path: '{path}'.\n{ex}");
+ return false;
+ }
+
+ return PlayFromPool(source, parent, position, settingsFull);
}
///
- /// Plays audio through this speaker.
+ /// Rents a speaker from the pool, plays a custom PCM source one time, and automatically returns it to the pool afterwards.
///
- /// Audio samples.
- /// The length of the samples array.
- /// Targets who will hear the audio. If null, audio will be sent to all players.
- public void Play(byte[] samples, int? length = null, IEnumerable targets = null) => Play(new AudioMessage(ControllerId, samples, length ?? samples.Length), targets);
+ /// The custom IPcmSource to play.
+ /// The parent transform, if any.
+ /// The local position of the speaker.
+ /// The optional audio and network settings. If null, default settings are used.
+ /// true if the source is valid and playback started; otherwise, false.
+ public static bool PlayFromPool(IPcmSource source, Transform parent = null, Vector3? position = null, in PlaybackSettings? settings = null)
+ {
+ if (source == null)
+ {
+ Log.Error("[Speaker] Provided custom IPcmSource is null for PlayFromPool!");
+ return false;
+ }
+
+ Speaker speaker = Rent(parent, position);
+
+ PlaybackSettings settingsFull = settings ?? new PlaybackSettings();
+
+ speaker.Volume = settingsFull.Volume;
+ speaker.IsSpatial = settingsFull.IsSpatial;
+ speaker.MinDistance = settingsFull.MinDistance;
+ speaker.MaxDistance = settingsFull.MaxDistance;
+
+ speaker.Pitch = settingsFull.Pitch;
+ speaker.Channel = settingsFull.Channel;
+ speaker.PlayMode = settingsFull.PlayMode;
+ speaker.Predicate = settingsFull.Predicate;
+ speaker.TargetPlayer = settingsFull.TargetPlayer;
+ speaker.TargetPlayers = settingsFull.TargetPlayers;
+ speaker.Filter = settingsFull.Filter;
+
+ speaker.ReturnToPoolAfter = true;
+
+ if (!speaker.Play(source, true))
+ {
+ speaker.ReturnToPool();
+ return false;
+ }
+
+ return true;
+ }
///
- /// Plays a wav file through this speaker.(File must be 16 bit, mono and 48khz.)
+ /// Gets the next available controller ID for a .
///
- /// The path to the wav file.
- /// Whether to stream the audio or preload it.
- /// Whether to destroy the speaker after playback.
- /// Whether to loop the audio.
- public void Play(string path, bool stream = false, bool destroyAfter = false, bool loop = false)
+ /// An optional ID to check first.
+ /// The next available byte ID. If all IDs are currently in use, returns a default of 0.
+ public static byte GetNextFreeControllerId(byte? preferredId = null)
{
- if (!File.Exists(path))
- throw new FileNotFoundException("The specified file does not exist.", path);
+ HashSet usedIds = HashSetPool.Shared.Rent(byte.MaxValue + 1);
- if (!path.EndsWith(".wav", StringComparison.OrdinalIgnoreCase))
- throw new NotSupportedException($"The file type '{Path.GetExtension(path)}' is not supported. Please use .wav file.");
+ foreach (SpeakerToyPlaybackBase playbackBase in SpeakerToyPlaybackBase.AllInstances)
+ {
+ usedIds.Add(playbackBase.ControllerId);
+ }
- TryInitializePlayBack();
- Stop();
+ if (usedIds.Count >= byte.MaxValue + 1)
+ {
+ HashSetPool.Shared.Return(usedIds);
+ Log.Warn("[Speaker] All controller IDs are in use. Default Controll Id will be use, Audio may conflict!");
+ return DefaultControllerId;
+ }
- Loop = loop;
- LastTrack = path;
- DestroyAfter = destroyAfter;
- source = stream ? new WavStreamSource(path) : new PreloadedPcmSource(path);
- playBackRoutine = Timing.RunCoroutine(PlayBackCoroutine().CancelWith(GameObject));
+ if (preferredId.HasValue && !usedIds.Contains(preferredId.Value))
+ {
+ HashSetPool.Shared.Return(usedIds);
+ return preferredId.Value;
+ }
+
+ byte id = 0;
+ while (usedIds.Contains(id))
+ {
+ id++;
+ }
+
+ HashSetPool.Shared.Return(usedIds);
+ return id;
}
///
- /// Stops playback.
+ /// Plays a local wav file or web URL through this speaker. (File must be 16-bit, mono, and 48kHz.)
///
- public void Stop()
+ /// The path/url or custom name(if is true) to the wav file.
+ /// If true, clears the upcoming tracks in the playlist before starting playback.
+ /// If true, the file will be streamed from disk when played; otherwise, it will be loaded into memory (Ignored for web URLs).
+ /// If true, loads the audio via for optimized playback.
+ /// true if the audio file was successfully found, loaded, and playback started; otherwise, false.
+ public bool PlayWav(string path, bool clearQueue = true, bool stream = false, bool useCache = false)
{
- if (playBackRoutine.IsRunning)
+ if (string.IsNullOrEmpty(path))
{
- Timing.KillCoroutines(playBackRoutine);
- OnPlaybackStopped?.Invoke();
+ Log.Error("[Speaker] Provided path/url or name cannot be null or empty!");
+ return false;
+ }
+
+ if (!useCache && !WavUtility.TryValidatePath(path, out string errorMessage))
+ {
+ Log.Error($"[Speaker] {errorMessage}");
+ return false;
+ }
+
+ IPcmSource newSource;
+ try
+ {
+ newSource = WavUtility.CreatePcmSource(path, stream, useCache);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Failed to initialize audio source for file at path: '{path}'.\nException Details: {ex}");
+ return false;
}
- source?.Dispose();
- source = null;
+ return Play(newSource, clearQueue);
}
- private void TryInitializePlayBack()
+ ///
+ /// Converts provided paths/URLs to sources and plays them mixed together.
+ ///
+ /// The collection of paths or URLs to the audio files.
+ /// If true, clears the upcoming tracks in the playlist before starting playback.
+ /// If true, streams local files from disk. (Ignored for web URLs).
+ /// If true, utilizes for the sources.
+ /// true if at least one valid path was loaded and started; otherwise, false.
+ public bool PlayMixedWav(IEnumerable paths, bool clearQueue = true, bool stream = false, bool useCache = false)
{
- if (isPlayBackInitialized)
- return;
+ if (paths == null || !paths.Any())
+ {
+ Log.Error("[Speaker] No paths provided for PlayMixedWav!");
+ return false;
+ }
- isPlayBackInitialized = true;
+ List createdSources = new();
- frame = new float[FrameSize];
- resampleBuffer = Array.Empty();
- encoder = new(OpusApplicationType.Audio);
- encoded = new byte[VoiceChatSettings.MaxEncodedSize];
+ foreach (string path in paths)
+ {
+ if (string.IsNullOrEmpty(path))
+ {
+ Log.Warn("[Speaker] One of the provided paths for PlayMixedWav is null or empty. Skipping this entry.");
+ continue;
+ }
- AdminToyBase.OnRemoved += OnToyRemoved;
+ if (!WavUtility.TryValidatePath(path, out string error))
+ {
+ Log.Error($"[Speaker] Skipping invalid path in mix: {path}. Reason: {error}");
+ continue;
+ }
+
+ try
+ {
+ IPcmSource source = WavUtility.CreatePcmSource(path, stream, useCache);
+ if (source != null)
+ createdSources.Add(source);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Failed to create source for mix from '{path}': {ex.Message}");
+ }
+ }
+
+ if (createdSources.Count == 0)
+ return false;
+
+ return PlayMixed(createdSources, clearQueue);
}
- private IEnumerator PlayBackCoroutine()
+ ///
+ /// Plays the live voice of a specific player through this speaker.
+ ///
+ /// The player whose voice will be broadcasted.
+ /// If true, prevents the player's original voice message's from being heard while broadcasting.
+ /// If true, clears the upcoming tracks in the playlist before starting playback.
+ /// true if the playback started successfully; otherwise, false.
+ public bool PlayFromPlayer(Player player, bool blockOriginalVoice = false, bool clearQueue = true)
{
- OnPlaybackStarted?.Invoke();
+ if (player == null)
+ {
+ Log.Error("[Speaker] Source player cannot be null when streaming live microphone!");
+ return false;
+ }
- resampleTime = 0.0;
- resampleBufferFilled = 0;
+ PlayerVoiceSource source;
+ try
+ {
+ source = new PlayerVoiceSource(player, blockOriginalVoice);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Failed to initialize live voice stream for player '{player.Nickname}' ({player.Id}).\nException Details: {ex}");
+ return false;
+ }
- float timeAccumulator = 0f;
+ return Play(source, clearQueue);
+ }
- while (true)
+ ///
+ /// Plays audio directly from a provided PCM source.
+ ///
+ /// The custom IPcmSource to play.
+ /// If true, clears the upcoming tracks in the playlist before starting playback.
+ /// true if the source is valid and playback started; otherwise, false.
+ public bool Play(IPcmSource customSource, bool clearQueue = true)
+ {
+ if (customSource == null)
{
- timeAccumulator += Time.deltaTime;
-
- while (timeAccumulator >= FrameTime)
- {
- timeAccumulator -= FrameTime;
+ Log.Error("[Speaker] Provided custom IPcmSource is null!");
+ return false;
+ }
- if (isPitchDefault)
- {
- int read = source.Read(frame, 0, FrameSize);
- if (read < FrameSize)
- Array.Clear(frame, read, FrameSize - read);
- }
- else
- {
- ResampleFrame();
- }
+ TryInitializePlayBack();
+ Stop(clearQueue);
- int len = encoder.Encode(frame, encoded);
+ CurrentSource = customSource;
+ LastTrackInfo = CurrentSource.TrackInfo;
- if (len > 2)
- SendPacket(len);
+ if (CurrentSource is ILiveSource)
+ Pitch = 1.0f;
- if (!source.Ended)
- continue;
+ playBackRoutine = Timing.RunCoroutine(PlayBackCoroutine().CancelWith(GameObject));
+ return true;
+ }
- OnPlaybackFinished?.Invoke(LastTrack);
+ ///
+ /// Plays multiple instances mixed together.
+ ///
+ /// The collection of PCM sources to mix and play.
+ /// If true, clears the upcoming tracks in the playlist before starting playback.
+ /// true if at least one source was successfully mixed; otherwise, false.
+ public bool PlayMixed(IEnumerable sources, bool clearQueue = true)
+ {
+ if (sources == null || !sources.Any())
+ {
+ Log.Error("[Speaker] No sources provided for PlayMixed!");
+ return false;
+ }
- if (Loop)
- {
- source.Reset();
- OnPlaybackLooped?.Invoke();
- resampleTime = resampleBufferFilled = 0;
- continue;
- }
+ if (clearQueue)
+ TrackQueue.Clear();
- if (DestroyAfter)
- Destroy();
- else
- Stop();
+ bool anyAdded = false;
- yield break;
- }
+ foreach (IPcmSource source in sources)
+ {
+ if (source == null)
+ continue;
- yield return Timing.WaitForOneFrame;
+ if (AddMixed(source))
+ anyAdded = true;
}
+
+ return anyAdded;
}
- private void ResampleFrame()
+ ///
+ /// Dynamically mixes a new audio source into the currently playing audio without interrupting it.
+ ///
+ /// The additional to mix with the current playback.
+ /// true if the source was successfully mixed or started; otherwise, false.
+ public bool AddMixed(IPcmSource extraSource)
{
- int requiredSize = (int)(FrameSize * Mathf.Abs(Pitch) * 2) + 10;
-
- if (resampleBuffer.Length < requiredSize)
+ if (extraSource == null)
{
- resampleBuffer = new float[requiredSize];
- resampleTime = 0.0;
- resampleBufferFilled = 0;
+ Log.Error("[Speaker] Provided extra IPcmSource for mixing is null!");
+ return false;
}
- int outputIdx = 0;
+ if (!playBackRoutine.IsRunning || CurrentSource == null || CurrentSource.Ended)
+ return Play(extraSource, false);
- while (outputIdx < FrameSize)
+ if (extraSource is ILiveSource)
+ Pitch = 1.0f;
+
+ if (CurrentSource is MixerSource currentMixer)
{
- if (resampleBufferFilled == 0)
- {
- int toRead = resampleBuffer.Length - 4;
- int actualRead = source.Read(resampleBuffer, 0, toRead);
+ currentMixer.AddSource(extraSource);
+ return true;
+ }
- if (actualRead == 0)
- {
- while (outputIdx < FrameSize)
- frame[outputIdx++] = 0f;
- return;
- }
+ try
+ {
+ IPcmSource oldSource = CurrentSource;
+ MixerSource newMixer = new([oldSource, extraSource]);
+ CurrentSource = newMixer;
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Failed to transition to MixerSource on the fly!\nException Details: {ex}");
+ return false;
+ }
+ }
- resampleBufferFilled = actualRead;
- resampleTime = 0.0;
- }
+ ///
+ /// Stops playback.
+ ///
+ /// If true, clears the upcoming tracks in the playlist.
+ public void Stop(bool clearQueue = true)
+ {
+ if (!isPlayBackInitialized)
+ return;
- int currentSample = (int)resampleTime;
+ if (playBackRoutine.IsRunning)
+ {
+ playBackRoutine.IsRunning = false;
- if (currentSample >= resampleBufferFilled - 1)
- {
- if (resampleBufferFilled > 0)
- {
- resampleBuffer[0] = resampleBuffer[resampleBufferFilled - 1];
+ OnPlaybackStopped?.Invoke();
+ SpeakerEvents.OnPlaybackStopped(this);
+ }
- int toRead = resampleBuffer.Length - 5;
- int actualRead = source.Read(resampleBuffer, 1, toRead);
+ if (clearQueue)
+ TrackQueue.Clear();
- if (actualRead == 0)
- {
- while (outputIdx < FrameSize)
- frame[outputIdx++] = 0f;
- return;
- }
+ StopFade();
+ ResetEncoder();
+ ClearScheduledEvents();
- resampleBufferFilled = actualRead + 1;
- resampleTime -= currentSample;
- }
- else
- {
- resampleBufferFilled = 0;
- }
+ Filter?.Reset();
+ CurrentSource?.Dispose();
+ CurrentSource = null;
+ }
- continue;
- }
+ ///
+ /// Fades the volume to a specific target over a given duration.
+ /// IMPORTANT: If the property is manually changed while a fade is in progress, the fade operation will be immediately aborted.
+ ///
+ /// The initial volume level when the fade begins.
+ /// The final volume level to reach at the end of the fade.
+ /// The time in seconds the fading process should take to complete.
+ /// If true, uses linear interpolation; if false, uses natural easing (ease-in for fade-in, ease-out for fade-out).
+ /// An optional action to invoke when the fade process is fully finished.
+ public void FadeVolume(float startVolume, float targetVolume, float duration = 3, bool linear = false, Action onComplete = null)
+ {
+ if (fadeRoutine.IsRunning)
+ fadeRoutine.IsRunning = false;
- double frac = resampleTime - currentSample;
- float sample1 = resampleBuffer[currentSample];
- float sample2 = resampleBuffer[currentSample + 1];
+ fadeRoutine = Timing.RunCoroutine(FadeCoroutine(startVolume, targetVolume, duration, linear, onComplete).CancelWith(GameObject));
+ }
- frame[outputIdx++] = (float)(sample1 + ((sample2 - sample1) * frac));
+ ///
+ /// Stops currently active volume fading process, leaving the volume at its exact current level.
+ ///
+ public void StopFade()
+ {
+ if (fadeRoutine.IsRunning)
+ fadeRoutine.IsRunning = false;
+ }
- resampleTime += Pitch;
+ ///
+ /// Restarts the currently playing track from the beginning.
+ ///
+ public void RestartTrack()
+ {
+ if (!playBackRoutine.IsRunning)
+ return;
+
+ CurrentTime = 0.0;
+ }
+
+ ///
+ /// Helper method to easily queue a .wav file/url with stream support.
+ ///
+ /// An optional name or identifier for this track in the queue. This is only used for reference.
+ /// The path/url or custom name(if is true) to the wav file.
+ /// If true, the file will be streamed from disk when played; otherwise, it will be loaded into memory (Ignored for web URLs).
+ /// If true, loads the audio via for optimized playback.
+ /// true if successfully queued or started.
+ public bool QueueWavTrack(string name, string path, bool isStream = false, bool useCache = false)
+ {
+ if (string.IsNullOrEmpty(path))
+ {
+ Log.Error("[Speaker] Provided path or cache name cannot be null or empty!");
+ return false;
+ }
+
+ if (!useCache && !WavUtility.TryValidatePath(path, out string errorMessage))
+ {
+ Log.Error($"[Speaker] {errorMessage}");
+ return false;
}
+
+ return QueueTrack(new QueuedTrack(name, () => WavUtility.CreatePcmSource(path, isStream, useCache)));
}
- private void SendPacket(int len)
+ ///
+ /// Adds a track to the playback queue. If nothing is playing, playback starts immediately.
+ ///
+ /// The queued track containing its creation logic and optional identifier.
+ /// true if successfully queued or started.
+ public bool QueueTrack(QueuedTrack track)
{
- AudioMessage msg = new(ControllerId, encoded, len);
+ if (!playBackRoutine.IsRunning && !IsPaused)
+ return Play(track.SourceProvider.Invoke());
+
+ TrackQueue.Add(track);
+ return true;
+ }
+
+ ///
+ /// Skips the currently playing track and starts playing the next one in the queue.
+ ///
+ public void SkipTrack()
+ {
+ if (TrackQueue.Count == 0)
+ {
+ Stop();
+ return;
+ }
+
+ Stop(clearQueue: false);
+
+ QueuedTrack nextTrack = TrackQueue[0];
+ TrackQueue.RemoveAt(0);
+
+ try
+ {
+ IPcmSource newSource = nextTrack.SourceProvider.Invoke();
+ OnTrackSwitching?.Invoke(nextTrack);
+ SpeakerEvents.OnTrackSwitching(this, nextTrack);
+
+ Play(newSource, clearQueue: false);
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Playlist next track failed: '{nextTrack}'.\n{ex}");
+ SkipTrack();
+ }
+ }
+
+ ///
+ /// Removes a specific track from the playback queue by its file path.
+ ///
+ /// The exact file path of the track to remove.
+ /// If true, removes the first occurrence; if false, removes the last occurrence.
+ /// true if the track was successfully found and removed; otherwise, false.
+ public bool RemoveTrack(string path, bool findFirst = true)
+ {
+ int index = findFirst ? TrackQueue.FindIndex(t => t.Name == path) : TrackQueue.FindLastIndex(t => t.Name == path);
+
+ if (index == -1)
+ return false;
+
+ TrackQueue.RemoveAt(index);
+ return true;
+ }
+
+ ///
+ /// Shuffles the tracks in the into a random order with Fisher-Yates algorithm.
+ ///
+ public void ShuffleTracks()
+ {
+ if (TrackQueue.Count <= 1)
+ return;
+
+ for (int i = TrackQueue.Count - 1; i > 0; i--)
+ {
+ int j = Random.Range(0, i + 1);
+ (TrackQueue[i], TrackQueue[j]) = (TrackQueue[j], TrackQueue[i]);
+ }
+ }
+
+ ///
+ /// Adds an action to be executed at a specific time in seconds during the current playback.
+ /// WARNING: Heavy operations can cause audio interruptions. If you need to perform heavy operations, start a MEC Coroutine inside the action.
+ ///
+ /// The exact time in seconds to trigger the action.
+ /// The action to invoke when the specified time is reached.
+ /// An optional unique string identifier for this event. If not provided, a random GUID will be assigned.
+ /// The unique string ID of the created time event, which can be used to remove it later via .
+ public string AddScheduledEvent(double timeInSeconds, Action action, string id = null)
+ {
+ ScheduledEvent timeEvent = new(timeInSeconds, action, id);
+
+ ScheduledEvents.Add(timeEvent);
+ ScheduledEvents.Sort();
+ UpdateNextScheduledEventIndex();
+
+ return timeEvent.Id;
+ }
+
+ ///
+ /// Removes a specific time-based event using its ID.
+ ///
+ /// The unique string identifier of the event to remove.
+ /// true if the event was successfully found and removed; otherwise, false.
+ public bool RemoveScheduledEvent(string id)
+ {
+ int removed = ScheduledEvents.RemoveAll(e => e.Id == id);
+
+ if (removed <= 0)
+ return false;
+
+ UpdateNextScheduledEventIndex();
+ return true;
+ }
+
+ ///
+ /// Clears all time-based events for the current playback.
+ ///
+ public void ClearScheduledEvents()
+ {
+ ScheduledEvents.Clear();
+ nextScheduledEventIndex = 0;
+ }
+
+ ///
+ /// Stops the current playback, resets all properties of the , and returns the instance to the object pool for future reuse.
+ ///
+ public void ReturnToPool()
+ {
+ if (Base == null)
+ return;
+
+ Stop();
+
+ if (Transform.parent != null || AdminToyBase._clientParentId != 0)
+ {
+ Transform.parent = null;
+ Base.RpcChangeParent(0);
+ }
+
+ LocalPosition = SpeakerParkPosition;
+
+ Volume = DefaultVolume;
+ IsSpatial = DefaultSpatial;
+ MinDistance = DefaultMinDistance;
+ MaxDistance = DefaultMaxDistance;
+
+ IsStatic = true;
+ Loop = false;
+ DestroyAfter = false;
+ ReturnToPoolAfter = false;
+ PlayMode = SpeakerPlayMode.Global;
+ Channel = Channels.ReliableOrdered2;
+
+ LastTrackInfo = default;
+
+ Predicate = null;
+ TargetPlayer = null;
+ TargetPlayers = null;
+
+ Pitch = 1f;
+ Filter = null;
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+ isPitchDefault = true;
+ needsSyncWait = false;
+
+ OnPlaybackStarted = null;
+ OnPlaybackPaused = null;
+ OnPlaybackResumed = null;
+ OnPlaybackLooped = null;
+ OnTrackSwitching = null;
+ OnPlaybackFinished = null;
+ OnPlaybackStopped = null;
+
+ SpeakerToyPlaybackBase.AllInstances.Remove(Base.Playback);
+
+ Pool.Enqueue(this);
+ }
+
+ ///
+ /// Sends the constructed audio message to the appropriate players based on the current .
+ ///
+ /// The .
+ public void SendAudioMessage(AudioMessage audioMessage)
+ {
switch (PlayMode)
{
case SpeakerPlayMode.Global:
- NetworkServer.SendToReady(msg, Channel);
+ NetworkServer.SendToReady(audioMessage, Channel);
break;
case SpeakerPlayMode.Player:
- TargetPlayer?.Connection.Send(msg, Channel);
+ TargetPlayer?.Connection?.Send(audioMessage, Channel);
break;
case SpeakerPlayMode.PlayerList:
+
+ if (TargetPlayers is null)
+ break;
+
using (NetworkWriterPooled writer = NetworkWriterPool.Get())
{
- NetworkMessages.Pack(msg, writer);
+ NetworkMessages.Pack(audioMessage, writer);
ArraySegment segment = writer.ToArraySegment();
foreach (Player ply in TargetPlayers)
{
- ply?.Connection.Send(segment, Channel);
+ ply?.Connection?.Send(segment, Channel);
}
}
break;
case SpeakerPlayMode.Predicate:
+ if (Predicate is null)
+ break;
+
using (NetworkWriterPooled writer = NetworkWriterPool.Get())
{
- NetworkMessages.Pack(msg, writer);
+ NetworkMessages.Pack(audioMessage, writer);
ArraySegment segment = writer.ToArraySegment();
foreach (Player ply in Player.List)
{
if (Predicate(ply))
- ply.Connection.Send(segment, Channel);
+ ply.Connection?.Send(segment, Channel);
}
}
@@ -572,6 +1141,25 @@ private void SendPacket(int len)
}
}
+ private void TryInitializePlayBack()
+ {
+ if (isPlayBackInitialized)
+ return;
+
+ isPlayBackInitialized = true;
+
+ frame = new float[FrameSize];
+ processNextFrame = ProcessNextFrame;
+ resampleBuffer = Array.Empty();
+ encoder = new(OpusApplicationType.Audio);
+ encoded = new byte[VoiceChatSettings.MaxEncodedSize];
+
+ // 3002 => OPUS_SIGNAL_MUSIC (https://github.com/xiph/opus/blob/2d862ea14b233e5a3f3afaf74d96050691af3cd5/include/opus_defines.h#L229)
+ OpusWrapper.SetEncoderSetting(encoder._handle, OpusCtlSetRequest.Signal, 3002);
+
+ AdminToyBase.OnRemoved += OnToyRemoved;
+ }
+
private void OnToyRemoved(AdminToyBase toy)
{
if (toy != Base)
@@ -580,8 +1168,288 @@ private void OnToyRemoved(AdminToyBase toy)
AdminToyBase.OnRemoved -= OnToyRemoved;
Stop();
-
encoder?.Dispose();
+
+ OnPlaybackStarted = null;
+ OnPlaybackPaused = null;
+ OnPlaybackResumed = null;
+ OnPlaybackLooped = null;
+ OnTrackSwitching = null;
+ OnPlaybackFinished = null;
+ OnPlaybackStopped = null;
+ }
+
+ private void UpdateNextScheduledEventIndex()
+ {
+ nextScheduledEventIndex = 0;
+ double current = CurrentTime;
+
+ while (nextScheduledEventIndex < ScheduledEvents.Count && ScheduledEvents[nextScheduledEventIndex].Time <= current)
+ {
+ nextScheduledEventIndex++;
+ }
+ }
+
+ private void ResetEncoder()
+ {
+ if (encoder != null && encoder._handle != IntPtr.Zero)
+ {
+ // 4028 => OPUS_RESET_STATE (https://github.com/xiph/opus/blob/2d862ea14b233e5a3f3afaf74d96050691af3cd5/include/opus_defines.h#L710)
+ OpusWrapper.SetEncoderSetting(encoder._handle, (OpusCtlSetRequest)4028, 0);
+ }
+ }
+
+ private IEnumerator FadeCoroutine(float startVolume, float targetVolume, float duration, bool linear, Action onComplete)
+ {
+ float timePassed = 0f;
+ bool isFadeOut = startVolume > targetVolume;
+
+ while (timePassed < duration)
+ {
+ timePassed += Time.deltaTime;
+ float t = timePassed / duration;
+
+ if (!linear)
+ t = isFadeOut ? 1f - ((1f - t) * (1f - t)) : t * t;
+
+ Base.NetworkVolume = Mathf.Lerp(startVolume, targetVolume, t);
+ yield return Timing.WaitForOneFrame;
+ }
+
+ Base.NetworkVolume = targetVolume;
+ onComplete?.Invoke();
+ }
+
+ private IEnumerator PlayBackCoroutine()
+ {
+ if (needsSyncWait)
+ {
+ int framesPassed = Time.frameCount - idChangeFrame;
+ while (framesPassed < 2)
+ {
+ yield return Timing.WaitForOneFrame;
+ framesPassed = Time.frameCount - idChangeFrame;
+ }
+
+ needsSyncWait = false;
+ }
+
+ OnPlaybackStarted?.Invoke();
+ SpeakerEvents.OnPlaybackStarted(this);
+
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+
+ float timeAccumulator = 0f;
+
+ ReadNextFrame();
+ int firstLen = processNextFrame();
+
+ if (firstLen > 2)
+ SendAudioMessage(new AudioMessage(ControllerId, encoded, firstLen));
+
+ if (CurrentSource.Ended)
+ {
+ OnPlaybackFinished?.Invoke();
+ SpeakerEvents.OnPlaybackFinished(this);
+ EndingPlayBack();
+ yield break;
+ }
+
+ Task encodeTask = PrepareNextFrameAsync();
+
+ while (true)
+ {
+ timeAccumulator += Time.deltaTime;
+
+ while (timeAccumulator >= FrameTime)
+ {
+ timeAccumulator -= FrameTime;
+
+ if (encodeTask.IsFaulted)
+ {
+ Log.Error($"[Speaker] An error occurred during audio encoding.\nException Details: {encodeTask.Exception}");
+ Stop();
+ yield break;
+ }
+
+ int len = encodeTask.Result;
+
+ if (len > 2)
+ SendAudioMessage(new AudioMessage(ControllerId, encoded, len));
+
+ if (!CurrentSource.Ended)
+ {
+ encodeTask = PrepareNextFrameAsync();
+ continue;
+ }
+
+ bool trackFailed = CurrentSource is IAsyncPcmSource asyncSource && asyncSource.IsFailed;
+
+ if (!trackFailed)
+ {
+ OnPlaybackFinished?.Invoke();
+ SpeakerEvents.OnPlaybackFinished(this);
+
+ yield return Timing.WaitForOneFrame;
+
+ if (Loop)
+ {
+ resampleTime = 0.0;
+ timeAccumulator = 0;
+ resampleBufferFilled = 0;
+ nextScheduledEventIndex = 0;
+
+ ResetEncoder();
+ Filter?.Reset();
+ CurrentSource.Reset();
+
+ OnPlaybackLooped?.Invoke();
+ SpeakerEvents.OnPlaybackLooped(this);
+
+ encodeTask = PrepareNextFrameAsync();
+ continue;
+ }
+ }
+
+ EndingPlayBack();
+
+ yield break;
+ }
+
+ while (nextScheduledEventIndex < ScheduledEvents.Count && CurrentTime >= ScheduledEvents[nextScheduledEventIndex].Time)
+ {
+ try
+ {
+ ScheduledEvents[nextScheduledEventIndex].Action?.Invoke();
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"[Speaker] Failed to execute scheduled time event at {ScheduledEvents[nextScheduledEventIndex].Time:F2}s.\nException Details: {ex}");
+ }
+
+ nextScheduledEventIndex++;
+ }
+
+ yield return Timing.WaitForOneFrame;
+ }
+ }
+
+ private void ReadNextFrame()
+ {
+ if (isPitchDefault)
+ {
+ int read = CurrentSource.Read(frame, 0, FrameSize);
+ if (read < FrameSize)
+ Array.Clear(frame, read, FrameSize - read);
+ }
+ else
+ {
+ ResampleFrame();
+ }
+ }
+
+ private int ProcessNextFrame()
+ {
+ Filter?.Process(frame);
+ return encoder.Encode(frame, encoded);
+ }
+
+ private Task PrepareNextFrameAsync()
+ {
+ ReadNextFrame();
+ return Task.Run(processNextFrame);
+ }
+
+ private void ResampleFrame()
+ {
+ int requiredSize = (int)(FrameSize * Mathf.Abs(Pitch) * 2) + 10;
+
+ if (resampleBuffer.Length < requiredSize)
+ {
+ resampleBuffer = new float[requiredSize];
+ resampleTime = 0.0;
+ resampleBufferFilled = 0;
+ }
+
+ int outputIdx = 0;
+
+ while (outputIdx < FrameSize)
+ {
+ if (resampleBufferFilled == 0)
+ {
+ int toRead = resampleBuffer.Length - 4;
+ int actualRead = CurrentSource.Read(resampleBuffer, 0, toRead);
+
+ if (actualRead == 0)
+ {
+ while (outputIdx < FrameSize)
+ frame[outputIdx++] = 0f;
+ return;
+ }
+
+ resampleBufferFilled = actualRead;
+ resampleTime = 0.0;
+ }
+
+ int currentSample = (int)resampleTime;
+
+ if (currentSample >= resampleBufferFilled - 1)
+ {
+ if (resampleBufferFilled > 0)
+ {
+ resampleBuffer[0] = resampleBuffer[resampleBufferFilled - 1];
+
+ int toRead = resampleBuffer.Length - 5;
+ int actualRead = CurrentSource.Read(resampleBuffer, 1, toRead);
+
+ if (actualRead == 0)
+ {
+ while (outputIdx < FrameSize)
+ frame[outputIdx++] = 0f;
+ return;
+ }
+
+ resampleBufferFilled = actualRead + 1;
+ resampleTime -= currentSample;
+ }
+ else
+ {
+ resampleBufferFilled = 0;
+ }
+
+ continue;
+ }
+
+ double frac = resampleTime - currentSample;
+ float sample1 = resampleBuffer[currentSample];
+ float sample2 = resampleBuffer[currentSample + 1];
+
+ frame[outputIdx++] = (float)(sample1 + ((sample2 - sample1) * frac));
+
+ resampleTime += Pitch;
+ }
+ }
+
+ private void EndingPlayBack()
+ {
+ if (TrackQueue.Count > 0)
+ {
+ playBackRoutine.IsRunning = false;
+ SkipTrack();
+ }
+ else if (ReturnToPoolAfter)
+ {
+ ReturnToPool();
+ }
+ else if (DestroyAfter)
+ {
+ Destroy();
+ }
+ else
+ {
+ Stop();
+ }
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/Audio/IAsyncPcmSource.cs b/EXILED/Exiled.API/Interfaces/Audio/IAsyncPcmSource.cs
new file mode 100644
index 0000000000..1ae0a2f7e5
--- /dev/null
+++ b/EXILED/Exiled.API/Interfaces/Audio/IAsyncPcmSource.cs
@@ -0,0 +1,25 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Interfaces.Audio
+{
+ ///
+ /// Represents an audio source that loads its data asynchronously and can potentially fail.
+ ///
+ public interface IAsyncPcmSource
+ {
+ ///
+ /// Gets a value indicating whether the asynchronous source has finished loading/buffering and is ready to be played.
+ ///
+ bool IsReady { get; }
+
+ ///
+ /// Gets a value indicating whether the source failed to load.
+ ///
+ bool IsFailed { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs b/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs
new file mode 100644
index 0000000000..3bd096a2a7
--- /dev/null
+++ b/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs
@@ -0,0 +1,26 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Interfaces.Audio
+{
+ ///
+ /// Represents a custom filter for the speaker.
+ ///
+ public interface IAudioFilter
+ {
+ ///
+ /// Processes the raw PCM audio frame directly before it is encoded and sending.
+ ///
+ /// The array of PCM audio samples.
+ void Process(float[] frame);
+
+ ///
+ /// Resets the internal state and buffers of the filter.
+ ///
+ void Reset();
+ }
+}
diff --git a/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs b/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs
new file mode 100644
index 0000000000..ad9c9caea9
--- /dev/null
+++ b/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs
@@ -0,0 +1,16 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Interfaces.Audio
+{
+ ///
+ /// A marker interface used to identify PCM sources that are live or continuous.
+ ///
+ public interface ILiveSource
+ {
+ }
+}
diff --git a/EXILED/Exiled.API/Interfaces/IPcmSource.cs b/EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs
similarity index 89%
rename from EXILED/Exiled.API/Interfaces/IPcmSource.cs
rename to EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs
index 680f568410..6f0423b86f 100644
--- a/EXILED/Exiled.API/Interfaces/IPcmSource.cs
+++ b/EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs
@@ -5,10 +5,12 @@
//
// -----------------------------------------------------------------------
-namespace Exiled.API.Interfaces
+namespace Exiled.API.Interfaces.Audio
{
using System;
+ using Exiled.API.Structs.Audio;
+
///
/// Represents a source of PCM audio data.
///
@@ -29,6 +31,11 @@ public interface IPcmSource : IDisposable
///
double CurrentTime { get; set; }
+ ///
+ /// Gets the metadata of the streaming track.
+ ///
+ TrackData TrackInfo { get; }
+
///
/// Reads a sequence of PCM samples into the specified buffer.
///
diff --git a/EXILED/Exiled.API/Structs/Audio/AudioData.cs b/EXILED/Exiled.API/Structs/Audio/AudioData.cs
new file mode 100644
index 0000000000..e8924f8c10
--- /dev/null
+++ b/EXILED/Exiled.API/Structs/Audio/AudioData.cs
@@ -0,0 +1,36 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Structs.Audio
+{
+ ///
+ /// Represents raw audio data and its associated metadata.
+ ///
+ public struct AudioData
+ {
+ ///
+ /// Gets the raw PCM audio samples.
+ ///
+ public float[] Pcm;
+
+ ///
+ /// Gets the metadata of the audio track, including its total duration.
+ ///
+ public TrackData TrackInfo;
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The raw PCM float array containing the audio data.
+ /// The metadata associated with the audio track.
+ public AudioData(float[] pcmData, TrackData trackInfo)
+ {
+ Pcm = pcmData;
+ TrackInfo = trackInfo;
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Structs/Audio/QueuedTrack.cs b/EXILED/Exiled.API/Structs/Audio/QueuedTrack.cs
new file mode 100644
index 0000000000..34d1cfbf63
--- /dev/null
+++ b/EXILED/Exiled.API/Structs/Audio/QueuedTrack.cs
@@ -0,0 +1,40 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Structs.Audio
+{
+ using System;
+
+ using Exiled.API.Interfaces.Audio;
+
+ ///
+ /// Represents a track waiting in the queue, along with its specific playback options.
+ ///
+ public readonly struct QueuedTrack
+ {
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The name, path, or identifier of the track (used for displaying or removing from queue).
+ /// A function that returns the instantiated .
+ public QueuedTrack(string name, Func sourceFactory)
+ {
+ Name = name;
+ SourceProvider = sourceFactory;
+ }
+
+ ///
+ /// Gets the name, path, or identifier of the track.
+ ///
+ public string Name { get; }
+
+ ///
+ /// Gets the provider function used to create the custom audio source on demand.
+ ///
+ public Func SourceProvider { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Structs/Audio/TrackData.cs b/EXILED/Exiled.API/Structs/Audio/TrackData.cs
new file mode 100644
index 0000000000..93f549369f
--- /dev/null
+++ b/EXILED/Exiled.API/Structs/Audio/TrackData.cs
@@ -0,0 +1,74 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Structs.Audio
+{
+ using System;
+
+ ///
+ /// Contains metadata about a audio track.
+ ///
+ public struct TrackData
+ {
+ ///
+ /// Gets the title of the track, if available in the metadata.
+ ///
+ public string Title { get; internal set; }
+
+ ///
+ /// Gets the artist of the track, if available in the metadata.
+ ///
+ public string Artist { get; internal set; }
+
+ ///
+ /// Gets the total duration of the track in seconds.
+ ///
+ public double Duration { get; internal set; }
+
+ ///
+ /// Gets the file path of the track.
+ ///
+ public string Path { get; internal set; }
+
+ ///
+ /// Gets a value indicating whether the track data is completely empty.
+ ///
+ public readonly bool IsEmpty => string.IsNullOrEmpty(Title) && string.IsNullOrEmpty(Artist) && Duration <= 0;
+
+ ///
+ /// Gets a formatted display name for the track.
+ ///
+ public string DisplayName
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(Artist) && !string.IsNullOrEmpty(Title))
+ return $"{Artist} - {Title}";
+
+ if (!string.IsNullOrEmpty(Title))
+ return Title;
+
+ if (!string.IsNullOrEmpty(Path))
+ return System.IO.Path.GetFileNameWithoutExtension(Path);
+
+ return "Unknown Track";
+ }
+ }
+
+ ///
+ /// Gets the duration formatted as a digital clock string.
+ ///
+ public readonly string FormattedDuration
+ {
+ get
+ {
+ TimeSpan t = TimeSpan.FromSeconds(Duration);
+ return t.Hours > 0 ? t.ToString(@"hh\:mm\:ss") : t.ToString(@"mm\:ss");
+ }
+ }
+ }
+}
From 6ae54e676286e622bdf3a5de0e6afbde15ded084 Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Wed, 29 Apr 2026 20:28:33 +0300
Subject: [PATCH 33/39] (MS forgor) Change Speaker channel from
ReliableOrdered2 to Unreliable (#812)
---
EXILED/Exiled.API/Features/Toys/Speaker.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs
index 40201e9aa9..a1e320c002 100644
--- a/EXILED/Exiled.API/Features/Toys/Speaker.cs
+++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs
@@ -1059,7 +1059,7 @@ public void ReturnToPool()
DestroyAfter = false;
ReturnToPoolAfter = false;
PlayMode = SpeakerPlayMode.Global;
- Channel = Channels.ReliableOrdered2;
+ Channel = Channels.Unreliable;
LastTrackInfo = default;
@@ -1452,4 +1452,4 @@ private void EndingPlayBack()
}
}
}
-}
\ No newline at end of file
+}
From 7b95466b9421b479e16cd20c0872a1c45205b6ee Mon Sep 17 00:00:00 2001
From: jiraya <177346249+intjiraya@users.noreply.github.com>
Date: Fri, 8 May 2026 12:11:56 +0200
Subject: [PATCH 34/39] fix: Installer always returns exit code 0 even on
failure (#818)
---
EXILED/Exiled.Installer/Program.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/EXILED/Exiled.Installer/Program.cs b/EXILED/Exiled.Installer/Program.cs
index 6ea75b0df0..ea09dada54 100644
--- a/EXILED/Exiled.Installer/Program.cs
+++ b/EXILED/Exiled.Installer/Program.cs
@@ -155,6 +155,7 @@ internal static async Task MainSafe(CommandSettings args)
}
catch (Exception ex)
{
+ error = true;
Console.WriteLine(ex);
Console.WriteLine(Resources.Program_MainSafe_Read_the_exception_message__read_the_readme__and_if_you_still_don_t_understand_what_to_do__then_contact__support_in_our_discord_server_with_the_attached_screenshot_of_the_full_exception);
if (!args.Exit)
From ef89a1280af8e17c69baff316e1610c30951d729 Mon Sep 17 00:00:00 2001
From: MS-crew <100300664+MS-crew@users.noreply.github.com>
Date: Sat, 9 May 2026 21:02:59 +0300
Subject: [PATCH 35/39] feat: Refactor object spawn and unspawn logic (#810)
* Refactor object spawn and unspawn logic
* fix not real player specific / added edit network identiyty player specific / code clean
* michcios suggestion
* fix
* better
* more optimize destroy
* optimize spawn message
---
.../Exiled.API/Extensions/MirrorExtensions.cs | 286 +++++++++++++-----
1 file changed, 214 insertions(+), 72 deletions(-)
diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
index 20f5b1a376..ca7742fda5 100644
--- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
@@ -16,23 +16,32 @@ namespace Exiled.API.Extensions
using System.Text;
using AdminToys;
+
using AudioPooling;
+
using Cassie;
+
using CustomPlayerEffects;
+
using Exiled.API.Enums;
using Exiled.API.Features.Items;
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Features.Pickups.Keycards;
+
using Features;
using Features.Pools;
+
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Autosync;
using InventorySystem.Items.Firearms;
using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Keycards;
+
using MEC;
+
using Mirror;
+
using PlayerRoles;
using PlayerRoles.Blood;
using PlayerRoles.FirstPersonControl;
@@ -40,9 +49,13 @@ namespace Exiled.API.Extensions
using PlayerRoles.PlayableScps.Scp1507;
using PlayerRoles.Spectating;
using PlayerRoles.Voice;
+
using RelativePositioning;
+
using Respawning;
+
using UnityEngine;
+
using Utils.Networking;
///
@@ -148,9 +161,9 @@ public static ReadOnlyDictionary RpcFullNames
}
///
- /// Gets a 's .
+ /// Gets a NetworkIdentity.SerializeServer's .
///
- public static MethodInfo SetDirtyBitsMethodInfo => field ??= typeof(NetworkBehaviour).GetMethod(nameof(NetworkBehaviour.SetSyncVarDirtyBit));
+ public static MethodInfo SerializeServerMethodInfo => field ??= typeof(NetworkIdentity).GetMethod("SerializeServer", BindingFlags.NonPublic | BindingFlags.Instance);
///
/// Gets a NetworkServer.SendSpawnMessage's .
@@ -400,7 +413,7 @@ public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumer
if (target != player || !isRisky)
target.Connection.Send(writer.ToArraySegment());
else
- Log.Error($"Prevent Seld-Desync of {player.Nickname} with {type}");
+ Log.Error($"Prevent Self-Desync of {player.Nickname} with {type}");
}
NetworkWriterPool.Return(writer);
@@ -538,27 +551,6 @@ public static void MessageTranslated(this Player player, string words, string tr
announcement.Payload.SendToHubsConditionally(hub => hub == player.ReferenceHub);
}
- ///
- /// Moves object for the player.
- ///
- /// Target to send.
- /// The to move.
- /// The position to change.
- public static void MoveNetworkIdentityObject(this Player player, NetworkIdentity identity, Vector3 pos)
- {
- if (identity == null)
- return;
-
- identity.gameObject.transform.position = pos;
- ObjectDestroyMessage objectDestroyMessage = new()
- {
- netId = identity.netId,
- };
-
- player.Connection.Send(objectDestroyMessage, 0);
- SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, player.Connection });
- }
-
///
/// Sends to the player a Fake Change Scene.
///
@@ -588,6 +580,58 @@ public static void ChangeSceneToAllClients(ScenesType scene)
NetworkServer.SendToAll(message);
}
+ ///
+ /// Sends a spawn message for the specified to the given .
+ ///
+ /// The player who should receive the spawn message.
+ /// The to spawn.
+ public static void SpawnNetworkIdentity(this Player player, NetworkIdentity identity) => SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, player.Connection });
+
+ ///
+ /// Sends a destroy message for the specified to the given .
+ ///
+ /// The player who should receive the destroy message.
+ /// The to destroy.
+ public static void DestroyNetworkIdentity(this Player player, NetworkIdentity identity) => player.DestroyNetworkId(identity.netId);
+
+ ///
+ /// Sends a destroy message for the specified network ID to the given .
+ ///
+ /// The player who should receive the destroy message.
+ /// The network ID of the object to destroy.
+ public static void DestroyNetworkId(this Player player, uint netId) => player.Connection.Send(new ObjectDestroyMessage() { netId = netId });
+
+ ///
+ /// Respawns the specified for the given .
+ /// This sends a destroy message followed by a spawn message to the player's client.
+ ///
+ /// The player who should receive the respawn messages.
+ /// The to respawn.
+ public static void RespawnNetworkIdentity(this Player player, NetworkIdentity identity)
+ {
+ player.DestroyNetworkIdentity(identity);
+ player.SpawnNetworkIdentity(identity);
+ }
+
+ ///
+ /// Moves object for the player.
+ ///
+ /// Target to send.
+ /// The to move.
+ /// The position to change.
+ public static void MoveNetworkIdentityObject(this Player player, NetworkIdentity identity, Vector3 pos)
+ {
+ if (identity == null)
+ return;
+
+ Vector3 originalPosition = identity.transform.position;
+ identity.transform.position = pos;
+
+ player.RespawnNetworkIdentity(identity);
+
+ identity.transform.position = originalPosition;
+ }
+
///
/// Scales an object for the specified player.
///
@@ -599,14 +643,135 @@ public static void ScaleNetworkIdentityObject(this Player player, NetworkIdentit
if (identity == null)
return;
- identity.gameObject.transform.localScale = scale;
- ObjectDestroyMessage objectDestroyMessage = new()
+ Vector3 originalScale = identity.transform.localScale;
+ identity.transform.localScale = scale;
+
+ player.RespawnNetworkIdentity(identity);
+
+ identity.transform.localScale = originalScale;
+ }
+
+ ///
+ /// Edit 's parameter and sync.
+ ///
+ /// Target to send.
+ /// Target object.
+ /// Edit function.
+ /// Reback function for reset object to original state.
+ public static void EditNetworkObject(this Player player, NetworkIdentity identity, Action customAction, Action resetAction)
+ {
+ if (identity == null)
+ return;
+
+ customAction?.Invoke(identity);
+
+ player.RespawnNetworkIdentity(identity);
+
+ resetAction?.Invoke(identity);
+ }
+
+ ///
+ /// Sends a spawn message for the specified to a targeted collection of players.
+ ///
+ /// The to serialize and spawn.
+ /// The collection of who will receive the spawn message.
+ public static void SendSpawnMessageForPlayers(this NetworkIdentity identity, IEnumerable players)
+ {
+ if (identity == null || identity.netId == 0 || !players.Any())
+ return;
+
+ using NetworkWriterPooled ownerWriter = NetworkWriterPool.Get();
+ using NetworkWriterPooled observersWriter = NetworkWriterPool.Get();
+
+ SerializeServerMethodInfo?.Invoke(identity, new object[] { true, ownerWriter, observersWriter });
+
+ ArraySegment ownerPayload = ownerWriter.ToArraySegment();
+ ArraySegment observerPayload = observersWriter.ToArraySegment();
+
+ SpawnMessage spawnMessage = new()
{
netId = identity.netId,
+ isLocalPlayer = false,
+ isOwner = false,
+ sceneId = identity.sceneId,
+ assetId = identity.assetId,
+ position = identity.transform.localPosition,
+ rotation = identity.transform.localRotation,
+ scale = identity.transform.localScale,
+ payload = observerPayload,
};
- player.Connection.Send(objectDestroyMessage, 0);
- SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, player.Connection });
+ using NetworkWriterPooled prepackedObserverWriter = NetworkWriterPool.Get();
+ NetworkMessages.Pack(spawnMessage, prepackedObserverWriter);
+ ArraySegment segment = prepackedObserverWriter.ToArraySegment();
+
+ foreach (Player player in players)
+ {
+ if (!player.IsConnected)
+ continue;
+
+ bool isOwner = identity.connectionToClient == player.Connection;
+
+ if (!isOwner)
+ {
+ player.Connection.Send(segment);
+ continue;
+ }
+
+ SpawnMessage ownerMessage = spawnMessage;
+ ownerMessage.isOwner = true;
+ ownerMessage.isLocalPlayer = player.NetworkIdentity == identity;
+ ownerMessage.payload = ownerPayload;
+
+ player.Connection.Send(ownerMessage);
+ }
+ }
+
+ ///
+ /// Sends a destroy message for the specified to a targeted collection of players.
+ ///
+ /// The to destroy on the clients.
+ /// The collection of who will receive the destroy message.
+ public static void DestroyNetworkIdentityForPlayers(this NetworkIdentity identity, IEnumerable players)
+ {
+ if (identity == null || identity.netId == 0 || !players.Any())
+ return;
+
+ using NetworkWriterPooled writer = NetworkWriterPool.Get();
+ NetworkMessages.Pack(new ObjectDestroyMessage() { netId = identity.netId }, writer);
+ ArraySegment segment = writer.ToArraySegment();
+
+ foreach (Player player in players)
+ {
+ if (!player.IsConnected)
+ continue;
+
+ player.Connection.Send(segment);
+ }
+ }
+
+ ///
+ /// Respawns the specified by respawning its underlying on the server.
+ ///
+ /// The to respawn.
+ public static void RespawnNetworkIdentity(this NetworkIdentity identity)
+ {
+ if (identity == null || identity.netId == 0)
+ return;
+
+ NetworkServer.SendToReady(new ObjectDestroyMessage() { netId = identity.netId });
+ identity.SendSpawnMessageForPlayers(Player.List);
+ }
+
+ ///
+ /// Respawns a networked on the server by unspawning and respawning it.
+ /// This forces Mirror to reinitialize the network state for the object.
+ ///
+ /// The networked GameObject to respawn.
+ public static void RespawnNetworkObject(this GameObject gameObject)
+ {
+ NetworkServer.UnSpawn(gameObject);
+ NetworkServer.Spawn(gameObject);
}
///
@@ -619,17 +784,8 @@ public static void MoveNetworkIdentityObject(this NetworkIdentity identity, Vect
if (identity == null)
return;
- identity.gameObject.transform.position = pos;
- ObjectDestroyMessage objectDestroyMessage = new()
- {
- netId = identity.netId,
- };
-
- foreach (Player ply in Player.List)
- {
- ply.Connection.Send(objectDestroyMessage, 0);
- SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, ply.Connection });
- }
+ identity.transform.position = pos;
+ RespawnNetworkIdentity(identity);
}
///
@@ -642,17 +798,19 @@ public static void ScaleNetworkIdentityObject(this NetworkIdentity identity, Vec
if (identity == null)
return;
- identity.gameObject.transform.localScale = scale;
- ObjectDestroyMessage objectDestroyMessage = new()
- {
- netId = identity.netId,
- };
+ identity.transform.localScale = scale;
+ RespawnNetworkIdentity(identity);
+ }
- foreach (Player ply in Player.List)
- {
- ply.Connection.Send(objectDestroyMessage, 0);
- SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, ply.Connection });
- }
+ ///
+ /// Edit 's parameter and sync.
+ ///
+ /// The to edit.
+ /// Edit function.
+ public static void EditNetworkObject(this NetworkIdentity identity, Action customAction)
+ {
+ customAction.Invoke(identity);
+ RespawnNetworkIdentity(identity);
}
///
@@ -714,7 +872,12 @@ public static void ResyncSyncVar(NetworkIdentity behaviorOwner, Type targetType,
{
if (behaviorOwner == null)
return;
- SetDirtyBitsMethodInfo.Invoke(behaviorOwner.gameObject.GetComponent(targetType), new object[] { SyncVarDirtyBits[$"{targetType.Name}.{propertyName}"] });
+
+ if (behaviorOwner.gameObject.GetComponent(targetType) is not NetworkBehaviour behaviour)
+ return;
+
+ ulong dirtyBit = SyncVarDirtyBits[$"{targetType.Name}.{propertyName}"];
+ behaviour.SetSyncVarDirtyBit(dirtyBit);
}
///
@@ -774,32 +937,11 @@ public static void SendFakeSyncObject(Player target, NetworkIdentity behaviorOwn
NetworkWriterPooled writer = NetworkWriterPool.Get();
NetworkWriterPooled writer2 = NetworkWriterPool.Get();
MakeCustomSyncWriter(behaviorOwner, targetType, customAction, null, writer, writer2);
- target.ReferenceHub.networkIdentity.connectionToClient.Send(new EntityStateMessage() { netId = behaviorOwner.netId, payload = writer.ToArraySegment() });
+ target.Connection.Send(new EntityStateMessage() { netId = behaviorOwner.netId, payload = writer.ToArraySegment() });
NetworkWriterPool.Return(writer);
NetworkWriterPool.Return(writer2);
}
- ///
- /// Edit 's parameter and sync.
- ///
- /// Target object.
- /// Edit function.
- public static void EditNetworkObject(NetworkIdentity identity, Action customAction)
- {
- customAction.Invoke(identity);
-
- ObjectDestroyMessage objectDestroyMessage = new()
- {
- netId = identity.netId,
- };
-
- foreach (Player player in Player.List)
- {
- player.Connection.Send(objectDestroyMessage, 0);
- SendSpawnMessageMethodInfo.Invoke(null, new object[] { identity, player.Connection });
- }
- }
-
// Get components index in identity.(private)
private static int GetComponentIndex(NetworkIdentity identity, Type type)
{
From 92358ee2807714f99497ee885c64c40ca8116393 Mon Sep 17 00:00:00 2001
From: Yamato <66829532+louis1706@users.noreply.github.com>
Date: Wed, 13 May 2026 16:14:51 +0200
Subject: [PATCH 36/39] feat: add new rule for .editorconfig (#822)
* feat: add new rule for .editorconfig
* remove resharper specific
remove resharper specific as Github build do not take it into account
* stylecop is happy life :3
* using change
* fix compile error
* halfway from player i need to sleep
* fix: now Style code make Error like i wanted
* 127 Error remaining
* 98 Error remaining
* there was more error
* Bro i finally succeed to GPT making it
* fix
* Update EXILED/Exiled.Events/Patches/Fixes/RoleChangedPatch.cs
* Update EXILED/Exiled.Events/Patches/Fixes/FixNWFlashbangDuration.cs
* more rules :3
* Update SyleCopVersion
* it's finally got it right
* fix build error
* better check
* more ignore
* fix: Error on Debug
* fix: build error
* useless pragma warning disable
* found a better way than warning disable
* oups this shouldn't have been removed
* doc: DanceType.None
---
EXILED/.editorconfig | 31 ++++++++++-
EXILED/EXILED.props | 3 +-
EXILED/Exiled.API/Enums/AmmoType.cs | 4 +-
EXILED/Exiled.API/Enums/AspectRatioType.cs | 2 +-
EXILED/Exiled.API/Enums/CameraType.cs | 2 +-
EXILED/Exiled.API/Enums/DamageType.cs | 4 +-
EXILED/Exiled.API/Enums/DanceType.cs | 2 +-
.../Exiled.API/Enums/DecontaminationState.cs | 4 +-
EXILED/Exiled.API/Enums/DoorLockType.cs | 2 +-
EXILED/Exiled.API/Enums/DoorType.cs | 1 +
EXILED/Exiled.API/Enums/EffectCategory.cs | 2 +-
EXILED/Exiled.API/Enums/EffectType.cs | 2 +-
EXILED/Exiled.API/Enums/FirearmType.cs | 2 +-
EXILED/Exiled.API/Enums/GlassType.cs | 2 +-
EXILED/Exiled.API/Enums/HazardType.cs | 2 +-
EXILED/Exiled.API/Enums/LayerMasks.cs | 2 +-
EXILED/Exiled.API/Enums/LeadingTeam.cs | 2 +-
EXILED/Exiled.API/Enums/LockerType.cs | 2 +-
EXILED/Exiled.API/Enums/PingType.cs | 2 +-
EXILED/Exiled.API/Enums/RespawnEffectType.cs | 4 --
.../Exiled.API/Enums/RevolverChamberState.cs | 2 +-
EXILED/Exiled.API/Enums/ScenesType.cs | 6 +-
...lityStates.cs => Scp939VisibilityState.cs} | 4 +-
EXILED/Exiled.API/Enums/SpawnLocationType.cs | 10 ++--
EXILED/Exiled.API/Enums/UncuffReason.cs | 2 +-
EXILED/Exiled.API/Enums/UsableRippleType.cs | 2 +-
EXILED/Exiled.API/Enums/ZoneType.cs | 1 +
.../Exiled.API/Extensions/CommonExtensions.cs | 2 +-
.../Extensions/DamageTypeExtensions.cs | 6 +-
.../Extensions/DangerTypeExtensions.cs | 1 +
.../Extensions/EffectTypeExtension.cs | 7 ++-
.../Exiled.API/Extensions/FloatExtensions.cs | 2 +-
.../Exiled.API/Extensions/ItemExtensions.cs | 3 +-
.../Exiled.API/Extensions/LockerExtensions.cs | 5 +-
.../Exiled.API/Extensions/MirrorExtensions.cs | 22 ++++----
.../Exiled.API/Extensions/RoleExtensions.cs | 13 +++--
.../Exiled.API/Extensions/StringExtensions.cs | 2 +-
.../Features/Audio/AudioDataStorage.cs | 3 +-
.../Exiled.API/Features/Audio/WavUtility.cs | 2 +-
EXILED/Exiled.API/Features/Camera.cs | 4 ++
EXILED/Exiled.API/Features/Cassie.cs | 14 +++--
EXILED/Exiled.API/Features/Coffee.cs | 3 +-
.../Features/ComponentsEqualityComparer.cs | 2 +-
EXILED/Exiled.API/Features/Core/EActor.cs | 1 +
.../Features/Core/Generic/EBehaviour.cs | 2 -
.../Features/Core/StateMachine/State.cs | 1 -
.../Core/UserSettings/ButtonSetting.cs | 1 +
.../Core/UserSettings/DropdownSetting.cs | 1 +
.../Core/UserSettings/HeaderSetting.cs | 1 +
.../Core/UserSettings/KeybindSetting.cs | 2 +
.../Features/Core/UserSettings/SettingBase.cs | 7 ++-
.../Core/UserSettings/SliderSetting.cs | 1 +
.../Core/UserSettings/TextInputSetting.cs | 2 +
.../Core/UserSettings/TwoButtonsSetting.cs | 1 +
.../Core/UserSettings/UserTextInputSetting.cs | 2 +
.../CustomStats/CustomHumeShieldStat.cs | 4 ++
.../Features/DamageHandlers/DamageHandler.cs | 1 +
.../DamageHandlers/DamageHandlerBase.cs | 7 ++-
.../DamageHandlers/GenericDamageHandler.cs | 19 ++-----
EXILED/Exiled.API/Features/Doors/BasicDoor.cs | 2 +
EXILED/Exiled.API/Features/Doors/Door.cs | 12 ++--
.../Exiled.API/Features/Doors/ElevatorDoor.cs | 2 +
.../Features/Doors/EmergencyReleaseButton.cs | 1 +
EXILED/Exiled.API/Features/Doors/Gate.cs | 2 +
EXILED/Exiled.API/Features/Draw.cs | 1 -
EXILED/Exiled.API/Features/Generator.cs | 3 +
.../Features/GlobalPatchProcessor.cs | 38 ++++++-------
.../Features/Hazards/AmnesticCloudHazard.cs | 1 +
EXILED/Exiled.API/Features/Hazards/Hazard.cs | 17 +++---
.../Features/Hazards/SinkholeHazard.cs | 1 +
.../Features/Hazards/TantrumHazard.cs | 4 ++
EXILED/Exiled.API/Features/Items/Ammo.cs | 1 +
EXILED/Exiled.API/Features/Items/Armor.cs | 2 +-
.../Exiled.API/Features/Items/Consumable.cs | 2 +-
.../Features/Items/ExplosiveGrenade.cs | 1 +
EXILED/Exiled.API/Features/Items/Firearm.cs | 23 +++-----
.../Barrel/AutomaticBarrelMagazine.cs | 8 +--
.../FirearmModules/Barrel/BarrelMagazine.cs | 2 +-
.../Barrel/PumpBarrelMagazine.cs | 8 +--
.../Features/Items/FirearmModules/Magazine.cs | 8 +--
.../Primary/CylinderMagazine.cs | 4 +-
.../FirearmModules/Primary/NormalMagazine.cs | 2 +-
.../FirearmModules/Primary/PrimaryMagazine.cs | 3 +-
.../Exiled.API/Features/Items/Flashlight.cs | 6 +-
EXILED/Exiled.API/Features/Items/Item.cs | 8 ++-
EXILED/Exiled.API/Features/Items/Jailbird.cs | 3 +
EXILED/Exiled.API/Features/Items/Keycard.cs | 2 +
.../Items/Keycards/CustomKeycardItem.cs | 7 ++-
.../Items/Keycards/PermissionsProvider.cs | 2 +
.../Items/Keycards/SingleUseKeycard.cs | 2 +
.../Exiled.API/Features/Items/Marshmallow.cs | 4 ++
EXILED/Exiled.API/Features/Items/MicroHid.cs | 5 --
EXILED/Exiled.API/Features/Items/Radio.cs | 1 +
EXILED/Exiled.API/Features/Items/Scp127.cs | 5 +-
EXILED/Exiled.API/Features/Items/Scp1344.cs | 7 +--
EXILED/Exiled.API/Features/Items/Scp1509.cs | 4 +-
EXILED/Exiled.API/Features/Items/Scp1576.cs | 2 +-
EXILED/Exiled.API/Features/Items/Scp330.cs | 2 +-
EXILED/Exiled.API/Features/Items/Throwable.cs | 2 +-
EXILED/Exiled.API/Features/Items/Usable.cs | 1 -
EXILED/Exiled.API/Features/Lift.cs | 7 ++-
EXILED/Exiled.API/Features/Lockers/Chamber.cs | 5 +-
EXILED/Exiled.API/Features/Lockers/Locker.cs | 4 +-
EXILED/Exiled.API/Features/Map.cs | 13 ++++-
EXILED/Exiled.API/Features/Npc.cs | 16 ++++--
.../Features/Objectives/EscapeObjective.cs | 2 +
.../Objectives/GeneratorActivatedObjective.cs | 1 +
.../Objectives/HumanDamageObjective.cs | 1 +
.../Features/Objectives/HumanKillObjective.cs | 2 +
.../Features/Objectives/HumanObjective.cs | 1 +
.../Features/Objectives/Objective.cs | 9 +--
.../Objectives/ScpItemPickupObjective.cs | 2 +
.../Exiled.API/Features/Pickups/AmmoPickup.cs | 2 +-
.../Features/Pickups/BodyArmorPickup.cs | 4 +-
.../Features/Pickups/FirearmPickup.cs | 3 +-
.../Features/Pickups/FlashGrenadePickup.cs | 2 +-
.../Features/Pickups/GrenadePickup.cs | 2 +-
.../Features/Pickups/JailbirdPickup.cs | 2 +-
.../Features/Pickups/KeycardPickup.cs | 2 +-
.../Pickups/Keycards/CustomKeycardPickup.cs | 7 ++-
.../Keycards/ManagementKeycardPickup.cs | 3 +
.../Pickups/Keycards/MetalKeycardPickup.cs | 3 +
.../Keycards/SingleUseKeycardPickup.cs | 1 +
.../Pickups/Keycards/Site02KeycardPickup.cs | 3 +
.../Keycards/TaskForceKeycardPickup.cs | 3 +
.../Features/Pickups/MicroHIDPickup.cs | 4 +-
EXILED/Exiled.API/Features/Pickups/Pickup.cs | 7 ++-
.../Projectiles/EffectGrenadeProjectile.cs | 2 +-
.../Projectiles/ExplosionGrenadeProjectile.cs | 2 +-
.../Projectiles/FlashbangProjectile.cs | 2 +-
.../Pickups/Projectiles/Projectile.cs | 4 +-
.../Pickups/Projectiles/Scp018Projectile.cs | 4 +-
.../Pickups/Projectiles/Scp2176Projectile.cs | 2 +-
.../Projectiles/TimeGrenadeProjectile.cs | 2 +-
.../Features/Pickups/RadioPickup.cs | 2 +-
.../Features/Pickups/Scp1509Pickup.cs | 3 +-
.../Features/Pickups/Scp1576Pickup.cs | 2 +-
.../Features/Pickups/Scp244Pickup.cs | 4 +-
.../Features/Pickups/Scp330Pickup.cs | 2 +-
.../Features/Pickups/UsablePickup.cs | 2 +-
EXILED/Exiled.API/Features/Player.cs | 36 ++++++++----
EXILED/Exiled.API/Features/Plugin.cs | 8 ++-
.../Features/Pools/DictionaryPool.cs | 2 +-
.../Exiled.API/Features/Pools/HashSetPool.cs | 2 +-
EXILED/Exiled.API/Features/Pools/IPool.cs | 2 +-
EXILED/Exiled.API/Features/Pools/ListPool.cs | 2 +-
EXILED/Exiled.API/Features/Pools/QueuePool.cs | 2 +-
.../Features/Pools/StringBuilderPool.cs | 2 +-
EXILED/Exiled.API/Features/PrefabHelper.cs | 7 ++-
EXILED/Exiled.API/Features/Ragdoll.cs | 9 ++-
EXILED/Exiled.API/Features/Recontainer.cs | 5 ++
EXILED/Exiled.API/Features/Respawn.cs | 5 ++
.../Features/Roles/DestroyedRole.cs | 9 +--
.../Features/Roles/FilmMakerRole.cs | 1 +
EXILED/Exiled.API/Features/Roles/FpcRole.cs | 6 +-
EXILED/Exiled.API/Features/Roles/HumanRole.cs | 2 +-
.../Features/Roles/IHumeShieldRole.cs | 2 +-
EXILED/Exiled.API/Features/Roles/NoneRole.cs | 2 +-
.../Features/Roles/OverwatchRole.cs | 2 +-
EXILED/Exiled.API/Features/Roles/Role.cs | 8 ++-
.../Exiled.API/Features/Roles/Scp049Role.cs | 7 ++-
.../Exiled.API/Features/Roles/Scp079Role.cs | 8 ++-
.../Exiled.API/Features/Roles/Scp096Role.cs | 2 +-
.../Exiled.API/Features/Roles/Scp106Role.cs | 2 +
.../Exiled.API/Features/Roles/Scp1507Role.cs | 2 +-
.../Exiled.API/Features/Roles/Scp173Role.cs | 5 +-
.../Exiled.API/Features/Roles/Scp3114Role.cs | 1 +
.../Exiled.API/Features/Roles/Scp939Role.cs | 2 +-
.../Features/Roles/SpectatorRole.cs | 3 +-
EXILED/Exiled.API/Features/Room.cs | 14 ++++-
EXILED/Exiled.API/Features/Round.cs | 2 +-
EXILED/Exiled.API/Features/Scp3114Ragdoll.cs | 3 +-
EXILED/Exiled.API/Features/Scp559.cs | 2 +
EXILED/Exiled.API/Features/Scp914.cs | 4 +-
EXILED/Exiled.API/Features/Scp956.cs | 1 +
EXILED/Exiled.API/Features/Server.cs | 2 -
.../Features/Spawn/LockerSpawnPoint.cs | 4 +-
.../Features/Spawn/RoomSpawnPoint.cs | 2 +-
.../Features/Spawn/SpawnLocation.cs | 3 +-
.../Exiled.API/Features/Spawn/SpawnPoint.cs | 1 +
EXILED/Exiled.API/Features/TeslaGate.cs | 8 ++-
EXILED/Exiled.API/Features/Toys/AdminToy.cs | 3 +
EXILED/Exiled.API/Features/Toys/Light.cs | 1 +
EXILED/Exiled.API/Features/Toys/Primitive.cs | 55 ++++++++++---------
.../Features/Toys/ShootingTargetToy.cs | 1 +
EXILED/Exiled.API/Features/Toys/Speaker.cs | 2 +-
EXILED/Exiled.API/Features/Toys/Text.cs | 2 +-
EXILED/Exiled.API/Features/Toys/Waypoint.cs | 2 +-
EXILED/Exiled.API/Features/Warhead.cs | 10 +++-
EXILED/Exiled.API/Features/Waves/TimedWave.cs | 8 ++-
EXILED/Exiled.API/Features/Waves/WaveTimer.cs | 2 -
EXILED/Exiled.API/Features/Window.cs | 3 +
EXILED/Exiled.API/Features/Workstation.cs | 4 +-
.../Interfaces/Audio/IAudioFilter.cs | 2 +-
.../Interfaces/Audio/ILiveSource.cs | 2 +-
.../Exiled.API/Interfaces/Audio/IPcmSource.cs | 2 +-
EXILED/Exiled.API/Interfaces/IPosition.cs | 2 +-
EXILED/Exiled.API/Interfaces/IRotation.cs | 2 +-
EXILED/Exiled.API/Interfaces/IWorldSpace.cs | 2 +-
.../Interfaces/Keycards/ILabelKeycard.cs | 1 +
EXILED/Exiled.API/Structs/Audio/TrackData.cs | 2 +-
.../Exiled.API/Structs/PrimitiveSettings.cs | 1 +
EXILED/Exiled.CreditTags/Enums/InfoSide.cs | 2 +-
.../Events/CreditsHandler.cs | 1 +
.../Features/DatabaseHandler.cs | 3 +-
.../Features/ThreadSafeRequest.cs | 2 +
.../API/EventArgs/OwnerEscapingEventArgs.cs | 7 ---
.../API/Features/CustomArmor.cs | 1 +
.../API/Features/CustomGoggles.cs | 2 +-
.../API/Features/CustomGrenade.cs | 5 +-
.../API/Features/CustomItem.cs | 9 ++-
.../API/Features/CustomKeycard.cs | 2 +
.../API/Features/CustomWeapon.cs | 2 +-
EXILED/Exiled.CustomItems/Commands/Give.cs | 4 +-
EXILED/Exiled.CustomItems/Commands/Main.cs | 2 +-
.../Exiled.CustomItems/Events/MapHandler.cs | 1 +
.../Patches/PlayerInventorySee.cs | 2 +-
EXILED/Exiled.CustomRoles/API/Extensions.cs | 2 +-
.../API/Features/ActiveAbility.cs | 2 +-
.../API/Features/CustomAbility.cs | 8 +--
.../API/Features/CustomRole.cs | 11 ++--
...nType.cs => AbilityKeypressTriggerType.cs} | 2 +-
.../API/Features/Enums/CheckType.cs | 2 +-
EXILED/Exiled.CustomRoles/Commands/Get.cs | 2 +-
EXILED/Exiled.CustomRoles/Commands/Parent.cs | 2 +-
EXILED/Exiled.CustomRoles/CustomRoles.cs | 2 +-
.../Events/PlayerHandlers.cs | 1 -
EXILED/Exiled.Events/Commands/Config/Merge.cs | 9 +--
EXILED/Exiled.Events/Commands/Config/Split.cs | 9 +--
.../Commands/PluginManager/Disable.cs | 4 +-
.../Commands/PluginManager/Enable.cs | 6 +-
.../Commands/PluginManager/PluginManager.cs | 2 +-
.../Commands/PluginManager/Show.cs | 5 +-
.../Exiled.Events/Commands/Reload/Configs.cs | 5 +-
.../Commands/Reload/Translations.cs | 3 +-
EXILED/Exiled.Events/Commands/TpsCommand.cs | 3 +-
EXILED/Exiled.Events/Config.cs | 4 +-
.../Cassie/SendingCassieMessageEventArgs.cs | 3 +
.../EventArgs/Interfaces/IAttackerEvent.cs | 4 +-
.../EventArgs/Interfaces/ICameraEvent.cs | 2 +-
.../EventArgs/Interfaces/IConsumableEvent.cs | 2 +-
.../EventArgs/Interfaces/IFirearmEvent.cs | 2 +-
.../EventArgs/Interfaces/IGeneratorEvent.cs | 2 +-
.../EventArgs/Interfaces/IItemEvent.cs | 2 +-
.../EventArgs/Interfaces/IMicroHIDEvent.cs | 2 +-
.../EventArgs/Interfaces/IPlayerEvent.cs | 2 +-
.../EventArgs/Interfaces/IRagdollEvent.cs | 2 +-
.../EventArgs/Interfaces/IRoomEvent.cs | 2 +-
.../EventArgs/Interfaces/ITeslaEvent.cs | 2 +-
.../EventArgs/Item/CacklingEventArgs.cs | 1 +
.../EventArgs/Item/ChangingAmmoEventArgs.cs | 2 +-
.../Item/ChangingAttachmentsEventArgs.cs | 7 +--
.../ChangingMicroHIDPickupStateEventArgs.cs | 1 +
.../Item/ChargingJailbirdEventArgs.cs | 2 +-
.../Item/DisruptorFiringEventArgs.cs | 3 +-
.../EventArgs/Item/InspectedItemEventArgs.cs | 3 +-
.../EventArgs/Item/InspectingItemEventArgs.cs | 3 +-
.../Item/JailbirdChangedWearStateEventArgs.cs | 3 +-
.../JailbirdChangingWearStateEventArgs.cs | 3 +-
.../Item/JailbirdChargeCompleteEventArgs.cs | 2 +-
.../Item/KeycardInteractingEventArgs.cs | 1 +
.../EventArgs/Item/PunchingEventArgs.cs | 1 +
.../Item/ReceivingPreferenceEventArgs.cs | 5 +-
.../EventArgs/Item/SwingingEventArgs.cs | 2 +-
.../Map/AnnouncingChaosEntranceEventArgs.cs | 3 +-
.../Map/AnnouncingNtfEntranceEventArgs.cs | 2 +
.../Map/AnnouncingScpTerminationEventArgs.cs | 7 ++-
.../Map/ChangedIntoGrenadeEventArgs.cs | 3 +-
.../Map/ElevatorSequencesUpdatedEventArgs.cs | 3 +-
.../EventArgs/Map/FillingLockerEventArgs.cs | 2 +
.../EventArgs/Map/GeneratingEventArgs.cs | 3 +-
.../Map/GeneratorActivatingEventArgs.cs | 2 +-
.../EventArgs/Map/PickupAddedEventArgs.cs | 3 +-
.../EventArgs/Map/PickupDestroyedEventArgs.cs | 3 +-
.../Map/PlacingBulletHoleEventArgs.cs | 3 +-
...acingPickupIntoPocketDimensionEventArgs.cs | 1 +
.../EventArgs/Map/Scp244SpawningEventArgs.cs | 5 +-
.../EventArgs/Map/SpawningItemEventArgs.cs | 2 +
.../Map/SpawningRoomConnectorEventArgs.cs | 3 +-
.../Map/SpawningTeamVehicleEventArgs.cs | 2 +-
.../Player/ActivatingGeneratorEventArgs.cs | 2 +-
.../Player/ActivatingWarheadPanelEventArgs.cs | 2 +-
.../Player/ActivatingWorkstationEventArgs.cs | 2 +-
.../Player/AimingDownSightEventArgs.cs | 4 +-
.../EventArgs/Player/BannedEventArgs.cs | 2 +-
.../EventArgs/Player/BanningEventArgs.cs | 3 +-
.../Player/CancelledItemUseEventArgs.cs | 3 +-
.../Player/CancellingItemUseEventArgs.cs | 3 +-
.../Player/ChangedEmotionEventArgs.cs | 1 +
.../EventArgs/Player/ChangedItemEventArgs.cs | 6 +-
.../EventArgs/Player/ChangedRatioEventArgs.cs | 2 +-
.../Player/ChangingDangerStateEventArgs.cs | 1 +
.../Player/ChangingDisruptorModeEventArgs.cs | 3 +-
.../Player/ChangingEmotionEventArgs.cs | 1 +
.../Player/ChangingGroupEventArgs.cs | 2 +-
.../EventArgs/Player/ChangingItemEventArgs.cs | 4 +-
.../Player/ChangingMicroHIDStateEventArgs.cs | 6 +-
.../Player/ChangingMoveStateEventArgs.cs | 2 +-
.../Player/ChangingRadioPresetEventArgs.cs | 3 +-
.../EventArgs/Player/ChangingRoleEventArgs.cs | 8 ++-
.../ChangingSpectatedPlayerEventArgs.cs | 2 +-
.../Player/ClosingGeneratorEventArgs.cs | 5 +-
.../Player/ConsumingItemEventArgs.cs | 6 +-
.../EventArgs/Player/DamagingDoorEventArgs.cs | 3 +
.../Player/DamagingShootingTargetEventArgs.cs | 6 +-
.../Player/DamagingWindowEventArgs.cs | 10 ++--
.../DeactivatingWorkstationEventArgs.cs | 2 +-
.../EventArgs/Player/DestroyingEventArgs.cs | 4 +-
.../EventArgs/Player/DiedEventArgs.cs | 4 +-
.../EventArgs/Player/DroppedAmmoEventArgs.cs | 7 ++-
.../EventArgs/Player/DroppedItemEventArgs.cs | 4 +-
.../EventArgs/Player/DroppingAmmoEventArgs.cs | 7 ++-
.../EventArgs/Player/DroppingItemEventArgs.cs | 4 +-
.../Player/DroppingNothingEventArgs.cs | 2 +-
.../Player/DryfiringWeaponEventArgs.cs | 4 +-
.../EventArgs/Player/DyingEventArgs.cs | 8 +--
.../Player/EarningAchievementEventArgs.cs | 2 +
.../EnteringEnvironmentalHazardEventArgs.cs | 2 +
.../EnteringKillerCollisionEventArgs.cs | 2 +-
.../EnteringPocketDimensionEventArgs.cs | 2 +-
.../EventArgs/Player/EscapingEventArgs.cs | 5 +-
.../EscapingPocketDimensionEventArgs.cs | 2 +-
.../ExitingEnvironmentalHazardEventArgs.cs | 2 +
.../Player/ExplodingMicroHIDEventArgs.cs | 1 +
.../FailingEscapePocketDimensionEventArgs.cs | 4 +-
.../EventArgs/Player/FlippingCoinEventArgs.cs | 6 +-
.../EventArgs/Player/HandcuffingEventArgs.cs | 2 +-
.../EventArgs/Player/HitEventArgs.cs | 6 +-
.../EventArgs/Player/HurtEventArgs.cs | 4 +-
.../EventArgs/Player/HurtingEventArgs.cs | 6 +-
.../EventArgs/Player/InteractedEventArgs.cs | 2 +-
.../Player/InteractingDoorEventArgs.cs | 6 +-
.../InteractingEmergencyButtonEventArgs.cs | 3 +-
.../Player/InteractingLockerEventArgs.cs | 3 +-
.../InteractingShootingTargetEventArgs.cs | 6 +-
.../Player/IntercomSpeakingEventArgs.cs | 2 +-
.../EventArgs/Player/IssuingMuteEventArgs.cs | 2 +-
.../EventArgs/Player/JoinedEventArgs.cs | 2 +-
.../EventArgs/Player/JumpingEventArgs.cs | 2 +-
.../EventArgs/Player/KickedEventArgs.cs | 2 +-
.../EventArgs/Player/KickingEventArgs.cs | 4 +-
.../EventArgs/Player/LandingEventArgs.cs | 2 +-
.../EventArgs/Player/LeftEventArgs.cs | 2 +-
.../EventArgs/Player/MakingNoiseEventArgs.cs | 2 +-
.../Player/MicroHIDOpeningDoorEventArgs.cs | 1 +
.../Player/OpeningGeneratorEventArgs.cs | 2 +-
.../Player/PickingUpItemEventArgs.cs | 2 +-
.../Player/PlayingAudioLogEventArgs.cs | 2 +-
.../Player/ReceivingEffectEventArgs.cs | 4 +-
.../Player/ReceivingGunSoundEventArgs.cs | 7 +--
.../Player/ReceivingVoiceMessageEventArgs.cs | 4 +-
.../Player/ReloadedWeaponEventArgs.cs | 4 +-
.../Player/ReloadingWeaponEventArgs.cs | 6 +-
.../Player/RemovedHandcuffsEventArgs.cs | 6 +-
.../Player/RemovingHandcuffsEventArgs.cs | 4 +-
.../Player/ReservedSlotsCheckEventArgs.cs | 2 +-
.../EventArgs/Player/RevokingMuteEventArgs.cs | 2 +-
.../EventArgs/Player/RoomChangedEventArgs.cs | 2 +-
.../Player/RotatingRevolverEventArgs.cs | 8 +--
.../Player/SavingByAntiScp207EventArgs.cs | 3 +-
.../Scp1576TransmissionEndedEventArgs.cs | 8 ++-
.../SendingAdminChatMessageEventsArgs.cs | 6 +-
.../Player/SendingGunSoundEventArgs.cs | 7 +--
.../Player/SendingValidCommandEventArgs.cs | 6 +-
.../Player/SentValidCommandEventArgs.cs | 6 +-
.../EventArgs/Player/ShootingEventArgs.cs | 5 +-
.../EventArgs/Player/ShotEventArgs.cs | 7 ++-
.../EventArgs/Player/SpawnedEventArgs.cs | 2 +-
.../Player/SpawnedRagdollEventArgs.cs | 5 +-
.../EventArgs/Player/SpawningEventArgs.cs | 4 +-
.../Player/SpawningRagdollEventArgs.cs | 6 +-
.../StayingOnEnvironmentalHazardEventArgs.cs | 2 +
.../Player/StoppingGeneratorEventArgs.cs | 3 +-
.../Player/ThrowingRequestEventArgs.cs | 2 +-
.../Player/ThrownProjectileEventArgs.cs | 2 +-
.../Player/TogglingFlashlightEventArgs.cs | 5 +-
.../Player/TogglingNoClipEventArgs.cs | 2 +-
.../Player/TogglingRadioEventArgs.cs | 7 ++-
.../TogglingWeaponFlashlightEventArgs.cs | 4 +-
.../Player/TriggeringTeslaEventArgs.cs | 2 +-
.../Player/UnloadedWeaponEventArgs.cs | 4 +-
.../Player/UnloadingWeaponEventArgs.cs | 6 +-
.../Player/UnlockingGeneratorEventArgs.cs | 2 +-
.../EventArgs/Player/UsedItemEventArgs.cs | 4 +-
.../Player/UsingItemCompletedEventArgs.cs | 3 +-
.../EventArgs/Player/UsingItemEventArgs.cs | 3 +-
.../Player/UsingMicroHIDEnergyEventArgs.cs | 4 +-
.../Player/UsingRadioBatteryEventArgs.cs | 4 +-
.../EventArgs/Player/VerifiedEventArgs.cs | 2 +-
.../Player/VoiceChattingEventArgs.cs | 2 +-
.../Scp049/ActivatingSenseEventArgs.cs | 4 +-
.../Scp049/FinishingRecallEventArgs.cs | 4 +-
.../Scp049/FinishingSenseEventArgs.cs | 2 +-
.../EventArgs/Scp049/SendingCallEventArgs.cs | 3 +-
.../Scp049/StartingRecallEventArgs.cs | 5 +-
.../Scp0492/ConsumedCorpseEventArgs.cs | 5 +-
.../Scp0492/ConsumingCorpseEventArgs.cs | 3 +-
.../Scp079/ChangingSpeakerStatusEventArgs.cs | 2 +-
.../Scp079/GainingExperienceEventArgs.cs | 3 +-
.../EventArgs/Scp079/GainingLevelEventArgs.cs | 3 +-
.../EventArgs/Scp079/LosingSignalEventArgs.cs | 2 +-
.../EventArgs/Scp079/LostSignalEventArgs.cs | 2 +-
.../EventArgs/Scp079/PingingEventArgs.cs | 4 +-
.../EventArgs/Scp079/RecontainedEventArgs.cs | 5 +-
.../EventArgs/Scp079/RecontainingEventArgs.cs | 2 +-
.../EventArgs/Scp079/RoomBlackoutEventArgs.cs | 1 -
.../Scp079/TriggeringDoorEventArgs.cs | 3 +-
.../EventArgs/Scp079/ZoneBlackoutEventArgs.cs | 6 +-
.../EventArgs/Scp096/AddingTargetEventArgs.cs | 2 +-
.../EventArgs/Scp096/CalmingDownEventArgs.cs | 2 +-
.../EventArgs/Scp096/ChargingEventArgs.cs | 3 +-
.../EventArgs/Scp096/EnragingEventArgs.cs | 3 +-
.../Scp096/RemovingTargetEventArgs.cs | 4 +-
.../Scp096/StartPryingGateEventArgs.cs | 5 +-
.../Scp096/TryingNotToCryEventArgs.cs | 4 +-
.../EventArgs/Scp106/ExitStalkingEventArgs.cs | 3 +-
.../EventArgs/Scp106/StalkingEventArgs.cs | 4 +-
.../EventArgs/Scp106/TeleportingEventArgs.cs | 3 +-
.../Scp127/GainedExperienceEventArgs.cs | 1 +
.../Scp127/GainingExperienceEventArgs.cs | 3 +-
.../EventArgs/Scp127/TalkedEventArgs.cs | 3 +-
.../EventArgs/Scp127/TalkingEventArgs.cs | 1 +
.../Scp1344/ChangedStatusEventArgs.cs | 2 +-
.../Scp1344/ChangingStatusEventArgs.cs | 3 +-
.../EventArgs/Scp1344/DeactivatedEventArgs.cs | 2 +-
.../Scp1344/DeactivatingEventArgs.cs | 2 +-
.../Scp1507/AttackingDoorEventArgs.cs | 1 +
.../Scp1507/SpawningFlamingosEventArgs.cs | 4 +-
.../EventArgs/Scp1507/UsingTapeEventArgs.cs | 1 +
.../Scp1509/ResurrectingEventArgs.cs | 4 +-
.../Scp1509/TriggeringAttackEventArgs.cs | 3 +-
.../Scp173/AddingObserverEventArgs.cs | 1 +
.../Scp173/BeingObservedEventArgs.cs | 2 +-
.../EventArgs/Scp173/BlinkingEventArgs.cs | 4 +-
.../Scp173/BlinkingRequestEventArgs.cs | 7 ++-
.../Scp173/PlacingTantrumEventArgs.cs | 1 +
.../Scp173/RemovedObserverEventArgs.cs | 1 +
.../Scp173/UsingBreakneckSpeedsEventArgs.cs | 5 +-
.../Scp244/OpeningScp244EventArgs.cs | 2 +-
.../EventArgs/Scp244/UsingScp244EventArgs.cs | 6 +-
.../Scp2536/FindingPositionEventArgs.cs | 1 +
.../Scp2536/FoundPositionEventArgs.cs | 3 +-
.../Scp2536/GrantingGiftEventArgs.cs | 1 +
.../EventArgs/Scp2536/OpeningGiftEventArgs.cs | 1 -
.../EventArgs/Scp3114/DancingEventArgs.cs | 1 -
.../EventArgs/Scp3114/DisguisedEventArgs.cs | 3 +-
.../EventArgs/Scp3114/DisguisingEventArgs.cs | 3 +-
.../EventArgs/Scp3114/RevealedEventArgs.cs | 3 +-
.../EventArgs/Scp3114/RevealingEventArgs.cs | 3 +-
.../EventArgs/Scp3114/SlappedEventArgs.cs | 4 +-
.../EventArgs/Scp3114/StranglingEventArgs.cs | 6 +-
.../EventArgs/Scp3114/TryUseBodyEventArgs.cs | 3 +-
.../EventArgs/Scp3114/VoiceLinesEventArgs.cs | 3 +-
.../Scp330/DroppingScp330EventArgs.cs | 4 +-
.../EventArgs/Scp330/EatenScp330EventArgs.cs | 3 +-
.../EventArgs/Scp330/EatingScp330EventArgs.cs | 3 +-
.../Scp330/InteractingScp330EventArgs.cs | 8 ++-
.../EventArgs/Scp559/SpawningEventArgs.cs | 1 +
.../EventArgs/Scp914/ActivatingEventArgs.cs | 2 +-
.../Scp914/ChangingKnobSettingEventArgs.cs | 2 +-
.../Scp914/UpgradedInventoryItemEventArgs.cs | 8 ++-
.../Scp914/UpgradedPickupEventArgs.cs | 3 +
.../Scp914/UpgradingInventoryItemEventArgs.cs | 7 ++-
.../Scp914/UpgradingPickupEventArgs.cs | 3 +
.../Scp914/UpgradingPlayerEventArgs.cs | 2 +-
.../Scp939/ChangingFocusEventArgs.cs | 3 +-
.../EventArgs/Scp939/ClawedEventArgs.cs | 2 +-
.../EventArgs/Scp939/LungingEventArgs.cs | 6 +-
.../Scp939/PlacedAmnesticCloudEventArgs.cs | 6 +-
.../Scp939/PlacingAmnesticCloudEventArgs.cs | 3 +-
.../Scp939/PlacingMimicPointEventArgs.cs | 1 +
.../Scp939/PlayingFootstepEventArgs.cs | 6 +-
.../EventArgs/Scp939/PlayingSoundEventArgs.cs | 4 +-
.../EventArgs/Scp939/PlayingVoiceEventArgs.cs | 3 +-
.../EventArgs/Scp939/SavingVoiceEventArgs.cs | 3 +-
.../Scp939/UpdatedCloudStateEventArgs.cs | 5 +-
.../Scp939/ValidatingVisibilityEventArgs.cs | 10 ++--
.../Server/ChoosingStartTeamQueueEventArgs.cs | 2 +
.../Server/CompletingObjectiveEventArgs.cs | 3 +-
.../EventArgs/Server/EndingRoundEventArgs.cs | 3 +-
.../Server/LocalReportingEventArgs.cs | 2 +-
.../Server/ReportingCheaterEventArgs.cs | 2 +-
.../Server/RespawnedTeamEventArgs.cs | 4 +-
.../Server/RespawningTeamEventArgs.cs | 6 +-
.../EventArgs/Server/RoundEndedEventArgs.cs | 2 +-
.../Server/RoundStartingEventArgs.cs | 8 +--
.../Server/SelectingRespawnTeamEventArgs.cs | 1 +
.../Warhead/ChangingLeverStatusEventArgs.cs | 2 +-
.../DeadmanSwitchInitiatingEventArgs.cs | 2 +-
.../EventArgs/Warhead/DetonatingEventArgs.cs | 2 +-
.../EventArgs/Warhead/StoppingEventArgs.cs | 2 +-
EXILED/Exiled.Events/Events.cs | 18 +++---
EXILED/Exiled.Events/Exiled.Events.csproj | 2 +-
EXILED/Exiled.Events/Features/Event.cs | 43 +++++++--------
EXILED/Exiled.Events/Features/Event{T}.cs | 43 +++++++--------
EXILED/Exiled.Events/Features/Patcher.cs | 3 +-
.../Handlers/Internal/AdminToyList.cs | 2 +-
.../Handlers/Internal/ClientStarted.cs | 3 +
.../Handlers/Internal/ExplodingGrenade.cs | 3 +-
.../Handlers/Internal/MapGenerated.cs | 4 +-
.../Handlers/Internal/PickupEvent.cs | 3 +-
.../Handlers/Internal/RagdollList.cs | 2 +-
.../Exiled.Events/Handlers/Internal/Round.cs | 9 ++-
.../Handlers/Internal/SceneUnloaded.cs | 4 +-
EXILED/Exiled.Events/Handlers/Item.cs | 2 +-
EXILED/Exiled.Events/Handlers/Player.cs | 7 +--
EXILED/Exiled.Events/Handlers/Scp049.cs | 2 +-
EXILED/Exiled.Events/Handlers/Scp0492.cs | 4 +-
EXILED/Exiled.Events/Handlers/Scp127.cs | 1 +
EXILED/Exiled.Events/Handlers/Scp1344.cs | 2 +-
EXILED/Exiled.Events/Handlers/Scp173.cs | 2 +-
EXILED/Exiled.Events/Handlers/Server.cs | 3 +-
.../Events/Cassie/SendingCassieMessage.cs | 7 ++-
.../Patches/Events/Item/Cackling.cs | 3 +-
.../Patches/Events/Item/ChangingAmmo.cs | 9 ---
.../Events/Item/ChangingAttachments.cs | 6 +-
.../Patches/Events/Item/DisruptorFiring.cs | 5 +-
.../Patches/Events/Item/Inspect.cs | 4 +-
.../Patches/Events/Item/JailbirdPatch.cs | 53 ++++++++++--------
.../Patches/Events/Item/JailbirdWearState.cs | 2 +
.../Patches/Events/Item/KeycardInteracting.cs | 8 ++-
.../Patches/Events/Item/Punching.cs | 3 +-
.../Events/Item/ReceivingPreference.cs | 2 +-
.../Events/Item/UsingRadioPickupBattery.cs | 2 +
.../Events/Map/AnnouncingChaosEntrance.cs | 5 +-
.../Events/Map/AnnouncingDecontamination.cs | 4 +-
.../Events/Map/AnnouncingNtfEntrance.cs | 8 ++-
.../Events/Map/AnnouncingNtfMiniEntrance.cs | 8 ++-
.../Events/Map/AnnouncingScpTermination.cs | 8 ++-
.../Patches/Events/Map/BreakingScp2176.cs | 8 ++-
.../Patches/Events/Map/ChangingIntoGrenade.cs | 2 +-
.../Patches/Events/Map/Decontaminating.cs | 4 +-
.../Events/Map/ElevatorSequencesUpdated.cs | 4 +-
.../Events/Map/ExplodingFlashGrenade.cs | 7 ++-
.../Events/Map/ExplodingFragGrenade.cs | 5 +-
.../Patches/Events/Map/FillingLocker.cs | 2 +-
.../Patches/Events/Map/Generating.cs | 10 +++-
.../Patches/Events/Map/GeneratorActivating.cs | 2 +-
.../Patches/Events/Map/PlacingBulletHole.cs | 8 ++-
.../Map/PlacingPickupIntoPocketDimension.cs | 7 ++-
.../Patches/Events/Map/Scp244Spawning.cs | 7 ++-
.../Patches/Events/Map/SpawningItem.cs | 6 +-
.../Events/Map/SpawningRoomConnector.cs | 2 +
.../Patches/Events/Map/TurningOffLights.cs | 2 +-
.../Events/Player/ActivatingWarheadPanel.cs | 8 ++-
.../Events/Player/ActivatingWorkstation.cs | 5 +-
.../Patches/Events/Player/Aiming.cs | 5 +-
.../Patches/Events/Player/Banned.cs | 4 +-
.../Patches/Events/Player/Banning.cs | 5 +-
.../Events/Player/ChangedAspectRatio.cs | 7 ++-
.../Patches/Events/Player/ChangedItem.cs | 6 +-
.../Patches/Events/Player/ChangedRoom.cs | 6 +-
.../Events/Player/ChangingDangerState.cs | 2 +
.../Events/Player/ChangingDisruptorMode.cs | 4 +-
.../Patches/Events/Player/ChangingGroup.cs | 6 +-
.../Patches/Events/Player/ChangingItem.cs | 6 +-
.../Events/Player/ChangingMicroHIDState.cs | 8 +--
.../Events/Player/ChangingMoveState.cs | 2 +-
.../Events/Player/ChangingRadioPreset.cs | 6 +-
.../Events/Player/ChangingRoleAndSpawned.cs | 18 +++---
.../Player/ChangingSpectatedPlayerPatch.cs | 3 +-
.../Patches/Events/Player/ConsumingItem.cs | 2 +-
.../Patches/Events/Player/DamagingDoor.cs | 6 +-
.../Events/Player/DamagingShootingTarget.cs | 4 +-
.../Patches/Events/Player/DamagingWindow.cs | 4 +-
.../Events/Player/DeactivatingWorkstation.cs | 2 +-
.../Patches/Events/Player/Destroying.cs | 4 +-
.../Patches/Events/Player/DrinkingCoffee.cs | 1 +
.../Patches/Events/Player/DroppingAmmo.cs | 4 +-
.../Patches/Events/Player/DroppingItem.cs | 2 +-
.../Patches/Events/Player/DryFire.cs | 4 +-
.../Patches/Events/Player/DyingAndDied.cs | 8 +--
.../Events/Player/EarningAchievement.cs | 6 +-
.../Patches/Events/Player/Emotion.cs | 6 +-
.../Events/Player/EnteringKillerCollision.cs | 2 +-
.../Events/Player/EnteringPocketDimension.cs | 4 +-
.../EnteringSinkholeEnvironmentalHazard.cs | 2 +-
.../EnteringTantrumEnvironmentalHazard.cs | 2 +-
.../Events/Player/EscapingAndEscaped.cs | 7 ++-
.../Events/Player/EscapingPocketDimension.cs | 7 +--
.../ExitingSinkholeEnvironmentalHazard.cs | 2 +-
.../ExitingTantrumEnvironmentalHazard.cs | 2 +-
.../Events/Player/ExplodingMicroHID.cs | 2 +
.../Player/FailingEscapePocketDimension.cs | 6 +-
.../Patches/Events/Player/FlippingCoin.cs | 8 ++-
.../Patches/Events/Player/Healing.cs | 4 +-
.../Patches/Events/Player/Hit.cs | 11 ++--
.../Patches/Events/Player/Hurting.cs | 5 +-
.../Patches/Events/Player/Interacted.cs | 7 ++-
.../Patches/Events/Player/InteractingDoor.cs | 9 ++-
.../Events/Player/InteractingElevator.cs | 4 +-
.../Player/InteractingEmergencyButton.cs | 4 +-
.../Events/Player/InteractingGenerator.cs | 2 +-
.../Events/Player/InteractingLocker.cs | 8 ++-
.../Player/InteractingShootingTarget.cs | 4 +-
.../Patches/Events/Player/IntercomSpeaking.cs | 5 +-
.../Patches/Events/Player/IssuingMute.cs | 4 +-
.../Patches/Events/Player/Joined.cs | 4 +-
.../Patches/Events/Player/Jumping.cs | 2 +-
.../Patches/Events/Player/Kicked.cs | 4 +-
.../Patches/Events/Player/Kicking.cs | 1 +
.../Patches/Events/Player/Landing.cs | 5 +-
.../Patches/Events/Player/Left.cs | 6 +-
.../Patches/Events/Player/MakingNoise.cs | 2 +
.../Events/Player/MicroHIDOpeningDoor.cs | 4 +-
.../Patches/Events/Player/PickingUp330.cs | 4 +-
.../Patches/Events/Player/PickingUpAmmo.cs | 4 +-
.../Patches/Events/Player/PickingUpArmor.cs | 3 +-
.../Patches/Events/Player/PickingUpItem.cs | 3 +-
.../Patches/Events/Player/PickingUpScp244.cs | 2 +-
.../Patches/Events/Player/PlayingAudioLog.cs | 6 +-
.../Events/Player/PreAuthenticating.cs | 8 +--
.../Events/Player/ProcessDisarmMessage.cs | 6 +-
.../Events/Player/ReceivingGunSound.cs | 2 +-
.../Events/Player/ReceivingStatusEffect.cs | 7 +--
.../Events/Player/ReceivingVoiceMessage.cs | 2 +-
.../Events/Player/ReloadedAndUnloaded.cs | 12 +---
.../Events/Player/ReservedSlotPatch.cs | 2 +-
.../Patches/Events/Player/RevokingMute.cs | 4 +-
.../Patches/Events/Player/RotatingRevolver.cs | 4 +-
.../Events/Player/SavingByAntiScp207.cs | 3 +-
.../Events/Player/Scp1576TransmissionEnded.cs | 46 ++++++++--------
.../Events/Player/SearchingPickupEvent.cs | 6 +-
.../Events/Player/SendingAdminChatMessage.cs | 7 +--
.../Patches/Events/Player/SendingGunSound.cs | 2 +-
.../Player/SendingValidGameConsoleCommand.cs | 10 ++--
.../Events/Player/SendingValidRACommand.cs | 9 ++-
.../Patches/Events/Player/Shooting.cs | 13 +++--
.../Patches/Events/Player/Shot.cs | 8 +--
.../Patches/Events/Player/Spawning.cs | 5 +-
.../Patches/Events/Player/SpawningRagdoll.cs | 5 +-
.../Player/StayingOnEnvironmentalHazard.cs | 12 ++--
.../StayingOnSinkholeEnvironmentalHazard.cs | 12 ++--
.../StayingOnTantrumEnvironmentalHazard.cs | 13 ++---
.../Patches/Events/Player/ThrowingRequest.cs | 5 +-
.../Patches/Events/Player/ThrownProjectile.cs | 5 +-
.../Events/Player/TogglingFlashlight.cs | 5 +-
.../Patches/Events/Player/TogglingNoClip.cs | 5 +-
.../Events/Player/TogglingOverwatch.cs | 3 +-
.../Patches/Events/Player/TogglingRadio.cs | 2 +-
.../Events/Player/TogglingWeaponFlashlight.cs | 1 -
.../Patches/Events/Player/TriggeringTesla.cs | 8 +--
.../Events/Player/UsedItemByHolstering.cs | 7 ++-
.../Player/UsingAndCancellingItemUse.cs | 6 +-
.../Events/Player/UsingItemCompleted.cs | 6 +-
.../Events/Player/UsingMicroHIDEnergy.cs | 6 +-
.../Events/Player/UsingRadioBattery.cs | 3 +-
.../Patches/Events/Player/Verified.cs | 6 +-
.../Patches/Events/Player/VoiceChatting.cs | 2 +-
.../Patches/Events/Scp049/ActivatingSense.cs | 6 +-
.../Patches/Events/Scp049/Attacking.cs | 3 +-
.../Patches/Events/Scp049/FinishingRecall.cs | 4 +-
.../Patches/Events/Scp049/FinishingSense.cs | 5 +-
.../Patches/Events/Scp049/SendingCall.cs | 1 -
.../Patches/Events/Scp049/StartingRecall.cs | 8 ++-
.../Patches/Events/Scp0492/Consumed.cs | 10 ++--
.../Patches/Events/Scp0492/Consuming.cs | 9 ++-
.../Scp0492/TriggeringBloodlustEvent.cs | 2 +-
.../Patches/Events/Scp079/ChangingCamera.cs | 5 +-
.../Events/Scp079/ChangingSpeakerStatus.cs | 4 +-
.../Events/Scp079/ElevatorTeleporting.cs | 5 +-
.../Events/Scp079/GainingExperience.cs | 2 +-
.../Patches/Events/Scp079/GainingLevel.cs | 2 +-
.../Patches/Events/Scp079/InteractingTesla.cs | 2 +-
.../Patches/Events/Scp079/LockingDown.cs | 4 +-
.../Patches/Events/Scp079/Lost.cs | 2 +-
.../Patches/Events/Scp079/Pinging.cs | 10 ++--
.../Patches/Events/Scp079/Recontain.cs | 6 +-
.../Patches/Events/Scp079/Recontaining.cs | 2 +-
.../Patches/Events/Scp079/RoomBlackout.cs | 6 +-
.../Patches/Events/Scp079/TriggeringDoor.cs | 6 +-
.../Patches/Events/Scp079/ZoneBlackout.cs | 3 +-
.../Patches/Events/Scp096/AddingTarget.cs | 4 +-
.../Patches/Events/Scp096/CalmingDown.cs | 4 +-
.../Patches/Events/Scp096/Charging.cs | 4 +-
.../Patches/Events/Scp096/Enraging.cs | 4 +-
.../Patches/Events/Scp096/RemovingTarget.cs | 10 ++--
.../Patches/Events/Scp096/StartPryingGate.cs | 4 +-
.../Patches/Events/Scp096/TryingNotToCry.cs | 4 +-
.../Patches/Events/Scp106/Attacking.cs | 3 +-
.../Patches/Events/Scp106/ExitStalking.cs | 5 +-
.../Patches/Events/Scp106/Stalking.cs | 6 +-
.../Patches/Events/Scp106/Teleporting.cs | 7 ++-
.../Patches/Events/Scp1344/Deactivating.cs | 6 +-
.../Patches/Events/Scp1344/Status.cs | 4 +-
.../Patches/Events/Scp1507/AttackingDoor.cs | 2 +
.../Patches/Events/Scp1507/Scream.cs | 2 +
.../Events/Scp1507/SpawningFlamingos.cs | 2 +
.../Patches/Events/Scp1507/TapeUsing.cs | 2 +
.../Scp1509/InspectingAndTriggeringAttack.cs | 2 +
.../Patches/Events/Scp1509/Resurrecting.cs | 4 +-
.../Patches/Events/Scp173/BeingObserved.cs | 6 +-
.../Patches/Events/Scp173/Blinking.cs | 4 +-
.../Patches/Events/Scp173/BlinkingRequest.cs | 6 +-
.../Patches/Events/Scp173/Observers.cs | 11 ++--
.../Patches/Events/Scp173/PlacingTantrum.cs | 2 +-
.../Events/Scp173/UsingBreakneckSpeeds.cs | 6 +-
.../Patches/Events/Scp244/DamagingScp244.cs | 4 +-
.../Patches/Events/Scp244/UpdateScp244.cs | 2 +-
.../Patches/Events/Scp244/UsingScp244.cs | 3 +-
.../Patches/Events/Scp2536/FindingPosition.cs | 4 +-
.../Patches/Events/Scp2536/FoundPosition.cs | 4 +-
.../Patches/Events/Scp2536/GrantingGift.cs | 2 +
.../Patches/Events/Scp2536/OpeningGift.cs | 2 +
.../Patches/Events/Scp3114/Dancing.cs | 6 +-
.../Patches/Events/Scp3114/Disguising.cs | 2 +-
.../Patches/Events/Scp3114/Slapped.cs | 4 +-
.../Patches/Events/Scp3114/Strangling.cs | 4 +-
.../Patches/Events/Scp3114/TryUseBody.cs | 2 +-
.../Patches/Events/Scp330/DroppingCandy.cs | 8 +--
.../Patches/Events/Scp330/EatingScp330.cs | 2 +-
.../Events/Scp330/InteractingScp330.cs | 11 +---
.../Patches/Events/Scp559/Interacting.cs | 1 +
.../Patches/Events/Scp559/Spawning.cs | 1 +
.../Events/Scp914/InteractingEvents.cs | 5 +-
.../Patches/Events/Scp914/UpgradedPickup.cs | 5 +-
.../Patches/Events/Scp914/UpgradedPlayer.cs | 13 ++---
.../Patches/Events/Scp914/UpgradingPickup.cs | 3 +-
.../Patches/Events/Scp914/UpgradingPlayer.cs | 11 ++--
.../Patches/Events/Scp939/Clawed.cs | 4 +-
.../Patches/Events/Scp939/Focus.cs | 1 +
.../Patches/Events/Scp939/Lunge.cs | 5 +-
.../Events/Scp939/PlacedAmnesticCloud.cs | 2 +
.../Events/Scp939/PlacingAmnesticCloud.cs | 4 +-
.../Events/Scp939/PlacingMimicPoint.cs | 4 +-
.../Patches/Events/Scp939/PlayingFootstep.cs | 3 +-
.../Patches/Events/Scp939/PlayingSound.cs | 6 +-
.../Patches/Events/Scp939/PlayingVoice.cs | 2 +-
.../Patches/Events/Scp939/SavingVoice.cs | 2 +
.../Events/Scp939/ValidatingVisibility.cs | 12 ++--
.../Patches/Events/Server/AddingUnitName.cs | 7 ++-
.../Events/Server/ChoosingStartTeamQueue.cs | 5 +-
.../Events/Server/CompletingObjective.cs | 4 +-
.../Patches/Events/Server/Reporting.cs | 5 +-
.../Patches/Events/Server/RespawningTeam.cs | 8 ++-
.../Patches/Events/Server/RestartingRound.cs | 14 +----
.../Patches/Events/Server/RoundEnd.cs | 1 +
.../Patches/Events/Server/RoundStarting.cs | 6 +-
.../Events/Server/SelectingRespawnTeam.cs | 2 +
.../Patches/Events/Server/Unban.cs | 1 +
.../Events/Server/WaitingForPlayers.cs | 4 +-
.../Events/Warhead/ChangingLeverStatus.cs | 6 +-
.../Events/Warhead/DeadmanSwitchStart.cs | 5 +-
.../Patches/Events/Warhead/Detonation.cs | 5 +-
.../Patches/Events/Warhead/Starting.cs | 5 +-
.../Patches/Events/Warhead/Stopping.cs | 5 +-
.../Fixes/Fix106RegenerationWithScp244.cs | 6 +-
.../Patches/Fixes/Fix1344Dupe.cs | 4 +-
.../Patches/Fixes/FixCapturePosition.cs | 6 +-
.../Patches/Fixes/FixEffectOrder.cs | 11 ++--
.../Patches/Fixes/FixElevatorChamberAwake.cs | 2 +-
.../Patches/Fixes/FixNWFlashbangDuration.cs | 7 +--
.../FixOnAddedBeingCallAfterOnRemoved.cs | 11 ++--
.../Patches/Fixes/FixPickupPreviousOwner.cs | 9 ++-
.../Patches/Fixes/FixScp1507DestroyingDoor.cs | 10 +++-
.../Patches/Fixes/FootprintConstructorFix.cs | 6 +-
.../Patches/Fixes/GetAmmoLimitFix.cs | 9 +--
.../Patches/Fixes/GrenadePropertiesFix.cs | 8 +--
.../Exiled.Events/Patches/Fixes/HurtingFix.cs | 4 +-
.../Patches/Fixes/Jailbird914CoarseFix.cs | 5 +-
.../Exiled.Events/Patches/Fixes/KillPlayer.cs | 6 +-
.../Patches/Fixes/LockerFixes.cs | 2 +-
.../Patches/Fixes/NWFixDetonationTimer.cs | 3 +-
.../Patches/Fixes/NWFixScp096BreakingDoor.cs | 9 ++-
.../Patches/Fixes/NameTagDetailFix.cs | 5 +-
...RemoteAdminNpcCommandAddToDictionaryFix.cs | 7 ++-
.../Patches/Fixes/RoleChangedPatch.cs | 5 +-
.../Patches/Fixes/Scp3114AttackAhpFix.cs | 6 +-
.../Patches/Fixes/Scp3114FriendlyFireFix.cs | 10 ++--
.../Patches/Fixes/ServerHubMicroHidFix.cs | 7 +--
.../Patches/Fixes/ThrownCustomKeycardFix.cs | 5 +-
.../Patches/Fixes/TryRaycastRoomFix.cs | 5 +-
.../Patches/Fixes/VoiceChatMutesClear.cs | 4 +-
.../Patches/Generic/AirlockListAdd.cs | 1 +
.../Patches/Generic/AmmoDrain.cs | 4 --
.../Patches/Generic/CameraList.cs | 2 +-
.../Patches/Generic/CanScp049SenseTutorial.cs | 4 +-
.../Patches/Generic/CoffeeListAdd.cs | 1 +
.../Patches/Generic/CommandLogging.cs | 4 +-
.../Patches/Generic/CurrentHint.cs | 2 +-
.../Generic/DestroyRecontainerInstance.cs | 4 +-
.../Exiled.Events/Patches/Generic/DoorList.cs | 2 +-
.../Patches/Generic/GeneratorList.cs | 4 +-
.../Patches/Generic/GetCustomAmmoLimit.cs | 3 +
.../Patches/Generic/GetCustomCategoryLimit.cs | 5 +-
.../Patches/Generic/GhostModePatch.cs | 10 ++--
.../Patches/Generic/HazardList.cs | 2 +
.../Patches/Generic/IndividualFriendlyFire.cs | 7 +--
.../Generic/InitRecontainerInstance.cs | 4 +-
.../CustomItemNameDetailData.cs | 4 +-
.../KeycardDetails/CustomLabelDetailData.cs | 2 +
.../KeycardDetails/CustomPermsDetailData.cs | 2 +
.../KeycardDetails/CustomRankDetailData.cs | 3 +
.../CustomSerialNumberDetailData.cs | 2 +
.../KeycardDetails/CustomTintDetailData.cs | 2 +
.../KeycardDetails/CustomWearDetailData.cs | 2 +
.../KeycardDetails/NameTagDetailData.cs | 2 +
.../Patches/Generic/LastTarget.cs | 2 +
.../Exiled.Events/Patches/Generic/LiftList.cs | 3 +-
.../Patches/Generic/LockerList.cs | 7 +--
.../Patches/Generic/MapLayoutGetter.cs | 4 +-
.../Patches/Generic/OfflineModeIds.cs | 4 +-
.../Patches/Generic/ParseVisionInformation.cs | 4 +-
.../Patches/Generic/PickupControlPatch.cs | 13 ++---
.../Generic/PocketDimensionTeleportList.cs | 2 +-
.../Exiled.Events/Patches/Generic/RoomList.cs | 2 +-
.../Patches/Generic/RoundTargetCount.cs | 3 +-
.../Patches/Generic/Scp079Recontain.cs | 2 +-
.../Patches/Generic/Scp079Scan.cs | 4 +-
.../Patches/Generic/Scp127MaxHs.cs | 2 +
.../Patches/Generic/Scp173BeingLooked.cs | 2 +-
.../Patches/Generic/Scp559List.cs | 3 +-
.../Patches/Generic/Scp956Capybara.cs | 1 +
.../Generic/SingleUseKeycardRemainingUses.cs | 4 +-
.../Patches/Generic/SpeakerInRoom.cs | 2 +-
.../Patches/Generic/StaminaRegen.cs | 2 +
.../Patches/Generic/StaminaRegenArmor.cs | 2 +-
.../Patches/Generic/StaminaUsage.cs | 2 +
.../Patches/Generic/TeslaList.cs | 2 +-
.../Patches/Generic/WorkstationListAdd.cs | 1 +
EXILED/Exiled.Example/Commands/Test.cs | 1 +
EXILED/Exiled.Example/Events/PlayerHandler.cs | 7 +--
EXILED/Exiled.Example/Exiled.Example.csproj | 2 +-
EXILED/Exiled.Installer/CommandSettings.cs | 20 +++++--
EXILED/Exiled.Installer/Program.cs | 32 ++++++++---
.../Properties/Resources.Designer.cs | 6 +-
EXILED/Exiled.Loader/Config.cs | 5 +-
EXILED/Exiled.Loader/ConfigManager.cs | 12 ++--
.../Configs/CommentsObjectGraphVisitor.cs | 2 +-
.../AttachmentIdentifiersConverter.cs | 2 +-
.../CustomConverters/ColorConverter.cs | 2 +
.../CustomConverters/VectorsConverter.cs | 2 +
.../Configs/TypeAssigningEventEmitter.cs | 2 +-
.../Configs/UnderscoredNamingConvention.cs | 1 +
.../Features/PluginPriorityComparer.cs | 2 +-
EXILED/Exiled.Loader/Loader.cs | 10 ++--
EXILED/Exiled.Loader/LoaderPlugin.cs | 1 +
EXILED/Exiled.Loader/PathExtensions.cs | 2 +-
EXILED/Exiled.Loader/TranslationManager.cs | 12 ++--
EXILED/Exiled.Loader/Updater.cs | 3 +-
EXILED/Exiled.Permissions/Config.cs | 3 +-
.../Extensions/Permissions.cs | 3 +
.../Properties/Resources.Designer.cs | 4 +-
843 files changed, 2170 insertions(+), 1574 deletions(-)
rename EXILED/Exiled.API/Enums/{Scp939VisibilityStates.cs => Scp939VisibilityState.cs} (94%)
rename EXILED/Exiled.CustomRoles/API/Features/Enums/{KeypressActivationType.cs => AbilityKeypressTriggerType.cs} (93%)
diff --git a/EXILED/.editorconfig b/EXILED/.editorconfig
index b64d58c275..e5ab37f77f 100644
--- a/EXILED/.editorconfig
+++ b/EXILED/.editorconfig
@@ -19,10 +19,37 @@ ij_wrap_on_typing = false
csharp_style_var_for_built_in_types = false:error
csharp_style_var_when_type_is_apparent = false:error
csharp_style_var_elsewhere = false:error
+dotnet_diagnostic.IDE0005.severity = warning
+dotnet_diagnostic.IDE0017.severity = warning
+dotnet_diagnostic.IDE0019.severity = warning
+dotnet_diagnostic.IDE0031.severity = warning
+dotnet_diagnostic.IDE0048.severity = warning
+dotnet_diagnostic.IDE0055.severity = warning
+dotnet_diagnostic.IDE0060.severity = warning
+dotnet_diagnostic.IDE0074.severity = warning
+dotnet_diagnostic.IDE0079.severity = warning
+dotnet_diagnostic.IDE0090.severity = warning
+dotnet_diagnostic.IDE0200.severity = warning
+dotnet_diagnostic.IDE0350.severity = warning
+dotnet_diagnostic.IDE0370.severity = warning
+
+dotnet_diagnostic.IDE0028.severity = none
+dotnet_diagnostic.IDE0034.severity = none
+dotnet_diagnostic.IDE0056.severity = none
+dotnet_diagnostic.IDE0057.severity = none
+dotnet_diagnostic.IDE0290.severity = none
+dotnet_diagnostic.IDE0300.severity = none
+dotnet_diagnostic.IDE0301.severity = none
+dotnet_diagnostic.IDE0302.severity = none
+dotnet_diagnostic.IDE0303.severity = none
+dotnet_diagnostic.IDE0304.severity = none
dotnet_diagnostic.IDE0305.severity = none
+dotnet_diagnostic.IDE0306.severity = none
+dotnet_diagnostic.IDE0340.severity = none
-# ReSharper properties
-resharper_csharp_max_line_length = 400
+dotnet_sort_system_directives_first = true
+dotnet_separate_import_directive_groups = true
+csharp_using_directive_placement = inside_namespace
[*.properties]
ij_properties_align_group_field_declarations = false
diff --git a/EXILED/EXILED.props b/EXILED/EXILED.props
index 052935a2c5..9b69d1bb48 100644
--- a/EXILED/EXILED.props
+++ b/EXILED/EXILED.props
@@ -20,7 +20,7 @@
false
2.4.2
- 1.1.118
+ 1.2.0-beta.556
2.0.2
Copyright © $(Authors) 2020 - $([System.DateTime]::Now.ToString("yyyy"))
@@ -35,6 +35,7 @@
True
True
+ True
Portable
diff --git a/EXILED/Exiled.API/Enums/AmmoType.cs b/EXILED/Exiled.API/Enums/AmmoType.cs
index 506d3067de..5a9b19f74a 100644
--- a/EXILED/Exiled.API/Enums/AmmoType.cs
+++ b/EXILED/Exiled.API/Enums/AmmoType.cs
@@ -40,13 +40,13 @@ public enum AmmoType
///
/// 12 gauge shotgun ammo.
- /// Used by
+ /// Used by .
///
Ammo12Gauge,
///
/// 44 Caliber Revolver Ammo
- /// Used by
+ /// Used by .
///
Ammo44Cal,
}
diff --git a/EXILED/Exiled.API/Enums/AspectRatioType.cs b/EXILED/Exiled.API/Enums/AspectRatioType.cs
index 79e4f4c96e..65d6005749 100644
--- a/EXILED/Exiled.API/Enums/AspectRatioType.cs
+++ b/EXILED/Exiled.API/Enums/AspectRatioType.cs
@@ -57,4 +57,4 @@ public enum AspectRatioType : byte
///
Ratio32_9,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/CameraType.cs b/EXILED/Exiled.API/Enums/CameraType.cs
index 292da90b2d..eb18b59633 100644
--- a/EXILED/Exiled.API/Enums/CameraType.cs
+++ b/EXILED/Exiled.API/Enums/CameraType.cs
@@ -166,4 +166,4 @@ public enum CameraType
HczLoadingBayStairwell,
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/DamageType.cs b/EXILED/Exiled.API/Enums/DamageType.cs
index bb6f2524d5..28c399b4e3 100644
--- a/EXILED/Exiled.API/Enums/DamageType.cs
+++ b/EXILED/Exiled.API/Enums/DamageType.cs
@@ -240,7 +240,7 @@ public enum DamageType
A7,
///
- /// Damage caused by
+ /// Damage caused by .
///
Scp3114,
@@ -289,4 +289,4 @@ public enum DamageType
///
Scp1509,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/DanceType.cs b/EXILED/Exiled.API/Enums/DanceType.cs
index 685c01ed00..94f5eaac16 100644
--- a/EXILED/Exiled.API/Enums/DanceType.cs
+++ b/EXILED/Exiled.API/Enums/DanceType.cs
@@ -48,7 +48,7 @@ public enum DanceType : byte
Swing,
///
- /// Dance1
+ /// None.
///
None = byte.MaxValue,
}
diff --git a/EXILED/Exiled.API/Enums/DecontaminationState.cs b/EXILED/Exiled.API/Enums/DecontaminationState.cs
index c415a6750e..d821f75a5d 100644
--- a/EXILED/Exiled.API/Enums/DecontaminationState.cs
+++ b/EXILED/Exiled.API/Enums/DecontaminationState.cs
@@ -7,8 +7,6 @@
namespace Exiled.API.Enums
{
- using System;
-
using Features;
///
@@ -57,4 +55,4 @@ public enum DecontaminationState
///
Finish,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/DoorLockType.cs b/EXILED/Exiled.API/Enums/DoorLockType.cs
index b876c24c11..28b5e5447f 100644
--- a/EXILED/Exiled.API/Enums/DoorLockType.cs
+++ b/EXILED/Exiled.API/Enums/DoorLockType.cs
@@ -74,4 +74,4 @@ public enum DoorLockType
///
Lockdown2176 = 512,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/DoorType.cs b/EXILED/Exiled.API/Enums/DoorType.cs
index 5e99c32a22..2df0eb8973 100644
--- a/EXILED/Exiled.API/Enums/DoorType.cs
+++ b/EXILED/Exiled.API/Enums/DoorType.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Enums
using System;
using Exiled.API.Features.Doors;
+
using Interactables.Interobjects;
///
diff --git a/EXILED/Exiled.API/Enums/EffectCategory.cs b/EXILED/Exiled.API/Enums/EffectCategory.cs
index c340fca101..cb8af3a988 100644
--- a/EXILED/Exiled.API/Enums/EffectCategory.cs
+++ b/EXILED/Exiled.API/Enums/EffectCategory.cs
@@ -39,4 +39,4 @@ public enum EffectCategory
///
Harmful = 8,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/EffectType.cs b/EXILED/Exiled.API/Enums/EffectType.cs
index 8d1157e0c6..0d2117d223 100644
--- a/EXILED/Exiled.API/Enums/EffectType.cs
+++ b/EXILED/Exiled.API/Enums/EffectType.cs
@@ -406,4 +406,4 @@ public enum EffectType
///
AnomalousTarget,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/FirearmType.cs b/EXILED/Exiled.API/Enums/FirearmType.cs
index 05cccf2388..7992265e71 100644
--- a/EXILED/Exiled.API/Enums/FirearmType.cs
+++ b/EXILED/Exiled.API/Enums/FirearmType.cs
@@ -95,4 +95,4 @@ public enum FirearmType
///
Scp127,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/GlassType.cs b/EXILED/Exiled.API/Enums/GlassType.cs
index fef4d59f44..70056bf02c 100644
--- a/EXILED/Exiled.API/Enums/GlassType.cs
+++ b/EXILED/Exiled.API/Enums/GlassType.cs
@@ -86,7 +86,7 @@ public enum GlassType
GateAArmory,
///
- /// Represents the window in
+ /// Represents the window in .
///
HczLoadingBay,
}
diff --git a/EXILED/Exiled.API/Enums/HazardType.cs b/EXILED/Exiled.API/Enums/HazardType.cs
index 43d16dac41..f13dc69d60 100644
--- a/EXILED/Exiled.API/Enums/HazardType.cs
+++ b/EXILED/Exiled.API/Enums/HazardType.cs
@@ -30,7 +30,7 @@ public enum HazardType
Tantrum,
///
- /// Should never happen
+ /// Should never happen.
///
Unknown,
}
diff --git a/EXILED/Exiled.API/Enums/LayerMasks.cs b/EXILED/Exiled.API/Enums/LayerMasks.cs
index e13683a3a1..53137d47de 100644
--- a/EXILED/Exiled.API/Enums/LayerMasks.cs
+++ b/EXILED/Exiled.API/Enums/LayerMasks.cs
@@ -84,4 +84,4 @@ public enum LayerMasks
InteractionAnticheatMask = Default | Glass | Door | InteractableNoPlayerCollision,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/LeadingTeam.cs b/EXILED/Exiled.API/Enums/LeadingTeam.cs
index b136e854f0..23644058ee 100644
--- a/EXILED/Exiled.API/Enums/LeadingTeam.cs
+++ b/EXILED/Exiled.API/Enums/LeadingTeam.cs
@@ -45,4 +45,4 @@ public enum LeadingTeam : byte
///
Draw,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/LockerType.cs b/EXILED/Exiled.API/Enums/LockerType.cs
index 755da9d18f..21dbe9f78f 100644
--- a/EXILED/Exiled.API/Enums/LockerType.cs
+++ b/EXILED/Exiled.API/Enums/LockerType.cs
@@ -126,4 +126,4 @@ public enum LockerType
///
Scp1509Pedestal,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/PingType.cs b/EXILED/Exiled.API/Enums/PingType.cs
index ab9f8f5fd6..50949d3b93 100644
--- a/EXILED/Exiled.API/Enums/PingType.cs
+++ b/EXILED/Exiled.API/Enums/PingType.cs
@@ -47,4 +47,4 @@ public enum PingType : byte
///
Default,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/RespawnEffectType.cs b/EXILED/Exiled.API/Enums/RespawnEffectType.cs
index 672abb1976..34ce495b51 100644
--- a/EXILED/Exiled.API/Enums/RespawnEffectType.cs
+++ b/EXILED/Exiled.API/Enums/RespawnEffectType.cs
@@ -7,10 +7,6 @@
namespace Exiled.API.Enums
{
- using Features;
-
- using PlayerRoles;
-
///
/// Layers game respawn effects.
///
diff --git a/EXILED/Exiled.API/Enums/RevolverChamberState.cs b/EXILED/Exiled.API/Enums/RevolverChamberState.cs
index 421f18587d..13c0095162 100644
--- a/EXILED/Exiled.API/Enums/RevolverChamberState.cs
+++ b/EXILED/Exiled.API/Enums/RevolverChamberState.cs
@@ -30,4 +30,4 @@ public enum RevolverChamberState
///
Discharged,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/ScenesType.cs b/EXILED/Exiled.API/Enums/ScenesType.cs
index 60691443f9..c69874f0d0 100644
--- a/EXILED/Exiled.API/Enums/ScenesType.cs
+++ b/EXILED/Exiled.API/Enums/ScenesType.cs
@@ -19,7 +19,7 @@ public enum ScenesType
///
/// The current main menu.
- /// ! Will cause crash when trying joining servers !
+ /// ! Will cause crash when trying joining servers !.
///
NewMainMenu,
@@ -35,7 +35,7 @@ public enum ScenesType
///
/// The loading Screen.
- /// ! Will cause crash when trying joining servers !
+ /// ! Will cause crash when trying joining servers !.
///
PreLoader,
@@ -44,4 +44,4 @@ public enum ScenesType
///
Loader,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/Scp939VisibilityStates.cs b/EXILED/Exiled.API/Enums/Scp939VisibilityState.cs
similarity index 94%
rename from EXILED/Exiled.API/Enums/Scp939VisibilityStates.cs
rename to EXILED/Exiled.API/Enums/Scp939VisibilityState.cs
index f03fc8e51e..7d6a9b2811 100644
--- a/EXILED/Exiled.API/Enums/Scp939VisibilityStates.cs
+++ b/EXILED/Exiled.API/Enums/Scp939VisibilityState.cs
@@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
-//
+//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
@@ -44,4 +44,4 @@ public enum Scp939VisibilityState
///
SeenByLastTime,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/SpawnLocationType.cs b/EXILED/Exiled.API/Enums/SpawnLocationType.cs
index 2fc9d2a780..4752396e34 100644
--- a/EXILED/Exiled.API/Enums/SpawnLocationType.cs
+++ b/EXILED/Exiled.API/Enums/SpawnLocationType.cs
@@ -152,27 +152,27 @@ public enum SpawnLocationType
InsideGr18Glass,
///
- /// Inside 106's Primary Door
+ /// Inside 106's Primary Door.
///
Inside106Primary,
///
- /// Inside 106's Secondary Door
+ /// Inside 106's Secondary Door.
///
Inside106Secondary,
///
- /// Inside 939 Cryo Chamber
+ /// Inside 939 Cryo Chamber.
///
Inside939Cryo,
///
- /// Inside SCP-079's Armory
+ /// Inside SCP-079's Armory.
///
Inside079Armory,
///
- /// Inside SCP-127's Lab
+ /// Inside SCP-127's Lab.
///
Inside127Lab,
diff --git a/EXILED/Exiled.API/Enums/UncuffReason.cs b/EXILED/Exiled.API/Enums/UncuffReason.cs
index 977ad09fe1..1cf4bd6961 100644
--- a/EXILED/Exiled.API/Enums/UncuffReason.cs
+++ b/EXILED/Exiled.API/Enums/UncuffReason.cs
@@ -27,4 +27,4 @@ public enum UncuffReason
///
CufferDied,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/UsableRippleType.cs b/EXILED/Exiled.API/Enums/UsableRippleType.cs
index 1abc6936f8..cef62046c7 100644
--- a/EXILED/Exiled.API/Enums/UsableRippleType.cs
+++ b/EXILED/Exiled.API/Enums/UsableRippleType.cs
@@ -23,4 +23,4 @@ public enum UsableRippleType
///
Footstep,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/ZoneType.cs b/EXILED/Exiled.API/Enums/ZoneType.cs
index 382833528c..ab2e7f38a2 100644
--- a/EXILED/Exiled.API/Enums/ZoneType.cs
+++ b/EXILED/Exiled.API/Enums/ZoneType.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Enums
using System;
using Exiled.API.Features.Doors;
+
using Features;
///
diff --git a/EXILED/Exiled.API/Extensions/CommonExtensions.cs b/EXILED/Exiled.API/Extensions/CommonExtensions.cs
index 6b175fc281..f44f9a14ab 100644
--- a/EXILED/Exiled.API/Extensions/CommonExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/CommonExtensions.cs
@@ -80,4 +80,4 @@ public static AnimationCurve Add(this AnimationCurve curve, float amount)
return curve;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
index 8c06d82d0d..dc32e86cf6 100644
--- a/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
@@ -11,10 +11,14 @@ namespace Exiled.API.Extensions
using System.Linq;
using Enums;
+
using Features;
+
using InventorySystem.Items.Scp1509;
+
using PlayerRoles.PlayableScps.Scp1507;
using PlayerRoles.PlayableScps.Scp3114;
+
using PlayerStatsSystem;
///
@@ -211,4 +215,4 @@ public static DamageType GetDamageType(DamageHandlerBase damageHandlerBase)
return DamageType.Unknown;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs
index 86c4c27099..2715e726dc 100644
--- a/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs
@@ -13,6 +13,7 @@ namespace Exiled.API.Extensions
using System.Linq;
using CustomPlayerEffects.Danger;
+
using Exiled.API.Enums;
///
diff --git a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
index 69677e71c7..8ceb671037 100644
--- a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
+++ b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
@@ -13,11 +13,16 @@ namespace Exiled.API.Extensions
using System.Linq;
using CustomPlayerEffects;
+
using CustomRendering;
+
using Enums;
+
using Exiled.API.Features;
+
using InventorySystem.Items.MarshmallowMan;
using InventorySystem.Items.Usables.Scp244.Hypothermia;
+
using PlayerRoles.FirstPersonControl;
///
@@ -242,4 +247,4 @@ public static EffectCategory GetCategories(this EffectType effect)
return category;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/FloatExtensions.cs b/EXILED/Exiled.API/Extensions/FloatExtensions.cs
index b7a32af87f..f9608626c0 100644
--- a/EXILED/Exiled.API/Extensions/FloatExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/FloatExtensions.cs
@@ -53,4 +53,4 @@ public static AspectRatioType GetAspectRatioLabel(this float ratio)
return closestRatio;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/ItemExtensions.cs b/EXILED/Exiled.API/Extensions/ItemExtensions.cs
index 80c77a4c37..3a4bb791cc 100644
--- a/EXILED/Exiled.API/Extensions/ItemExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/ItemExtensions.cs
@@ -20,6 +20,7 @@ namespace Exiled.API.Extensions
using InventorySystem.Items.Firearms.Attachments;
using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Pickups;
+
using Structs;
///
@@ -353,4 +354,4 @@ public static uint GetBaseCode(this FirearmType type)
/// true if weapon has the specified attachment. Otherwise, false.
public static bool HasAttachment(this Firearm firearm, AttachmentName attachment) => firearm.Attachments.FirstOrDefault(x => x.Name == attachment)?.IsEnabled ?? false;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/LockerExtensions.cs b/EXILED/Exiled.API/Extensions/LockerExtensions.cs
index fbd60ec2a6..3bf7edf51b 100644
--- a/EXILED/Exiled.API/Extensions/LockerExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/LockerExtensions.cs
@@ -7,9 +7,8 @@
namespace Exiled.API.Extensions
{
- using System;
-
using Exiled.API.Enums;
+
using MapGeneration.Distributors;
///
@@ -53,4 +52,4 @@ public static class LockerExtensions
_ => LockerType.Unknown,
};
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
index 34897f5abf..bbd3258782 100644
--- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
@@ -13,7 +13,6 @@ namespace Exiled.API.Extensions
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
- using System.Text;
using AdminToys;
@@ -24,17 +23,16 @@ namespace Exiled.API.Extensions
using CustomPlayerEffects;
using Exiled.API.Enums;
- using Exiled.API.Features.Items;
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Features.Pickups.Keycards;
using Features;
- using Features.Pools;
+
using HarmonyLib;
+
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Autosync;
- using InventorySystem.Items.Firearms;
using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Keycards;
@@ -52,9 +50,8 @@ namespace Exiled.API.Extensions
using RelativePositioning;
- using Respawning;
-
using Unity.Collections.LowLevel.Unsafe;
+
using UnityEngine;
using Utils.Networking;
@@ -125,7 +122,7 @@ public static ReadOnlyDictionary SyncVarDirtyBits
return ReadOnlySyncVarDirtyBitsValue;
- ulong GetBit(MethodInfo setter)
+ static ulong GetBit(MethodInfo setter)
{
List instructions = PatchProcessor.GetOriginalInstructions(setter);
@@ -274,7 +271,9 @@ public static void PlayGunSound(this Player player, Vector3 position, FirearmTyp
/// The direction of the blood decal.
/// The RoleTypeId from who blood come from.
/// The sound than player get when getting shot.
+#pragma warning disable IDE0060 // TODO: Deleted the unused param
public static void PlaceBlood(this Player player, Vector3 position, Vector3 origin, RoleTypeId roleTypeId, int gettingShotSoundIndex)
+#pragma warning restore IDE0060
{
if (!roleTypeId.TryGetRoleBase(out PlayerRoleBase playerRoleBase) || playerRoleBase is not IBleedableRole)
return;
@@ -311,7 +310,8 @@ public static void PlaceBlood(this Player player, Vector3 position, Vector3 orig
writer.WriteRelativePosition(new RelativePosition(origin));
writer.WriteByte(255);
writer.WriteRoleType(RoleTypeId.ClassD);
- }, true);
+ },
+ true);
#pragma warning restore SA1116 // Split parameters should start on line after declaration
}
@@ -561,7 +561,9 @@ public static void PlayCassieAnnouncement(this Player player, string words, bool
/// Same on 's isHeld.
/// Same on 's isNoisy.
/// Same on 's isSubtitles.
+#pragma warning disable IDE0060 // TODO: Deleted the unused param
public static void MessageTranslated(this Player player, string words, string translation, string customSubtitles, bool makeHold = false, bool makeNoise = true, bool isSubtitles = true)
+#pragma warning restore IDE0060
{
CassieAnnouncement announcement = new(new CassieTtsPayload(words, customSubtitles, makeHold), 0, makeNoise ? 1 : 0);
@@ -1008,7 +1010,7 @@ private static void MakeCustomSyncWriter(NetworkIdentity behaviorOwner, Type tar
// Write syncdata position data
int position3 = owner.Position;
owner.Position = position;
- owner.WriteByte((byte)(position3 - position2 & 255));
+ owner.WriteByte((byte)((position3 - position2) & 255));
owner.Position = position3;
// Copy owner to observer
@@ -1016,4 +1018,4 @@ private static void MakeCustomSyncWriter(NetworkIdentity behaviorOwner, Type tar
observer.WriteBytes(owner.ToArraySegment().Array, position, owner.Position - position);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/RoleExtensions.cs b/EXILED/Exiled.API/Extensions/RoleExtensions.cs
index db1a7c99a9..14e1c4dd59 100644
--- a/EXILED/Exiled.API/Extensions/RoleExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/RoleExtensions.cs
@@ -12,14 +12,19 @@ namespace Exiled.API.Extensions
using System.Linq;
using Enums;
+
using Features.Spawn;
+
using Footprinting;
+
using InventorySystem;
using InventorySystem.Configs;
+
using PlayerRoles;
using PlayerRoles.FirstPersonControl;
- using Respawning;
+
using Respawning.Waves;
+
using UnityEngine;
using Team = PlayerRoles.Team;
@@ -84,7 +89,7 @@ public static class RoleExtensions
RoleTypeId.ChaosConscript or RoleTypeId.ChaosMarauder or RoleTypeId.ChaosRepressor or RoleTypeId.ChaosRifleman or RoleTypeId.ChaosFlamingo => Team.ChaosInsurgency,
RoleTypeId.Scientist => Team.Scientists,
RoleTypeId.ClassD => Team.ClassD,
- RoleTypeId.Scp049 or RoleTypeId.Scp939 or RoleTypeId.Scp0492 or RoleTypeId.Scp079 or RoleTypeId.Scp096 or RoleTypeId.Scp106 or RoleTypeId.Scp173 or RoleTypeId.Scp3114 or RoleTypeId.ZombieFlamingo=> Team.SCPs,
+ RoleTypeId.Scp049 or RoleTypeId.Scp939 or RoleTypeId.Scp0492 or RoleTypeId.Scp079 or RoleTypeId.Scp096 or RoleTypeId.Scp106 or RoleTypeId.Scp173 or RoleTypeId.Scp3114 or RoleTypeId.ZombieFlamingo => Team.SCPs,
RoleTypeId.FacilityGuard or RoleTypeId.NtfCaptain or RoleTypeId.NtfPrivate or RoleTypeId.NtfSergeant or RoleTypeId.NtfSpecialist or RoleTypeId.NtfFlamingo => Team.FoundationForces,
RoleTypeId.Tutorial => Team.OtherAlive,
RoleTypeId.Flamingo or RoleTypeId.AlphaFlamingo => Team.Flamingos,
@@ -243,7 +248,7 @@ public static Dictionary GetStartingAmmo(this RoleTypeId roleT
NtfMiniWave => SpawnableFaction.NtfMiniWave,
ChaosSpawnWave => SpawnableFaction.ChaosWave,
ChaosMiniWave => SpawnableFaction.ChaosMiniWave,
- _ => SpawnableFaction.None
+ _ => SpawnableFaction.None,
};
///
@@ -283,4 +288,4 @@ public static bool TryGetSpawnableFaction(this Faction faction, out SpawnableFac
return true;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Extensions/StringExtensions.cs b/EXILED/Exiled.API/Extensions/StringExtensions.cs
index 1cc8dc7c32..c6ccc67202 100644
--- a/EXILED/Exiled.API/Extensions/StringExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/StringExtensions.cs
@@ -67,7 +67,7 @@ public static int GetDistance(this string firstString, string secondString)
///
/// The to extract from.
/// Returns a containing the exctracted command name and arguments.
- public static (string commandName, string[] arguments) ExtractCommand(this string commandLine)
+ public static (string CommandName, string[] Arguments) ExtractCommand(this string commandLine)
{
string[] extractedArguments = commandLine.Split(' ');
diff --git a/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs b/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs
index 17ea91b02f..10db73bbb4 100644
--- a/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs
+++ b/EXILED/Exiled.API/Features/Audio/AudioDataStorage.cs
@@ -8,7 +8,6 @@
namespace Exiled.API.Features.Audio
{
using System;
- using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
@@ -210,4 +209,4 @@ private static void OnRoundRestart()
Clear();
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Audio/WavUtility.cs b/EXILED/Exiled.API/Features/Audio/WavUtility.cs
index 9be12fa6b8..7e8df6dbea 100644
--- a/EXILED/Exiled.API/Features/Audio/WavUtility.cs
+++ b/EXILED/Exiled.API/Features/Audio/WavUtility.cs
@@ -129,7 +129,7 @@ public static AudioData ParseWavSpanToPcm(Stream stream, ReadOnlySpan audi
/// A struct containing the parsed file information.
public static TrackData SkipHeader(Stream stream)
{
- TrackData trackData = new();
+ TrackData trackData = default(TrackData);
if (stream.Length < 12)
{
diff --git a/EXILED/Exiled.API/Features/Camera.cs b/EXILED/Exiled.API/Features/Camera.cs
index 4eedc693dd..0c949f124b 100644
--- a/EXILED/Exiled.API/Features/Camera.cs
+++ b/EXILED/Exiled.API/Features/Camera.cs
@@ -12,10 +12,14 @@ namespace Exiled.API.Features
using System.Linq;
using Enums;
+
using Exiled.API.Extensions;
using Exiled.API.Interfaces;
+
using MapGeneration;
+
using PlayerRoles.PlayableScps.Scp079.Cameras;
+
using UnityEngine;
using CameraType = Enums.CameraType;
diff --git a/EXILED/Exiled.API/Features/Cassie.cs b/EXILED/Exiled.API/Features/Cassie.cs
index 475e68ad4e..ab7b490451 100644
--- a/EXILED/Exiled.API/Features/Cassie.cs
+++ b/EXILED/Exiled.API/Features/Cassie.cs
@@ -13,12 +13,16 @@ namespace Exiled.API.Features
using System.Text;
using Exiled.API.Features.Pools;
+
using global::Cassie;
using global::Cassie.Interpreters;
+
using MEC;
+
using PlayerRoles;
+
using PlayerStatsSystem;
- using Respawning;
+
using Respawning.NamingRules;
using CustomFirearmHandler = DamageHandlers.FirearmDamageHandler;
@@ -57,7 +61,9 @@ public static void Message(string message, bool isHeld = false, bool isNoisy = t
/// Indicates whether C.A.S.S.I.E has to hold the message.
/// Indicates whether C.A.S.S.I.E has to make noises during the message.
/// Indicates whether C.A.S.S.I.E has to make subtitles.
+#pragma warning disable IDE0060 // TODO: Deleted the unused param
public static void MessageTranslated(string message, string translation, bool isHeld = false, bool isNoisy = true, bool isSubtitles = true)
+#pragma warning restore IDE0060
{
new CassieAnnouncement(new CassieTtsPayload(message, translation, isHeld), 0f, isNoisy ? 1 : 0).AddToQueue();
}
@@ -117,7 +123,7 @@ public static float CalculateDuration(string message)
float value = 0;
string[] lines = message.Split(' ', StringSplitOptions.RemoveEmptyEntries);
- CassiePlaybackModifiers modifiers = new();
+ CassiePlaybackModifiers modifiers = default(CassiePlaybackModifiers);
StringBuilder builder = StringBuilderPool.Pool.Get();
for (int i = 0; i < lines.Length; i++)
@@ -167,7 +173,7 @@ public static string ConvertNumber(int num)
return string.Empty;
}
- NumberInterpreter numberInterpreter = (NumberInterpreter)CassieTtsAnnouncer.Interpreters.FirstOrDefault((CassieInterpreter x) => x is NumberInterpreter);
+ NumberInterpreter numberInterpreter = (NumberInterpreter)CassieTtsAnnouncer.Interpreters.FirstOrDefault(x => x is NumberInterpreter);
if (numberInterpreter == null)
{
return string.Empty;
@@ -222,7 +228,7 @@ public static void CustomScpTermination(string scpName, CustomHandlerBase info)
///
/// The word to check.
/// if the word is valid; otherwise, .
- public static bool IsValid(string word) => CassieTtsAnnouncer.TryGetDatabase(out CassieLineDatabase cassieLineDatabase) ? cassieLineDatabase.AllLines.Any(line => line.ApiName.ToUpper() == word.ToUpper()) : false;
+ public static bool IsValid(string word) => CassieTtsAnnouncer.TryGetDatabase(out CassieLineDatabase cassieLineDatabase) && cassieLineDatabase.AllLines.Any(line => line.ApiName.ToUpper() == word.ToUpper());
///
/// Gets a value indicating whether the given sentence is all valid C.A.S.S.I.E word.
diff --git a/EXILED/Exiled.API/Features/Coffee.cs b/EXILED/Exiled.API/Features/Coffee.cs
index adabb2387e..5874d66245 100644
--- a/EXILED/Exiled.API/Features/Coffee.cs
+++ b/EXILED/Exiled.API/Features/Coffee.cs
@@ -13,6 +13,7 @@ namespace Exiled.API.Features
using Exiled.API.Extensions;
using Exiled.API.Interfaces;
+
using UnityEngine;
using BaseCoffee = global::Coffee;
@@ -118,4 +119,4 @@ public string TranslationAuthor
/// The player who interacts. If , it will be chosen randomly.
public void Interact(Player player = null) => Base.ServerInteract((player ?? Player.Get(x => x.IsHuman).GetRandomValue()).ReferenceHub, byte.MaxValue);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs b/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs
index a61a7f1602..e2db497289 100644
--- a/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs
+++ b/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs
@@ -22,4 +22,4 @@ internal class ComponentsEqualityComparer : IEqualityComparer
///
public int GetHashCode(Component obj) => obj == null ? 0 : obj.GetHashCode();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/EActor.cs b/EXILED/Exiled.API/Features/Core/EActor.cs
index b051974788..31a8911725 100644
--- a/EXILED/Exiled.API/Features/Core/EActor.cs
+++ b/EXILED/Exiled.API/Features/Core/EActor.cs
@@ -15,6 +15,7 @@ namespace Exiled.API.Features.Core
using Exiled.API.Features.DynamicEvents;
using Exiled.API.Features.Pools;
using Exiled.API.Interfaces;
+
using MEC;
using UnityEngine;
diff --git a/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs b/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs
index 7bd14fb6e2..0ac6098b9b 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs
@@ -7,8 +7,6 @@
namespace Exiled.API.Features.Core.Generic
{
- using System;
-
using Exiled.API.Features;
///
diff --git a/EXILED/Exiled.API/Features/Core/StateMachine/State.cs b/EXILED/Exiled.API/Features/Core/StateMachine/State.cs
index e790e61a8d..dee7f4cd49 100644
--- a/EXILED/Exiled.API/Features/Core/StateMachine/State.cs
+++ b/EXILED/Exiled.API/Features/Core/StateMachine/State.cs
@@ -14,7 +14,6 @@ namespace Exiled.API.Features.Core.StateMachine
using Exiled.API.Features;
using Exiled.API.Features.Core.Attributes;
- using UnityEngine;
///
/// The base class which handles in-context states.
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs
index 46938d13b4..dfccf71d77 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs
@@ -11,6 +11,7 @@ namespace Exiled.API.Features.Core.UserSettings
using System.Diagnostics;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs
index ada19ec63a..8876f74b96 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Features.Core.UserSettings
using System.Linq;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs
index 4b13238b65..5944a682fd 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Core.UserSettings
using System;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
index e3b40e8f0c..98c168adaa 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
@@ -10,7 +10,9 @@ namespace Exiled.API.Features.Core.UserSettings
using System;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs b/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs
index 38b5132ec7..9286c5b409 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs
@@ -14,6 +14,7 @@ namespace Exiled.API.Features.Core.UserSettings
using Exiled.API.Features.Pools;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
///
@@ -205,7 +206,7 @@ public static bool TryGetSetting(Player player, int id, out T setting)
SSTwoButtonsSetting twoButtonsSetting => new TwoButtonsSetting(twoButtonsSetting),
SSPlaintextSetting plainTextSetting => new UserTextInputSetting(plainTextSetting),
SSSliderSetting sliderSetting => new SliderSetting(sliderSetting),
- _ => new SettingBase(settingBase)
+ _ => new SettingBase(settingBase),
};
///
@@ -419,7 +420,7 @@ internal static void OnSettingUpdated(ReferenceHub hub, ServerSpecificSettingBas
setting = list.Find(x => x.Id == settingBase.SettingId);
- invoke:
+ invoke:
if (setting.OriginalDefinition == null)
{
@@ -429,4 +430,4 @@ internal static void OnSettingUpdated(ReferenceHub hub, ServerSpecificSettingBas
setting.OriginalDefinition?.OnChanged?.Invoke(player, setting);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/SliderSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/SliderSetting.cs
index abb522fd76..3a88ab477c 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/SliderSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/SliderSetting.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Core.UserSettings
using System;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs
index 69c7875ad1..d1c9aa7eb5 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs
@@ -10,7 +10,9 @@ namespace Exiled.API.Features.Core.UserSettings
using System;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
+
using TMPro;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs
index 18233e6ffc..d921ede5a4 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Core.UserSettings
using System;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
///
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/UserTextInputSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/UserTextInputSetting.cs
index 99c163581e..fe773e8021 100644
--- a/EXILED/Exiled.API/Features/Core/UserSettings/UserTextInputSetting.cs
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/UserTextInputSetting.cs
@@ -10,7 +10,9 @@ namespace Exiled.API.Features.Core.UserSettings
using System;
using Exiled.API.Interfaces;
+
using global::UserSettings.ServerSpecific;
+
using TMPro;
///
diff --git a/EXILED/Exiled.API/Features/CustomStats/CustomHumeShieldStat.cs b/EXILED/Exiled.API/Features/CustomStats/CustomHumeShieldStat.cs
index e19ce970f5..f366ba01bf 100644
--- a/EXILED/Exiled.API/Features/CustomStats/CustomHumeShieldStat.cs
+++ b/EXILED/Exiled.API/Features/CustomStats/CustomHumeShieldStat.cs
@@ -8,9 +8,13 @@
namespace Exiled.API.Features.CustomStats
{
using Mirror;
+
using PlayerRoles.PlayableScps.HumeShield;
+
using PlayerStatsSystem;
+
using UnityEngine;
+
using Utils.Networking;
///
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs
index 1103ed138e..7b4720f6d3 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Features.DamageHandlers
using Footprinting;
using PlayerStatsSystem;
+
using UnityEngine;
using BaseHandler = PlayerStatsSystem.DamageHandlerBase;
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
index 6a9b8f4562..0c1bd95076 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
@@ -13,12 +13,17 @@ namespace Exiled.API.Features.DamageHandlers
using System.Linq;
using Enums;
+
using Exiled.API.Features.Items;
+
using Extensions;
+
using InventorySystem.Items.Scp1509;
+
using PlayerRoles.PlayableScps.Scp1507;
using PlayerRoles.PlayableScps.Scp3114;
using PlayerRoles.PlayableScps.Scp939;
+
using PlayerStatsSystem;
using BaseHandler = PlayerStatsSystem.DamageHandlerBase;
@@ -266,7 +271,7 @@ protected DamageType GetDamageType(BaseHandler damageHandler = null)
FirearmType.E11SR => DamageType.E11Sr,
FirearmType.FSP9 => DamageType.Fsp9,
FirearmType.FRMG0 => DamageType.Frmg0,
- _ => DamageType.Firearm
+ _ => DamageType.Firearm,
};
case PlayerStatsSystem.AttackerDamageHandler attackerDamageHandler:
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
index 4ea1909b72..776aa1943f 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
@@ -12,19 +12,13 @@ namespace Exiled.API.Features.DamageHandlers
using Enums;
using Exiled.API.Extensions;
- using Exiled.API.Features.Pickups.Projectiles;
using Footprinting;
using InventorySystem;
- using InventorySystem.Items;
- using InventorySystem.Items.Firearms;
- using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Firearms.ShotEvents;
using InventorySystem.Items.Scp1509;
- using Items;
-
using PlayerRoles;
using PlayerRoles.PlayableScps.Scp096;
using PlayerRoles.PlayableScps.Scp1507;
@@ -35,8 +29,6 @@ namespace Exiled.API.Features.DamageHandlers
using UnityEngine;
- using Object = UnityEngine.Object;
-
///
/// Allows generic damage to a player.
///
@@ -70,8 +62,7 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
cassieAnnouncement ??= DamageHandlerBase.CassieAnnouncement.Default;
customCassieAnnouncement = cassieAnnouncement;
- if (customCassieAnnouncement is not null)
- customCassieAnnouncement.Announcement ??= $"{player.Nickname} killed by {attacker.Nickname} utilizing {damageType}";
+ customCassieAnnouncement?.Announcement ??= $"{player.Nickname} killed by {attacker.Nickname} utilizing {damageType}";
Attacker = attacker != null ? attacker.Footprint : Server.Host.Footprint;
AllowSelfDamage = true;
@@ -192,16 +183,14 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
case DamageType.Scp096:
Scp096Role curr096 = attacker.ReferenceHub.roleManager.CurrentRole as Scp096Role ?? new Scp096Role();
- if (curr096 != null)
- curr096._lastOwner = attacker.ReferenceHub;
+ curr096?._lastOwner = attacker.ReferenceHub;
Base = new Scp096DamageHandler(curr096, damage, Scp096DamageHandler.AttackType.SlapRight);
break;
case DamageType.Scp939:
Scp939Role curr939 = attacker.ReferenceHub.roleManager.CurrentRole as Scp939Role ?? new Scp939Role();
- if (curr939 != null)
- curr939._lastOwner = attacker.ReferenceHub;
+ curr939?._lastOwner = attacker.ReferenceHub;
Base = new Scp939DamageHandler(curr939, damage, Scp939DamageType.LungeTarget);
break;
@@ -344,4 +333,4 @@ private void GenericFirearm(float amount, ItemType itemType)
};
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Doors/BasicDoor.cs b/EXILED/Exiled.API/Features/Doors/BasicDoor.cs
index 5a53caa738..a0c184b22a 100644
--- a/EXILED/Exiled.API/Features/Doors/BasicDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/BasicDoor.cs
@@ -10,7 +10,9 @@ namespace Exiled.API.Features.Doors
using System.Collections.Generic;
using Exiled.API.Enums;
+
using PlayerRoles;
+
using UnityEngine;
using Basegame = Interactables.Interobjects.BasicDoor;
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index 0e27b6daae..8518be4a9c 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -15,11 +15,15 @@ namespace Exiled.API.Features.Doors
using Exiled.API.Extensions;
using Exiled.API.Features.Core;
using Exiled.API.Interfaces;
+
using Interactables.Interobjects;
using Interactables.Interobjects.DoorButtons;
using Interactables.Interobjects.DoorUtils;
+
using MEC;
+
using Mirror;
+
using UnityEngine;
using BaseBreakableDoor = Interactables.Interobjects.BreakableDoor;
@@ -421,7 +425,7 @@ public static void LockAll(float duration, ZoneType zoneType = ZoneType.Unspecif
{
door.IsOpen = false;
door.ChangeLock(lockType);
- Timing.CallDelayed(duration, () => door.Unlock());
+ Timing.CallDelayed(duration, door.Unlock);
}
}
@@ -448,7 +452,7 @@ public static void LockAll(float duration, DoorLockType lockType = DoorLockType.
{
door.IsOpen = false;
door.ChangeLock(lockType);
- Timing.CallDelayed(duration, () => door.Unlock());
+ Timing.CallDelayed(duration, door.Unlock);
}
}
@@ -593,7 +597,7 @@ internal static Door Create(DoorVariant doorVariant, List rooms)
PryableDoor prbl => new Gate(prbl, rooms),
Interactables.Interobjects.BasicNonInteractableDoor nonInteractableDoor => new BasicNonInteractableDoor(nonInteractableDoor, rooms),
Interactables.Interobjects.BasicDoor basicDoor => new BasicDoor(basicDoor, rooms),
- _ => new Door(doorVariant, rooms)
+ _ => new Door(doorVariant, rooms),
};
}
@@ -709,4 +713,4 @@ private DoorType GetDoorType()
};
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs
index 8d455e6653..9f5643cb04 100644
--- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs
@@ -11,7 +11,9 @@ namespace Exiled.API.Features.Doors
using System.Linq;
using Exiled.API.Enums;
+
using Interactables.Interobjects;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Doors/EmergencyReleaseButton.cs b/EXILED/Exiled.API/Features/Doors/EmergencyReleaseButton.cs
index 4fb094f639..e115b4416a 100644
--- a/EXILED/Exiled.API/Features/Doors/EmergencyReleaseButton.cs
+++ b/EXILED/Exiled.API/Features/Doors/EmergencyReleaseButton.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Features.Doors
using System.Linq;
using Exiled.API.Interfaces;
+
using Interactables.Interobjects;
///
diff --git a/EXILED/Exiled.API/Features/Doors/Gate.cs b/EXILED/Exiled.API/Features/Doors/Gate.cs
index 89cbc3ced0..050c635ef6 100644
--- a/EXILED/Exiled.API/Features/Doors/Gate.cs
+++ b/EXILED/Exiled.API/Features/Doors/Gate.cs
@@ -10,8 +10,10 @@ namespace Exiled.API.Features.Doors
using System.Collections.Generic;
using Exiled.API.Enums;
+
using Interactables.Interobjects;
using Interactables.Interobjects.DoorUtils;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs
index 5eb7361b91..8eb2127d3f 100644
--- a/EXILED/Exiled.API/Features/Draw.cs
+++ b/EXILED/Exiled.API/Features/Draw.cs
@@ -8,7 +8,6 @@
namespace Exiled.API.Features
{
using System;
- using System.Buffers;
using System.Collections.Generic;
using DrawableLine;
diff --git a/EXILED/Exiled.API/Features/Generator.cs b/EXILED/Exiled.API/Features/Generator.cs
index 8f3d6f41be..e494184cd0 100644
--- a/EXILED/Exiled.API/Features/Generator.cs
+++ b/EXILED/Exiled.API/Features/Generator.cs
@@ -12,8 +12,11 @@ namespace Exiled.API.Features
using System.Linq;
using Enums;
+
using Exiled.API.Interfaces;
+
using Interactables.Interobjects.DoorUtils;
+
using MapGeneration.Distributors;
using UnityEngine;
diff --git a/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs b/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs
index 22d34ffa8e..f7844678c4 100644
--- a/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs
+++ b/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs
@@ -152,39 +152,35 @@ public static void UnpatchAll(string id = "", string groupId = null)
if (string.IsNullOrEmpty(groupId) || patchGroup.GroupId != groupId)
continue;
- Unpatch:
+ Unpatch:
bool hasMethodBody = methodBase.HasMethodBody();
if (hasMethodBody)
{
- patchInfo.Postfixes.Do(
- delegate(Patch patchInfo)
- {
- harmony.Unpatch(methodBase, patchInfo.PatchMethod);
- });
- patchInfo.Prefixes.Do(
- delegate(Patch patchInfo)
- {
- harmony.Unpatch(methodBase, patchInfo.PatchMethod);
- });
- }
-
- patchInfo.Transpilers.Do(
- delegate(Patch patchInfo)
+ patchInfo.Postfixes.Do((patchInfo) =>
+ {
+ harmony.Unpatch(methodBase, patchInfo.PatchMethod);
+ });
+ patchInfo.Prefixes.Do((patchInfo) =>
{
harmony.Unpatch(methodBase, patchInfo.PatchMethod);
});
+ }
+
+ patchInfo.Transpilers.Do((patchInfo) =>
+ {
+ harmony.Unpatch(methodBase, patchInfo.PatchMethod);
+ });
if (hasMethodBody)
{
- patchInfo.Finalizers.Do(
- delegate(Patch patchInfo)
- {
- harmony.Unpatch(methodBase, patchInfo.PatchMethod);
- });
+ patchInfo.Finalizers.Do((patchInfo) =>
+ {
+ harmony.Unpatch(methodBase, patchInfo.PatchMethod);
+ });
}
PatchedGroupMethodsValue.Remove(methodBase);
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
index 3c2a982ab7..9a1cc7e110 100644
--- a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Hazards
{
using Exiled.API.Enums;
+
using PlayerRoles.PlayableScps.Scp939;
///
diff --git a/EXILED/Exiled.API/Features/Hazards/Hazard.cs b/EXILED/Exiled.API/Features/Hazards/Hazard.cs
index 22d620092a..c0c82a3aea 100644
--- a/EXILED/Exiled.API/Features/Hazards/Hazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/Hazard.cs
@@ -14,8 +14,11 @@ namespace Exiled.API.Features.Hazards
using Exiled.API.Enums;
using Exiled.API.Features.Core;
using Exiled.API.Interfaces;
+
using global::Hazards;
+
using PlayerRoles.PlayableScps.Scp939;
+
using UnityEngine;
///
@@ -121,13 +124,13 @@ public Vector3 Position
public static Hazard Get(EnvironmentalHazard environmentalHazard) =>
EnvironmentalHazardToHazard.TryGetValue(environmentalHazard, out Hazard hazard) ? hazard
: environmentalHazard switch
- {
- TantrumEnvironmentalHazard tantrumEnvironmentalHazard => new TantrumHazard(tantrumEnvironmentalHazard),
- Scp939AmnesticCloudInstance scp939AmnesticCloudInstance => new AmnesticCloudHazard(scp939AmnesticCloudInstance),
- SinkholeEnvironmentalHazard sinkholeEnvironmentalHazard => new SinkholeHazard(sinkholeEnvironmentalHazard),
- global::Hazards.TemporaryHazard temporaryHazard => new TemporaryHazard(temporaryHazard),
- _ => new Hazard(environmentalHazard)
- };
+ {
+ TantrumEnvironmentalHazard tantrumEnvironmentalHazard => new TantrumHazard(tantrumEnvironmentalHazard),
+ Scp939AmnesticCloudInstance scp939AmnesticCloudInstance => new AmnesticCloudHazard(scp939AmnesticCloudInstance),
+ SinkholeEnvironmentalHazard sinkholeEnvironmentalHazard => new SinkholeHazard(sinkholeEnvironmentalHazard),
+ global::Hazards.TemporaryHazard temporaryHazard => new TemporaryHazard(temporaryHazard),
+ _ => new Hazard(environmentalHazard),
+ };
///
/// Gets the by .
diff --git a/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs b/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs
index 5e368dfd25..86f924c0d0 100644
--- a/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Hazards
{
using Exiled.API.Enums;
+
using global::Hazards;
///
diff --git a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
index 1660ba4dc9..733096ae26 100644
--- a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
@@ -8,9 +8,13 @@
namespace Exiled.API.Features.Hazards
{
using Exiled.API.Enums;
+
using global::Hazards;
+
using Mirror;
+
using RelativePositioning;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Items/Ammo.cs b/EXILED/Exiled.API/Features/Items/Ammo.cs
index d6cf394750..54210cc6d2 100644
--- a/EXILED/Exiled.API/Features/Items/Ammo.cs
+++ b/EXILED/Exiled.API/Features/Items/Ammo.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Items
{
using Enums;
+
using Exiled.API.Interfaces;
using InventorySystem.Items.Firearms.Ammo;
diff --git a/EXILED/Exiled.API/Features/Items/Armor.cs b/EXILED/Exiled.API/Features/Items/Armor.cs
index 344b7a0118..43676a2e97 100644
--- a/EXILED/Exiled.API/Features/Items/Armor.cs
+++ b/EXILED/Exiled.API/Features/Items/Armor.cs
@@ -15,10 +15,10 @@ namespace Exiled.API.Features.Items
using Exiled.API.Interfaces;
using InventorySystem.Items.Armor;
+
using PlayerRoles;
using Structs;
- using UnityEngine;
///
/// A wrapper class for .
diff --git a/EXILED/Exiled.API/Features/Items/Consumable.cs b/EXILED/Exiled.API/Features/Items/Consumable.cs
index 6b4ec6c5ce..0927474fe0 100644
--- a/EXILED/Exiled.API/Features/Items/Consumable.cs
+++ b/EXILED/Exiled.API/Features/Items/Consumable.cs
@@ -49,4 +49,4 @@ internal override void ChangeOwner(Player oldOwner, Player newOwner)
Base.Owner = newOwner.ReferenceHub;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs b/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs
index b550c13456..e9b7b0ce95 100644
--- a/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs
+++ b/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs
@@ -15,6 +15,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.ThrowableProjectiles;
+
using UnityEngine;
using Object = UnityEngine.Object;
diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs
index b97a8673bd..00630fad35 100644
--- a/EXILED/Exiled.API/Features/Items/Firearm.cs
+++ b/EXILED/Exiled.API/Features/Items/Firearm.cs
@@ -7,11 +7,11 @@
namespace Exiled.API.Features.Items
{
- using System;
using System.Collections.Generic;
using System.Linq;
using CameraShaking;
+
using Enums;
using Exiled.API.Features.Items.FirearmModules;
@@ -20,7 +20,9 @@ namespace Exiled.API.Features.Items
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
using Exiled.API.Structs;
+
using Extensions;
+
using InventorySystem.Items.Autosync;
using InventorySystem.Items.Firearms.Attachments;
using InventorySystem.Items.Firearms.Attachments.Components;
@@ -109,8 +111,7 @@ public static IReadOnlyDictionary>> playerPreferences =
AttachmentsServerHandler.PlayerPreferences.Where(
- kvp => kvp.Key is not null).Select(
- (KeyValuePair> keyValuePair) =>
+ kvp => kvp.Key is not null).Select(keyValuePair =>
{
return new KeyValuePair>(
Player.Get(keyValuePair.Key),
@@ -169,12 +170,7 @@ public int MagazineAmmo
public int BarrelAmmo
{
get => BarrelMagazine?.Ammo ?? 0;
-
- set
- {
- if (BarrelMagazine != null)
- BarrelMagazine.Ammo = value;
- }
+ set => BarrelMagazine?.Ammo = value;
}
///
@@ -251,12 +247,7 @@ public float DamageFalloffDistance
public int MaxBarrelAmmo
{
get => BarrelMagazine?.MaxAmmo ?? 0;
-
- set
- {
- if (BarrelMagazine != null)
- BarrelMagazine.MaxAmmo = value;
- }
+ set => BarrelMagazine?.MaxAmmo = value;
}
///
@@ -821,4 +812,4 @@ internal override void ReadPickupInfoBefore(Pickup pickup)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/AutomaticBarrelMagazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/AutomaticBarrelMagazine.cs
index db8992d720..0ddbd8bf54 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/AutomaticBarrelMagazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/AutomaticBarrelMagazine.cs
@@ -7,12 +7,6 @@
namespace Exiled.API.Features.Items.FirearmModules.Barrel
{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
using InventorySystem.Items.Firearms.Modules;
using UnityEngine;
@@ -102,4 +96,4 @@ public bool BoltLocked
///
public override void Resync() => AutomaticBarrel.ServerResync();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/BarrelMagazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/BarrelMagazine.cs
index b1e11f7580..d189df088f 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/BarrelMagazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/BarrelMagazine.cs
@@ -28,4 +28,4 @@ public BarrelMagazine(IAmmoContainerModule module)
///
public abstract bool IsCocked { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/PumpBarrelMagazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/PumpBarrelMagazine.cs
index afeb1f3248..141cacbab8 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/PumpBarrelMagazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Barrel/PumpBarrelMagazine.cs
@@ -7,12 +7,6 @@
namespace Exiled.API.Features.Items.FirearmModules.Barrel
{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
using InventorySystem.Items.Firearms.Modules;
using UnityEngine;
@@ -88,4 +82,4 @@ public override bool IsCocked
///
public override void Resync() => PumpBarrel.ServerResync();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Magazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Magazine.cs
index 8fb2688bb7..a0633f46c0 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Magazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Magazine.cs
@@ -7,12 +7,12 @@
namespace Exiled.API.Features.Items.FirearmModules
{
- using System;
-
using Exiled.API.Features.Items.FirearmModules.Barrel;
using Exiled.API.Features.Items.FirearmModules.Primary;
+
using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Firearms.Modules.Scp127;
+
using UnityEngine;
///
@@ -69,7 +69,7 @@ public static Magazine Get(IAmmoContainerModule module)
MagazineModule magazine => magazine switch
{
Scp127MagazineModule scp127MagazineModule => new Scp127Magazine(scp127MagazineModule),
- _ => new NormalMagazine(magazine)
+ _ => new NormalMagazine(magazine),
},
_ => null,
},
@@ -111,4 +111,4 @@ public int ModifyAmmo(int delta, bool useBorders = true)
///
public abstract void Resync();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/CylinderMagazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/CylinderMagazine.cs
index 2beedd7bb7..652d71250e 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/CylinderMagazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/CylinderMagazine.cs
@@ -7,8 +7,6 @@
namespace Exiled.API.Features.Items.FirearmModules.Primary
{
- using System;
- using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -102,4 +100,4 @@ public RevolverChamberState State
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/NormalMagazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/NormalMagazine.cs
index 6c4bb19c28..0421ec1f0e 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/NormalMagazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/NormalMagazine.cs
@@ -95,4 +95,4 @@ public bool MagazineInserted
///
public override void Resync() => MagazineModule.ServerResyncData();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/PrimaryMagazine.cs b/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/PrimaryMagazine.cs
index 39ff428556..85a294f5d8 100644
--- a/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/PrimaryMagazine.cs
+++ b/EXILED/Exiled.API/Features/Items/FirearmModules/Primary/PrimaryMagazine.cs
@@ -10,7 +10,6 @@ namespace Exiled.API.Features.Items.FirearmModules.Primary
using System;
using Exiled.API.Enums;
- using Exiled.API.Extensions;
using InventorySystem.Items.Firearms.Modules;
@@ -60,4 +59,4 @@ public override int Ammo
///
public abstract AmmoType AmmoType { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Flashlight.cs b/EXILED/Exiled.API/Features/Items/Flashlight.cs
index 93a3876ca6..4030d1a358 100644
--- a/EXILED/Exiled.API/Features/Items/Flashlight.cs
+++ b/EXILED/Exiled.API/Features/Items/Flashlight.cs
@@ -7,12 +7,12 @@
namespace Exiled.API.Features.Items
{
- using System;
-
using Exiled.API.Interfaces;
+
using InventorySystem.Items.ToggleableLights;
using InventorySystem.Items.ToggleableLights.Flashlight;
using InventorySystem.Items.ToggleableLights.Lantern;
+
using Utils.Networking;
///
@@ -80,4 +80,4 @@ public float NextAllowedTime
/// A string containing item-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{IsEmittingLight}| /{NextAllowedTime}/";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Item.cs b/EXILED/Exiled.API/Features/Items/Item.cs
index 6e9a20d66f..6446dd8cf6 100644
--- a/EXILED/Exiled.API/Features/Items/Item.cs
+++ b/EXILED/Exiled.API/Features/Items/Item.cs
@@ -15,6 +15,7 @@ namespace Exiled.API.Features.Items
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
+
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Armor;
@@ -34,6 +35,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items.Usables.Scp1576;
using InventorySystem.Items.Usables.Scp244;
using InventorySystem.Items.Usables.Scp330;
+
using UnityEngine;
using BaseConsumable = InventorySystem.Items.Usables.Consumable;
@@ -235,7 +237,7 @@ public static Item Get(ItemBase itemBase)
ItemType.KeycardCustomManagement => new ManagementKeycard(keycard),
ItemType.KeycardCustomMetalCase => new MetalKeycard(keycard),
_ => new Keycard(keycard),
- }
+ },
},
UsableItem usable => usable switch
{
@@ -340,7 +342,7 @@ public static T Get(ushort serial)
ItemType.KeycardCustomManagement => new ManagementKeycard(type),
ItemType.KeycardCustomMetalCase => new MetalKeycard(type),
_ => new Keycard(type, owner),
- }
+ },
},
UsableItem usable => usable switch
{
@@ -522,4 +524,4 @@ internal virtual void ReadPickupInfoAfter(Pickup pickup)
{
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Jailbird.cs b/EXILED/Exiled.API/Features/Items/Jailbird.cs
index 4cc9a59c86..d4d5c60302 100644
--- a/EXILED/Exiled.API/Features/Items/Jailbird.cs
+++ b/EXILED/Exiled.API/Features/Items/Jailbird.cs
@@ -11,10 +11,13 @@ namespace Exiled.API.Features.Items
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
+
using InventorySystem.Items;
using InventorySystem.Items.Autosync;
using InventorySystem.Items.Jailbird;
+
using Mirror;
+
using UnityEngine;
using JailbirdPickup = Pickups.JailbirdPickup;
diff --git a/EXILED/Exiled.API/Features/Items/Keycard.cs b/EXILED/Exiled.API/Features/Items/Keycard.cs
index e153ebdbda..92d424cd98 100644
--- a/EXILED/Exiled.API/Features/Items/Keycard.cs
+++ b/EXILED/Exiled.API/Features/Items/Keycard.cs
@@ -9,7 +9,9 @@ namespace Exiled.API.Features.Items
{
using Exiled.API.Enums;
using Exiled.API.Interfaces;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.Keycards;
///
diff --git a/EXILED/Exiled.API/Features/Items/Keycards/CustomKeycardItem.cs b/EXILED/Exiled.API/Features/Items/Keycards/CustomKeycardItem.cs
index 7497cfef56..20334bb7f1 100644
--- a/EXILED/Exiled.API/Features/Items/Keycards/CustomKeycardItem.cs
+++ b/EXILED/Exiled.API/Features/Items/Keycards/CustomKeycardItem.cs
@@ -14,10 +14,13 @@ namespace Exiled.API.Features.Items.Keycards
using Exiled.API.Extensions;
using Exiled.API.Features.Pools;
using Exiled.API.Interfaces.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Keycards;
+
using UnityEngine;
///
@@ -199,10 +202,10 @@ public ItemType FindMatch(bool matchDesign, bool matchPerms, bool matchColors)
goto add;
- cont:
+ cont:
continue;
- add:
+ add:
matches.Add(type);
}
diff --git a/EXILED/Exiled.API/Features/Items/Keycards/PermissionsProvider.cs b/EXILED/Exiled.API/Features/Items/Keycards/PermissionsProvider.cs
index bbf6b31de7..37ca31f796 100644
--- a/EXILED/Exiled.API/Features/Items/Keycards/PermissionsProvider.cs
+++ b/EXILED/Exiled.API/Features/Items/Keycards/PermissionsProvider.cs
@@ -8,9 +8,11 @@
namespace Exiled.API.Features.Items.Keycards
{
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items;
using InventorySystem.Items.Autosync;
using InventorySystem.Items.Keycards;
+
using Mirror;
///
diff --git a/EXILED/Exiled.API/Features/Items/Keycards/SingleUseKeycard.cs b/EXILED/Exiled.API/Features/Items/Keycards/SingleUseKeycard.cs
index 0caff46af8..e0a6b4676b 100644
--- a/EXILED/Exiled.API/Features/Items/Keycards/SingleUseKeycard.cs
+++ b/EXILED/Exiled.API/Features/Items/Keycards/SingleUseKeycard.cs
@@ -12,7 +12,9 @@ namespace Exiled.API.Features.Items.Keycards
using Exiled.API.Enums;
using Exiled.API.Features.Pickups;
using Exiled.API.Features.Pickups.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items;
using InventorySystem.Items.Keycards;
diff --git a/EXILED/Exiled.API/Features/Items/Marshmallow.cs b/EXILED/Exiled.API/Features/Items/Marshmallow.cs
index 16f7030000..9390c1b331 100644
--- a/EXILED/Exiled.API/Features/Items/Marshmallow.cs
+++ b/EXILED/Exiled.API/Features/Items/Marshmallow.cs
@@ -8,10 +8,14 @@
namespace Exiled.API.Features.Items
{
using CustomPlayerEffects;
+
using Exiled.API.Interfaces;
+
using InventorySystem.Items.MarshmallowMan;
using InventorySystem.Items.Usables;
+
using PlayerStatsSystem;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Items/MicroHid.cs b/EXILED/Exiled.API/Features/Items/MicroHid.cs
index 0495a3b3bc..07cad32048 100644
--- a/EXILED/Exiled.API/Features/Items/MicroHid.cs
+++ b/EXILED/Exiled.API/Features/Items/MicroHid.cs
@@ -7,14 +7,9 @@
namespace Exiled.API.Features.Items
{
- using System;
- using System.Reflection;
-
- using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
using InventorySystem.Items.Autosync;
- using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.MicroHID;
using InventorySystem.Items.MicroHID.Modules;
diff --git a/EXILED/Exiled.API/Features/Items/Radio.cs b/EXILED/Exiled.API/Features/Items/Radio.cs
index d54abae2d9..449bc6bb21 100644
--- a/EXILED/Exiled.API/Features/Items/Radio.cs
+++ b/EXILED/Exiled.API/Features/Items/Radio.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Items
{
using Enums;
+
using Exiled.API.Interfaces;
using InventorySystem.Items.Radio;
diff --git a/EXILED/Exiled.API/Features/Items/Scp127.cs b/EXILED/Exiled.API/Features/Items/Scp127.cs
index 2c71fbe4bb..31177095a4 100644
--- a/EXILED/Exiled.API/Features/Items/Scp127.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp127.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Firearms.Modules.Scp127;
+
using UnityEngine;
///
@@ -19,12 +20,12 @@ namespace Exiled.API.Features.Items
///
public class Scp127 : Firearm
{
- #pragma warning disable SA1401
+#pragma warning disable SA1401
///
/// Custom amount of max HS.
///
internal float? CustomHsMax;
- #pragma warning restore SA1401
+#pragma warning restore SA1401
///
/// Initializes a new instance of the class.
diff --git a/EXILED/Exiled.API/Features/Items/Scp1344.cs b/EXILED/Exiled.API/Features/Items/Scp1344.cs
index 7f96da8903..cd824fc3f0 100644
--- a/EXILED/Exiled.API/Features/Items/Scp1344.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp1344.cs
@@ -11,6 +11,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items.Usables;
using InventorySystem.Items.Usables.Scp1344;
+
using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers.Wearables;
///
@@ -66,10 +67,8 @@ public Scp1344Status Status
/// Whether or not 1344 should be dropped.
public void Deactivate(bool dropItem = false)
{
- if (Status is not(Scp1344Status.Active or Scp1344Status.Stabbing or Scp1344Status.Dropping))
- {
+ if (Status is not (Scp1344Status.Active or Scp1344Status.Stabbing or Scp1344Status.Dropping))
return;
- }
Base.Owner.DisableWearables(WearableElements.Scp1344Goggles);
Base.ActivateFinalEffects();
@@ -86,4 +85,4 @@ public void Deactivate(bool dropItem = false)
///
public void Actived() => Status = Scp1344Status.Stabbing;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Scp1509.cs b/EXILED/Exiled.API/Features/Items/Scp1509.cs
index 010aaf666e..7cd4a6eef1 100644
--- a/EXILED/Exiled.API/Features/Items/Scp1509.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp1509.cs
@@ -12,7 +12,9 @@ namespace Exiled.API.Features.Items
using Exiled.API.Enums;
using Exiled.API.Interfaces;
+
using InventorySystem.Items.Scp1509;
+
using PlayerRoles;
///
@@ -176,4 +178,4 @@ public IEnumerable RevivedPlayers
UnequipDecayDelay = UnequipDecayDelay,
};
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Scp1576.cs b/EXILED/Exiled.API/Features/Items/Scp1576.cs
index 3ff4514e4a..1b2551e66e 100644
--- a/EXILED/Exiled.API/Features/Items/Scp1576.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp1576.cs
@@ -50,4 +50,4 @@ internal Scp1576()
///
public void StopTransmitting() => Base.ServerStopTransmitting();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Scp330.cs b/EXILED/Exiled.API/Features/Items/Scp330.cs
index 38c9ded765..4df42da51e 100644
--- a/EXILED/Exiled.API/Features/Items/Scp330.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp330.cs
@@ -290,4 +290,4 @@ internal override void ChangeOwner(Player oldOwner, Player newOwner)
Base.Owner = newOwner.ReferenceHub;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Throwable.cs b/EXILED/Exiled.API/Features/Items/Throwable.cs
index 00a2e1af89..a4b0434632 100644
--- a/EXILED/Exiled.API/Features/Items/Throwable.cs
+++ b/EXILED/Exiled.API/Features/Items/Throwable.cs
@@ -113,4 +113,4 @@ public void Throw(bool fullForce = true)
/// A string containing Throwable-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{PinPullTime}|";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Items/Usable.cs b/EXILED/Exiled.API/Features/Items/Usable.cs
index efdff0c2ff..9da85656aa 100644
--- a/EXILED/Exiled.API/Features/Items/Usable.cs
+++ b/EXILED/Exiled.API/Features/Items/Usable.cs
@@ -12,7 +12,6 @@ namespace Exiled.API.Features.Items
using Exiled.API.Interfaces;
using InventorySystem;
- using InventorySystem.Items;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.Usables;
diff --git a/EXILED/Exiled.API/Features/Lift.cs b/EXILED/Exiled.API/Features/Lift.cs
index d191cd6764..8e47b7ba04 100644
--- a/EXILED/Exiled.API/Features/Lift.cs
+++ b/EXILED/Exiled.API/Features/Lift.cs
@@ -16,9 +16,12 @@ namespace Exiled.API.Features
using Exiled.API.Features.Doors;
using Exiled.API.Features.Pools;
using Exiled.API.Interfaces;
+
using Interactables.Interobjects;
using Interactables.Interobjects.DoorUtils;
+
using UnityEngine;
+
using Utils;
using static Interactables.Interobjects.ElevatorChamber;
@@ -83,7 +86,7 @@ internal Lift(ElevatorChamber elevator)
///
/// Gets a value of the internal doors list.
///
- public IReadOnlyCollection Doors => internalDoorsList.Select(x => Door.Get(x)).ToList();
+ public IReadOnlyCollection Doors => internalDoorsList.Select(Door.Get).ToList();
///
/// Gets a of in the .
@@ -332,4 +335,4 @@ public void ChangeLock(DoorLockReason lockReason)
/// A string containing Lift-related data.
public override string ToString() => $"{Type} {Status} [{CurrentLevel}] *{IsLocked}*";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Lockers/Chamber.cs b/EXILED/Exiled.API/Features/Lockers/Chamber.cs
index 610fcaa90f..980f5df9f6 100644
--- a/EXILED/Exiled.API/Features/Lockers/Chamber.cs
+++ b/EXILED/Exiled.API/Features/Lockers/Chamber.cs
@@ -16,8 +16,11 @@ namespace Exiled.API.Features.Lockers
using Exiled.API.Extensions;
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
+
using InventorySystem.Items.Pickups;
+
using MapGeneration.Distributors;
+
using UnityEngine;
///
@@ -304,4 +307,4 @@ public Vector3 GetRandomSpawnPoint()
/// .
internal static Chamber Get(LockerChamber chamber) => chamber == null ? null : Chambers.TryGetValue(chamber, out Chamber chmb) ? chmb : new(chamber, Locker.Get(x => x.Chambers.Any(x => x.Base == chamber)).FirstOrDefault());
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Lockers/Locker.cs b/EXILED/Exiled.API/Features/Lockers/Locker.cs
index 5b3d9e33cf..f4b4164adb 100644
--- a/EXILED/Exiled.API/Features/Lockers/Locker.cs
+++ b/EXILED/Exiled.API/Features/Lockers/Locker.cs
@@ -16,10 +16,8 @@ namespace Exiled.API.Features.Lockers
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
- using InventorySystem.Items.Pickups;
using MapGeneration.Distributors;
- using Mirror;
using UnityEngine;
using BaseLocker = MapGeneration.Distributors.Locker;
@@ -225,4 +223,4 @@ internal static void ClearCache()
Chamber.Chambers.Clear();
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs
index 4e8b3547ed..95c13e13c2 100644
--- a/EXILED/Exiled.API/Features/Map.cs
+++ b/EXILED/Exiled.API/Features/Map.cs
@@ -15,22 +15,33 @@ namespace Exiled.API.Features
using System.Linq;
using CommandSystem.Commands.RemoteAdmin.Cleanup;
+
using Decals;
+
using Enums;
+
using Exiled.API.Extensions;
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Features.Pickups;
using Interactables.Interobjects;
+
using InventorySystem;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.ThrowableProjectiles;
+
using Items;
+
using LightContainmentZoneDecontamination;
+
using MapGeneration;
+
using PlayerRoles.Ragdolls;
+
using RemoteAdmin;
+
using UnityEngine;
+
using Utils;
using Utils.Networking;
@@ -531,4 +542,4 @@ internal static void ClearCache()
#pragma warning restore CS0618
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Npc.cs b/EXILED/Exiled.API/Features/Npc.cs
index 893feac92c..242f235091 100644
--- a/EXILED/Exiled.API/Features/Npc.cs
+++ b/EXILED/Exiled.API/Features/Npc.cs
@@ -14,15 +14,23 @@ namespace Exiled.API.Features
using CommandSystem;
using CommandSystem.Commands.RemoteAdmin.Dummies;
+
using Exiled.API.Enums;
using Exiled.API.Features.CustomStats;
using Exiled.API.Features.Roles;
+
using Footprinting;
+
using MEC;
+
using Mirror;
+
using NetworkManagerUtils.Dummies;
+
using PlayerRoles;
+
using PlayerStatsSystem;
+
using UnityEngine;
///
@@ -102,7 +110,7 @@ public float? MaxDistance
set
{
- if(!value.HasValue)
+ if (!value.HasValue)
return;
if (!GameObject.TryGetComponent(out PlayerFollower follower))
@@ -131,7 +139,7 @@ public float? MinDistance
set
{
- if(!value.HasValue)
+ if (!value.HasValue)
return;
if (!GameObject.TryGetComponent(out PlayerFollower follower))
@@ -160,7 +168,7 @@ public float? Speed
set
{
- if(!value.HasValue)
+ if (!value.HasValue)
return;
if (!GameObject.TryGetComponent(out PlayerFollower follower))
@@ -356,4 +364,4 @@ public void LateDestroy(float time)
});
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Objectives/EscapeObjective.cs b/EXILED/Exiled.API/Features/Objectives/EscapeObjective.cs
index 9b141f22f9..1bc646df3c 100644
--- a/EXILED/Exiled.API/Features/Objectives/EscapeObjective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/EscapeObjective.cs
@@ -9,7 +9,9 @@ namespace Exiled.API.Features.Objectives
{
using Exiled.API.Enums;
using Exiled.API.Interfaces;
+
using PlayerRoles;
+
using Respawning.Objectives;
using BaseObjective = Respawning.Objectives.EscapeObjective;
diff --git a/EXILED/Exiled.API/Features/Objectives/GeneratorActivatedObjective.cs b/EXILED/Exiled.API/Features/Objectives/GeneratorActivatedObjective.cs
index 77e95fa5e8..283d3b0d1a 100644
--- a/EXILED/Exiled.API/Features/Objectives/GeneratorActivatedObjective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/GeneratorActivatedObjective.cs
@@ -9,6 +9,7 @@ namespace Exiled.API.Features.Objectives
{
using Exiled.API.Enums;
using Exiled.API.Interfaces;
+
using Respawning.Objectives;
using BaseObjective = Respawning.Objectives.GeneratorActivatedObjective;
diff --git a/EXILED/Exiled.API/Features/Objectives/HumanDamageObjective.cs b/EXILED/Exiled.API/Features/Objectives/HumanDamageObjective.cs
index 5a9f136ba9..d34fb21611 100644
--- a/EXILED/Exiled.API/Features/Objectives/HumanDamageObjective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/HumanDamageObjective.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Objectives
using Exiled.API.Enums;
using Exiled.API.Features.DamageHandlers;
using Exiled.API.Interfaces;
+
using Respawning.Objectives;
using BaseObjective = Respawning.Objectives.HumanDamageObjective;
diff --git a/EXILED/Exiled.API/Features/Objectives/HumanKillObjective.cs b/EXILED/Exiled.API/Features/Objectives/HumanKillObjective.cs
index 7856d1845b..bd73b46ebc 100644
--- a/EXILED/Exiled.API/Features/Objectives/HumanKillObjective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/HumanKillObjective.cs
@@ -10,7 +10,9 @@ namespace Exiled.API.Features.Objectives
using Exiled.API.Enums;
using Exiled.API.Features.DamageHandlers;
using Exiled.API.Interfaces;
+
using PlayerRoles;
+
using Respawning.Objectives;
using BaseObjective = Respawning.Objectives.HumanKillObjective;
diff --git a/EXILED/Exiled.API/Features/Objectives/HumanObjective.cs b/EXILED/Exiled.API/Features/Objectives/HumanObjective.cs
index 77dd37f5c7..b6f50b4c31 100644
--- a/EXILED/Exiled.API/Features/Objectives/HumanObjective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/HumanObjective.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Objectives
{
using Exiled.API.Interfaces;
+
using Respawning.Objectives;
///
diff --git a/EXILED/Exiled.API/Features/Objectives/Objective.cs b/EXILED/Exiled.API/Features/Objectives/Objective.cs
index 7497737b0f..4a4f09388e 100644
--- a/EXILED/Exiled.API/Features/Objectives/Objective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/Objective.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -7,14 +7,15 @@
namespace Exiled.API.Features.Objectives
{
- using System;
using System.Collections.Generic;
using System.Linq;
using Exiled.API.Enums;
using Exiled.API.Features.Core;
using Exiled.API.Interfaces;
+
using PlayerRoles;
+
using Respawning;
using Respawning.Objectives;
@@ -69,7 +70,7 @@ internal Objective(FactionObjectiveBase objectiveFootprintBase)
ObjectiveType.HumanDamage => FactionInfluenceManager.Objectives.OfType().First(),
ObjectiveType.HumanKill => FactionInfluenceManager.Objectives.OfType().First(),
ObjectiveType.Escape => FactionInfluenceManager.Objectives.OfType().First(),
- _ => null
+ _ => null,
});
///
@@ -89,7 +90,7 @@ public static Objective Get(FactionObjectiveBase factionObjectiveBase)
BaseHumanDamageObjective humanDamageObjective => new HumanDamageObjective(humanDamageObjective),
BaseHumanKillObjective humanKillObjective => new HumanKillObjective(humanKillObjective),
BaseEscapeObjective escapeObjective => new EscapeObjective(escapeObjective),
- _ => new Objective(factionObjectiveBase)
+ _ => new Objective(factionObjectiveBase),
};
}
diff --git a/EXILED/Exiled.API/Features/Objectives/ScpItemPickupObjective.cs b/EXILED/Exiled.API/Features/Objectives/ScpItemPickupObjective.cs
index a50a36057f..e4d79ad4b1 100644
--- a/EXILED/Exiled.API/Features/Objectives/ScpItemPickupObjective.cs
+++ b/EXILED/Exiled.API/Features/Objectives/ScpItemPickupObjective.cs
@@ -11,7 +11,9 @@ namespace Exiled.API.Features.Objectives
using Exiled.API.Features.Items;
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
+
using Respawning.Objectives;
+
using UnityEngine;
using BaseObjective = Respawning.Objectives.ScpItemPickupObjective;
diff --git a/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs b/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs
index ce68921031..b061a06ba4 100644
--- a/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs
@@ -68,4 +68,4 @@ public ushort Ammo
/// A string containing AmmoPickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{MaxDisplayedAmmo}| -{Ammo}-";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
index 3de6897413..aef81f1c79 100644
--- a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
@@ -18,8 +18,6 @@ namespace Exiled.API.Features.Pickups
using InventorySystem.Items;
using InventorySystem.Items.Armor;
- using UnityEngine;
-
using BaseBodyArmor = InventorySystem.Items.Armor.BodyArmorPickup;
///
@@ -144,4 +142,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
index 66ad5633db..1315fc2be4 100644
--- a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Pickups
using System;
using Exiled.API.Interfaces;
+
using InventorySystem.Items;
using InventorySystem.Items.Firearms;
using InventorySystem.Items.Firearms.Attachments;
@@ -177,4 +178,4 @@ protected override void InitializeProperties(ItemBase itemBase)
MaxAmmo = magazine.AmmoMax;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs b/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
index 3cdb59898e..d8d9f9bf95 100644
--- a/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
@@ -88,4 +88,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs b/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs
index 3d62c428fc..3cb4e21bf6 100644
--- a/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs
@@ -94,4 +94,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
index 93c18ff7bf..d7f0ef0df2 100644
--- a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
@@ -134,4 +134,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs
index 5a80eb35ca..f084899e32 100644
--- a/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs
@@ -87,4 +87,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Keycards/CustomKeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/Keycards/CustomKeycardPickup.cs
index 58e24a105e..d8694292f8 100644
--- a/EXILED/Exiled.API/Features/Pickups/Keycards/CustomKeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Keycards/CustomKeycardPickup.cs
@@ -16,11 +16,14 @@ namespace Exiled.API.Features.Pickups.Keycards
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Features.Pools;
using Exiled.API.Interfaces.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Keycards;
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
@@ -164,10 +167,10 @@ public ItemType FindMatch(bool matchDesign, bool matchPerms, bool matchColors)
goto add;
- cont:
+ cont:
continue;
- add:
+ add:
matches.Add(type);
}
diff --git a/EXILED/Exiled.API/Features/Pickups/Keycards/ManagementKeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/Keycards/ManagementKeycardPickup.cs
index 9666c24b21..cf6d6e6b82 100644
--- a/EXILED/Exiled.API/Features/Pickups/Keycards/ManagementKeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Keycards/ManagementKeycardPickup.cs
@@ -9,9 +9,12 @@ namespace Exiled.API.Features.Pickups.Keycards
{
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Interfaces.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.Keycards;
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Pickups/Keycards/MetalKeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/Keycards/MetalKeycardPickup.cs
index cf1c0ea894..94b34e7c92 100644
--- a/EXILED/Exiled.API/Features/Pickups/Keycards/MetalKeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Keycards/MetalKeycardPickup.cs
@@ -9,9 +9,12 @@ namespace Exiled.API.Features.Pickups.Keycards
{
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Interfaces.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.Keycards;
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Pickups/Keycards/SingleUseKeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/Keycards/SingleUseKeycardPickup.cs
index 8a79b0d405..62037fb344 100644
--- a/EXILED/Exiled.API/Features/Pickups/Keycards/SingleUseKeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Keycards/SingleUseKeycardPickup.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Pickups.Keycards
using Exiled.API.Enums;
using Exiled.API.Features.Items;
using Exiled.API.Features.Items.Keycards;
+
using InventorySystem.Items;
using InventorySystem.Items.Keycards;
using InventorySystem.Items.Pickups;
diff --git a/EXILED/Exiled.API/Features/Pickups/Keycards/Site02KeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/Keycards/Site02KeycardPickup.cs
index 162ec6a721..9417f4c4e2 100644
--- a/EXILED/Exiled.API/Features/Pickups/Keycards/Site02KeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Keycards/Site02KeycardPickup.cs
@@ -9,9 +9,12 @@ namespace Exiled.API.Features.Pickups.Keycards
{
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Interfaces.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.Keycards;
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Pickups/Keycards/TaskForceKeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/Keycards/TaskForceKeycardPickup.cs
index a6874f57d3..a55c810864 100644
--- a/EXILED/Exiled.API/Features/Pickups/Keycards/TaskForceKeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Keycards/TaskForceKeycardPickup.cs
@@ -9,9 +9,12 @@ namespace Exiled.API.Features.Pickups.Keycards
{
using Exiled.API.Features.Items.Keycards;
using Exiled.API.Interfaces.Keycards;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.Keycards;
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs b/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs
index 255c32b6ad..5091387416 100644
--- a/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs
@@ -7,8 +7,8 @@
namespace Exiled.API.Features.Pickups
{
- using Exiled.API.Features.Items;
using Exiled.API.Interfaces;
+
using InventorySystem.Items.MicroHID.Modules;
using BaseMicroHID = InventorySystem.Items.MicroHID.MicroHIDPickup;
@@ -149,4 +149,4 @@ public bool TryGetFireController(MicroHidFiringMode firingMode, out T module)
/// A string containing MicroHIDPickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{Energy}|";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Pickup.cs
index 5dcceb6135..4c49efbd70 100644
--- a/EXILED/Exiled.API/Features/Pickups/Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Pickup.cs
@@ -7,7 +7,6 @@
namespace Exiled.API.Features.Pickups
{
- using System;
using System.Collections.Generic;
using System.Linq;
@@ -24,7 +23,9 @@ namespace Exiled.API.Features.Pickups
using InventorySystem.Items.Usables.Scp244;
using Mirror;
+
using RelativePositioning;
+
using UnityEngine;
using BaseAmmoPickup = InventorySystem.Items.Firearms.Ammo.AmmoPickup;
@@ -376,7 +377,7 @@ public static T Get(ItemPickupBase pickupBase)
///
/// An of to convert into an of .
/// An of containing all existing instances.
- public static IEnumerable Get(IEnumerable pickups) => pickups.Select(ipb => Get(ipb));
+ public static IEnumerable Get(IEnumerable pickups) => pickups.Select(Get);
///
/// Gets an of containing all existing instances given an .
@@ -688,4 +689,4 @@ protected virtual void InitializeProperties(ItemBase itemBase)
{
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs
index a4cd84ef93..6508d90160 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs
@@ -47,4 +47,4 @@ internal EffectGrenadeProjectile(ItemType type)
/// A string containing EffectGrenadePickup-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{Position}| -{IsLocked}- ={InUse}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs
index 07cdbebefb..47809957a9 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs
@@ -104,4 +104,4 @@ public float ScpDamageMultiplier
/// A string containing ExplosionGrenadePickup-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{Position}| -{IsLocked}- ={InUse}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
index 8d30856743..361d5428fa 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
@@ -74,4 +74,4 @@ public float SurfaceDistanceIntensifier
/// A string containing FlashbangPickup-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{Position}| -{IsLocked}- ={InUse}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs
index f9d5b4f10d..276353262a 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs
@@ -12,10 +12,12 @@ namespace Exiled.API.Features.Pickups.Projectiles
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Interfaces;
+
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.ThrowableProjectiles;
+
using UnityEngine;
using Object = UnityEngine.Object;
@@ -170,4 +172,4 @@ public Projectile Spawn(Vector3 position, Quaternion? rotation = null, bool shou
/// A string containing ProjectilePickup-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{Position}| -{IsLocked}- ={InUse}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs
index f33d935a97..9e44ea478c 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs
@@ -7,10 +7,10 @@
namespace Exiled.API.Features.Pickups.Projectiles
{
- using System;
using System.Reflection;
using Exiled.API.Interfaces;
+
using HarmonyLib;
using InventorySystem.Items.ThrowableProjectiles;
@@ -105,4 +105,4 @@ public float FriendlyFireTime
/// A string containing Scp018Pickup-related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{Position}| -{Damage}- ={IgnoreFriendlyFire}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs
index 0c5715a9b9..f1a902828c 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs
@@ -62,4 +62,4 @@ public bool DropSound
/// A string containing Scp2176Pickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{FuseTime}| ={IsAlreadyDetonated}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs
index cafd9be8cb..5a26e9a2ef 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs
@@ -92,4 +92,4 @@ public void Explode()
/// A string containing TimeGrenadePickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{FuseTime}| ={IsAlreadyDetonated}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs b/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs
index b2eef73401..80bb879b27 100644
--- a/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs
@@ -74,4 +74,4 @@ public bool IsEnabled
/// A string containing RadioPickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{BatteryLevel}| -{Range}- /{IsEnabled}/";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp1509Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp1509Pickup.cs
index 935bc636ca..6ea875e2fe 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp1509Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp1509Pickup.cs
@@ -9,6 +9,7 @@ namespace Exiled.API.Features.Pickups
{
using Exiled.API.Features.Items;
using Exiled.API.Interfaces;
+
using InventorySystem.Items;
using InventorySystem.Items.Scp1509;
@@ -95,4 +96,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs
index 64ab902dc6..805cf32ebe 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs
@@ -46,4 +46,4 @@ internal Scp1576Pickup()
/// A string containing Scp1576Pickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}*";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs
index bd11cecc42..0652792e3d 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs
@@ -12,7 +12,7 @@ namespace Exiled.API.Features.Pickups
using Exiled.API.Features.DamageHandlers;
using Exiled.API.Features.Items;
using Exiled.API.Interfaces;
- using InventorySystem.Items;
+
using InventorySystem.Items.Usables.Scp244;
using UnityEngine;
@@ -148,4 +148,4 @@ internal override void ReadItemInfo(Item item)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs
index a4a971afb7..1ff14d5b15 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs
@@ -68,4 +68,4 @@ public List Candies
/// A string containing Scp330Pickup related data.
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{ExposedCandy}| -{Candies}-";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs b/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs
index 023469e4fe..511e7ce4ac 100644
--- a/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs
@@ -68,4 +68,4 @@ protected override void InitializeProperties(ItemBase itemBase)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs
index cca81284ad..a377c0a483 100644
--- a/EXILED/Exiled.API/Features/Player.cs
+++ b/EXILED/Exiled.API/Features/Player.cs
@@ -14,10 +14,14 @@ namespace Exiled.API.Features
using System.Runtime.CompilerServices;
using Core;
+
using CustomPlayerEffects;
using CustomPlayerEffects.Danger;
+
using DamageHandlers;
+
using Enums;
+
using Exiled.API.Features.Core.Interfaces;
using Exiled.API.Features.CustomStats;
using Exiled.API.Features.Doors;
@@ -28,11 +32,17 @@ namespace Exiled.API.Features
using Exiled.API.Features.Roles;
using Exiled.API.Interfaces;
using Exiled.API.Structs;
+
using Extensions;
+
using Footprinting;
+
using global::Scp914;
+
using Hints;
+
using Interactables.Interobjects;
+
using InventorySystem;
using InventorySystem.Disarming;
using InventorySystem.Items;
@@ -42,24 +52,35 @@ namespace Exiled.API.Features
using InventorySystem.Items.Firearms.ShotEvents;
using InventorySystem.Items.Usables;
using InventorySystem.Items.Usables.Scp330;
+
using MapGeneration.Distributors;
using MapGeneration.Rooms;
+
using MEC;
+
using Mirror;
using Mirror.LiteNetLib4Mirror;
+
using PlayerRoles;
using PlayerRoles.FirstPersonControl;
using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
using PlayerRoles.RoleAssign;
using PlayerRoles.Spectating;
using PlayerRoles.Voice;
+
using PlayerStatsSystem;
+
using RelativePositioning;
+
using RemoteAdmin;
+
using RoundRestarting;
+
using UnityEngine;
+
using Utils;
using Utils.Networking;
+
using VoiceChat;
using VoiceChat.Playbacks;
@@ -918,10 +939,7 @@ public float ArtificialHealth
if (value > MaxArtificialHealth)
MaxArtificialHealth = value;
- AhpStat.AhpProcess ahp = ActiveArtificialHealthProcesses.FirstOrDefault();
-
- if (ahp is not null)
- ahp.CurrentAmount = value;
+ ActiveArtificialHealthProcesses.FirstOrDefault()?.CurrentAmount = value;
}
}
@@ -938,8 +956,7 @@ public float MaxArtificialHealth
AhpStat.AhpProcess ahp = ActiveArtificialHealthProcesses.FirstOrDefault();
- if (ahp is not null)
- ahp.Limit = value;
+ ahp?.Limit = value;
}
}
@@ -1542,7 +1559,7 @@ public static Player Get(string args)
/// Contains the updated arguments after processing.
/// Determines whether empty entries should be kept in the result.
/// An representing the processed players.
- public static IEnumerable GetProcessedData(ArraySegment args, int startIndex, out string[] newargs, bool keepEmptyEntries = false) => RAUtils.ProcessPlayerIdOrNamesList(args, startIndex, out newargs, keepEmptyEntries).Select(hub => Get(hub));
+ public static IEnumerable GetProcessedData(ArraySegment args, int startIndex, out string[] newargs, bool keepEmptyEntries = false) => RAUtils.ProcessPlayerIdOrNamesList(args, startIndex, out newargs, keepEmptyEntries).Select(Get);
///
/// Gets an containing all players processed based on the arguments specified.
@@ -4031,8 +4048,7 @@ public void SetCooldownItem(float time, ItemType itemType)
///
public override bool Equals(object obj)
{
- Player player = obj as Player;
- return (object)player != null && ReferenceHub == player.ReferenceHub;
+ return obj is Player player && ReferenceHub == player.ReferenceHub;
}
///
@@ -4048,7 +4064,7 @@ public override int GetHashCode()
/// The second player instance.
/// if the values are equal.
#pragma warning disable SA1201
- public static bool operator ==(Player player1, Player player2) => player1?.Equals(player2) ?? player2 is null;
+ public static bool operator ==(Player player1, Player player2) => player1?.Equals(player2) ?? (player2 is null);
///
/// Returns whether the two players are different.
diff --git a/EXILED/Exiled.API/Features/Plugin.cs b/EXILED/Exiled.API/Features/Plugin.cs
index cebeab971f..e2818fb8df 100644
--- a/EXILED/Exiled.API/Features/Plugin.cs
+++ b/EXILED/Exiled.API/Features/Plugin.cs
@@ -15,9 +15,13 @@ namespace Exiled.API.Features
using System.Reflection;
using CommandSystem;
+
using Enums;
+
using Extensions;
+
using Interfaces;
+
using RemoteAdmin;
///
@@ -122,9 +126,7 @@ public virtual void OnRegisteringCommands()
if (typeof(ParentCommand).IsAssignableFrom(commandHandlerType))
{
- ParentCommand parentCommand = GetCommand(commandHandlerType) as ParentCommand;
-
- if (parentCommand == null)
+ if (GetCommand(commandHandlerType) is not ParentCommand parentCommand)
{
if (!toRegister.TryGetValue(commandHandlerType, out List list))
toRegister.Add(commandHandlerType, new() { command });
diff --git a/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs b/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs
index 93ebd299d4..a1352d6b8d 100644
--- a/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs
@@ -83,4 +83,4 @@ public KeyValuePair[] ToArrayReturn(Dictionary obj)
return array;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pools/HashSetPool.cs b/EXILED/Exiled.API/Features/Pools/HashSetPool.cs
index b8749f5faa..06332c0437 100644
--- a/EXILED/Exiled.API/Features/Pools/HashSetPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/HashSetPool.cs
@@ -56,4 +56,4 @@ public T[] ToArrayReturn(HashSet obj)
return array;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pools/IPool.cs b/EXILED/Exiled.API/Features/Pools/IPool.cs
index 57a2f3da46..edd40fedf4 100644
--- a/EXILED/Exiled.API/Features/Pools/IPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/IPool.cs
@@ -25,4 +25,4 @@ public interface IPool
/// The object to return, of type .
public void Return(T obj);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pools/ListPool.cs b/EXILED/Exiled.API/Features/Pools/ListPool.cs
index f0508f7834..dda0918930 100644
--- a/EXILED/Exiled.API/Features/Pools/ListPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/ListPool.cs
@@ -62,4 +62,4 @@ public T[] ToArrayReturn(List obj)
return array;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pools/QueuePool.cs b/EXILED/Exiled.API/Features/Pools/QueuePool.cs
index 04b5f3df50..7b3e093a9f 100644
--- a/EXILED/Exiled.API/Features/Pools/QueuePool.cs
+++ b/EXILED/Exiled.API/Features/Pools/QueuePool.cs
@@ -77,4 +77,4 @@ public T[] ToArrayReturn(Queue obj)
return array;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs b/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs
index 16d84cc697..edf576e663 100644
--- a/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs
@@ -52,4 +52,4 @@ public string ToStringReturn(StringBuilder obj)
return s;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/PrefabHelper.cs b/EXILED/Exiled.API/Features/PrefabHelper.cs
index 22579651ac..fe05eceef2 100644
--- a/EXILED/Exiled.API/Features/PrefabHelper.cs
+++ b/EXILED/Exiled.API/Features/PrefabHelper.cs
@@ -14,9 +14,12 @@ namespace Exiled.API.Features
using Exiled.API.Enums;
using Exiled.API.Features.Attributes;
+
using MapGeneration.Distributors;
using MapGeneration.RoomConnectors;
+
using Mirror;
+
using UnityEngine;
///
@@ -32,7 +35,7 @@ public static class PrefabHelper
///
/// Gets a of and their corresponding .
///
- public static IReadOnlyDictionary PrefabToGameObjectAndComponent => Prefabs;
+ public static IReadOnlyDictionary PrefabToGameObjectAndComponent => Prefabs;
///
/// Gets a of and their corresponding .
@@ -124,7 +127,7 @@ public static GameObject Spawn(PrefabType prefabType, Vector3 position = default
PrefabType.HCZTwoSided => 0b00000000,
PrefabType.HCZOneSided => 0b00000001,
PrefabType.HCZBreakableDoor => 0b00000011,
- _ => 0
+ _ => 0,
};
}
diff --git a/EXILED/Exiled.API/Features/Ragdoll.cs b/EXILED/Exiled.API/Features/Ragdoll.cs
index 19321ee35d..e743ad4ea2 100644
--- a/EXILED/Exiled.API/Features/Ragdoll.cs
+++ b/EXILED/Exiled.API/Features/Ragdoll.cs
@@ -12,15 +12,22 @@ namespace Exiled.API.Features
using System.Linq;
using DeathAnimations;
+
using Enums;
+
using Exiled.API.Extensions;
using Exiled.API.Interfaces;
+
using Mirror;
+
using PlayerRoles;
using PlayerRoles.PlayableScps.Scp049.Zombies;
using PlayerRoles.Ragdolls;
+
using PlayerStatsSystem;
+
using RelativePositioning;
+
using UnityEngine;
using BaseScp3114Ragdoll = PlayerRoles.PlayableScps.Scp3114.Scp3114Ragdoll;
@@ -472,4 +479,4 @@ public void Spawn(NetworkConnection ownerConnection, uint? assetId = null)
/// A string containing Ragdoll-related data.
public override string ToString() => $"{Owner} ({Name}) [{DeathReason}] *{Role}* |{CreationTime}| ={IsExpired}=";
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Recontainer.cs b/EXILED/Exiled.API/Features/Recontainer.cs
index dbc31a35bf..4b17861038 100644
--- a/EXILED/Exiled.API/Features/Recontainer.cs
+++ b/EXILED/Exiled.API/Features/Recontainer.cs
@@ -12,8 +12,11 @@ namespace Exiled.API.Features
using System.Linq;
using Enums;
+
using Exiled.API.Features.Doors;
+
using PlayerRoles.PlayableScps.Scp079;
+
using UnityEngine;
///
@@ -187,7 +190,9 @@ public static bool IsContainmentSequenceSuccessful
///
/// The announcement to play.
/// The glitchy multiplier.
+#pragma warning disable IDE0060 // TODO: glitchyMultiplier is not used
public static void PlayAnnouncement(string announcement, float glitchyMultiplier) => Base.PlayAnnouncement(announcement, false, false, null);
+#pragma warning restore IDE0060
///
/// Begins the overcharge procedure.
diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs
index 6a49231d1c..aeebe336f6 100644
--- a/EXILED/Exiled.API/Features/Respawn.cs
+++ b/EXILED/Exiled.API/Features/Respawn.cs
@@ -12,12 +12,17 @@ namespace Exiled.API.Features
using System.Linq;
using CustomPlayerEffects;
+
using Enums;
+
using Extensions;
+
using PlayerRoles;
+
using Respawning;
using Respawning.Waves;
using Respawning.Waves.Generic;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs b/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs
index 42e6cfe349..230a127c4c 100644
--- a/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs
@@ -7,14 +7,7 @@
namespace Exiled.API.Features.Roles
{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
using PlayerRoles;
- using PlayerRoles.Voice;
///
/// Defines a role that represents players with destroyed role.
@@ -33,4 +26,4 @@ internal DestroyedRole(PlayerRoleBase baseRole)
///
public override RoleTypeId Type { get; } = RoleTypeId.Destroyed;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs b/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs
index 632abc33aa..a245812f32 100644
--- a/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Roles
{
using PlayerRoles;
+
using UnityEngine;
using FilmmakerGameRole = PlayerRoles.Filmmaker.FilmmakerRole;
diff --git a/EXILED/Exiled.API/Features/Roles/FpcRole.cs b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
index e61e866ea7..17294f5236 100644
--- a/EXILED/Exiled.API/Features/Roles/FpcRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
@@ -11,6 +11,7 @@ namespace Exiled.API.Features.Roles
using System.Collections.Generic;
using Exiled.API.Features.Pools;
+
using PlayerRoles;
using PlayerRoles.FirstPersonControl;
using PlayerRoles.FirstPersonControl.Thirdperson;
@@ -18,8 +19,11 @@ namespace Exiled.API.Features.Roles
using PlayerRoles.Spectating;
using PlayerRoles.Visibility;
using PlayerRoles.Voice;
+
using PlayerStatsSystem;
+
using RelativePositioning;
+
using UnityEngine;
///
@@ -348,4 +352,4 @@ public void Jump(float? jumpStrength = null)
FirstPersonController.FpcModule.Motor.JumpController.ForceJump(strength);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/HumanRole.cs b/EXILED/Exiled.API/Features/Roles/HumanRole.cs
index 767a010d45..307376b44b 100644
--- a/EXILED/Exiled.API/Features/Roles/HumanRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/HumanRole.cs
@@ -9,7 +9,7 @@ namespace Exiled.API.Features.Roles
{
using PlayerRoles;
using PlayerRoles.PlayableScps.HumeShield;
- using Respawning;
+
using Respawning.NamingRules;
using HumanGameRole = PlayerRoles.HumanRole;
diff --git a/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs b/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs
index e0921af831..741d274e0d 100644
--- a/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs
@@ -19,4 +19,4 @@ public interface IHumeShieldRole
///
HumeShieldModuleBase HumeShieldModule { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/NoneRole.cs b/EXILED/Exiled.API/Features/Roles/NoneRole.cs
index ed52752a5a..fe7aeb774f 100644
--- a/EXILED/Exiled.API/Features/Roles/NoneRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/NoneRole.cs
@@ -30,6 +30,6 @@ internal NoneRole(PlayerRoleBase baseRole)
public override RoleTypeId Type { get; } = RoleTypeId.None;
///
- public VoiceModuleBase VoiceModule => (Base as NoneGameRole) !.VoiceModule;
+ public VoiceModuleBase VoiceModule => (Base as NoneGameRole).VoiceModule;
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs b/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs
index 92ce09fa3f..d8f94198a9 100644
--- a/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs
@@ -40,4 +40,4 @@ internal OverwatchRole(OverwatchGameRole baseRole)
/// The overwatch RoleType.
public RoleTypeId GetObfuscatedRole() => Base.GetRoleForUser(Owner.ReferenceHub);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/Role.cs b/EXILED/Exiled.API/Features/Roles/Role.cs
index 31f53ac040..f6745bcb12 100644
--- a/EXILED/Exiled.API/Features/Roles/Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Role.cs
@@ -10,12 +10,16 @@ namespace Exiled.API.Features.Roles
using System;
using Enums;
+
using Exiled.API.Features.Core;
using Exiled.API.Features.Spawn;
using Exiled.API.Interfaces;
+
using Extensions;
+
using PlayerRoles;
using PlayerRoles.PlayableScps.Scp049.Zombies;
+
using UnityEngine;
using DestroyedGameRole = PlayerRoles.DestroyedRole;
@@ -138,7 +142,7 @@ protected Role(PlayerRoleBase baseRole)
/// The role.
/// The other role.
/// if the values are equal.
- public static bool operator ==(Role left, Role right) => left?.Equals(right) ?? right is null;
+ public static bool operator ==(Role left, Role right) => left?.Equals(right) ?? (right is null);
///
/// Returns whether the two roles are different.
@@ -242,4 +246,4 @@ public virtual void Set(RoleTypeId newRole, SpawnReason reason, RoleSpawnFlags s
_ => throw new Exception($"Missing role found in Exiled.API.Features.Roles.Role::Create ({role?.RoleTypeId}). Please contact an Exiled developer."),
};
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/Scp049Role.cs b/EXILED/Exiled.API/Features/Roles/Scp049Role.cs
index 6283226eb4..05b163d390 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp049Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp049Role.cs
@@ -11,13 +11,16 @@ namespace Exiled.API.Features.Roles
using System.Linq;
using CustomPlayerEffects;
+
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.HumeShield;
using PlayerRoles.PlayableScps.Scp049;
using PlayerRoles.Ragdolls;
using PlayerRoles.Subroutines;
+
using PlayerStatsSystem;
+
using UnityEngine;
using Scp049GameRole = PlayerRoles.PlayableScps.Scp049.Scp049Role;
@@ -116,7 +119,7 @@ internal Scp049Role(Scp049GameRole baseRole)
///
/// Gets all the dead zombies.
///
- public IEnumerable DeadZombies => Scp049ResurrectAbility.DeadZombies.Select(x => Player.Get(x));
+ public IEnumerable DeadZombies => Scp049ResurrectAbility.DeadZombies.Select(Player.Get);
///
/// Gets all the resurrected players.
@@ -362,4 +365,4 @@ public void Sense(Player player)
/// The Spawn Chance.
public float GetSpawnChance(List alreadySpawned) => Base.GetSpawnChance(alreadySpawned);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs
index 9d7e308659..37202c1cdb 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs
@@ -12,9 +12,13 @@ namespace Exiled.API.Features.Roles
using Exiled.API.Enums;
using Exiled.API.Features.Doors;
+
using Interactables.Interobjects.DoorUtils;
+
using MapGeneration;
+
using Mirror;
+
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.Scp079;
@@ -23,7 +27,9 @@ namespace Exiled.API.Features.Roles
using PlayerRoles.PlayableScps.Scp079.Rewards;
using PlayerRoles.Subroutines;
using PlayerRoles.Voice;
+
using RelativePositioning;
+
using Utils.NonAllocLINQ;
using Mathf = UnityEngine.Mathf;
@@ -621,4 +627,4 @@ public void ActivateTesla(bool consumeEnergy = true)
/// The Spawn Chance.
public float GetSpawnChance(List alreadySpawned) => Base.GetSpawnChance(alreadySpawned);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/Scp096Role.cs b/EXILED/Exiled.API/Features/Roles/Scp096Role.cs
index 6e78b6c662..7dba16ecd4 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp096Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp096Role.cs
@@ -322,4 +322,4 @@ public void Charge(float cooldown = 1f)
/// The Spawn Chance.
public float GetSpawnChance(List alreadySpawned) => Base.GetSpawnChance(alreadySpawned);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs
index 8c5fda149a..fa94fe883e 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs
@@ -10,11 +10,13 @@ namespace Exiled.API.Features.Roles
using System.Collections.Generic;
using Exiled.API.Enums;
+
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.HumeShield;
using PlayerRoles.PlayableScps.Scp106;
using PlayerRoles.Subroutines;
+
using PlayerStatsSystem;
using UnityEngine;
diff --git a/EXILED/Exiled.API/Features/Roles/Scp1507Role.cs b/EXILED/Exiled.API/Features/Roles/Scp1507Role.cs
index a4c9ba78cf..cb1bce9f4f 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp1507Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp1507Role.cs
@@ -66,4 +66,4 @@ internal Scp1507Role(Scp1507GameRole baseRole)
/// The Spawn Chance.
public float GetSpawnChance(List alreadySpawned) => Base is ISpawnableScp spawnableScp ? spawnableScp.GetSpawnChance(alreadySpawned) : 0;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/Scp173Role.cs b/EXILED/Exiled.API/Features/Roles/Scp173Role.cs
index f7f603eece..30928530d0 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp173Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp173Role.cs
@@ -11,12 +11,15 @@ namespace Exiled.API.Features.Roles
using System.Linq;
using Exiled.API.Features.Hazards;
+
using Mirror;
+
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.HumeShield;
using PlayerRoles.PlayableScps.Scp173;
using PlayerRoles.Subroutines;
+
using UnityEngine;
using Scp173GameRole = PlayerRoles.PlayableScps.Scp173.Scp173Role;
@@ -162,7 +165,7 @@ public float RemainingTantrumCooldown
///
/// Gets a of players that are currently viewing SCP-173. Can be empty.
///
- public IEnumerable ObservingPlayers => ObserversTracker.Observers.Select(x => Player.Get(x));
+ public IEnumerable ObservingPlayers => ObserversTracker.Observers.Select(Player.Get);
///
/// Gets SCP-173's max move speed.
diff --git a/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs b/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
index 35a3aa032a..4d685518cd 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
@@ -10,6 +10,7 @@ namespace Exiled.API.Features.Roles
using System.Collections.Generic;
using Exiled.API.Enums;
+
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.HumeShield;
diff --git a/EXILED/Exiled.API/Features/Roles/Scp939Role.cs b/EXILED/Exiled.API/Features/Roles/Scp939Role.cs
index 222a57670d..42799d47a1 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp939Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp939Role.cs
@@ -329,4 +329,4 @@ public void DestroyCurrentMimicPoint()
/// The Spawn Chance.
public float GetSpawnChance(List alreadySpawned) => Base.GetSpawnChance(alreadySpawned);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs b/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs
index d7fbcc7920..1ae9c59cab 100644
--- a/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs
@@ -11,6 +11,7 @@ namespace Exiled.API.Features.Roles
using PlayerRoles;
using PlayerRoles.Voice;
+
using UnityEngine;
using SpectatorGameRole = PlayerRoles.Spectating.SpectatorRole;
@@ -74,4 +75,4 @@ public Player SpectatedPlayer
///
public VoiceModuleBase VoiceModule => Base.VoiceModule;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Room.cs b/EXILED/Exiled.API/Features/Room.cs
index 45a86e7580..bee30fa96c 100644
--- a/EXILED/Exiled.API/Features/Room.cs
+++ b/EXILED/Exiled.API/Features/Room.cs
@@ -12,18 +12,26 @@ namespace Exiled.API.Features
using System.Linq;
using Enums;
+
using Exiled.API.Extensions;
using Exiled.API.Features.Doors;
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
+
using MapGeneration;
using MapGeneration.Holidays;
using MapGeneration.Rooms;
+
using MEC;
+
using Mirror;
+
using PlayerRoles.PlayableScps.Scp079;
+
using RelativePositioning;
+
using UnityEngine;
+
using Utils.NonAllocLINQ;
///
@@ -500,7 +508,7 @@ private static RoomType FindType(GameObject gameObject)
"HCZ_Corner_Deep" => RoomType.HczCornerDeep,
"HCZ_Straight" => RoomType.HczStraight,
"HCZ_Straight_C" => RoomType.HczStraightC,
- "HCZ_Straight_PipeRoom"=> RoomType.HczStraightPipeRoom,
+ "HCZ_Straight_PipeRoom" => RoomType.HczStraightPipeRoom,
"HCZ_Straight Variant" => RoomType.HczStraightVariant,
"HCZ_ChkpA" => RoomType.HczElevatorA,
"HCZ_ChkpB" => RoomType.HczElevatorB,
@@ -533,7 +541,7 @@ private static RoomType FindType(GameObject gameObject)
"HCZ_EZ_Checkpoint Part" => gameObject.transform.position.z switch
{
> 95 => RoomType.HczEzCheckpointA,
- _ => RoomType.HczEzCheckpointB
+ _ => RoomType.HczEzCheckpointB,
},
_ => RoomType.Unknown,
};
@@ -546,4 +554,4 @@ private static string TryRemovePostfixes(string str)
return str;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Round.cs b/EXILED/Exiled.API/Features/Round.cs
index 02a3407b5a..1ee9b16407 100644
--- a/EXILED/Exiled.API/Features/Round.cs
+++ b/EXILED/Exiled.API/Features/Round.cs
@@ -259,4 +259,4 @@ public static bool EndRound(bool forceEnd = false)
///
public static void Start() => CharacterClassManager.ForceRoundStart();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs b/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs
index e8bb6a3f02..de6006d8f8 100644
--- a/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs
+++ b/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features
{
using Exiled.API.Interfaces;
+
using PlayerRoles;
using BaseScp3114Ragdoll = PlayerRoles.PlayableScps.Scp3114.Scp3114Ragdoll;
@@ -75,4 +76,4 @@ public bool IsPlayingAnimation
set => Base._playingAnimation = value;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Scp559.cs b/EXILED/Exiled.API/Features/Scp559.cs
index 246a030d7f..1a0225e446 100644
--- a/EXILED/Exiled.API/Features/Scp559.cs
+++ b/EXILED/Exiled.API/Features/Scp559.cs
@@ -12,7 +12,9 @@ namespace Exiled.API.Features
using System.Linq;
using Exiled.API.Interfaces;
+
using MapGeneration;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Scp914.cs b/EXILED/Exiled.API/Features/Scp914.cs
index 7d9ea65818..3088d8849c 100644
--- a/EXILED/Exiled.API/Features/Scp914.cs
+++ b/EXILED/Exiled.API/Features/Scp914.cs
@@ -13,7 +13,9 @@ namespace Exiled.API.Features
using Exiled.API.Features.Doors;
using Exiled.API.Features.Pickups;
using Exiled.API.Features.Pools;
+
using global::Scp914;
+
using UnityEngine;
///
@@ -141,4 +143,4 @@ public static IEnumerable Scp914InputObject(out IEnumerable
/// Interact code.
public static void Start(Player player = null, Scp914InteractCode code = Scp914InteractCode.Activate) => Scp914Controller.ServerInteract((player ?? Server.Host).ReferenceHub, (byte)code);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Scp956.cs b/EXILED/Exiled.API/Features/Scp956.cs
index 49c90a5b36..cdcc2b75ee 100644
--- a/EXILED/Exiled.API/Features/Scp956.cs
+++ b/EXILED/Exiled.API/Features/Scp956.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Features
using Exiled.API.Enums;
using Exiled.API.Extensions;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs
index 0d5809912e..fd90b8d14c 100644
--- a/EXILED/Exiled.API/Features/Server.cs
+++ b/EXILED/Exiled.API/Features/Server.cs
@@ -11,8 +11,6 @@ namespace Exiled.API.Features
using System.Collections.Generic;
using System.Reflection;
- using Exiled.API.Enums;
-
using GameCore;
using Interfaces;
diff --git a/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs
index 405a285098..63f85fa6a4 100644
--- a/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs
@@ -12,7 +12,9 @@ namespace Exiled.API.Features.Spawn
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features.Lockers;
+
using UnityEngine;
+
using YamlDotNet.Serialization;
///
@@ -78,4 +80,4 @@ public void GetSpawningInfo(out Locker locker, out Chamber chamber, out Vector3
position = chamber?.GetRandomSpawnPoint() ?? (Offset == Vector3.zero ? locker.Position : locker.Transform.TransformPoint(Offset));
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs
index 97041a2c92..dc219b40a6 100644
--- a/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs
@@ -56,4 +56,4 @@ public override Vector3 Position
set => throw new InvalidOperationException("The position of this type of SpawnPoint cannot be changed.");
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs b/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs
index 975d5bc77e..a1426f2fa6 100644
--- a/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs
+++ b/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Spawn
{
using Exiled.API.Interfaces;
+
using PlayerRoles;
using UnityEngine;
@@ -45,4 +46,4 @@ public SpawnLocation(RoleTypeId roleType, Vector3 position, float horizontalRota
///
public float HorizontalRotation { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs
index 880ea9e35a..66ccfb4f22 100644
--- a/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Features.Spawn
{
using Exiled.API.Interfaces;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/TeslaGate.cs b/EXILED/Exiled.API/Features/TeslaGate.cs
index ddc04ac791..dd9893e929 100644
--- a/EXILED/Exiled.API/Features/TeslaGate.cs
+++ b/EXILED/Exiled.API/Features/TeslaGate.cs
@@ -12,9 +12,13 @@ namespace Exiled.API.Features
using System.Linq;
using Exiled.API.Interfaces;
+
using Hazards;
+
using MEC;
+
using PlayerRoles;
+
using UnityEngine;
using BaseTeslaGate = global::TeslaGate;
@@ -178,7 +182,7 @@ public bool UseInstantBurst
///
/// Gets a of which contains all the tantrums to destroy.
///
- public IEnumerable TantrumsToDestroy => Base.TantrumsToBeDestroyed.Select(x => Hazard.Get(x));
+ public IEnumerable TantrumsToDestroy => Base.TantrumsToBeDestroyed.Select(Hazard.Get);
///
/// Gets a of which contains all the players inside the hurt range.
@@ -293,4 +297,4 @@ public bool CanBeIdle(Player player) => player is not null && player.IsAlive &&
public bool CanBeTriggered(Player player) => player is not null && player.IsAlive && !IgnoredPlayers.Contains(player) && !IgnoredRoles.Contains(player.Role) &&
!IgnoredTeams.Contains(player.Role.Team) && IsPlayerInTriggerRange(player);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
index 6f8fe5555a..84983ae556 100644
--- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs
+++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
@@ -12,8 +12,11 @@ namespace Exiled.API.Features.Toys
using AdminToys;
using Enums;
+
using Exiled.API.Interfaces;
+
using Footprinting;
+
using Mirror;
using UnityEngine;
diff --git a/EXILED/Exiled.API/Features/Toys/Light.cs b/EXILED/Exiled.API/Features/Toys/Light.cs
index 4dad774de2..6bf193b624 100644
--- a/EXILED/Exiled.API/Features/Toys/Light.cs
+++ b/EXILED/Exiled.API/Features/Toys/Light.cs
@@ -13,6 +13,7 @@ namespace Exiled.API.Features.Toys
using AdminToys;
using Enums;
+
using Exiled.API.Interfaces;
using UnityEngine;
diff --git a/EXILED/Exiled.API/Features/Toys/Primitive.cs b/EXILED/Exiled.API/Features/Toys/Primitive.cs
index 9ca95036da..ad00b21f56 100644
--- a/EXILED/Exiled.API/Features/Toys/Primitive.cs
+++ b/EXILED/Exiled.API/Features/Toys/Primitive.cs
@@ -7,14 +7,15 @@
namespace Exiled.API.Features.Toys
{
- using System;
using System.Linq;
using AdminToys;
using Enums;
+
using Exiled.API.Interfaces;
using Exiled.API.Structs;
+
using UnityEngine;
using Object = UnityEngine.Object;
@@ -120,12 +121,13 @@ public static Primitive Create(PrimitiveType primitiveType = PrimitiveType.Spher
/// The new .
public static Primitive Create(Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Primitive primitive = new(Object.Instantiate(Prefab));
-
- primitive.Position = position ?? Vector3.zero;
- primitive.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
- primitive.Scale = scale ?? Vector3.one;
- primitive.Color = color ?? Color.gray;
+ Primitive primitive = new(Object.Instantiate(Prefab))
+ {
+ Position = position ?? Vector3.zero,
+ Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
+ Scale = scale ?? Vector3.one,
+ Color = color ?? Color.gray,
+ };
if (spawn)
primitive.Spawn();
@@ -145,11 +147,12 @@ public static Primitive Create(Vector3? position /*= null*/, Vector3? rotation /
/// The new .
public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sphere*/, Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Primitive primitive = new(Object.Instantiate(Prefab));
-
- primitive.Position = position ?? Vector3.zero;
- primitive.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
- primitive.Scale = scale ?? Vector3.one;
+ Primitive primitive = new(Object.Instantiate(Prefab))
+ {
+ Position = position ?? Vector3.zero,
+ Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
+ Scale = scale ?? Vector3.one,
+ };
primitive.Base.NetworkPrimitiveType = primitiveType;
primitive.Color = color ?? Color.gray;
@@ -173,12 +176,13 @@ public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sph
/// The new .
public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sphere*/, PrimitiveFlags flags, Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Primitive primitive = new(Object.Instantiate(Prefab));
-
- primitive.Position = position ?? Vector3.zero;
- primitive.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
- primitive.Scale = scale ?? Vector3.one;
- primitive.Flags = flags;
+ Primitive primitive = new(Object.Instantiate(Prefab))
+ {
+ Position = position ?? Vector3.zero,
+ Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
+ Scale = scale ?? Vector3.one,
+ Flags = flags,
+ };
primitive.Base.NetworkPrimitiveType = primitiveType;
primitive.Color = color ?? Color.gray;
@@ -196,12 +200,13 @@ public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sph
/// The new .
public static Primitive Create(PrimitiveSettings primitiveSettings)
{
- Primitive primitive = new(Object.Instantiate(Prefab));
-
- primitive.Position = primitiveSettings.Position;
- primitive.Rotation = Quaternion.Euler(primitiveSettings.Rotation);
- primitive.Scale = primitiveSettings.Scale;
- primitive.Flags = primitiveSettings.Flags;
+ Primitive primitive = new(Object.Instantiate(Prefab))
+ {
+ Position = primitiveSettings.Position,
+ Rotation = Quaternion.Euler(primitiveSettings.Rotation),
+ Scale = primitiveSettings.Scale,
+ Flags = primitiveSettings.Flags,
+ };
primitive.Base.NetworkPrimitiveType = primitiveSettings.PrimitiveType;
primitive.Color = primitiveSettings.Color;
@@ -224,4 +229,4 @@ public static Primitive Get(PrimitiveObjectToy primitiveObjectToy)
return adminToy is not null ? adminToy as Primitive : new(primitiveObjectToy);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs b/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs
index 86246ffd28..fd3ed8ebaa 100644
--- a/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs
+++ b/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs
@@ -12,6 +12,7 @@ namespace Exiled.API.Features.Toys
using System.Linq;
using Enums;
+
using Exiled.API.Interfaces;
using Mirror;
diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs
index a1e320c002..9aa6d574fe 100644
--- a/EXILED/Exiled.API/Features/Toys/Speaker.cs
+++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs
@@ -1452,4 +1452,4 @@ private void EndingPlayBack()
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/Text.cs b/EXILED/Exiled.API/Features/Toys/Text.cs
index 055993e4a7..5a5980c4c3 100644
--- a/EXILED/Exiled.API/Features/Toys/Text.cs
+++ b/EXILED/Exiled.API/Features/Toys/Text.cs
@@ -117,4 +117,4 @@ public static Text Create(Vector3? position = null, Quaternion? rotation = null,
return textToy;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/Waypoint.cs b/EXILED/Exiled.API/Features/Toys/Waypoint.cs
index 0de33936a7..8811888349 100644
--- a/EXILED/Exiled.API/Features/Toys/Waypoint.cs
+++ b/EXILED/Exiled.API/Features/Toys/Waypoint.cs
@@ -109,7 +109,7 @@ public static Waypoint Create(Transform parent = null, Vector3? position = null,
Waypoint toy = new(Object.Instantiate(Prefab, parent))
{
Priority = priority,
- BoundsSize = scale ?? Vector3.one * 255.9961f,
+ BoundsSize = scale ?? (Vector3.one * 255.9961f),
VisualizeBounds = visualizeBounds,
};
diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs
index f765905410..652377647d 100644
--- a/EXILED/Exiled.API/Features/Warhead.cs
+++ b/EXILED/Exiled.API/Features/Warhead.cs
@@ -11,9 +11,13 @@ namespace Exiled.API.Features
using System.Collections.Generic;
using Enums;
+
using Exiled.API.Extensions;
+
using Interactables.Interobjects.DoorUtils;
+
using Mirror;
+
using UnityEngine;
///
@@ -34,7 +38,7 @@ public static class Warhead
///
/// Gets the cached component.
///
- public static AlphaWarheadOutsitePanel OutsitePanel => field != null ? field : (field = UnityEngine.Object.FindFirstObjectByType());
+ public static AlphaWarheadOutsitePanel OutsitePanel => field?.gameObject != null ? field : (field = UnityEngine.Object.FindFirstObjectByType());
///
/// Gets the of the warhead lever.
@@ -238,7 +242,7 @@ public static void Start()
public static void Start(bool isAutomatic, bool suppressSubtitles = false, Player trigger = null)
{
Controller.InstantPrepare();
- Controller.StartDetonation(isAutomatic, suppressSubtitles, trigger == null ? null : trigger.ReferenceHub);
+ Controller.StartDetonation(isAutomatic, suppressSubtitles, trigger?.ReferenceHub);
}
///
@@ -290,4 +294,4 @@ public static void Start(bool isAutomatic, bool suppressSubtitles = false, Playe
/// Whether the given position is prone to being detonated.
public static bool CanBeDetonated(Vector3 pos, bool includeOnlyLifts = false) => AlphaWarheadController.CanBeDetonated(pos, includeOnlyLifts);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Waves/TimedWave.cs b/EXILED/Exiled.API/Features/Waves/TimedWave.cs
index 6e9a5c55bf..ebded06851 100644
--- a/EXILED/Exiled.API/Features/Waves/TimedWave.cs
+++ b/EXILED/Exiled.API/Features/Waves/TimedWave.cs
@@ -11,7 +11,9 @@ namespace Exiled.API.Features.Waves
using System.Linq;
using Exiled.API.Enums;
+
using PlayerRoles;
+
using Respawning;
using Respawning.Announcements;
using Respawning.Waves;
@@ -67,7 +69,7 @@ public class TimedWave
Faction.FoundationStaff when IsMiniWave => SpawnableFaction.NtfMiniWave,
Faction.FoundationStaff => SpawnableFaction.NtfWave,
Faction.FoundationEnemy when IsMiniWave => SpawnableFaction.ChaosMiniWave,
- _ => SpawnableFaction.ChaosWave
+ _ => SpawnableFaction.ChaosWave,
};
///
@@ -96,7 +98,7 @@ public class TimedWave
public static bool TryGetTimedWaves(Faction faction, out List waves)
{
List spawnableWaveBases = WaveManager.Waves.Where(w => w is TimeBasedWave wave && wave.TargetFaction == faction).ToList();
- if(!spawnableWaveBases.Any())
+ if (!spawnableWaveBases.Any())
{
waves = null;
return false;
@@ -115,7 +117,7 @@ public static bool TryGetTimedWaves(Faction faction, out List waves)
public static bool TryGetTimedWaves(Team team, out List waves)
{
List spawnableWaveBases = WaveManager.Waves.Where(w => w is TimeBasedWave wave && wave.TargetFaction.GetSpawnableTeam() == team).ToList();
- if(!spawnableWaveBases.Any())
+ if (!spawnableWaveBases.Any())
{
waves = null;
return false;
diff --git a/EXILED/Exiled.API/Features/Waves/WaveTimer.cs b/EXILED/Exiled.API/Features/Waves/WaveTimer.cs
index b99f2cf2bf..df96fee7cc 100644
--- a/EXILED/Exiled.API/Features/Waves/WaveTimer.cs
+++ b/EXILED/Exiled.API/Features/Waves/WaveTimer.cs
@@ -15,8 +15,6 @@ namespace Exiled.API.Features.Waves
using PlayerRoles;
- using Respawning;
-
using Respawning.Waves;
///
diff --git a/EXILED/Exiled.API/Features/Window.cs b/EXILED/Exiled.API/Features/Window.cs
index 2d327ff0c4..a1f92bc26f 100644
--- a/EXILED/Exiled.API/Features/Window.cs
+++ b/EXILED/Exiled.API/Features/Window.cs
@@ -12,10 +12,13 @@ namespace Exiled.API.Features
using System.Linq;
using DamageHandlers;
+
using Enums;
+
using Exiled.API.Extensions;
using Exiled.API.Features.Doors;
using Exiled.API.Interfaces;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Features/Workstation.cs b/EXILED/Exiled.API/Features/Workstation.cs
index ae4b2612d3..2bc63e1e5e 100644
--- a/EXILED/Exiled.API/Features/Workstation.cs
+++ b/EXILED/Exiled.API/Features/Workstation.cs
@@ -14,9 +14,11 @@ namespace Exiled.API.Features
using Exiled.API.Enums;
using Exiled.API.Interfaces;
+
using InventorySystem.Items.Firearms.Attachments;
+
using MapGeneration.Distributors;
- using Mirror;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs b/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs
index 3bd096a2a7..c0ffcb97d2 100644
--- a/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs
+++ b/EXILED/Exiled.API/Interfaces/Audio/IAudioFilter.cs
@@ -23,4 +23,4 @@ public interface IAudioFilter
///
void Reset();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs b/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs
index ad9c9caea9..32eeaf798f 100644
--- a/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs
+++ b/EXILED/Exiled.API/Interfaces/Audio/ILiveSource.cs
@@ -13,4 +13,4 @@ namespace Exiled.API.Interfaces.Audio
public interface ILiveSource
{
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs b/EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs
index 6f0423b86f..7ab6211c81 100644
--- a/EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs
+++ b/EXILED/Exiled.API/Interfaces/Audio/IPcmSource.cs
@@ -56,4 +56,4 @@ public interface IPcmSource : IDisposable
///
void Reset();
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/IPosition.cs b/EXILED/Exiled.API/Interfaces/IPosition.cs
index 467495137a..a169aa2965 100644
--- a/EXILED/Exiled.API/Interfaces/IPosition.cs
+++ b/EXILED/Exiled.API/Interfaces/IPosition.cs
@@ -19,4 +19,4 @@ public interface IPosition
///
public Vector3 Position { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/IRotation.cs b/EXILED/Exiled.API/Interfaces/IRotation.cs
index f7e244b19b..c7f1090d79 100644
--- a/EXILED/Exiled.API/Interfaces/IRotation.cs
+++ b/EXILED/Exiled.API/Interfaces/IRotation.cs
@@ -19,4 +19,4 @@ public interface IRotation
///
public Quaternion Rotation { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/IWorldSpace.cs b/EXILED/Exiled.API/Interfaces/IWorldSpace.cs
index 0df54e81e9..f17d2219fc 100644
--- a/EXILED/Exiled.API/Interfaces/IWorldSpace.cs
+++ b/EXILED/Exiled.API/Interfaces/IWorldSpace.cs
@@ -15,4 +15,4 @@ namespace Exiled.API.Interfaces
public interface IWorldSpace : IPosition, IRotation
{
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/Keycards/ILabelKeycard.cs b/EXILED/Exiled.API/Interfaces/Keycards/ILabelKeycard.cs
index d724f997ea..fbc1b980aa 100644
--- a/EXILED/Exiled.API/Interfaces/Keycards/ILabelKeycard.cs
+++ b/EXILED/Exiled.API/Interfaces/Keycards/ILabelKeycard.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Interfaces.Keycards
{
using Exiled.API.Features.Items.Keycards;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.API/Structs/Audio/TrackData.cs b/EXILED/Exiled.API/Structs/Audio/TrackData.cs
index 93f549369f..596b137d23 100644
--- a/EXILED/Exiled.API/Structs/Audio/TrackData.cs
+++ b/EXILED/Exiled.API/Structs/Audio/TrackData.cs
@@ -71,4 +71,4 @@ public readonly string FormattedDuration
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Structs/PrimitiveSettings.cs b/EXILED/Exiled.API/Structs/PrimitiveSettings.cs
index 24fcc04393..0da6238ce4 100644
--- a/EXILED/Exiled.API/Structs/PrimitiveSettings.cs
+++ b/EXILED/Exiled.API/Structs/PrimitiveSettings.cs
@@ -8,6 +8,7 @@
namespace Exiled.API.Structs
{
using AdminToys;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.CreditTags/Enums/InfoSide.cs b/EXILED/Exiled.CreditTags/Enums/InfoSide.cs
index 9d87360d4b..7bf491865a 100644
--- a/EXILED/Exiled.CreditTags/Enums/InfoSide.cs
+++ b/EXILED/Exiled.CreditTags/Enums/InfoSide.cs
@@ -18,7 +18,7 @@ public enum InfoSide
Badge,
///
- /// Uses Custom Player Info area
+ /// Uses Custom Player Info area.
///
CustomPlayerInfo,
diff --git a/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs b/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs
index 06c30e30fb..4d1bfd0bed 100644
--- a/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs
+++ b/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs
@@ -9,6 +9,7 @@ namespace Exiled.CreditTags.Events
{
using Exiled.CreditTags.Features;
using Exiled.Events.EventArgs.Player;
+
using MEC;
using static CreditTags;
diff --git a/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs b/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs
index ac3cc91781..9092ae4056 100644
--- a/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs
+++ b/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs
@@ -12,6 +12,7 @@ namespace Exiled.CreditTags.Features
using System.IO;
using Cryptography;
+
using Exiled.API.Features;
using Exiled.CreditTags.Enums;
@@ -55,7 +56,7 @@ static DatabaseHandler()
///
/// Gets the path to the cache directory.
///
- private static DirectoryInfo CacheDirectory { get; } = new (Path.Combine(Paths.Configs, "CreditTags"));
+ private static DirectoryInfo CacheDirectory { get; } = new(Path.Combine(Paths.Configs, "CreditTags"));
///
/// Gets the path to the cache file.
diff --git a/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs b/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs
index b6ceaee015..15aa4ae1e9 100644
--- a/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs
+++ b/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs
@@ -10,7 +10,9 @@ namespace Exiled.CreditTags.Features
using System.Collections.Generic;
using Exiled.API.Features;
+
using MEC;
+
using UnityEngine.Networking;
internal sealed class ThreadSafeRequest
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs
index 54f478d7ce..219f9e8aba 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs
@@ -7,18 +7,11 @@
namespace Exiled.CustomItems.API.EventArgs
{
- using System.Collections.Generic;
-
- using Exiled.API.Enums;
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs.Player;
- using PlayerRoles;
-
- using Respawning;
-
///
/// Contains all information of a before a escapes.
///
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
index c1a77f6351..4b1e23ef21 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
@@ -18,6 +18,7 @@ namespace Exiled.CustomItems.API.Features
using Exiled.Events.EventArgs.Player;
using InventorySystem.Items.Armor;
+
using MEC;
///
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs b/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs
index 68f8d07818..7ac099f9bd 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomGoggles.cs
@@ -245,4 +245,4 @@ private void RemoveSafely(ReferenceHub hub)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs b/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
index feafdae9c2..00ee5157a5 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
@@ -11,15 +11,12 @@ namespace Exiled.CustomItems.API.Features
using Exiled.API.Extensions;
using Exiled.API.Features;
- using Exiled.API.Features.Items;
using Exiled.API.Features.Pickups;
using Exiled.API.Features.Pickups.Projectiles;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Map;
using Exiled.Events.EventArgs.Player;
- using Footprinting;
-
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Pickups;
@@ -225,4 +222,4 @@ private void OnInternalChangedIntoGrenade(ChangedIntoGrenadeEventArgs ev)
ev.Projectile.GameObject.AddComponent().Init((ev.Pickup.PreviousOwner ?? Server.Host).GameObject, ev.Projectile.Base);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
index e131db7086..2b7356c0b6 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
@@ -26,18 +26,21 @@ namespace Exiled.CustomItems.API.Features
using Exiled.Events.EventArgs.Player;
using Exiled.Events.EventArgs.Scp914;
using Exiled.Loader;
+
using InventorySystem.Items.Pickups;
+
using MEC;
+
using PlayerRoles;
+
using UnityEngine;
+
using YamlDotNet.Serialization;
using static CustomItems;
- using BaseFirearmPickup = InventorySystem.Items.Firearms.FirearmPickup;
using Firearm = Exiled.API.Features.Items.Firearm;
using Item = Exiled.API.Features.Items.Item;
- using Map = Exiled.API.Features.Map;
using Player = Exiled.API.Features.Player;
using UpgradingPickupEventArgs = Exiled.Events.EventArgs.Scp914.UpgradingPickupEventArgs;
@@ -1106,4 +1109,4 @@ private void OnInternalUpgradingPickup(UpgradingPickupEventArgs ev)
});
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomKeycard.cs b/EXILED/Exiled.CustomItems/API/Features/CustomKeycard.cs
index 1777953129..3347c4b44f 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomKeycard.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomKeycard.cs
@@ -21,7 +21,9 @@ namespace Exiled.CustomItems.API.Features
using Exiled.API.Interfaces.Keycards;
using Exiled.Events.EventArgs.Item;
using Exiled.Events.EventArgs.Player;
+
using InventorySystem.Items.Keycards;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
index cc2e7f25bc..537ce96291 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
@@ -351,4 +351,4 @@ private void OnInternalChangingAttachment(ChangingAttachmentsEventArgs ev)
OnChangingAttachment(ev);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomItems/Commands/Give.cs b/EXILED/Exiled.CustomItems/Commands/Give.cs
index cc63ed2228..d4083c6097 100644
--- a/EXILED/Exiled.CustomItems/Commands/Give.cs
+++ b/EXILED/Exiled.CustomItems/Commands/Give.cs
@@ -18,8 +18,6 @@ namespace Exiled.CustomItems.Commands
using Exiled.Permissions.Extensions;
using RemoteAdmin;
- using UnityStandardAssets.Effects;
- using Utils;
///
/// The command to give a player an item.
@@ -127,4 +125,4 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
///
private bool CheckEligible(Player player) => player.IsAlive && !player.IsCuffed && (player.Items.Count < 8);
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomItems/Commands/Main.cs b/EXILED/Exiled.CustomItems/Commands/Main.cs
index de3b3ad2f6..e3557d1a66 100644
--- a/EXILED/Exiled.CustomItems/Commands/Main.cs
+++ b/EXILED/Exiled.CustomItems/Commands/Main.cs
@@ -51,4 +51,4 @@ protected override bool ExecuteParent(ArraySegment arguments, ICommandSe
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomItems/Events/MapHandler.cs b/EXILED/Exiled.CustomItems/Events/MapHandler.cs
index ed1ae61970..bb9966ba01 100644
--- a/EXILED/Exiled.CustomItems/Events/MapHandler.cs
+++ b/EXILED/Exiled.CustomItems/Events/MapHandler.cs
@@ -9,6 +9,7 @@ namespace Exiled.CustomItems.Events
{
using Exiled.API.Features;
using Exiled.CustomItems.API.Features;
+
using MEC;
///
diff --git a/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs b/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs
index 8efcc98fb7..da551cd4f1 100644
--- a/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs
+++ b/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs
@@ -76,4 +76,4 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstruction);
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomRoles/API/Extensions.cs b/EXILED/Exiled.CustomRoles/API/Extensions.cs
index 8a0821216d..6cd23c603d 100644
--- a/EXILED/Exiled.CustomRoles/API/Extensions.cs
+++ b/EXILED/Exiled.CustomRoles/API/Extensions.cs
@@ -124,4 +124,4 @@ public static void Unregister(this IEnumerable customRoles)
/// The the has selected, or .
public static ActiveAbility? GetSelectedAbility(this Player player) => !ActiveAbility.AllActiveAbilities.TryGetValue(player, out HashSet abilities) ? null : abilities.FirstOrDefault(a => a.Check(player, CheckType.Selected));
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs b/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs
index cadc7c63f0..9b823fbf95 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs
@@ -141,7 +141,7 @@ public virtual bool Check(Player player, CheckType type)
CheckType.Active => ActivePlayers.Contains(player),
CheckType.Selected => SelectedPlayers.Contains(player),
CheckType.Available => Players.Contains(player),
- _ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
+ _ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
};
return result;
diff --git a/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs b/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs
index 1528d08fa3..91198b9e3b 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs
@@ -166,8 +166,7 @@ public static IEnumerable RegisterAbilities(bool skipReflection =
}
}
- if (customAbility is null)
- customAbility = (CustomAbility)Activator.CreateInstance(type);
+ customAbility ??= (CustomAbility)Activator.CreateInstance(type);
if (customAbility.TryRegister())
abilities.Add(customAbility);
@@ -209,8 +208,7 @@ public static IEnumerable RegisterAbilities(IEnumerable tar
}
}
- if (customAbility is null)
- customAbility = (CustomAbility)Activator.CreateInstance(type);
+ customAbility ??= (CustomAbility)Activator.CreateInstance(type);
if (customAbility.TryRegister())
abilities.Add(customAbility);
@@ -311,7 +309,7 @@ public void RemoveAbility(Player player)
/// True if the ability registered properly.
internal bool TryRegister()
{
- if (!CustomRoles.Instance!.Config.IsEnabled)
+ if (!CustomRoles.Instance.Config.IsEnabled)
return false;
if (!Registered.Contains(this))
diff --git a/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs b/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs
index f2dd9bc8d8..9f11652d14 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs
@@ -25,8 +25,11 @@ namespace Exiled.CustomRoles.API.Features
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs.Player;
using Exiled.Loader;
+
using InventorySystem.Configs;
+
using MEC;
+
using PlayerRoles;
using UnityEngine;
@@ -643,7 +646,7 @@ public virtual void AddRole(Player player)
ability.AddAbility(player);
}
- if (CustomRoles.Instance!.Config.GotRoleHint.Show)
+ if (CustomRoles.Instance.Config.GotRoleHint.Show)
ShowMessage(player);
ShowBroadcast(player);
@@ -807,7 +810,7 @@ public bool TryAddFriendlyFire(Dictionary ffRules, bool overw
/// True if the role registered properly.
internal bool TryRegister()
{
- if (!CustomRoles.Instance!.Config.IsEnabled)
+ if (!CustomRoles.Instance.Config.IsEnabled)
return false;
if (!Registered.Contains(this))
@@ -892,7 +895,7 @@ protected Vector3 GetSpawnPosition()
}
float totalchance = 0f;
- List<(float chance, Vector3 pos)> spawnPointPool = new(4);
+ List<(float Chance, Vector3 Pos)> spawnPointPool = new(4);
void Add(Vector3 pos, float chance)
{
@@ -985,7 +988,7 @@ protected virtual void UnsubscribeEvents()
/// Shows the spawn message to the player.
///
/// The to show the message to.
- protected virtual void ShowMessage(Player player) => player.ShowHint(string.Format(CustomRoles.Instance!.Config.GotRoleHint.Content, Name, Description), CustomRoles.Instance.Config.GotRoleHint.Duration);
+ protected virtual void ShowMessage(Player player) => player.ShowHint(string.Format(CustomRoles.Instance.Config.GotRoleHint.Content, Name, Description), CustomRoles.Instance.Config.GotRoleHint.Duration);
///
/// Shows the spawn broadcast to the player.
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs b/EXILED/Exiled.CustomRoles/API/Features/Enums/AbilityKeypressTriggerType.cs
similarity index 93%
rename from EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs
rename to EXILED/Exiled.CustomRoles/API/Features/Enums/AbilityKeypressTriggerType.cs
index d63845ff70..3ba1d84bc7 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Enums/AbilityKeypressTriggerType.cs
@@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
-//
+//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs b/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs
index fb636665a8..5e6ba3ab31 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs
@@ -13,7 +13,7 @@ namespace Exiled.CustomRoles.API.Features.Enums
public enum CheckType
{
///
- /// Check if the ability is available to the player. (DOES NOT CHECK COOLDOWNS)
+ /// Check if the ability is available to the player. (DOES NOT CHECK COOLDOWNS).
///
Available,
diff --git a/EXILED/Exiled.CustomRoles/Commands/Get.cs b/EXILED/Exiled.CustomRoles/Commands/Get.cs
index 7d96d5f6b4..acaf661554 100644
--- a/EXILED/Exiled.CustomRoles/Commands/Get.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/Get.cs
@@ -14,13 +14,13 @@ namespace Exiled.CustomRoles.Commands
using System.Text;
using CommandSystem;
+
using Exiled.API.Extensions;
using Exiled.API.Features;
using Exiled.API.Features.Pools;
using Exiled.CustomRoles.API;
using Exiled.CustomRoles.API.Features;
using Exiled.Permissions.Extensions;
- using HarmonyLib;
///
/// The command to get specified player(s) current custom roles.
diff --git a/EXILED/Exiled.CustomRoles/Commands/Parent.cs b/EXILED/Exiled.CustomRoles/Commands/Parent.cs
index eca719d667..c5a46a0e7a 100644
--- a/EXILED/Exiled.CustomRoles/Commands/Parent.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/Parent.cs
@@ -51,4 +51,4 @@ protected override bool ExecuteParent(ArraySegment arguments, ICommandSe
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomRoles/CustomRoles.cs b/EXILED/Exiled.CustomRoles/CustomRoles.cs
index a66457b3bd..fc7a3e4333 100644
--- a/EXILED/Exiled.CustomRoles/CustomRoles.cs
+++ b/EXILED/Exiled.CustomRoles/CustomRoles.cs
@@ -82,4 +82,4 @@ public override void OnDisabled()
base.OnDisabled();
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs b/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs
index 47a153221d..23b27aac2f 100644
--- a/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs
+++ b/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs
@@ -9,7 +9,6 @@ namespace Exiled.CustomRoles.Events
{
using System;
using System.Collections.Generic;
- using System.Threading;
using Exiled.API.Enums;
using Exiled.API.Features;
diff --git a/EXILED/Exiled.Events/Commands/Config/Merge.cs b/EXILED/Exiled.Events/Commands/Config/Merge.cs
index c6cf79042d..c8d5ff08b1 100644
--- a/EXILED/Exiled.Events/Commands/Config/Merge.cs
+++ b/EXILED/Exiled.Events/Commands/Config/Merge.cs
@@ -9,12 +9,13 @@ namespace Exiled.Events.Commands.Config
{
using System;
using System.Collections.Generic;
- using System.Linq;
- using API.Enums;
- using API.Features;
- using API.Interfaces;
using CommandSystem;
+
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
+ using Exiled.API.Interfaces;
+
using Loader;
///
diff --git a/EXILED/Exiled.Events/Commands/Config/Split.cs b/EXILED/Exiled.Events/Commands/Config/Split.cs
index 34816af579..a083e4388c 100644
--- a/EXILED/Exiled.Events/Commands/Config/Split.cs
+++ b/EXILED/Exiled.Events/Commands/Config/Split.cs
@@ -9,12 +9,13 @@ namespace Exiled.Events.Commands.Config
{
using System;
using System.Collections.Generic;
- using System.Linq;
- using API.Enums;
- using API.Features;
- using API.Interfaces;
using CommandSystem;
+
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
+ using Exiled.API.Interfaces;
+
using Loader;
///
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs b/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs
index 4169b84cd7..54fc5e4260 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs
@@ -9,9 +9,11 @@ namespace Exiled.Events.Commands.PluginManager
{
using System;
- using API.Interfaces;
using CommandSystem;
+
+ using Exiled.API.Interfaces;
using Exiled.Permissions.Extensions;
+
using RemoteAdmin;
///
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs b/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs
index 36b6aa1ecd..59350f2500 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs
@@ -12,10 +12,12 @@ namespace Exiled.Events.Commands.PluginManager
using System.Linq;
using System.Reflection;
- using API.Interfaces;
using CommandSystem;
+
using Exiled.API.Features;
+ using Exiled.API.Interfaces;
using Exiled.Permissions.Extensions;
+
using RemoteAdmin;
///
@@ -92,4 +94,4 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
return true;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs b/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs
index 1f9a62c13d..f789174a33 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs
@@ -39,4 +39,4 @@ protected override bool ExecuteParent(ArraySegment arguments, ICommandSe
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Show.cs b/EXILED/Exiled.Events/Commands/PluginManager/Show.cs
index 0b9f4d5459..edaac0d85e 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Show.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Show.cs
@@ -12,11 +12,10 @@ namespace Exiled.Events.Commands.PluginManager
using System.Linq;
using System.Text;
- using API.Features.Pools;
- using API.Interfaces;
-
using CommandSystem;
+ using Exiled.API.Features.Pools;
+ using Exiled.API.Interfaces;
using Exiled.Permissions.Extensions;
using RemoteAdmin;
diff --git a/EXILED/Exiled.Events/Commands/Reload/Configs.cs b/EXILED/Exiled.Events/Commands/Reload/Configs.cs
index 05f75a07ed..12beb34a1b 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Configs.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Configs.cs
@@ -9,10 +9,9 @@ namespace Exiled.Events.Commands.Reload
{
using System;
- using API.Interfaces;
-
using CommandSystem;
+ using Exiled.API.Interfaces;
using Exiled.Permissions.Extensions;
using Loader;
@@ -63,4 +62,4 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
return haveBeenReloaded;
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Commands/Reload/Translations.cs b/EXILED/Exiled.Events/Commands/Reload/Translations.cs
index 99459b3f19..d2c4132b0d 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Translations.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Translations.cs
@@ -9,10 +9,9 @@ namespace Exiled.Events.Commands.Reload
{
using System;
- using API.Interfaces;
-
using CommandSystem;
+ using Exiled.API.Interfaces;
using Exiled.Permissions.Extensions;
using Loader;
diff --git a/EXILED/Exiled.Events/Commands/TpsCommand.cs b/EXILED/Exiled.Events/Commands/TpsCommand.cs
index 14c0def05e..15ca3d44c9 100644
--- a/EXILED/Exiled.Events/Commands/TpsCommand.cs
+++ b/EXILED/Exiled.Events/Commands/TpsCommand.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.Commands
using System;
using CommandSystem;
+
using Exiled.API.Features;
///
@@ -35,7 +36,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
{
> 0.9 => "green",
> 0.5 => "yellow",
- _ => "red"
+ _ => "red",
};
response = $"{Server.SmoothTps}/{Server.MaxTps}";
diff --git a/EXILED/Exiled.Events/Config.cs b/EXILED/Exiled.Events/Config.cs
index fd244f699b..c4f94d76a8 100644
--- a/EXILED/Exiled.Events/Config.cs
+++ b/EXILED/Exiled.Events/Config.cs
@@ -9,7 +9,7 @@ namespace Exiled.Events
{
using System.ComponentModel;
- using API.Interfaces;
+ using Exiled.API.Interfaces;
///
public sealed class Config : IConfig
@@ -111,4 +111,4 @@ public sealed class Config : IConfig
[Description("Whether to log RA commands.")]
public bool LogRaCommands { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
index d5dbbef859..c7c2c633df 100644
--- a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
@@ -11,8 +11,11 @@ namespace Exiled.Events.EventArgs.Cassie
using System.Text;
using Exiled.API.Features.Pools;
+
using global::Cassie;
+
using Interfaces;
+
using Subtitles;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
index bb523f3d75..7abe187114 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
- using API.Features.DamageHandlers;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
///
/// Event args for when a player is taking damage.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
index 8c44ab58b6..d86189d40b 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
+ using Exiled.API.Features;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs
index eaa1babdcc..1a8711d078 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IConsumableEvent.cs
@@ -19,4 +19,4 @@ public interface IConsumableEvent : IItemEvent
///
public Consumable Consumable { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
index 0cf0ba2810..f27c8c0ec6 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features.Items;
+ using Exiled.API.Features.Items;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
index 5cddb0a8fb..265aa5a2d7 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
+ using Exiled.API.Features;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
index c2fcb61da9..bde0b9c466 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features.Items;
+ using Exiled.API.Features.Items;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IMicroHIDEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IMicroHIDEvent.cs
index bc17988cc2..ee42510c79 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IMicroHIDEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IMicroHIDEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features.Items;
+ using Exiled.API.Features.Items;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs
index fec096f0b3..2f2e7d9962 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
+ using Exiled.API.Features;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs
index c15fbc028a..1889c43cd7 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
+ using Exiled.API.Features;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs
index 0ff4df980b..64bac5ca77 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
+ using Exiled.API.Features;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs
index 7f79c1b15d..fcc91cc850 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
- using API.Features;
+ using Exiled.API.Features;
///
/// Event args used for all related events.
diff --git a/EXILED/Exiled.Events/EventArgs/Item/CacklingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/CacklingEventArgs.cs
index 8e491ee0b1..995daa4b2f 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/CacklingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/CacklingEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.MarshmallowMan;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs
index 6e76f8b7a6..f339e8c5ed 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs
@@ -65,4 +65,4 @@ public ChangingAmmoEventArgs(InventorySystem.Items.ItemBase firearm, byte oldAmm
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs
index 6f4dc2ef60..d8dcfc1883 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs
@@ -10,11 +10,10 @@ namespace Exiled.Events.EventArgs.Item
using System.Collections.Generic;
using System.Linq;
- using API.Features;
- using API.Features.Items;
- using API.Structs;
-
using Exiled.API.Extensions;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
+ using Exiled.API.Structs;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChangingMicroHIDPickupStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChangingMicroHIDPickupStateEventArgs.cs
index a70c37fde7..510a4718d6 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChangingMicroHIDPickupStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChangingMicroHIDPickupStateEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features.Pickups;
using Interfaces;
+
using InventorySystem.Items.MicroHID.Modules;
using InventorySystem.Items.Pickups;
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
index 98f2588187..e9ec5fd5ea 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
@@ -49,4 +49,4 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Item/DisruptorFiringEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/DisruptorFiringEventArgs.cs
index ad3feef017..4252578733 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/DisruptorFiringEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/DisruptorFiringEventArgs.cs
@@ -8,9 +8,10 @@
namespace Exiled.Events.EventArgs.Item
{
using Exiled.API.Features.Pickups;
+
using Interfaces;
+
using InventorySystem.Items.Firearms.Modules;
- using InventorySystem.Items.Pickups;
///
/// Contains all information before a pickup shoot while on the ground.
diff --git a/EXILED/Exiled.Events/EventArgs/Item/InspectedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/InspectedItemEventArgs.cs
index 283fd4910f..23c20404b1 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/InspectedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/InspectedItemEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Item/InspectingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/InspectingItemEventArgs.cs
index 5bb7cb4077..2e51f8d305 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/InspectingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/InspectingItemEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangedWearStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangedWearStateEventArgs.cs
index 1bfbcd529e..f7fe990ce5 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangedWearStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangedWearStateEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Jailbird;
///
@@ -56,4 +57,4 @@ public JailbirdChangedWearStateEventArgs(InventorySystem.Items.ItemBase jailbird
///
public Item Item => Jailbird;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangingWearStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangingWearStateEventArgs.cs
index bf7ac51d95..31c15e72e6 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangingWearStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/JailbirdChangingWearStateEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Jailbird;
///
@@ -61,4 +62,4 @@ public JailbirdChangingWearStateEventArgs(InventorySystem.Items.ItemBase jailbir
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Item/JailbirdChargeCompleteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/JailbirdChargeCompleteEventArgs.cs
index d583f22b3f..f6adb9770b 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/JailbirdChargeCompleteEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/JailbirdChargeCompleteEventArgs.cs
@@ -49,4 +49,4 @@ public JailbirdChargeCompleteEventArgs(ReferenceHub player, InventorySystem.Item
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs
index 11f82ddbb4..50b8b39e49 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs
@@ -11,6 +11,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features.Doors;
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using Interactables.Interobjects.DoorUtils;
using BaseKeycardPickup = InventorySystem.Items.Keycards.KeycardPickup;
diff --git a/EXILED/Exiled.Events/EventArgs/Item/PunchingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/PunchingEventArgs.cs
index d2d927d95a..ab58078c81 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/PunchingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/PunchingEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Item
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.MarshmallowMan;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs
index a7cdb73f70..3d6764df0a 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs
@@ -10,11 +10,10 @@ namespace Exiled.Events.EventArgs.Item
using System.Collections.Generic;
using System.Linq;
- using API.Features;
- using API.Structs;
-
using Exiled.API.Enums;
using Exiled.API.Extensions;
+ using Exiled.API.Features;
+ using Exiled.API.Structs;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs
index 0d97d9da16..8c768a5379 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs
@@ -49,4 +49,4 @@ public SwingingEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swi
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs
index e0e7fb8931..1e6ec08d27 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -11,6 +11,7 @@ namespace Exiled.Events.EventArgs.Map
using Exiled.API.Features.Waves;
using Exiled.Events.EventArgs.Interfaces;
+
using Respawning.Announcements;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs
index fd5a8f417e..0d3e0121d9 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs
@@ -8,7 +8,9 @@
namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Features.Waves;
+
using Interfaces;
+
using Respawning.Announcements;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs
index d8d38cc474..b693cfc0b9 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs
@@ -9,9 +9,10 @@ namespace Exiled.Events.EventArgs.Map
{
using System;
- using API.Features;
- using API.Features.DamageHandlers;
- using API.Features.Roles;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
+ using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs
index 197c741949..e0439cfbe8 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Map
using Exiled.API.Features.Pickups;
using Exiled.API.Features.Pickups.Projectiles;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.ThrowableProjectiles;
///
@@ -41,4 +42,4 @@ public ChangedIntoGrenadeEventArgs(TimedGrenadePickup pickup, ThrownProjectile p
///
Pickup IPickupEvent.Pickup => Pickup;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/ElevatorSequencesUpdatedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ElevatorSequencesUpdatedEventArgs.cs
index c2a8fbe9aa..4d62722f63 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/ElevatorSequencesUpdatedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/ElevatorSequencesUpdatedEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using Interactables.Interobjects;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs
index 205500cf60..d480492ce9 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs
@@ -10,7 +10,9 @@ namespace Exiled.Events.EventArgs.Map
using Exiled.API.Features.Lockers;
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Pickups;
+
using MapGeneration.Distributors;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/GeneratingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/GeneratingEventArgs.cs
index 15725ac6c6..32f7ef7ceb 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/GeneratingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/GeneratingEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -9,7 +9,6 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Enums;
using Exiled.Events.EventArgs.Interfaces;
- using UnityEngine;
///
/// Contains all information after the server generates a seed, but before the map is generated.
diff --git a/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs
index b6187bb2ba..856950f7e6 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Map
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs
index faa0b772a4..f41b0bc637 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Pickups;
///
@@ -32,4 +33,4 @@ public PickupAddedEventArgs(ItemPickupBase pickupBase)
///
public Pickup Pickup { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs
index 49bba314cc..1661f669c3 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Pickups;
///
@@ -32,4 +33,4 @@ public PickupDestroyedEventArgs(ItemPickupBase pickupBase)
///
public Pickup Pickup { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs
index 8a066fbaf9..da482dee23 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Map
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
using UnityEngine;
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs
index 3dcef688d2..a47ccaf63b 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Pickups;
using UnityEngine;
diff --git a/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs
index 263deba65c..b751b05c80 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs
@@ -7,10 +7,13 @@
namespace Exiled.Events.EventArgs.Map
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Pickups;
+
using Interfaces;
+
using InventorySystem.Items.Usables.Scp244;
+
using MapGeneration;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs
index 4476b88419..6c83d590bd 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs
@@ -10,7 +10,9 @@ namespace Exiled.Events.EventArgs.Map
using Exiled.API.Features.Doors;
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.Pickups;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Map/SpawningRoomConnectorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/SpawningRoomConnectorEventArgs.cs
index 179c244e83..8717f22371 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/SpawningRoomConnectorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/SpawningRoomConnectorEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using MapGeneration.RoomConnectors;
using MapGeneration.RoomConnectors.Spawners;
@@ -55,4 +56,4 @@ public SpawningRoomConnectorEventArgs(RoomConnectorSpawnpointBase roomConnectorS
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs
index 2e455ff305..1bc1c3b0ce 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs
@@ -8,7 +8,7 @@
namespace Exiled.Events.EventArgs.Map
{
using Exiled.Events.EventArgs.Interfaces;
- using Respawning;
+
using Respawning.Waves;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs
index 8050e534bf..dfafdd0808 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs
index 65504085ed..e6c1004b80 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs
index e035556555..a10068d1c8 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs
index 945295631a..9e9b2a932b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs
index 0c060df6dc..d4814305df 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
index 5679b15f76..5fea86b4c6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
@@ -9,9 +9,10 @@ namespace Exiled.Events.EventArgs.Player
{
using System.Reflection;
- using API.Features;
using CommandSystem;
+ using Exiled.API.Features;
+
///
/// Contains all information before banning a player from the server.
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs
index 19435c5250..71a39402c7 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs
@@ -7,9 +7,10 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Usables;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs
index a030f171c2..f2e9778d81 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs
@@ -7,9 +7,10 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Usables;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs
index cd5e3447a9..06fdc3ef0e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs
index 2381256901..42dfc76855 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
@@ -50,4 +50,4 @@ public ChangedItemEventArgs(Player player, ItemBase oldItem)
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangedRatioEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangedRatioEventArgs.cs
index 5df04b729e..329aaa2a54 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangedRatioEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangedRatioEventArgs.cs
@@ -51,4 +51,4 @@ public ChangedRatioEventArgs(ReferenceHub player, float oldratio, float newratio
///
public AspectRatioType NewRatio { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs
index 8ee98adb01..1579036d2a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs
@@ -8,6 +8,7 @@
namespace Exiled.Events.EventArgs.Player
{
using CustomPlayerEffects.Danger;
+
using Exiled.API.Enums;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs
index 699848459b..08fe6b0a82 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs
@@ -11,6 +11,7 @@ namespace Exiled.Events.EventArgs.Player
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items;
///
@@ -43,4 +44,4 @@ public ChangingDisruptorModeEventArgs(ItemBase firearm, bool mode)
///
public Player Player => Item.Owner;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs
index 759f1fa9ed..71a691b25c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs
index feffd9882d..54ec5d2f11 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
index ee305c7ada..97fdd988b4 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
@@ -9,8 +9,8 @@ namespace Exiled.Events.EventArgs.Player
{
using System;
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs
index 3e3c1eee9c..4240a4482d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs
@@ -7,14 +7,12 @@
namespace Exiled.Events.EventArgs.Player
{
- using System;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
- using API.Features;
- using API.Features.Items;
using Interfaces;
using InventorySystem.Items;
- using InventorySystem.Items.MicroHID;
using InventorySystem.Items.MicroHID.Modules;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs
index 36d5240158..5c8c6e4ff4 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs
index c00696a759..e73f6e9cff 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs
@@ -7,9 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
-
using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
index 92adf3b91a..f1f05804a5 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
@@ -10,14 +10,18 @@ namespace Exiled.Events.EventArgs.Player
using System.Collections.Generic;
using System.Linq;
- using API.Enums;
- using API.Features;
+ using Exiled.API.Enums;
using Exiled.API.Extensions;
+ using Exiled.API.Features;
using Exiled.API.Features.Pools;
+
using Interfaces;
+
using InventorySystem;
+
using LabApi.Events.Arguments.PlayerEvents;
using LabApi.Events.Handlers;
+
using PlayerRoles;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs
index c50f5d6116..c39918116e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs
index c33b0bcc0f..348316e0a6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using MapGeneration.Distributors;
///
@@ -43,4 +44,4 @@ public ClosingGeneratorEventArgs(Player player, Scp079Generator generator)
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs
index 0e48f83a8b..ec72c82b78 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ConsumingItemEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
@@ -46,4 +46,4 @@ public ConsumingItemEventArgs(ReferenceHub hub, InventorySystem.Items.Usables.Co
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs
index 4ed1981db1..177cb27f4c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs
@@ -9,8 +9,11 @@ namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features;
using Exiled.API.Features.Doors;
+
using Footprinting;
+
using Interactables.Interobjects.DoorUtils;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs
index 7132b6088e..891e669d57 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs
@@ -9,9 +9,9 @@ namespace Exiled.Events.EventArgs.Player
{
using AdminToys;
- using API.Features;
- using API.Features.Items;
- using API.Features.Toys;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
+ using Exiled.API.Features.Toys;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs
index 03e4aa1fa8..94bc523a82 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.DamageHandlers;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
using Interfaces;
@@ -33,9 +33,11 @@ public class DamagingWindowEventArgs : IPlayerEvent, IDeniableEvent
public DamagingWindowEventArgs(BreakableWindow window, float damage, DamageHandlerBase handler)
{
Window = Window.Get(window);
- Handler = new DamageHandler(handler is AttackerDamageHandler attackerDamageHandler ? Player.Get(attackerDamageHandler.Attacker.Hub) : null, handler);
- Handler.Damage = damage;
Player = Handler.Attacker;
+ Handler = new DamageHandler(handler is AttackerDamageHandler attackerDamageHandler ? Player.Get(attackerDamageHandler.Attacker.Hub) : null, handler)
+ {
+ Damage = damage,
+ };
}
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs
index 20ce6f84d0..6eded5ff67 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs
index 219838dc6f..504fbbdf4f 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
@@ -35,4 +35,4 @@ public DestroyingEventArgs(Player player)
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs
index 24e91e6870..9e6c119f43 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.DamageHandlers;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs
index 78d229d08f..3550bf9905 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs
@@ -9,10 +9,11 @@ namespace Exiled.Events.EventArgs.Player
{
using System.Collections.Generic;
- using API.Enums;
- using API.Features;
+ using Exiled.API.Enums;
using Exiled.API.Extensions;
+ using Exiled.API.Features;
using Exiled.API.Features.Pickups;
+
using Interfaces;
using AmmoPickup = API.Features.Pickups.AmmoPickup;
@@ -71,4 +72,4 @@ public DroppedAmmoEventArgs(Player player, ItemType itemType, ushort amount, Lis
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs
index c315553660..11ecf5c7c6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Pickups;
+
using Interfaces;
+
using InventorySystem.Items.Pickups;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
index 999516aef2..bcef3e3911 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
@@ -7,9 +7,10 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Enums;
- using API.Features;
+ using Exiled.API.Enums;
using Exiled.API.Extensions;
+ using Exiled.API.Features;
+
using Interfaces;
using PlayerRoles;
@@ -78,4 +79,4 @@ public bool IsAllowed
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
index 16006c8164..712b8963a2 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs
index dd9c80aa35..9273188f7f 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs
index 2073d62678..0f9aa9f844 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs
index 9919ac0899..63cbc5e5e8 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs
@@ -10,9 +10,9 @@ namespace Exiled.Events.EventArgs.Player
using System.Collections.Generic;
using System.Linq;
- using API.Features;
- using API.Features.DamageHandlers;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
+ using Exiled.API.Features.Items;
using Interfaces;
@@ -37,9 +37,7 @@ public DyingEventArgs(Player target, DamageHandlerBase damageHandler)
{
DamageHandler = new CustomDamageHandler(target, damageHandler);
Player = target;
-#pragma warning disable CS0618
ItemsToDrop = Player.Items.ToList();
-#pragma warning restore CS0618
Attacker = DamageHandler.BaseIs(out CustomAttackerHandler attackerDamageHandler) ? attackerDamageHandler.Attacker : null;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs
index d4594b42b3..2286cfe056 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs
@@ -8,7 +8,9 @@
namespace Exiled.Events.EventArgs.Player
{
using Achievements;
+
using Exiled.API.Features;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs
index dc61bef74e..fb87567110 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs
@@ -8,7 +8,9 @@
namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features.Hazards;
+
using Hazards;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs
index 0d8a82d3f6..398600ebba 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs
index 2b66874acd..1ea381387b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
index 7333b3b3f8..6717ff03ff 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
using Exiled.API.Enums;
+ using Exiled.API.Features;
+
using Interfaces;
using PlayerRoles;
@@ -62,4 +63,4 @@ public EscapeScenario EscapeScenario
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs
index 841edfdcf6..5426880210 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs
index e0b24de298..6043c9285e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs
@@ -8,7 +8,9 @@
namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features.Hazards;
+
using Hazards;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ExplodingMicroHIDEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ExplodingMicroHIDEventArgs.cs
index c2727317aa..0618e8cb7f 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ExplodingMicroHIDEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ExplodingMicroHIDEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.MicroHID;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs
index 620178368c..2579fcb43d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs
@@ -7,9 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using System;
-
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs
index 954d2f39e8..a7e92b0d45 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
+
using Interfaces;
+
using InventorySystem.Items.Coin;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs
index 7f2d8c34c3..4d5ff2803a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HitEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HitEventArgs.cs
index d9d18adc0e..b8bfdcf015 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HitEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HitEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,8 +10,10 @@ namespace Exiled.Events.EventArgs.Player
using System.Collections.Generic;
using System.Linq;
- using API.Features;
+ using Exiled.API.Features;
+
using Interfaces;
+
using PlayerRoles.PlayableScps.Subroutines;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs
index b42a7ab209..d970db90c9 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.DamageHandlers;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs
index f328bddd20..7da8ade642 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.DamageHandlers;
+ using Exiled.API.Features;
+ using Exiled.API.Features.DamageHandlers;
+
using Interfaces;
+
using PlayerStatsSystem;
using CustomAttackerHandler = API.Features.DamageHandlers.AttackerDamageHandler;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs
index f73f97451a..83d93bfd34 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs
index 509b8bc329..3cde5a1883 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs
@@ -7,10 +7,12 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Doors;
+
using Interactables;
using Interactables.Interobjects.DoorUtils;
+
using Interfaces;
///
@@ -74,4 +76,4 @@ public InteractingDoorEventArgs(Player player, DoorVariant door, byte colliderId
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingEmergencyButtonEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingEmergencyButtonEventArgs.cs
index 9efbad6105..9e3013178c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingEmergencyButtonEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingEmergencyButtonEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Player
using Exiled.API.Features;
using Exiled.API.Features.Doors;
using Exiled.Events.EventArgs.Interfaces;
+
using Interactables.Interobjects;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs
index b7cc7f3b5c..f598b07eb6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Lockers;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
index 9555a12861..89ea9e7037 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
@@ -11,9 +11,9 @@ namespace Exiled.Events.EventArgs.Player
using AdminToys;
- using API.Enums;
- using API.Features;
- using API.Features.Toys;
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Toys;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs
index d17296909b..d7c59cfb50 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs
index 71c4cef39a..25ccce6f1b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs
index 64b15a6888..a10eb18bf8 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs
index 410897b531..e25552d149 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs
index b99b6051b4..040e2d3e0b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
index 3fc6c1221d..bae8413450 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
@@ -9,8 +9,10 @@ namespace Exiled.Events.EventArgs.Player
{
using System.Reflection;
- using API.Features;
using CommandSystem;
+
+ using Exiled.API.Features;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs
index 1ef0bac618..6e41af086d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
index 84e5e8735a..057849e6f7 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs
index e0522ed31a..4ab397d828 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/MicroHIDOpeningDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/MicroHIDOpeningDoorEventArgs.cs
index fc1024823f..1b66453503 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/MicroHIDOpeningDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/MicroHIDOpeningDoorEventArgs.cs
@@ -12,6 +12,7 @@ namespace Exiled.Events.EventArgs.Player
using Exiled.Events.EventArgs.Interfaces;
using Interactables.Interobjects.DoorUtils;
+
using InventorySystem.Items.MicroHID;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs
index 13dc43febf..472da40bcb 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs
index f71781e3b7..0e61c47e8e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs
@@ -52,4 +52,4 @@ public PickingUpItemEventArgs(ReferenceHub referenceHub, ItemPickupBase pickup,
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs
index 41574b280c..4ea90f622d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs
index 038a3e16c4..b323e997bb 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs
@@ -7,10 +7,10 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
-
using CustomPlayerEffects;
+ using Exiled.API.Features;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReceivingGunSoundEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReceivingGunSoundEventArgs.cs
index b12fe11972..8620534e04 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReceivingGunSoundEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReceivingGunSoundEventArgs.cs
@@ -7,11 +7,10 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
-
using AudioPooling;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
using UnityEngine;
@@ -98,4 +97,4 @@ public ReceivingGunSoundEventArgs(ReferenceHub hub, InventorySystem.Items.Firear
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReceivingVoiceMessageEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReceivingVoiceMessageEventArgs.cs
index 4b491f739a..2261640c97 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReceivingVoiceMessageEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReceivingVoiceMessageEventArgs.cs
@@ -9,7 +9,9 @@ namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles.Voice;
+
using VoiceChat.Networking;
///
@@ -57,4 +59,4 @@ public ReceivingVoiceMessageEventArgs(Player receiver, Player sender, VoiceModul
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReloadedWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReloadedWeaponEventArgs.cs
index 464f2db6c5..6e30138b89 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReloadedWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReloadedWeaponEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs
index a33a3cabbc..d1edfe37c0 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
@@ -47,4 +47,4 @@ public ReloadingWeaponEventArgs(InventorySystem.Items.Firearms.Firearm firearm,
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs
index cef326e42d..5569f47e76 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Enums;
- using API.Features;
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
///
@@ -44,4 +44,4 @@ public RemovedHandcuffsEventArgs(Player cuffer, Player target, UncuffReason uncu
///
public UncuffReason UncuffReason { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs
index 782d77f0fb..bd683b6f25 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Enums;
- using API.Features;
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
index cb949391ca..e757034c37 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
@@ -74,4 +74,4 @@ public ReservedSlotEventResult Result
}
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
index 599ac864bf..871f831155 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RoomChangedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RoomChangedEventArgs.cs
index c640b78217..469d5811d1 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RoomChangedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RoomChangedEventArgs.cs
@@ -42,4 +42,4 @@ public RoomChangedEventArgs(ReferenceHub player, RoomIdentifier oldRoom, RoomIde
///
public Room NewRoom { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RotatingRevolverEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RotatingRevolverEventArgs.cs
index 515d8c7b04..c0286f7edb 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RotatingRevolverEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RotatingRevolverEventArgs.cs
@@ -7,15 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
-
- using Exiled.API.Features.Items.FirearmModules.Primary;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
- using InventorySystem.Items.Firearms.Modules;
-
using FirearmBase = InventorySystem.Items.Firearms.Firearm;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs
index 47b568d667..ef098bd4d7 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SavingByAntiScp207EventArgs.cs
@@ -8,6 +8,7 @@
namespace Exiled.Events.EventArgs.Player
{
using CustomPlayerEffects;
+
using Exiled.API.Features;
using Exiled.API.Features.DamageHandlers;
using Exiled.Events.EventArgs.Interfaces;
@@ -64,4 +65,4 @@ public SavingByAntiScp207EventArgs(ReferenceHub player, float damageAmount, Dama
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/Scp1576TransmissionEndedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/Scp1576TransmissionEndedEventArgs.cs
index 6dce01109c..bef34edd65 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/Scp1576TransmissionEndedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/Scp1576TransmissionEndedEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
+
using Interfaces;
+
using InventorySystem.Items.Usables.Scp1576;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs
index 921be7a267..5903268c82 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs
@@ -8,12 +8,8 @@
namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features;
- using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
- using InventorySystem.Items.Pickups;
- using InventorySystem.Searching;
-
///
/// Contains all information before a player sends a message in AdminChat.
///
@@ -53,4 +49,4 @@ public SendingAdminChatMessageEventsArgs(Player player, string message, bool isA
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SendingGunSoundEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SendingGunSoundEventArgs.cs
index c1041453ab..636d3fec80 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SendingGunSoundEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SendingGunSoundEventArgs.cs
@@ -6,11 +6,10 @@
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
-
using AudioPooling;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
using UnityEngine;
@@ -83,4 +82,4 @@ public SendingGunSoundEventArgs(InventorySystem.Items.Firearms.Firearm firearm,
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SendingValidCommandEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SendingValidCommandEventArgs.cs
index 1ea8a6df71..f4ef316f08 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SendingValidCommandEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SendingValidCommandEventArgs.cs
@@ -8,11 +8,11 @@
namespace Exiled.Events.EventArgs.Player
{
using CommandSystem;
+
using Exiled.API.Features;
- using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using LabApi.Features.Enums;
- using RemoteAdmin;
///
/// Contains all information before a player sends the command.
@@ -76,4 +76,4 @@ public SendingValidCommandEventArgs(Player player, ICommand command, CommandType
///
public ICommand Command { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SentValidCommandEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SentValidCommandEventArgs.cs
index 1c96ff88f9..3ecddd2c87 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SentValidCommandEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SentValidCommandEventArgs.cs
@@ -8,11 +8,11 @@
namespace Exiled.Events.EventArgs.Player
{
using CommandSystem;
+
using Exiled.API.Features;
- using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using LabApi.Features.Enums;
- using RemoteAdmin;
///
/// Contains all information after a player sends the command.
@@ -80,4 +80,4 @@ public SentValidCommandEventArgs(Player player, ICommand command, CommandType co
///
public ICommand Command { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs
index 3c2f9d12b6..8195b894a1 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs
@@ -7,10 +7,13 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
+
using InventorySystem.Items.Firearms.Modules.Misc;
+
using UnityEngine;
using BaseFirearm = InventorySystem.Items.Firearms.Firearm;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs
index 18d2303353..41ee8ac4f2 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs
@@ -7,10 +7,13 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
+
using InventorySystem.Items.Firearms.Modules;
+
using UnityEngine;
///
@@ -106,4 +109,4 @@ public ShotEventArgs(HitscanHitregModuleBase hitregModule, RaycastHit hitInfo, I
///
public bool CanSpawnImpactEffects { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs
index aa231bce41..b4364b8200 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs
index a500495017..d8e41a57f6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs
@@ -7,14 +7,17 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
using PlayerRoles;
using PlayerRoles.Ragdolls;
+
using PlayerStatsSystem;
+
using RelativePositioning;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs
index 785ff5a3cc..73413e42c1 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs
@@ -12,7 +12,9 @@ namespace Exiled.Events.EventArgs.Player
using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles;
+
using UnityEngine;
///
@@ -75,4 +77,4 @@ public SpawningEventArgs(Player player, Vector3 position, float rotation, Player
///
public Role NewRole { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs
index 9212024a25..9694a53946 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs
@@ -7,13 +7,17 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
+
using Interfaces;
using PlayerRoles;
using PlayerRoles.Ragdolls;
+
using PlayerStatsSystem;
+
using RelativePositioning;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs
index 002e6a9b8f..89f201ee26 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs
@@ -8,7 +8,9 @@
namespace Exiled.Events.EventArgs.Player
{
using Exiled.API.Features.Hazards;
+
using Hazards;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs
index 6462c655d8..87f61e1835 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using MapGeneration.Distributors;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs
index ee1b36558a..32e04847ce 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs
@@ -50,4 +50,4 @@ public ThrowingRequestEventArgs(Player player, ThrowableItem item, ThrowableNetw
///
public ThrowRequest RequestType { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs
index 14ab42de1e..48238a8e60 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs
@@ -54,4 +54,4 @@ public ThrownProjectileEventArgs(ThrownProjectile projectile, Player player, Thr
///
public Pickup Pickup => Projectile;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs
index 183476b48a..6ffaa716e3 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs
@@ -7,10 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
+
using InventorySystem.Items.ToggleableLights;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs
index 65ea273731..c0f397f7cf 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs
index 7b0c68d7a6..95dc42d62a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs
@@ -7,10 +7,11 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
-
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
+
using InventorySystem.Items.Radio;
///
@@ -64,4 +65,4 @@ public TogglingRadioEventArgs(Player player, RadioItem radio, bool newState, boo
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs
index 3c6f2f7886..cb30b5dc42 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs
index 6c897ba955..908c3c1ffb 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UnloadedWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UnloadedWeaponEventArgs.cs
index 69a37671dc..e3be85338e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UnloadedWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UnloadedWeaponEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs
index 2ac5ce4a2f..1cc14e9f77 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
@@ -51,4 +51,4 @@ public UnloadingWeaponEventArgs(InventorySystem.Items.Firearms.Firearm firearm,
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs
index 77541732d0..63c5ce8a4f 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs
index c6aeed7ffb..3d57657aed 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs
index 027d0a36c4..51b133fce6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
using InventorySystem.Items.Usables;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs
index 317d6ddbeb..e11878f465 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
using InventorySystem.Items.Usables;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs
index 2cfe7fee35..c87c0ade86 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs
index 3b3af1c73f..340f07bd0e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs
index ec1d841365..d0586ecd65 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Player
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs
index 5a488c3d2e..06b6500a71 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs
@@ -58,4 +58,4 @@ public VoiceChattingEventArgs(Player player, VoiceModuleBase voiceModule, VoiceM
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs
index a6144bbb8c..3fe1d31ba6 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp049
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
using Scp049Role = API.Features.Roles.Scp049Role;
@@ -61,4 +61,4 @@ public ActivatingSenseEventArgs(Player player, Player target, bool isAllowed = t
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs
index fc773a7fcb..f6767158ca 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Scp049
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
+
using PlayerRoles.Ragdolls;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingSenseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingSenseEventArgs.cs
index 43baf5987b..d8c918c99d 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingSenseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingSenseEventArgs.cs
@@ -63,4 +63,4 @@ public FinishingSenseEventArgs(ReferenceHub scp049, ReferenceHub target, double
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs
index e859023690..c261aae666 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp049
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs
index 93757c990a..d591160096 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp049
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
@@ -60,4 +61,4 @@ public StartingRecallEventArgs(Player player, Ragdoll ragdoll, bool isAllowed =
///
public Ragdoll Ragdoll { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs
index 56aff95ac3..43fd31568e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp0492
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
using PlayerRoles.PlayableScps.Scp049.Zombies;
@@ -50,4 +51,4 @@ public ConsumedCorpseEventArgs(ReferenceHub player, BasicRagdoll ragDoll)
///
public float ConsumeHeal { get; set; } = ZombieConsumeAbility.ConsumeHeal;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs
index 06de15a086..94c539686e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp0492
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
using PlayerRoles.PlayableScps.Scp049.Zombies;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs
index d827bbd254..b93d7a3775 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp079
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs
index 973cbfe84d..ecfcc677e4 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs
@@ -9,11 +9,10 @@ namespace Exiled.Events.EventArgs.Scp079
{
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles;
using PlayerRoles.PlayableScps.Scp079;
- using Scp079Role = API.Features.Roles.Scp079Role;
-
///
/// Contains all information before SCP-079 gains experience.
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs
index 57eeae5ded..54c781883e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp079
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/LosingSignalEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/LosingSignalEventArgs.cs
index cae1c775e2..33d635bed1 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/LosingSignalEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/LosingSignalEventArgs.cs
@@ -41,4 +41,4 @@ public LosingSignalEventArgs(ReferenceHub player)
///
public API.Features.Roles.Scp079Role Scp079 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/LostSignalEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/LostSignalEventArgs.cs
index 247eb5c20f..38f8dd2ee8 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/LostSignalEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/LostSignalEventArgs.cs
@@ -35,4 +35,4 @@ public LostSignalEventArgs(ReferenceHub player)
///
public API.Features.Roles.Scp079Role Scp079 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs
index 811dca1977..065658655e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs
@@ -7,10 +7,10 @@
namespace Exiled.Events.EventArgs.Scp079
{
- using API.Features;
-
using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
using RelativePositioning;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
index c897dd1a5f..4be20db3cb 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp079
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
@@ -57,4 +58,4 @@ public RecontainedEventArgs(Player player, PlayerRoles.PlayableScps.Scp079.Scp07
///
public bool IsAutomatic { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs
index 5bde59481d..d344068959 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs
@@ -39,4 +39,4 @@ public RecontainingEventArgs(BreakableWindow recontainer)
///
public bool IsAutomatic { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs
index 513a7d266a..6c1705e4c5 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs
@@ -8,7 +8,6 @@
namespace Exiled.Events.EventArgs.Scp079
{
using Exiled.API.Features;
- using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
using MapGeneration;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs
index e93c97772e..3ee025e03a 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs
@@ -7,10 +7,11 @@
namespace Exiled.Events.EventArgs.Scp079
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Doors;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
+
using Interactables.Interobjects.DoorUtils;
using Player;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs
index 6f23053ee4..e7eb9cb02e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs
@@ -11,10 +11,10 @@ namespace Exiled.Events.EventArgs.Scp079
using Exiled.API.Extensions;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using MapGeneration;
- using PlayerRoles.PlayableScps.Scp079;
- using Scp079Role = API.Features.Roles.Scp079Role;
+ using PlayerRoles.PlayableScps.Scp079;
///
/// Contains all information before SCP-079 lockdowns a room.
@@ -92,4 +92,4 @@ public ZoneBlackoutEventArgs(ReferenceHub player, FacilityZone zone, float auxil
///
public API.Features.Roles.Scp079Role Scp079 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs
index 13e0660a7e..dfd9b25120 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs
index c025e712ce..5a35f807f3 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs
index 299ce58675..6f40cd9fdc 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs
index 67ce2db693..d931149bd8 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/RemovingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/RemovingTargetEventArgs.cs
index 1dc1934942..f5afec9bf7 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/RemovingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/RemovingTargetEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs
index 22052c0350..648199d227 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs
@@ -7,10 +7,11 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
- using API.Features.Doors;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Doors;
using Interactables.Interobjects;
+
using Interfaces;
using Scp096Role = API.Features.Roles.Scp096Role;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs
index 803d7ddbcc..288ea9f8fe 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Scp096
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Doors;
+
using Interfaces;
+
using UnityEngine;
using Scp096Role = API.Features.Roles.Scp096Role;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs
index b501c112c9..26aba1480c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs
@@ -7,7 +7,8 @@
namespace Exiled.Events.EventArgs.Scp106
{
- using API.Features;
+ using Exiled.API.Features;
+
using Interfaces;
using Scp106Role = API.Features.Roles.Scp106Role;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs
index b94a3db6ff..cb3a10626b 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs
@@ -7,8 +7,10 @@
namespace Exiled.Events.EventArgs.Scp106
{
- using API.Features;
+ using Exiled.API.Features;
+
using Interfaces;
+
using PlayerRoles.PlayableScps.Scp106;
using Scp106Role = API.Features.Roles.Scp106Role;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs
index 52f503cf6a..9e5067f528 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp106
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
using UnityEngine;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp127/GainedExperienceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp127/GainedExperienceEventArgs.cs
index 533ccbb5ce..da3268e6f2 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp127/GainedExperienceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp127/GainedExperienceEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Scp127
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Firearms.Modules.Scp127;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp127/GainingExperienceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp127/GainingExperienceEventArgs.cs
index 6a1d7b738b..86b22c14df 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp127/GainingExperienceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp127/GainingExperienceEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Scp127
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Firearms.Modules.Scp127;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp127/TalkedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp127/TalkedEventArgs.cs
index 10810403d5..8c77180c9e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp127/TalkedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp127/TalkedEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Scp127
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Firearms.Modules.Scp127;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp127/TalkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp127/TalkingEventArgs.cs
index b8934566a8..614551c797 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp127/TalkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp127/TalkingEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Scp127
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Firearms.Modules.Scp127;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs
index c5c772529f..7c8c6b287e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs
@@ -56,4 +56,4 @@ public ChangedStatusEventArgs(ItemBase item, Scp1344Status scp1344Status)
[Obsolete("Please use ChangingStatusEventArgs::IsAllowed instead of this", true)]
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs
index 6cf7449e99..4330cc41ce 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Scp1344
{
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items;
using InventorySystem.Items.Usables.Scp1344;
@@ -61,4 +62,4 @@ public ChangingStatusEventArgs(ItemBase item, Scp1344Status scp1344StatusNew, Sc
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs
index 79ec6925ee..c00535c169 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs
@@ -41,4 +41,4 @@ public DeactivatedEventArgs(Item item)
///
public Scp1344 Scp1344 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs
index 8ff103fa53..680041f5df 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs
@@ -54,4 +54,4 @@ public DeactivatingEventArgs(Item item, bool isAllowed = true)
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1507/AttackingDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1507/AttackingDoorEventArgs.cs
index c58330e252..e3f92113bc 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1507/AttackingDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1507/AttackingDoorEventArgs.cs
@@ -13,6 +13,7 @@ namespace Exiled.Events.EventArgs.Scp1507
using Exiled.API.Features.Doors;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
+
using Interactables.Interobjects.DoorUtils;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs
index 376eba5abf..1806cc8eb4 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs
@@ -13,8 +13,8 @@ namespace Exiled.Events.EventArgs.Scp1507
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles.PlayableScps.Scp1507;
- using Utils.NonAllocLINQ;
///
/// Contains all information before flamingos get spawned.
@@ -30,7 +30,7 @@ public class SpawningFlamingosEventArgs : IDeniableEvent, IPlayerEvent
public SpawningFlamingosEventArgs(Player newAlpha, bool isAllowed = true)
{
Player = newAlpha;
- SpawnablePlayers = ReferenceHub.AllHubs.Where(Scp1507Spawner.ValidatePlayer).Select(x => Player.Get(x)).ToHashSet();
+ SpawnablePlayers = ReferenceHub.AllHubs.Where(Scp1507Spawner.ValidatePlayer).Select(Player.Get).ToHashSet();
IsAllowed = isAllowed;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1507/UsingTapeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1507/UsingTapeEventArgs.cs
index 0121d02d95..09eb92c630 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1507/UsingTapeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1507/UsingTapeEventArgs.cs
@@ -12,6 +12,7 @@ namespace Exiled.Events.EventArgs.Scp1507
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1509/ResurrectingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1509/ResurrectingEventArgs.cs
index 4484f3b730..90e3fd07cd 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1509/ResurrectingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1509/ResurrectingEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,7 +10,9 @@ namespace Exiled.Events.EventArgs.Scp1509
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Scp1509;
+
using PlayerRoles;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1509/TriggeringAttackEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1509/TriggeringAttackEventArgs.cs
index cbc9b54106..17d8d7c63c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp1509/TriggeringAttackEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp1509/TriggeringAttackEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Scp1509
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
+
using InventorySystem.Items.Scp1509;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/AddingObserverEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/AddingObserverEventArgs.cs
index b47ee821c6..6df42adb33 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/AddingObserverEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/AddingObserverEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Scp173
{
using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs
index d1ee0750bf..005499bb89 100755
--- a/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs
@@ -54,4 +54,4 @@ public BeingObservedEventArgs(API.Features.Player target, API.Features.Player sc
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs
index 95f3e2a084..36990b3464 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs
@@ -9,7 +9,7 @@ namespace Exiled.Events.EventArgs.Scp173
{
using System.Collections.Generic;
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
@@ -73,4 +73,4 @@ public BlinkingEventArgs(Player player, List targets, Vector3 blinkPos)
///
public Scp173Role Scp173 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs
index f526d55c38..af7b57a865 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs
@@ -10,7 +10,8 @@ namespace Exiled.Events.EventArgs.Scp173
using System.Collections.Generic;
using System.Linq;
- using API.Features;
+ using Exiled.API.Features;
+
using Interfaces;
using Scp173Role = API.Features.Roles.Scp173Role;
@@ -33,7 +34,7 @@ public BlinkingRequestEventArgs(Player player, HashSet targets)
{
Player = player;
Scp173 = player.Role.As();
- Targets = targets.Select(target => Player.Get(target)).ToList();
+ Targets = targets.Select(Player.Get).ToList();
}
///
@@ -54,4 +55,4 @@ public BlinkingRequestEventArgs(Player player, HashSet targets)
///
public Scp173Role Scp173 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs
index 70ed06bdf4..6b651d01a4 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs
@@ -13,6 +13,7 @@ namespace Exiled.Events.EventArgs.Scp173
using Exiled.Events.EventArgs.Interfaces;
using Hazards;
+
using PlayerRoles.Subroutines;
using Scp173Role = API.Features.Roles.Scp173Role;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/RemovedObserverEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/RemovedObserverEventArgs.cs
index a941cfeea6..c4db144aec 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/RemovedObserverEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/RemovedObserverEventArgs.cs
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Scp173
{
using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs
index 32216ba9e0..df671cccc2 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp173
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
@@ -54,4 +55,4 @@ public UsingBreakneckSpeedsEventArgs(Player player, bool isActivationRequested,
///
public Scp173Role Scp173 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs
index d8550dd4e4..808c41a500 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs
@@ -38,4 +38,4 @@ public OpeningScp244EventArgs(Scp244DeployablePickup pickup)
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs
index ab00eaab12..cc53b717a8 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Scp244
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
@@ -53,4 +53,4 @@ public UsingScp244EventArgs(Scp244Item scp244, Player player, bool isAllowed = t
///
public Player Player { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp2536/FindingPositionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp2536/FindingPositionEventArgs.cs
index 1bb5773188..c891012223 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp2536/FindingPositionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp2536/FindingPositionEventArgs.cs
@@ -8,6 +8,7 @@
namespace Exiled.Events.EventArgs.Scp2536
{
using Christmas.Scp2536;
+
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp2536/FoundPositionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp2536/FoundPositionEventArgs.cs
index d4935e6c92..193e057934 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp2536/FoundPositionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp2536/FoundPositionEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -8,6 +8,7 @@
namespace Exiled.Events.EventArgs.Scp2536
{
using Christmas.Scp2536;
+
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp2536/GrantingGiftEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp2536/GrantingGiftEventArgs.cs
index 4ecd4af405..7e1297d2da 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp2536/GrantingGiftEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp2536/GrantingGiftEventArgs.cs
@@ -8,6 +8,7 @@
namespace Exiled.Events.EventArgs.Scp2536
{
using Christmas.Scp2536;
+
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp2536/OpeningGiftEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp2536/OpeningGiftEventArgs.cs
index b952ed7fe3..8cc44aec2a 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp2536/OpeningGiftEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp2536/OpeningGiftEventArgs.cs
@@ -7,7 +7,6 @@
namespace Exiled.Events.EventArgs.Scp2536
{
- using Christmas.Scp2536;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs
index 49488a20bf..af9abfcf79 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs
@@ -11,7 +11,6 @@ namespace Exiled.Events.EventArgs.Scp3114
using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
- using Exiled.Events.Patches.Events.Scp3114;
///
/// Contains all information before SCP-3114 changes its dancing status.
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs
index b7c7d4bf6b..5f74301a1b 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs
index 050b4beb5b..3296b107d1 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs
index cab47ebc91..4bd687b7d5 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs
index 215ffd1771..b19db42e62 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs
index 41a01cdce7..3562415936 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
+
using PlayerRoles.PlayableScps.Subroutines;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs
index 94b45227c4..bb803f6606 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs
@@ -7,9 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
+
using Interfaces;
- using PlayerRoles.PlayableScps.Scp3114;
using Scp3114Role = Exiled.API.Features.Roles.Scp3114Role;
@@ -51,4 +51,4 @@ public StranglingEventArgs(ReferenceHub hub, ReferenceHub target)
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs
index f63aaba952..9d067c1a0a 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs
index 7fa402479a..d861a41285 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp3114
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
using static PlayerRoles.PlayableScps.Scp3114.Scp3114VoiceLines;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs
index dbb905ee8a..af5d2b7e80 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs
@@ -7,8 +7,8 @@
namespace Exiled.Events.EventArgs.Scp330
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs
index 74633d8c61..0f7f0a5123 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp330
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
using InventorySystem.Items.Usables.Scp330;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs
index ab15aa1d6b..b84aafaf61 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp330
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Items;
+
using Interfaces;
using InventorySystem.Items.Usables.Scp330;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs
index d706ea289d..c0b6ba40ab 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs
@@ -7,8 +7,10 @@
namespace Exiled.Events.EventArgs.Scp330
{
- using API.Features;
+ using Exiled.API.Features;
+
using Exiled.API.Features.Items;
+
using Interfaces;
using InventorySystem.Items.Usables.Scp330;
@@ -40,10 +42,10 @@ public InteractingScp330EventArgs(ReferenceHub referenceHub, int usage, bool sho
{
Player = Player.Get(referenceHub);
UsageCount = usage;
- ShouldSever = usage >= 2;
+ ShouldSever = shouldSever;
ShouldPlaySound = shouldPlaySound;
IsAllowed = Player.IsHuman;
- Candy = Scp330Candies.GetRandom();
+ Candy = candy;
}
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp559/SpawningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp559/SpawningEventArgs.cs
index 6e3a81f06a..8efc9cf7d6 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp559/SpawningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp559/SpawningEventArgs.cs
@@ -11,6 +11,7 @@ namespace Exiled.Events.EventArgs.Scp559
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs
index 1309a55978..491b626b00 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp914
{
- using API.Features;
+ using Exiled.API.Features;
using global::Scp914;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
index 4874f9de7b..ddde646524 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp914
{
- using API.Features;
+ using Exiled.API.Features;
using global::Scp914;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedInventoryItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedInventoryItemEventArgs.cs
index 4bd590dc55..fb77bcc015 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedInventoryItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedInventoryItemEventArgs.cs
@@ -7,12 +7,14 @@
namespace Exiled.Events.EventArgs.Scp914
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
+
using global::Scp914;
+
using Interfaces;
+
using InventorySystem.Items;
- using InventorySystem.Items.Pickups;
///
/// Contains all information before SCP-914 upgrades an item.
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedPickupEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedPickupEventArgs.cs
index 5bd2c9d952..8ead02480c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedPickupEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradedPickupEventArgs.cs
@@ -9,8 +9,11 @@ namespace Exiled.Events.EventArgs.Scp914
{
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using global::Scp914;
+
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs
index 667320e57e..b46ec984aa 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs
@@ -7,10 +7,13 @@
namespace Exiled.Events.EventArgs.Scp914
{
- using API.Features;
- using API.Features.Items;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Items;
+
using global::Scp914;
+
using Interfaces;
+
using InventorySystem.Items;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs
index 691db20a15..9a6fb7f4b5 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs
@@ -9,8 +9,11 @@ namespace Exiled.Events.EventArgs.Scp914
{
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
+
using global::Scp914;
+
using InventorySystem.Items.Pickups;
+
using UnityEngine;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs
index cf4487eccc..268f2cba15 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp914
{
- using API.Features;
+ using Exiled.API.Features;
using global::Scp914;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs
index 982fbd09fd..48b6c05313 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs
index 8ce4a1f1a2..5f82547a40 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs
index 387f0467cb..30125cb3e0 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs
@@ -7,8 +7,10 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
+
using Exiled.API.Features.Roles;
+
using Interfaces;
///
@@ -36,4 +38,4 @@ public LungingEventArgs(Player player)
///
public Scp939Role Scp939 { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs
index d2545aad3d..0d53bbe6a4 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
- using API.Features.Hazards;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Hazards;
+
using Interfaces;
+
using PlayerRoles.PlayableScps.Scp939;
using Scp939Role = API.Features.Roles.Scp939Role;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs
index 3d77ff708d..9571fb98cc 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlacingMimicPointEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlacingMimicPointEventArgs.cs
index a761942caf..3428e7a171 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlacingMimicPointEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlacingMimicPointEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Scp939
using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
+
using RelativePositioning;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs
index 269bb3ea3b..698ba3f498 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs
@@ -7,8 +7,10 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
+
using Exiled.API.Features.Roles;
+
using Interfaces;
///
@@ -54,4 +56,4 @@ public PlayingFootstepEventArgs(Player target, Player player, bool isAllowed = t
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs
index 675884707c..12011c7547 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs
@@ -7,9 +7,11 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
+
using PlayerRoles.PlayableScps.Scp939.Mimicry;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs
index b744934b8c..7fd8ec4862 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs
index 60133cc196..c8f60d96ed 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs
@@ -7,8 +7,9 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/UpdatedCloudStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/UpdatedCloudStateEventArgs.cs
index e75a835f44..a6dc837cc9 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/UpdatedCloudStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/UpdatedCloudStateEventArgs.cs
@@ -7,10 +7,10 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
+ using Exiled.API.Features;
using Exiled.API.Features.Hazards;
- using Exiled.API.Features.Roles;
+
using Interfaces;
using PlayerRoles.PlayableScps.Scp939;
@@ -38,6 +38,7 @@ public UpdatedCloudStateEventArgs(ReferenceHub hub, Scp939AmnesticCloudInstance.
{
Player = Player.Get(hub);
AmnesticCloud = Hazard.Get(cloud);
+ NewState = cloudState;
Scp939 = Player.Role.As();
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs
index fa3a93f300..6d50ae98d4 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -7,10 +7,10 @@
namespace Exiled.Events.EventArgs.Scp939
{
- using API.Features;
-
using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.API.Features.Roles;
+
using Interfaces;
///
@@ -36,7 +36,7 @@ public ValidatingVisibilityEventArgs(Scp939VisibilityState state, ReferenceHub p
Scp939 = Player.Role.As();
Target = Player.Get(target);
TargetVisibilityState = state;
- IsAllowed = TargetVisibilityState is not(Scp939VisibilityState.NotSeen or Scp939VisibilityState.None);
+ IsAllowed = TargetVisibilityState is not (Scp939VisibilityState.NotSeen or Scp939VisibilityState.None);
IsLateSeen = TargetVisibilityState is Scp939VisibilityState.SeenByRange;
}
@@ -69,4 +69,4 @@ public ValidatingVisibilityEventArgs(Scp939VisibilityState state, ReferenceHub p
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs
index 84c4457973..aaa305cc1f 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs
@@ -12,7 +12,9 @@ namespace Exiled.Events.EventArgs.Server
using System.Text;
using Exiled.API.Features.Pools;
+
using Interfaces;
+
using PlayerRoles;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Server/CompletingObjectiveEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/CompletingObjectiveEventArgs.cs
index def486974b..d685cbab5b 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/CompletingObjectiveEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/CompletingObjectiveEventArgs.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
//
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Server
{
using Exiled.API.Features.Objectives;
using Exiled.Events.EventArgs.Interfaces;
+
using Respawning.Objectives;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs
index 2e5c11dc05..c919f8ac1b 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs
@@ -9,7 +9,8 @@ namespace Exiled.Events.EventArgs.Server
{
using System;
- using API.Enums;
+ using Exiled.API.Enums;
+
using Interfaces;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs
index 02d1d6b984..834c0b516c 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Server
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs
index b102bdb377..4eedf333dd 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Server
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs
index d3d62667a0..e8543f64a7 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs
@@ -12,7 +12,7 @@ namespace Exiled.Events.EventArgs.Server
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
- using Respawning;
+
using Respawning.Waves;
///
@@ -41,4 +41,4 @@ public RespawnedTeamEventArgs(SpawnableWaveBase wave, IEnumerable
///
public SpawnableWaveBase Wave { get; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
index 6e017b2816..b334d64ef6 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
@@ -7,15 +7,15 @@
namespace Exiled.Events.EventArgs.Server
{
- using System;
using System.Collections.Generic;
using Exiled.API.Features;
using Exiled.API.Features.Waves;
using Exiled.Events.EventArgs.Interfaces;
+
using PlayerRoles;
using PlayerRoles.Spectating;
- using Respawning;
+
using Respawning.Objectives;
using Respawning.Waves;
@@ -100,4 +100,4 @@ public int MaximumRespawnAmount
///
public Queue SpawnQueue { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs
index 0e614d8a64..460747d00d 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Server
{
- using API.Enums;
+ using Exiled.API.Enums;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RoundStartingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RoundStartingEventArgs.cs
index b97f309edf..10de2a7c6e 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RoundStartingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RoundStartingEventArgs.cs
@@ -7,12 +7,6 @@
namespace Exiled.Events.EventArgs.Server
{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
using Exiled.Events.EventArgs.Interfaces;
///
@@ -59,4 +53,4 @@ public RoundStartingEventArgs(short timeLeft, short originalTimeLeft, int topPla
///
public bool IsAllowed { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs
index dd62947778..689ebd12f0 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs
@@ -10,6 +10,7 @@ namespace Exiled.Events.EventArgs.Server
using Exiled.API.Enums;
using Exiled.API.Features.Waves;
using Exiled.Events.EventArgs.Interfaces;
+
using Respawning.Waves;
///
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs
index 407cdfd762..b3cce5d9a4 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Warhead
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/DeadmanSwitchInitiatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/DeadmanSwitchInitiatingEventArgs.cs
index 389677132c..9c63e9ec19 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/DeadmanSwitchInitiatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/DeadmanSwitchInitiatingEventArgs.cs
@@ -17,4 +17,4 @@ public class DeadmanSwitchInitiatingEventArgs : IDeniableEvent
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs
index d9c00e9da4..4cc024c942 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs
@@ -17,4 +17,4 @@ public class DetonatingEventArgs : IDeniableEvent
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs
index 403380511b..71eff5af38 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs
@@ -7,7 +7,7 @@
namespace Exiled.Events.EventArgs.Warhead
{
- using API.Features;
+ using Exiled.API.Features;
using Interfaces;
diff --git a/EXILED/Exiled.Events/Events.cs b/EXILED/Exiled.Events/Events.cs
index f01919aff5..980d245cb2 100644
--- a/EXILED/Exiled.Events/Events.cs
+++ b/EXILED/Exiled.Events/Events.cs
@@ -10,19 +10,23 @@ namespace Exiled.Events
using System;
using System.Diagnostics;
- using API.Enums;
- using API.Features;
using CentralAuth;
+
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
using Exiled.API.Features.Core.UserSettings;
using Exiled.Events.Features;
- using HarmonyLib;
+
using InventorySystem.Items.Pickups;
using InventorySystem.Items.Usables;
+
using PlayerRoles.Ragdolls;
using PlayerRoles.RoleAssign;
using Respawning;
+
using UnityEngine.SceneManagement;
+
using UserSettings.ServerSpecific;
///
@@ -149,8 +153,8 @@ public void Patch()
{
Patcher = new Patcher();
#if DEBUG
- bool lastDebugStatus = Harmony.DEBUG;
- Harmony.DEBUG = true;
+ bool lastDebugStatus = HarmonyLib.Harmony.DEBUG;
+ HarmonyLib.Harmony.DEBUG = true;
#endif
Patcher.PatchAll(!Config.UseDynamicPatching, out int failedPatch);
@@ -159,7 +163,7 @@ public void Patch()
else
Log.Error($"Patching failed! There are {failedPatch} broken patches.");
#if DEBUG
- Harmony.DEBUG = lastDebugStatus;
+ HarmonyLib.Harmony.DEBUG = lastDebugStatus;
#endif
}
catch (Exception exception)
@@ -179,4 +183,4 @@ public void Unpatch()
Log.Debug("All events have been unpatched complete. Goodbye!");
}
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Exiled.Events.csproj b/EXILED/Exiled.Events/Exiled.Events.csproj
index c8d9aa1cd1..e686633b20 100644
--- a/EXILED/Exiled.Events/Exiled.Events.csproj
+++ b/EXILED/Exiled.Events/Exiled.Events.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/EXILED/Exiled.Events/Features/Event.cs b/EXILED/Exiled.Events/Features/Event.cs
index 7c2d146635..8d27e46b02 100644
--- a/EXILED/Exiled.Events/Features/Event.cs
+++ b/EXILED/Exiled.Events/Features/Event.cs
@@ -10,7 +10,6 @@ namespace Exiled.Events.Features
using System;
using System.Buffers;
using System.Collections.Generic;
- using System.Linq;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
@@ -33,15 +32,11 @@ namespace Exiled.Events.Features
///
public class Event : IExiledEvent
{
- private record Registration(CustomEventHandler handler, int priority);
-
- private record AsyncRegistration(CustomAsyncEventHandler handler, int priority);
-
private static readonly List EventsValue = new();
- private static readonly IComparer RegisterComparable = Comparer.Create((x, y) => y.priority - x.priority);
+ private static readonly IComparer RegisterComparable = Comparer.Create((x, y) => y.Priority - x.Priority);
- private static readonly IComparer AsyncRegisterComparable = Comparer.Create((x, y) => y.priority - x.priority);
+ private static readonly IComparer AsyncRegisterComparable = Comparer.Create((x, y) => y.Priority - x.Priority);
private readonly List innerEvent = new();
@@ -138,7 +133,7 @@ public void Subscribe(CustomEventHandler handler, int priority)
if (handler == null)
return;
- Registration registration = new Registration(handler, priority);
+ Registration registration = new(handler, priority);
int index = innerEvent.BinarySearch(registration, RegisterComparable);
if (index < 0)
{
@@ -146,7 +141,7 @@ public void Subscribe(CustomEventHandler handler, int priority)
}
else
{
- while (index < innerEvent.Count && innerEvent[index].priority == priority)
+ while (index < innerEvent.Count && innerEvent[index].Priority == priority)
index++;
innerEvent.Insert(index, registration);
}
@@ -177,7 +172,7 @@ public void Subscribe(CustomAsyncEventHandler handler, int priority)
if (handler == null)
return;
- AsyncRegistration registration = new AsyncRegistration(handler, 0);
+ AsyncRegistration registration = new(handler, 0);
int index = innerAsyncEvent.BinarySearch(registration, AsyncRegisterComparable);
if (index < 0)
{
@@ -185,7 +180,7 @@ public void Subscribe(CustomAsyncEventHandler handler, int priority)
}
else
{
- while (index < innerAsyncEvent.Count && innerAsyncEvent[index].priority == priority)
+ while (index < innerAsyncEvent.Count && innerAsyncEvent[index].Priority == priority)
index++;
innerAsyncEvent.Insert(index, registration);
}
@@ -197,7 +192,7 @@ public void Subscribe(CustomAsyncEventHandler handler, int priority)
/// The handler to add.
public void Unsubscribe(CustomEventHandler handler)
{
- int index = innerEvent.FindIndex(p => p.handler == handler);
+ int index = innerEvent.FindIndex(p => p.Handler == handler);
if (index != -1)
innerEvent.RemoveAt(index);
}
@@ -208,7 +203,7 @@ public void Unsubscribe(CustomEventHandler handler)
/// The handler to add.
public void Unsubscribe(CustomAsyncEventHandler handler)
{
- int index = innerAsyncEvent.FindIndex(p => p.handler == handler);
+ int index = innerAsyncEvent.FindIndex(p => p.Handler == handler);
if (index != -1)
innerAsyncEvent.RemoveAt(index);
}
@@ -241,15 +236,15 @@ internal void BlendedInvoke()
for (int i = 0; i < count; i++)
{
- if (eventIndex < syncCount && (asyncEventIndex >= asyncCount || localInnerEvent[eventIndex].priority >= localInnerAsyncEvent[asyncEventIndex].priority))
+ if (eventIndex < syncCount && (asyncEventIndex >= asyncCount || localInnerEvent[eventIndex].Priority >= localInnerAsyncEvent[asyncEventIndex].Priority))
{
try
{
- localInnerEvent[eventIndex].handler();
+ localInnerEvent[eventIndex].Handler();
}
catch (Exception ex)
{
- Log.Error($"Method \"{localInnerEvent[eventIndex].handler.Method.Name}\" of the class \"{localInnerEvent[eventIndex].handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
+ Log.Error($"Method \"{localInnerEvent[eventIndex].Handler.Method.Name}\" of the class \"{localInnerEvent[eventIndex].Handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
}
eventIndex++;
@@ -258,11 +253,11 @@ internal void BlendedInvoke()
{
try
{
- Timing.RunCoroutine(localInnerAsyncEvent[asyncEventIndex].handler());
+ Timing.RunCoroutine(localInnerAsyncEvent[asyncEventIndex].Handler());
}
catch (Exception ex)
{
- Log.Error($"Method \"{localInnerAsyncEvent[asyncEventIndex].handler.Method.Name}\" of the class \"{localInnerAsyncEvent[asyncEventIndex].handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
+ Log.Error($"Method \"{localInnerAsyncEvent[asyncEventIndex].Handler.Method.Name}\" of the class \"{localInnerAsyncEvent[asyncEventIndex].Handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
}
asyncEventIndex++;
@@ -290,11 +285,11 @@ internal void InvokeNormal()
{
try
{
- localInnerEvent[i].handler();
+ localInnerEvent[i].Handler();
}
catch (Exception ex)
{
- Log.Error($"Method \"{localInnerEvent[i].handler.Method.Name}\" of the class \"{localInnerEvent[i].handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
+ Log.Error($"Method \"{localInnerEvent[i].Handler.Method.Name}\" of the class \"{localInnerEvent[i].Handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
}
}
}
@@ -318,11 +313,11 @@ internal void InvokeAsync()
{
try
{
- Timing.RunCoroutine(localInnerAsyncEvent[i].handler());
+ Timing.RunCoroutine(localInnerAsyncEvent[i].Handler());
}
catch (Exception ex)
{
- Log.Error($"Method \"{localInnerAsyncEvent[i].handler.Method.Name}\" of the class \"{localInnerAsyncEvent[i].handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
+ Log.Error($"Method \"{localInnerAsyncEvent[i].Handler.Method.Name}\" of the class \"{localInnerAsyncEvent[i].Handler.Method.ReflectedType.FullName}\" caused an exception when handling the event \"{GetType().FullName}\"\n{ex}");
}
}
}
@@ -331,5 +326,9 @@ internal void InvokeAsync()
ArrayPool.Shared.Return(localInnerAsyncEvent, true);
}
}
+
+ private record Registration(CustomEventHandler Handler, int Priority);
+
+ private record AsyncRegistration(CustomAsyncEventHandler Handler, int Priority);
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Features/Event{T}.cs b/EXILED/Exiled.Events/Features/Event{T}.cs
index 40fdb85be7..095cb17b40 100644
--- a/EXILED/Exiled.Events/Features/Event{T}.cs
+++ b/EXILED/Exiled.Events/Features/Event{T}.cs
@@ -10,7 +10,6 @@ namespace Exiled.Events.Features
using System;
using System.Buffers;
using System.Collections.Generic;
- using System.Linq;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
@@ -38,15 +37,11 @@ namespace Exiled.Events.Features
/// The specified that the event will use.
public class Event : IExiledEvent
{
- private record Registration(CustomEventHandler handler, int priority);
-
- private record AsyncRegistration(CustomAsyncEventHandler handler, int priority);
-
private static readonly Dictionary> TypeToEvent = new();
- private static readonly IComparer RegisterComparable = Comparer