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 Empress RPCVisualizer v1.0.0
EmpressRPCVisualizer.dll
Decompiled 5 months 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 BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Omniscye")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("EmpressRPCVisualizer")] [assembly: AssemblyTitle("EmpressRPCVisualizer")] [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 Empress.RpcViz { [BepInPlugin("Empress.RpcViz", "Empress_RpcViz", "1.1.0")] public class Empress_RpcViz : BaseUnityPlugin { internal class Visualizer { private class Dot { public GameObject go = null; public Vector3 from; public Vector3 to; public float t; public float travelTime; } private readonly Transform _root; private readonly List<Dot> _active = new List<Dot>(64); private readonly Stack<GameObject> _pool = new Stack<GameObject>(); private const float Speed = 14f; private const float MinTime = 0.08f; private const float MaxTime = 0.8f; public int MaxActive { get; set; } public float Scale { get; set; } public Visualizer(Transform root, int maxActive, float scale) { _root = root; MaxActive = maxActive; Scale = scale; } public void Tick(float dt) { //IL_0069: 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) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) for (int num = _active.Count - 1; num >= 0; num--) { Dot dot = _active[num]; dot.t += dt / dot.travelTime; if (dot.t >= 1f) { Reclaim(dot.go); _active.RemoveAt(num); } else { Vector3 position = Vector3.LerpUnclamped(dot.from, dot.to, dot.t); dot.go.transform.position = position; } } } public void Shoot(Vector3 from, Vector3 to, Color color) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (_active.Count < MaxActive) { GameObject val = Spawn(color); float num = Vector3.Distance(from, to); float travelTime = Mathf.Clamp(num / 14f, 0.08f, 0.8f); val.transform.position = from; _active.Add(new Dot { go = val, from = from, to = to, t = 0f, travelTime = travelTime }); } } private GameObject Spawn(Color tint) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown GameObject val; if (_pool.Count > 0) { val = _pool.Pop(); if (Object.op_Implicit((Object)(object)val)) { val.transform.localScale = Vector3.one * Scale; ApplyColor(val, tint); } return val; } val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).hideFlags = (HideFlags)61; val.transform.SetParent(_root, false); val.transform.localScale = Vector3.one * Scale; Collider component = val.GetComponent<Collider>(); if (Object.op_Implicit((Object)(object)component)) { component.enabled = false; } MeshRenderer component2 = val.GetComponent<MeshRenderer>(); if ((Object)(object)component2 != (Object)null) { Shader val2 = Shader.Find("Unlit/Color"); if ((Object)(object)val2 != (Object)null) { ((Renderer)component2).material = new Material(val2); } EnsureTransparent(((Renderer)component2).material); } ApplyColor(val, tint); return val; } private void ApplyColor(GameObject go, Color tint) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) MeshRenderer component = go.GetComponent<MeshRenderer>(); if ((Object)(object)component == (Object)null) { return; } Material material = ((Renderer)component).material; if (!((Object)(object)material == (Object)null)) { if (material.HasProperty("_BaseColor")) { material.SetColor("_BaseColor", tint); } if (material.HasProperty("_Color")) { material.SetColor("_Color", tint); } if (material.HasProperty("_AlbedoColor")) { material.SetColor("_AlbedoColor", tint); } if (material.HasProperty("_EmissionColor")) { Color val = default(Color); ((Color)(ref val))..ctor(tint.r, tint.g, tint.b); material.SetColor("_EmissionColor", val); material.EnableKeyword("_EMISSION"); } EnsureTransparent(material); } } private void EnsureTransparent(Material mat) { if (!((Object)(object)mat == (Object)null)) { if (mat.HasProperty("_Surface")) { mat.SetFloat("_Surface", 1f); } if (mat.HasProperty("_Mode")) { mat.SetFloat("_Mode", 3f); } mat.SetInt("_SrcBlend", 5); mat.SetInt("_DstBlend", 10); mat.SetInt("_ZWrite", 0); mat.DisableKeyword("_ALPHATEST_ON"); mat.EnableKeyword("_ALPHABLEND_ON"); mat.DisableKeyword("_ALPHAPREMULTIPLY_ON"); mat.renderQueue = 3000; } } private void Reclaim(GameObject go) { if (Object.op_Implicit((Object)(object)go)) { _pool.Push(go); } } } private bool _subscribed; private static byte _rpcEventCode = byte.MaxValue; internal static Visualizer _viz; private ConfigEntry<bool> _enableInboundRPC = null; private ConfigEntry<bool> _enableOutboundRPC = null; private ConfigEntry<bool> _ignoreSelfInbound = null; private ConfigEntry<string> _rpcMethodAllow = null; private ConfigEntry<string> _rpcMethodBlock = null; private ConfigEntry<string> _allowedTargets = null; private ConfigEntry<float> _perActorMinInterval = null; private ConfigEntry<int> _maxActiveDots = null; private ConfigEntry<float> _dotScale = null; private readonly HashSet<string> _allowedTargetSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase); private readonly string[] _empty = Array.Empty<string>(); private string[] _allowNames = Array.Empty<string>(); private string[] _blockNames = Array.Empty<string>(); private readonly Dictionary<int, float> _lastInbound = new Dictionary<int, float>(16); private readonly Dictionary<int, float> _lastOutbound = new Dictionary<int, float>(16); internal static Empress_RpcViz Instance { get; private set; } = null; internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; _enableInboundRPC = ((BaseUnityPlugin)this).Config.Bind<bool>("Filter", "EnableInboundRPC", true, ""); _enableOutboundRPC = ((BaseUnityPlugin)this).Config.Bind<bool>("Filter", "EnableOutboundRPC", true, ""); _ignoreSelfInbound = ((BaseUnityPlugin)this).Config.Bind<bool>("Filter", "IgnoreSelfInbound", true, ""); _rpcMethodAllow = ((BaseUnityPlugin)this).Config.Bind<string>("Filter", "RpcMethodAllowList", "", ""); _rpcMethodBlock = ((BaseUnityPlugin)this).Config.Bind<string>("Filter", "RpcMethodBlockList", "", ""); _allowedTargets = ((BaseUnityPlugin)this).Config.Bind<string>("Filter", "AllowedTargets", "All;AllBuffered;AllViaServer;AllBufferedViaServer;Others;OthersBuffered;MasterClient;Player", ""); _perActorMinInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Filter", "PerActorMinIntervalSeconds", 0.15f, ""); _maxActiveDots = ((BaseUnityPlugin)this).Config.Bind<int>("Visual", "MaxActiveDots", 96, ""); _dotScale = ((BaseUnityPlugin)this).Config.Bind<float>("Visual", "DotScale", 0.16f, ""); RebuildTargetAllowlist(); RebuildNameLists(); _viz = new Visualizer(((Component)this).gameObject.transform, _maxActiveDots.Value, Mathf.Max(0.02f, _dotScale.Value)); ResolveRpcEventCode(); Patch(); SceneManager.sceneLoaded += OnSceneLoaded; RetargetEventHook(); Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} loaded"); } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; Unsubscribe(); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void OnSceneLoaded(Scene s, LoadSceneMode m) { RetargetEventHook(); RebuildTargetAllowlist(); RebuildNameLists(); } private static bool IsGameplayScene() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string text = ((Scene)(ref activeScene)).name ?? string.Empty; if (string.IsNullOrEmpty(text)) { return false; } if (text.IndexOf("Lobby", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } if (text.IndexOf("Menu", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } if (text.IndexOf("MainMenu", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } if (text.IndexOf("Title", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } return true; } private void RetargetEventHook() { if (IsGameplayScene()) { Subscribe(); } else { Unsubscribe(); } } private void Subscribe() { if (!_subscribed) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived += OnEventReceived; _subscribed = true; } } } private void Unsubscribe() { if (_subscribed) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnEventReceived; } _subscribed = false; } } private void Update() { if (_rpcEventCode == byte.MaxValue) { ResolveRpcEventCode(); } if (!IsGameplayScene()) { if (_subscribed) { Unsubscribe(); } } else if (!_subscribed) { Subscribe(); } if (_viz != null) { if (_viz.MaxActive != _maxActiveDots.Value) { _viz.MaxActive = _maxActiveDots.Value; } if (Mathf.Abs(_viz.Scale - _dotScale.Value) > 0.001f) { _viz.Scale = Mathf.Max(0.02f, _dotScale.Value); } _viz.Tick(Time.deltaTime); } } internal void Patch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal static bool Ready() { if (!PhotonNetwork.IsConnected) { return false; } if (!PhotonNetwork.InRoom) { return false; } if (SemiFunc.MenuLevel()) { return false; } PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if (!Object.op_Implicit((Object)(object)val)) { return false; } return true; } private static void ResolveRpcEventCode() { try { Assembly assembly = typeof(PhotonNetwork).Assembly; Type type = assembly.GetType("Photon.Pun.PunEvent"); if (type != null && type.IsEnum) { object value = Enum.Parse(type, "RPC"); _rpcEventCode = Convert.ToByte(value); return; } } catch { } _rpcEventCode = 200; } private void OnEventReceived(EventData photonEvent) { //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (!Ready()) { return; } byte code = photonEvent.Code; if ((code != _rpcEventCode && code != 200) || !_enableInboundRPC.Value) { return; } int sender = photonEvent.Sender; if ((_ignoreSelfInbound.Value && PhotonNetwork.LocalPlayer != null && sender == PhotonNetwork.LocalPlayer.ActorNumber) || !PassThrottle(_lastInbound, sender, _perActorMinInterval.Value)) { return; } Room currentRoom = PhotonNetwork.CurrentRoom; Player val = ((currentRoom != null) ? currentRoom.GetPlayer(sender, false) : null); if (val != null) { PlayerAvatar val2 = AvatarFromPlayer(val); PlayerAvatar val3 = SemiFunc.PlayerAvatarLocal(); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val3)) { Color color = TryGetAvatarColor(val2, Color.yellow, 0.35f); _viz.Shoot(AvatarPos(val2), AvatarPos(val3), color); } } } internal static PlayerAvatar AvatarFromPlayer(Player p) { if (p == null) { return null; } PlayerAvatar val = AvatarFromActorNumber(p.ActorNumber); if (Object.op_Implicit((Object)(object)val)) { return val; } string userId = p.UserId; if (string.IsNullOrEmpty(userId)) { return null; } return SemiFunc.PlayerGetFromSteamID(userId); } internal static PlayerAvatar AvatarFromActorNumber(int actorNumber) { if (actorNumber <= 0) { return null; } PlayerAvatar[] array = Object.FindObjectsOfType<PlayerAvatar>(true); foreach (PlayerAvatar val in array) { if (!Object.op_Implicit((Object)(object)val)) { continue; } PhotonView photonView = val.photonView; if (!Object.op_Implicit((Object)(object)photonView)) { continue; } try { if (photonView.OwnerActorNr == actorNumber) { return val; } } catch { } } return null; } internal static Vector3 AvatarPos(PlayerAvatar av) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)av)) { return Vector3.zero; } Transform val = (Object.op_Implicit((Object)(object)av.playerTransform) ? av.playerTransform : ((Component)av).transform); return val.position + Vector3.up * 1.6f; } private static bool PassThrottle(Dictionary<int, float> map, int key, float minInterval) { if (minInterval <= 0f) { return true; } float time = Time.time; if (map.TryGetValue(key, out var value)) { if (time - value < minInterval) { return false; } map[key] = time; return true; } map[key] = time; return true; } private static string[] SplitList(string s) { if (string.IsNullOrWhiteSpace(s)) { return Array.Empty<string>(); } string[] array = s.Split(new char[3] { ';', ',', '|' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { array[i] = array[i].Trim(); } return array; } private void RebuildTargetAllowlist() { _allowedTargetSet.Clear(); string[] array = SplitList(_allowedTargets.Value); for (int i = 0; i < array.Length; i++) { _allowedTargetSet.Add(array[i]); } } private void RebuildNameLists() { _allowNames = SplitList(_rpcMethodAllow.Value); _blockNames = SplitList(_rpcMethodBlock.Value); } internal static Color TryGetAvatarColor(PlayerAvatar av, Color fallback, float alpha) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) try { if (Object.op_Implicit((Object)(object)av) && Object.op_Implicit((Object)(object)av.playerAvatarVisuals) && Object.op_Implicit((Object)(object)av.playerAvatarVisuals.meshParent)) { Renderer componentInChildren = av.playerAvatarVisuals.meshParent.GetComponentInChildren<Renderer>(true); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.sharedMaterial)) { if (componentInChildren.sharedMaterial.HasProperty("_AlbedoColor")) { Color color = componentInChildren.sharedMaterial.GetColor("_AlbedoColor"); color.a = alpha; return color; } if (componentInChildren.sharedMaterial.HasProperty("_Color")) { Color color2 = componentInChildren.sharedMaterial.GetColor("_Color"); color2.a = alpha; return color2; } } } } catch { } fallback.a = alpha; return fallback; } internal static bool MethodPasses(string methodName) { string[] allowNames = Instance._allowNames; string[] blockNames = Instance._blockNames; if (blockNames != null && blockNames.Length != 0) { for (int i = 0; i < blockNames.Length; i++) { if (!string.IsNullOrEmpty(blockNames[i]) && methodName.IndexOf(blockNames[i], StringComparison.OrdinalIgnoreCase) >= 0) { return false; } } } if (allowNames != null && allowNames.Length != 0) { bool flag = false; for (int j = 0; j < allowNames.Length; j++) { if (!string.IsNullOrEmpty(allowNames[j]) && methodName.IndexOf(allowNames[j], StringComparison.OrdinalIgnoreCase) >= 0) { flag = true; break; } } if (!flag) { return false; } } return true; } internal static bool TargetPasses(string key) { return Instance._allowedTargetSet.Count == 0 || Instance._allowedTargetSet.Contains(key); } internal static bool OutboundEnabled() { return Instance._enableOutboundRPC.Value; } internal static bool OutboundThrottlePass(int actorNumber) { return PassThrottle(Instance._lastOutbound, actorNumber, Instance._perActorMinInterval.Value); } } [HarmonyPatch(typeof(PhotonView), "RPC", new Type[] { typeof(string), typeof(RpcTarget), typeof(object[]) })] public static class Patch_PhotonView_RPC_RpcTarget { public static void Postfix(PhotonView __instance, string methodName, RpcTarget target, object[] parameters) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) if (!Empress_RpcViz.Ready() || !Empress_RpcViz.OutboundEnabled() || !Empress_RpcViz.MethodPasses(methodName)) { return; } string key = ((object)(RpcTarget)(ref target)).ToString(); if (!Empress_RpcViz.TargetPasses(key)) { return; } PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if (!Object.op_Implicit((Object)(object)val)) { return; } Color color = Empress_RpcViz.TryGetAvatarColor(val, Color.yellow, 0.35f); IEnumerable<Player> enumerable = ResolveTargets(target); if (enumerable == null) { return; } foreach (Player item in enumerable) { if (item != null && item != PhotonNetwork.LocalPlayer && Empress_RpcViz.OutboundThrottlePass(item.ActorNumber)) { PlayerAvatar val2 = Empress_RpcViz.AvatarFromPlayer(item); if (Object.op_Implicit((Object)(object)val2)) { Empress_RpcViz._viz.Shoot(Empress_RpcViz.AvatarPos(val), Empress_RpcViz.AvatarPos(val2), color); } } } } private static IEnumerable<Player> ResolveTargets(RpcTarget t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I4, but got Unknown switch ((int)t) { case 0: case 3: case 5: case 6: return PhotonNetwork.PlayerList; case 1: case 4: return PhotonNetwork.PlayerListOthers; case 2: return (IEnumerable<Player>)(object)new Player[1] { PhotonNetwork.MasterClient }; default: return null; } } } [HarmonyPatch(typeof(PhotonView), "RPC", new Type[] { typeof(string), typeof(Player), typeof(object[]) })] public static class Patch_PhotonView_RPC_Player { public static void Postfix(PhotonView __instance, string methodName, Player targetPlayer, object[] parameters) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if (!Empress_RpcViz.Ready() || !Empress_RpcViz.OutboundEnabled() || !Empress_RpcViz.MethodPasses(methodName) || !Empress_RpcViz.TargetPasses("Player")) { return; } PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if (Object.op_Implicit((Object)(object)val) && targetPlayer != null && targetPlayer != PhotonNetwork.LocalPlayer && Empress_RpcViz.OutboundThrottlePass(targetPlayer.ActorNumber)) { PlayerAvatar val2 = Empress_RpcViz.AvatarFromPlayer(targetPlayer); if (Object.op_Implicit((Object)(object)val2)) { Color color = Empress_RpcViz.TryGetAvatarColor(val, Color.yellow, 0.35f); Empress_RpcViz._viz.Shoot(Empress_RpcViz.AvatarPos(val), Empress_RpcViz.AvatarPos(val2), color); } } } } }