From e878b9558764c92707c63b9581eb002c0d1d6d91 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 8 Oct 2024 00:34:04 +0200 Subject: [PATCH 1/2] Made it work because devs have no braincells :) --- EXILED/Exiled.API/Exiled.API.csproj | 2 +- EXILED/Exiled.API/Features/Player.cs | 4 ++-- EXILED/Exiled.CustomItems/CustomItems.cs | 2 +- EXILED/Exiled.CustomItems/Exiled.CustomItems.csproj | 2 +- EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs | 2 +- EXILED/Exiled.CustomRoles/Exiled.CustomRoles.csproj | 1 - EXILED/Exiled.Events/Exiled.Events.csproj | 2 +- EXILED/Exiled.Events/Features/Patcher.cs | 2 +- EXILED/Exiled.Example/Exiled.Example.csproj | 1 - 9 files changed, 8 insertions(+), 10 deletions(-) diff --git a/EXILED/Exiled.API/Exiled.API.csproj b/EXILED/Exiled.API/Exiled.API.csproj index e0949b7ff..72f45ff3b 100644 --- a/EXILED/Exiled.API/Exiled.API.csproj +++ b/EXILED/Exiled.API/Exiled.API.csproj @@ -17,9 +17,9 @@ + - diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 9e55712ee..cda806f9e 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -1333,7 +1333,7 @@ public static Player Get(string args) if (!player.IsVerified || player.Nickname is null) continue; - if (!player.Nickname.Contains(args, StringComparison.OrdinalIgnoreCase)) + if (!StringUtils.Contains(player.Nickname, args, StringComparison.OrdinalIgnoreCase)) continue; string secondString = player.Nickname; @@ -3761,6 +3761,6 @@ public void SetCooldownItem(float time, ItemType itemType) /// Converts the player in a human-readable format. /// /// A string containing Player-related data. - public override string ToString() => $"{Id} ({Nickname}) [{UserId}] *{(Role is null ? "No role" : Role)}*"; + public override string ToString() => $"{Id} ({Nickname}) [{UserId}] *{(Role is null ? "No role" : Role.ToString())}*"; } } diff --git a/EXILED/Exiled.CustomItems/CustomItems.cs b/EXILED/Exiled.CustomItems/CustomItems.cs index 855186c00..0e6077b29 100644 --- a/EXILED/Exiled.CustomItems/CustomItems.cs +++ b/EXILED/Exiled.CustomItems/CustomItems.cs @@ -54,7 +54,7 @@ public override void OnDisabled() Exiled.Events.Handlers.Player.ChangingItem -= playerHandler!.OnChangingItem; - harmony?.UnpatchAll(); + harmony?.UnpatchAll(harmony.Id); base.OnDisabled(); } diff --git a/EXILED/Exiled.CustomItems/Exiled.CustomItems.csproj b/EXILED/Exiled.CustomItems/Exiled.CustomItems.csproj index 703a8a7c7..166618d0c 100644 --- a/EXILED/Exiled.CustomItems/Exiled.CustomItems.csproj +++ b/EXILED/Exiled.CustomItems/Exiled.CustomItems.csproj @@ -20,8 +20,8 @@ + - diff --git a/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs b/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs index 28a557195..16ed61708 100644 --- a/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs +++ b/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs @@ -85,7 +85,7 @@ private IEnumerator ProcessAltKey(Player player) if (!altTracker.TryGetValue(player, out int pressCount)) yield break; - Log.Debug($"{player.Nickname}: {pressCount} {(player.Role is FpcRole fpc ? fpc.MoveState : false)}"); + Log.Debug($"{player.Nickname}: {pressCount} { player.Role is FpcRole { MoveState: PlayerMovementState.Sneaking }}"); AbilityKeypressTriggerType type = pressCount switch { 1 when player.Role is FpcRole { MoveState: PlayerMovementState.Sneaking } => AbilityKeypressTriggerType.DisplayInfo, diff --git a/EXILED/Exiled.CustomRoles/Exiled.CustomRoles.csproj b/EXILED/Exiled.CustomRoles/Exiled.CustomRoles.csproj index d569aacb2..c3e0c1ba5 100644 --- a/EXILED/Exiled.CustomRoles/Exiled.CustomRoles.csproj +++ b/EXILED/Exiled.CustomRoles/Exiled.CustomRoles.csproj @@ -22,7 +22,6 @@ - diff --git a/EXILED/Exiled.Events/Exiled.Events.csproj b/EXILED/Exiled.Events/Exiled.Events.csproj index aa7f9ff4b..cf7a9ea5d 100644 --- a/EXILED/Exiled.Events/Exiled.Events.csproj +++ b/EXILED/Exiled.Events/Exiled.Events.csproj @@ -18,8 +18,8 @@ - + diff --git a/EXILED/Exiled.Events/Features/Patcher.cs b/EXILED/Exiled.Events/Features/Patcher.cs index d22c29c7c..8e4cf3f98 100644 --- a/EXILED/Exiled.Events/Features/Patcher.cs +++ b/EXILED/Exiled.Events/Features/Patcher.cs @@ -142,7 +142,7 @@ public void ReloadDisabledPatches() public void UnpatchAll() { Log.Debug("Unpatching events..."); - Harmony.UnpatchAll(Harmony.Id); + Harmony.UnpatchAll(); UnpatchedTypes = GetAllPatchTypes(); Log.Debug("All events have been unpatched. Goodbye!"); diff --git a/EXILED/Exiled.Example/Exiled.Example.csproj b/EXILED/Exiled.Example/Exiled.Example.csproj index 9ad073fe0..3aa8e9dbf 100644 --- a/EXILED/Exiled.Example/Exiled.Example.csproj +++ b/EXILED/Exiled.Example/Exiled.Example.csproj @@ -18,7 +18,6 @@ - From 22afadf6571da6d48c0cf7cde5bf59d12dfbb8e1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 8 Oct 2024 00:46:49 +0200 Subject: [PATCH 2/2] iiiii fixx --- EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs b/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs index 16ed61708..79726265d 100644 --- a/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs +++ b/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs @@ -85,7 +85,7 @@ private IEnumerator ProcessAltKey(Player player) if (!altTracker.TryGetValue(player, out int pressCount)) yield break; - Log.Debug($"{player.Nickname}: {pressCount} { player.Role is FpcRole { MoveState: PlayerMovementState.Sneaking }}"); + Log.Debug($"{player.Nickname}: {pressCount} {player.Role is FpcRole { MoveState: PlayerMovementState.Sneaking } }"); AbilityKeypressTriggerType type = pressCount switch { 1 when player.Role is FpcRole { MoveState: PlayerMovementState.Sneaking } => AbilityKeypressTriggerType.DisplayInfo,