Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Respawn v1.2.4
Respawn.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Autodesk.Fbx")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")] [assembly: IgnoresAccessChecksTo("Klattersynth")] [assembly: IgnoresAccessChecksTo("Photon3Unity3D")] [assembly: IgnoresAccessChecksTo("PhotonChat")] [assembly: IgnoresAccessChecksTo("PhotonRealtime")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")] [assembly: IgnoresAccessChecksTo("PhotonVoice.API")] [assembly: IgnoresAccessChecksTo("PhotonVoice")] [assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")] [assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization")] [assembly: IgnoresAccessChecksTo("Sirenix.Utilities")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("websocket-sharp")] [assembly: AssemblyCompany("ShaderLaze")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Respawn")] [assembly: AssemblyTitle("Respawn")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RespawnMod { [BepInPlugin("ShaderLaze.Respawn", "Respawn", "1.2.4")] public class Respawn : BaseUnityPlugin { internal ConfigEntry<bool> configRespawnAtDeathPosition; internal ConfigEntry<int> configRespawnHP; internal ConfigEntry<KeyCode> configActivationKey; internal static Respawn Instance { get; private set; } private void Awake() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) Instance = this; configRespawnAtDeathPosition = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "RespawnAtDeathPosition", false, "Респавнить на месте смерти (true) или на точке спавна (false)"); configRespawnHP = ((BaseUnityPlugin)this).Config.Bind<int>("Settings", "RespawnHealAmount", 19, "Количество HP, восстанавливаемое при респавне"); configActivationKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Settings", "ActivationKey", (KeyCode)282, "Клавиша для активации респавна"); GameObject val = new GameObject("RespawnUpdater"); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent<RespawnUpdater>(); Object.DontDestroyOnLoad((Object)(object)val); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Respawn mod initialized. Activation key: {configActivationKey.Value}"); } } public class RespawnUpdater : MonoBehaviour { private void Update() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(Respawn.Instance.configActivationKey.Value)) { RespawnAllDeadPlayers(); } } private void RespawnAllDeadPlayers() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) List<PlayerAvatar> list = GameDirector.instance.PlayerList.FindAll((PlayerAvatar player) => player.deadSet); int num = 0; foreach (PlayerAvatar item in list) { bool flag = (Object)(object)item.playerDeathHead != (Object)null; PlayerDeathHead playerDeathHead = item.playerDeathHead; Vector3? obj; if (playerDeathHead == null) { obj = null; } else { Transform transform = ((Component)playerDeathHead).transform; obj = ((transform != null) ? new Vector3?(transform.position) : null); } Vector3? val = obj; Vector3 val2 = new Vector3(0f, 3000f, 0f); bool flag2 = val.HasValue && val.GetValueOrDefault() == val2; if (flag && !flag2) { RespawnPlayer(item); num++; } } Debug.Log((object)$"Respawned {num} dead player(s)."); } private void RespawnPlayer(PlayerAvatar player) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Respawn instance = Respawn.Instance; if (instance.configRespawnAtDeathPosition.Value) { player.photonView.RPC("ReviveRPC", (RpcTarget)0, new object[1] { false }); } else { SpawnPoint[] array = Object.FindObjectsOfType<SpawnPoint>(); if (array.Length == 0) { Debug.LogWarning((object)"No spawn points found."); return; } SpawnPoint val = array[Random.Range(0, array.Length)]; player.Revive(false); player.Spawn(((Component)val).transform.position, ((Component)val).transform.rotation); player.playerHealth.HealOther(instance.configRespawnHP.Value, true); } Debug.Log((object)("Respawned player: " + player.playerName)); } } }