From b5f9537de75f7704cb00d9eff6194643ff84ee14 Mon Sep 17 00:00:00 2001 From: Yamato Date: Fri, 2 Aug 2024 15:44:25 +0200 Subject: [PATCH 01/13] Trello Is Replaced by gitlab --- .../EventArgs/Scp049/FinishingRecallEventArgs.cs | 2 +- EXILED/Exiled.Events/Handlers/Internal/Round.cs | 2 +- .../Exiled.Events/Patches/Events/Scp049/FinishingRecall.cs | 5 +---- .../Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs | 2 +- EXILED/Exiled.Events/Patches/Fixes/Scp3114AttackAhpFix.cs | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs index e2c2c0728..e897dbb04 100644 --- a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs @@ -38,7 +38,7 @@ public FinishingRecallEventArgs(Player target, Player scp049, BasicRagdoll ragdo Scp049 = Player.Role.As(); Target = target; Ragdoll = Ragdoll.Get(ragdoll); - IsAllowed = isAllowed && Target.Role is SpectatorRole spectatorRole && spectatorRole.IsReadyToRespawn; + IsAllowed = isAllowed; } /// diff --git a/EXILED/Exiled.Events/Handlers/Internal/Round.cs b/EXILED/Exiled.Events/Handlers/Internal/Round.cs index 400eb044c..8f9bd58b2 100644 --- a/EXILED/Exiled.Events/Handlers/Internal/Round.cs +++ b/EXILED/Exiled.Events/Handlers/Internal/Round.cs @@ -86,7 +86,7 @@ public static void OnVerified(VerifiedEventArgs ev) { RoleAssigner.CheckLateJoin(ev.Player.ReferenceHub, ClientInstanceMode.ReadyClient); - // TODO: Remove if this has been fixed for https://trello.com/c/CzPD304L/5983-networking-blackout-is-not-synchronized-for-the-new-players + // TODO: Remove if this has been fixed for https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/52 foreach (Room room in Room.List.Where(current => current.AreLightsOff)) { ev.Player.SendFakeSyncVar(room.RoomLightControllerNetIdentity, typeof(RoomLightController), nameof(RoomLightController.NetworkLightsEnabled), true); diff --git a/EXILED/Exiled.Events/Patches/Events/Scp049/FinishingRecall.cs b/EXILED/Exiled.Events/Patches/Events/Scp049/FinishingRecall.cs index d1458e0fd..2eab40acc 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp049/FinishingRecall.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp049/FinishingRecall.cs @@ -25,11 +25,8 @@ namespace Exiled.Events.Patches.Events.Scp049 /// /// Patches . /// Adds the event. - /// Fix bug than Overwatch can get force respawn by Scp049 - /// Bug reported to NW https://trello.com/c/V0uHP2eV/5745-overwatch-overwatch-can-get-respawned-by-scp-049. - /// The fix is directly inside the . /// - // [EventPatch(typeof(Handlers.Scp049), nameof(Handlers.Scp049.FinishingRecall))] + [EventPatch(typeof(Handlers.Scp049), nameof(Handlers.Scp049.FinishingRecall))] [HarmonyPatch(typeof(Scp049ResurrectAbility), nameof(Scp049ResurrectAbility.ServerComplete))] internal static class FinishingRecall { diff --git a/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs b/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs index 4b294f953..5401f24b8 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs @@ -22,7 +22,7 @@ namespace Exiled.Events.Patches.Fixes /// /// Patches the delegate. /// Fixes open doors getting easily broke. - /// Bug reported to NW (https://trello.com/c/6Nz7Isjm/4637-scp096-easily-breaking-opened-doors). + /// Bug reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/198). /// [HarmonyPatch(typeof(Scp096HitHandler), nameof(Scp096HitHandler.CheckDoorHit))] internal class NWFixScp096BreakingDoor diff --git a/EXILED/Exiled.Events/Patches/Fixes/Scp3114AttackAhpFix.cs b/EXILED/Exiled.Events/Patches/Fixes/Scp3114AttackAhpFix.cs index 2722c59e1..45f3774c4 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Scp3114AttackAhpFix.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Scp3114AttackAhpFix.cs @@ -20,7 +20,7 @@ namespace Exiled.Events.Patches.Fixes /// /// Patches the delegate. /// Fix than Scp3114Slap was giving humeshield even if player was not hit by Scp3114. - /// Bug reported to NW (https://trello.com/c/1AwpM8XE/5814-scp3114-is-able-to-get-humeshield-with-godmod-player). + /// Bug reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/119). /// [HarmonyPatch(typeof(Scp3114Slap), nameof(Scp3114Slap.DamagePlayers))] internal class Scp3114AttackAhpFix From 96f09568f3724f953114560fa6422d7e91c9f45c Mon Sep 17 00:00:00 2001 From: Yamato Date: Fri, 2 Aug 2024 15:51:04 +0200 Subject: [PATCH 02/13] also this one --- EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs b/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs index 1b1dadf46..f75f2e91f 100644 --- a/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs +++ b/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs @@ -48,7 +48,7 @@ public static void OnMapGenerated() Map.ClearCache(); PrefabHelper.LoadPrefabs(); - // TODO: Fix For (https://trello.com/c/cUwpZDLs/5003-config-teamrespawnqueue-in-configgameplay-is-not-working-as-expected) + // TODO: Fix For (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/377) PlayerRoles.RoleAssign.HumanSpawner.Handlers[PlayerRoles.Team.ChaosInsurgency] = new PlayerRoles.RoleAssign.OneRoleHumanSpawner(PlayerRoles.RoleTypeId.ChaosConscript); PlayerRoles.RoleAssign.HumanSpawner.Handlers[PlayerRoles.Team.OtherAlive] = new PlayerRoles.RoleAssign.OneRoleHumanSpawner(PlayerRoles.RoleTypeId.Tutorial); PlayerRoles.RoleAssign.HumanSpawner.Handlers[PlayerRoles.Team.Dead] = new PlayerRoles.RoleAssign.OneRoleHumanSpawner(PlayerRoles.RoleTypeId.Spectator); From dad8574bc7eeea60fa313a597cb354c18b9a2c01 Mon Sep 17 00:00:00 2001 From: Yamato Date: Fri, 2 Aug 2024 16:40:24 +0200 Subject: [PATCH 03/13] Fix106RegenerationWithScp244 --- .../Fixes/Fix106RegenerationWithScp244.cs | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs new file mode 100644 index 000000000..8c9427e7e --- /dev/null +++ b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs @@ -0,0 +1,68 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) Exiled Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Fixes +{ + using System.Collections.Generic; + using System.Reflection.Emit; + + using API.Features.Pools; + using CustomPlayerEffects; + using HarmonyLib; + using InventorySystem.Items.Usables.Scp244.Hypothermia; + + using static HarmonyLib.AccessTools; + + /// + /// Patches the delegate. + /// Fix than SCP-106 regenerates slower in SCP-244 even if they are in stalk. + /// Bug reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/367). + /// + [HarmonyPatch(typeof(Hypothermia), nameof(Hypothermia.Update))] + internal class Fix106RegenerationWithScp244 + { + private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) + { + List newInstructions = ListPool.Pool.Get(instructions); + + int offset = 1; + int index = newInstructions.FindLastIndex(x => x.operand == (object)Method(typeof(SpawnProtected), nameof(SpawnProtected.CheckPlayer))) + offset; + + Label continueLabel = generator.DefineLabel(); + Label skip = (Label)newInstructions[index].operand; + + index += offset; + + newInstructions[index].labels.Add(continueLabel); + + newInstructions.InsertRange(index, new[] + { + // Scp106Role scp106Role = base.Hub.roleManager.CurrentRole as Scp106Role; + new CodeInstruction(OpCodes.Ldarg_0), + new CodeInstruction(OpCodes.Call, PropertyGetter(typeof(CustomPlayerEffects.StatusEffectBase), nameof(CustomPlayerEffects.StatusEffectBase.Hub))), + new CodeInstruction(OpCodes.Ldfld, Field(typeof(ReferenceHub), nameof(ReferenceHub.roleManager))), + new CodeInstruction(OpCodes.Callvirt, PropertyGetter(typeof(PlayerRoles.PlayerRoleManager), nameof(PlayerRoles.PlayerRoleManager.CurrentRole))), + new CodeInstruction(OpCodes.Isinst, typeof(PlayerRoles.PlayableScps.Scp106.Scp106Role)), + new CodeInstruction(OpCodes.Stloc_0), + + // if (scp106Role is null) goto continueLabel + new CodeInstruction(OpCodes.Ldloc_0), + new CodeInstruction(OpCodes.Brfalse_S, continueLabel), + + // if (!scp106Role.IsSubmerged) goto skip + new CodeInstruction(OpCodes.Ldloc_0), + new CodeInstruction(OpCodes.Callvirt, PropertyGetter(typeof(PlayerRoles.PlayableScps.Scp106.Scp106Role), nameof(PlayerRoles.PlayableScps.Scp106.Scp106Role.IsSubmerged))), + new CodeInstruction(OpCodes.Brtrue_S, skip), + }); + + for (int z = 0; z < newInstructions.Count; z++) + yield return newInstructions[z]; + + ListPool.Pool.Return(newInstructions); + } + } +} From 2da09c271c283c61057b51c1ed44a5f992e8dacd Mon Sep 17 00:00:00 2001 From: Yamato Date: Fri, 2 Aug 2024 16:40:33 +0200 Subject: [PATCH 04/13] Report To NW --- EXILED/Exiled.Events/Patches/Fixes/SlownessFix.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EXILED/Exiled.Events/Patches/Fixes/SlownessFix.cs b/EXILED/Exiled.Events/Patches/Fixes/SlownessFix.cs index e2e69b756..847f11182 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/SlownessFix.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/SlownessFix.cs @@ -19,6 +19,7 @@ namespace Exiled.Events.Patches.Fixes /// /// Patches getter to fix Slowness effect. + /// reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/378). /// [HarmonyPatch(typeof(FpcMotor), nameof(FpcMotor.DesiredMove), MethodType.Getter)] internal class SlownessFix @@ -41,6 +42,7 @@ private static IEnumerable Transpiler(IEnumerable /// Patches method to fix Slowness effect. + /// reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/378). /// [HarmonyPatch(typeof(FpcMotor), nameof(FpcMotor.UpdatePosition))] #pragma warning disable SA1402 // File may only contain a single type From fcf3987d7d7ef5e36d8579795ea30ce87c29b934 Mon Sep 17 00:00:00 2001 From: Yamato Date: Fri, 2 Aug 2024 17:14:17 +0200 Subject: [PATCH 05/13] . --- .../Patches/Fixes/Fix106RegenerationWithScp244.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs index 8c9427e7e..cd331eafa 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs @@ -14,6 +14,8 @@ namespace Exiled.Events.Patches.Fixes using CustomPlayerEffects; using HarmonyLib; using InventorySystem.Items.Usables.Scp244.Hypothermia; + using PlayerRoles; + using PlayerRoles.PlayableScps.Scp106; using static HarmonyLib.AccessTools; @@ -43,10 +45,10 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Date: Fri, 2 Aug 2024 18:40:36 +0200 Subject: [PATCH 06/13] Scp3114FriendlyFireFix --- .../Patches/Fixes/Scp3114FriendlyFireFix.cs | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs diff --git a/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs b/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs new file mode 100644 index 000000000..6374f034a --- /dev/null +++ b/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs @@ -0,0 +1,115 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) Exiled Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Fixes +{ +#pragma warning disable SA1402 // File may only contain a single type + using System.Collections.Generic; + using System.Reflection.Emit; + + using API.Features.Pools; + using Footprinting; + using HarmonyLib; + using InventorySystem.Items.Pickups; + using InventorySystem.Items.ThrowableProjectiles; + using PlayerRoles; + using PlayerStatsSystem; + + using static HarmonyLib.AccessTools; + + /// + /// Patches the delegate. + /// Fix Throwing a ghostlight with Scp in the room stun 079. + /// Bug reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/55). + /// + [HarmonyPatch(typeof(Scp2176Projectile), nameof(Scp2176Projectile.ServerShatter))] + internal class Scp3114FriendlyFireFix + { + private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) + { + List newInstructions = ListPool.Pool.Get(instructions); + + int offset = 0; + int index = newInstructions.FindIndex(x => x.operand == (object)Field(typeof(Scp2176Projectile), nameof(Scp2176Projectile.OnServerShattered))) + offset; + + Label skip = (Label)newInstructions[index].operand; + + newInstructions.InsertRange(index, new[] + { + // if (this.PreviousOwner.Role.GetTeam() is Team.SCPs) + new CodeInstruction(OpCodes.Ldarg_0).MoveLabelsFrom(newInstructions[index]), + new(OpCodes.Ldfld, Field(typeof(Scp2176Projectile), nameof(Scp2176Projectile.PreviousOwner))), + new(OpCodes.Ldfld, Field(typeof(Footprint), nameof(Footprint.Role))), + new(OpCodes.Call, Method(typeof(PlayerRolesUtils), nameof(PlayerRolesUtils.GetTeam))), + new(OpCodes.Ldc_I4_0), + new(OpCodes.Ceq), + new CodeInstruction(OpCodes.Brtrue_S, skip), + }); + + offset = 0; + index = newInstructions.FindIndex(x => x.operand == (object)Field(typeof(RoomLightController), nameof(RoomLightController.Instances))) + offset; + + newInstructions[index].labels.Add(skip); + + for (int z = 0; z < newInstructions.Count; z++) + yield return newInstructions[z]; + + ListPool.Pool.Return(newInstructions); + } + } + + /// + /// Patches the delegate. + /// Fix Throwing a ghostlight with Scp in the room stun 079. + /// Bug reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/55). + /// + [HarmonyPatch(typeof(CollisionDetectionPickup), nameof(CollisionDetectionPickup.ProcessCollision))] + internal class Scp3114FriendlyFireFix2 : AttackerDamageHandler + { +#pragma warning disable SA1600 // Elements should be documented + public Scp3114FriendlyFireFix2(Footprint attacker, float damage) + { + Attacker = attacker; + Damage = damage; + AllowSelfDamage = false; + ServerLogsText = "Scp3114 Fix"; + } + + public override Footprint Attacker { get; set; } + + public override bool AllowSelfDamage { get; } + + public override float Damage { get; set; } + + public override string ServerLogsText { get; } +#pragma warning restore SA1600 // Elements should be documented + + private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) + { + List newInstructions = ListPool.Pool.Get(instructions); + + int offset = 0; + int index = newInstructions.FindLastIndex(x => x.opcode == OpCodes.Ldnull) + offset; + + // replace null with new Scp3114FriendlyFireFix2(this.PreviousOwner, num2) + newInstructions.RemoveAt(index); + newInstructions.InsertRange(index, new CodeInstruction[] + { + // new Scp3114FriendlyFireFix2(this.PreviousOwner, num2) + new(OpCodes.Ldarg_0), + new(OpCodes.Ldfld, Field(typeof(CollisionDetectionPickup), nameof(CollisionDetectionPickup.PreviousOwner))), + new(OpCodes.Ldloc_3), + new(OpCodes.Newobj, GetDeclaredConstructors(typeof(Scp3114FriendlyFireFix2))[0]), + }); + + for (int z = 0; z < newInstructions.Count; z++) + yield return newInstructions[z]; + + ListPool.Pool.Return(newInstructions); + } + } +} From d88d592e36ebdf13af2a26660be8be89f91f6fe1 Mon Sep 17 00:00:00 2001 From: Yamato Date: Sat, 3 Aug 2024 02:44:51 +0200 Subject: [PATCH 07/13] Fix --- .../Fixes/Fix106RegenerationWithScp244.cs | 2 +- .../Patches/Fixes/WarheadConfigLockGateFix.cs | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 EXILED/Exiled.Events/Patches/Fixes/WarheadConfigLockGateFix.cs diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs index cd331eafa..fa2f0fd0e 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs @@ -45,7 +45,7 @@ private static IEnumerable Transpiler(IEnumerable +// Copyright (c) Exiled Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Fixes +{ + using System.Collections.Generic; + using System.Reflection.Emit; + + using API.Features.Pools; + using Footprinting; + using HarmonyLib; + using Interactables.Interobjects.DoorUtils; + using InventorySystem; + using InventorySystem.Items.Firearms.Ammo; + using InventorySystem.Items.Pickups; + + using static HarmonyLib.AccessTools; + + /// + /// Patches delegate. + /// Fix than NW config "lock_gates_on_countdown" + /// reported https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/316. + /// + [HarmonyPatch(typeof(DoorEventOpenerExtension), nameof(DoorEventOpenerExtension.Trigger))] + internal class WarheadConfigLockGateFix + { + private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) + { + List newInstructions = ListPool.Pool.Get(instructions); + + // replace Contains with StartWith + int index = newInstructions.FindIndex(x => x.operand == (object)Method(typeof(string), nameof(string.Contains))); + newInstructions[index].operand = Method(typeof(string), nameof(string.StartsWith), new System.Type[] { typeof(string) }); + + for (int z = 0; z < newInstructions.Count; z++) + yield return newInstructions[z]; + + ListPool.Pool.Return(newInstructions); + } + } +} From f108caa5133e4e60aa945a293f8f4548465bfa12 Mon Sep 17 00:00:00 2001 From: IRacle Date: Sat, 3 Aug 2024 14:39:43 +0300 Subject: [PATCH 08/13] yamatotototo --- .../Fixes/Fix106RegenerationWithScp244.cs | 10 +++++--- .../Patches/Fixes/Scp3114FriendlyFireFix.cs | 25 +++++++++++++------ .../Patches/Fixes/WarheadConfigLockGateFix.cs | 2 +- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs index fa2f0fd0e..33c54d5ad 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs @@ -31,10 +31,12 @@ private static IEnumerable Transpiler(IEnumerable newInstructions = ListPool.Pool.Get(instructions); + LocalBuilder scp106Role = generator.DeclareLocal(typeof(Scp106Role)); + Label continueLabel = generator.DefineLabel(); + int offset = 1; int index = newInstructions.FindLastIndex(x => x.operand == (object)Method(typeof(SpawnProtected), nameof(SpawnProtected.CheckPlayer))) + offset; - Label continueLabel = generator.DefineLabel(); Label skip = (Label)newInstructions[index].operand; index += offset; @@ -49,14 +51,14 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable newInstructions = ListPool.Pool.Get(instructions); + Label cnt = generator.DefineLabel(); + int offset = 0; - int index = newInstructions.FindIndex(x => x.operand == (object)Field(typeof(Scp2176Projectile), nameof(Scp2176Projectile.OnServerShattered))) + offset; + int index = newInstructions.FindIndex(x => x.LoadsField(Field(typeof(RoomLightController), nameof(RoomLightController.Instances)))) + offset; + + Label skip = newInstructions[index].labels[0]; - Label skip = (Label)newInstructions[index].operand; + offset = -3; + index += offset; newInstructions.InsertRange(index, new[] { @@ -44,16 +52,17 @@ private static IEnumerable Transpiler(IEnumerable x.operand == (object)Field(typeof(RoomLightController), nameof(RoomLightController.Instances))) + offset; + new(OpCodes.Brfalse_S, cnt), + + new(OpCodes.Pop), + new(OpCodes.Br_S, skip), - newInstructions[index].labels.Add(skip); + new CodeInstruction(OpCodes.Nop).WithLabels(cnt), + }); for (int z = 0; z < newInstructions.Count; z++) yield return newInstructions[z]; diff --git a/EXILED/Exiled.Events/Patches/Fixes/WarheadConfigLockGateFix.cs b/EXILED/Exiled.Events/Patches/Fixes/WarheadConfigLockGateFix.cs index be2fbff58..2c65c58a8 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/WarheadConfigLockGateFix.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/WarheadConfigLockGateFix.cs @@ -33,7 +33,7 @@ private static IEnumerable Transpiler(IEnumerable newInstructions = ListPool.Pool.Get(instructions); // replace Contains with StartWith - int index = newInstructions.FindIndex(x => x.operand == (object)Method(typeof(string), nameof(string.Contains))); + int index = newInstructions.FindIndex(x => x.operand == (object)Method(typeof(string), nameof(string.Contains), new[] { typeof(string) })); newInstructions[index].operand = Method(typeof(string), nameof(string.StartsWith), new System.Type[] { typeof(string) }); for (int z = 0; z < newInstructions.Count; z++) From e4adebba528fc81e79e8c5667c107c637e21e93a Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 8 Aug 2024 19:16:39 +0200 Subject: [PATCH 09/13] Fix --- EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs b/EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs index b19ffdaee..048de1136 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs @@ -138,9 +138,9 @@ private static IEnumerable Transpiler(IEnumerable customExit) newInstructions[i].opcode = OpCodes.Ldc_I4_5; } From 66146dccbd77a8d7890a9b9f27ac810edbcc1324 Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 8 Aug 2024 19:38:35 +0200 Subject: [PATCH 10/13] Fix for building dev + TODO than i just seen --- .../Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs | 2 +- EXILED/Exiled.Events/Patches/Events/Server/Reporting.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs index 316be5039..97a443ea7 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs @@ -5,7 +5,7 @@ // // ----------------------------------------------------------------------- -namespace Exiled.Events.EventArgs.Player +namespace Exiled.Events.EventArgs.Player // TODO: Wrong namespace should be Server { using API.Features; diff --git a/EXILED/Exiled.Events/Patches/Events/Server/Reporting.cs b/EXILED/Exiled.Events/Patches/Events/Server/Reporting.cs index 5d22e96c5..d672d1831 100644 --- a/EXILED/Exiled.Events/Patches/Events/Server/Reporting.cs +++ b/EXILED/Exiled.Events/Patches/Events/Server/Reporting.cs @@ -41,7 +41,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.opcode == OpCodes.Ldarg_S && instruction.operand == (object)4) + offset; + int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldarg_S && instruction.operand is byte and 4) + offset; Label ret = generator.DefineLabel(); From e59ced85e2bc73677c2ba95977c21ee4efbbdf4b Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 8 Aug 2024 20:11:30 +0200 Subject: [PATCH 11/13] Fix Undid patch --- EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs index aea840168..d9355e870 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs @@ -80,7 +80,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.LoadsField(Field(typeof(PlayerEffectsController), nameof(ReferenceHub.playerEffectsController)))) + serverEffectLocationStart; + instruction => instruction.LoadsField(Field(typeof(ReferenceHub), nameof(ReferenceHub.playerEffectsController)))) + serverEffectLocationStart; newInstructions.InsertRange( addShouldSeverIndex, From f7943672530246ff59b9127ac36eb20b7429eb9f Mon Sep 17 00:00:00 2001 From: Yamato Date: Sat, 10 Aug 2024 12:23:32 +0200 Subject: [PATCH 12/13] fIX --- .../Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs index 6bff66c86..c8ff97d32 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs @@ -83,9 +83,8 @@ private static IEnumerable Transpiler(IEnumerable instruction.LoadsField(Field(typeof(ReferenceHub), nameof(ReferenceHub.playerEffectsController)))) + serverEffectLocationStart; - newInstructions[enableEffect].WithLabels(enableEffectLabel); - - newInstructions.InsertRange( + newInstructions[enableEffect].WithLabels(enableEffectLabel); + newInstructions.InsertRange( addShouldSeverIndex, new[] { From 3a149eb5567684dd28c8c719731013fc49a41289 Mon Sep 17 00:00:00 2001 From: Yamato Date: Sat, 10 Aug 2024 17:08:47 +0200 Subject: [PATCH 13/13] Fix Client Crash Issue --- EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs b/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs index 28fd021f0..e65ced6fb 100644 --- a/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs +++ b/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs @@ -40,6 +40,7 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable instruction.IsLdarg(0));