Decompiled source of CrimsonLog v1.1.0

CrimsonLog.dll

Decompiled 3 days ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Bloodstone.API;
using Bloodstone.Hooks;
using CrimsonLog.Structs;
using CrimsonLog.Systems;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.Network;
using Unity.Collections;
using Unity.Entities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("CrimsonLog")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A simplistic logger for V Rising")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0+Branch.master.Sha.d2f6b350405bba1d32ed2389a2748101e9ffb355")]
[assembly: AssemblyProduct("CrimsonLog")]
[assembly: AssemblyTitle("CrimsonLog")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
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;
		}
	}
}
namespace CrimsonLog
{
	public static class ECSExtensions
	{
		private static EntityManager EntityManager => VWorld.Server.EntityManager;

		public unsafe static void Write<T>(this Entity entity, T componentData) where T : struct
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			byte[] array = StructureToByteArray(componentData);
			int num = Marshal.SizeOf<T>();
			fixed (byte* ptr = array)
			{
				EntityManager entityManager = EntityManager;
				((EntityManager)(ref entityManager)).SetComponentDataRaw(entity, val.TypeIndex, (void*)ptr, num);
			}
		}

		public static byte[] StructureToByteArray<T>(T structure) where T : struct
		{
			int num = Marshal.SizeOf(structure);
			byte[] array = new byte[num];
			IntPtr intPtr = Marshal.AllocHGlobal(num);
			Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true);
			Marshal.Copy(intPtr, array, 0, num);
			Marshal.FreeHGlobal(intPtr);
			return array;
		}

		public unsafe static T Read<T>(this Entity entity) where T : struct
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = EntityManager;
			return Marshal.PtrToStructure<T>(new IntPtr(((EntityManager)(ref entityManager)).GetComponentDataRawRO(entity, val.TypeIndex)));
		}

		public static DynamicBuffer<T> ReadBuffer<T>(this Entity entity) where T : struct
		{
			//IL_0000: 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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = EntityManager;
			return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity, false);
		}

		public static bool TryGetComponent<T>(this Entity entity, out T componentData) where T : struct
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			componentData = default(T);
			if (entity.Has<T>())
			{
				componentData = entity.Read<T>();
				return true;
			}
			return false;
		}

		public static NativeArray<Entity> GetEntitiesByComponentTypes<T1>(EntityQueryOptions queryOption = 0, bool includeAll = false)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			EntityQueryOptions options = queryOption;
			if ((int)queryOption == 0)
			{
				options = (EntityQueryOptions)(includeAll ? 195 : 0);
			}
			EntityQueryDesc val = new EntityQueryDesc();
			val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[1]
			{
				new ComponentType(Il2CppType.Of<T1>(), (AccessMode)0)
			});
			val.Options = options;
			EntityQueryDesc val2 = val;
			EntityManager entityManager = EntityManager;
			EntityQuery val3 = ((EntityManager)(ref entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)new EntityQueryDesc[1] { val2 });
			return ((EntityQuery)(ref val3)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
		}

		public static bool Has<T>(this Entity entity)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = EntityManager;
			return ((EntityManager)(ref entityManager)).HasComponent(entity, val);
		}

		public static void Add<T>(this Entity entity)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = EntityManager;
			((EntityManager)(ref entityManager)).AddComponent(entity, val);
		}

		public static void Remove<T>(this Entity entity)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = EntityManager;
			((EntityManager)(ref entityManager)).RemoveComponent(entity, val);
		}
	}
	[BepInPlugin("CrimsonLog", "CrimsonLog", "1.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BasePlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static ChatEventHandler <>9__14_0;

			internal void <Load>b__14_0(VChatEvent x)
			{
				//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_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Expected I4, but got Unknown
				if (Settings.ToggleLog.Value)
				{
					ChatMessageType type = x.Type;
					switch ((int)type)
					{
					case 0:
						Chat.Global(x);
						break;
					case 1:
						Chat.Region(x);
						break;
					case 4:
						Chat.Local(x);
						break;
					case 2:
						Chat.Team(x);
						break;
					case 3:
						break;
					}
				}
			}
		}

		private Harmony _harmony;

		public static readonly string ConfigFFiles = Path.Combine(Paths.ConfigPath, "CrimsonLog");

		internal static Plugin Instance { get; private set; }

		public static Settings Settings { get; private set; }

		public static Harmony Harmony => Instance._harmony;

		public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log;

		public override void Load()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			Instance = this;
			Settings = default(Settings);
			_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			Settings.InitConfig();
			ManualLogSource logInstance = LogInstance;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(7, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CrimsonLog");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded");
			}
			logInstance.LogInfo(val);
			object obj = <>c.<>9__14_0;
			if (obj == null)
			{
				ChatEventHandler val2 = delegate(VChatEvent x)
				{
					//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_0014: Unknown result type (might be due to invalid IL or missing references)
					//IL_002e: Expected I4, but got Unknown
					if (Settings.ToggleLog.Value)
					{
						ChatMessageType type = x.Type;
						switch ((int)type)
						{
						case 0:
							Chat.Global(x);
							break;
						case 1:
							Chat.Region(x);
							break;
						case 4:
							Chat.Local(x);
							break;
						case 2:
							Chat.Team(x);
							break;
						case 3:
							break;
						}
					}
				};
				<>c.<>9__14_0 = val2;
				obj = (object)val2;
			}
			Chat.OnChatMessage += (ChatEventHandler)obj;
		}

		public override bool Unload()
		{
			((BasePlugin)this).Config.Clear();
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			return true;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "CrimsonLog";

		public const string PLUGIN_NAME = "CrimsonLog";

		public const string PLUGIN_VERSION = "1.1.0";
	}
}
namespace CrimsonLog.Systems
{
	public static class Chat
	{
		private static readonly bool SingleFile = Settings.ChatSingleFile.Value;

		private static readonly bool LogGlobal = Settings.GlobalChat.Value;

		private static readonly bool LogWhisper = Settings.WhisperChat.Value;

		private static readonly bool LogRegion = Settings.RegionChat.Value;

		private static readonly bool LogLocal = Settings.LocalChat.Value;

		private static readonly bool LogTeam = Settings.TeamChat.Value;

		private static async void LogMessage(string chatType, string prefix, string message, string characterName, string additionalInfo = "")
		{
			string text = await Logger.CreateDirectory("Chat");
			string value = (SingleFile ? (Logger.Time() + " | " + chatType) : Logger.Time());
			string contents = $"{value} | {characterName}{additionalInfo} | {message}\n";
			string path = $"{text}/{(SingleFile ? "chat_" : prefix)}{DateTime.Now:yyy-MM-dd}";
			if (!File.Exists(path))
			{
				File.Create(path).Dispose();
				Logger.DeleteOldLogs(text, prefix);
			}
			File.AppendAllText(path, contents);
		}

		public static void Global(VChatEvent message)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (LogGlobal)
			{
				string message2 = message.Message.ToString();
				User user = message.User;
				LogMessage("Global", "global_", message2, ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString());
			}
		}

		public static void Region(VChatEvent message)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (LogRegion)
			{
				string message2 = message.Message.ToString();
				User user = message.User;
				LogMessage("Region", "region_", message2, ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString());
			}
		}

		public static void Local(VChatEvent message)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (LogLocal)
			{
				string message2 = message.Message.ToString();
				User user = message.User;
				LogMessage("Local", "local_", message2, ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString());
			}
		}

		public static void Team(VChatEvent message)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if (LogTeam)
			{
				ClanTeam val = message.User.ClanEntity._Entity.Read<ClanTeam>();
				string value = ((FixedString64Bytes)(ref val.Name)).Value;
				string message2 = message.Message.ToString();
				User user = message.User;
				LogMessage("Clan", "clan_", message2, ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString(), " | " + value);
			}
		}

		public static void Whisper(ChatMessageEvent message, User fromUser)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (LogWhisper)
			{
				User val = GetEntityFromNetworkId(message.ReceiverEntity).Read<User>();
				string text = ((object)(FixedString64Bytes)(ref val.CharacterName)).ToString();
				LogMessage("Whisper", "whisper_", ((object)(FixedString512Bytes)(ref message.MessageText)).ToString(), ((object)(FixedString64Bytes)(ref fromUser.CharacterName)).ToString(), " -> " + text);
			}
		}

		public static Entity GetEntityFromNetworkId(NetworkId networkid)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			Singleton val = ECSExtensions.GetEntitiesByComponentTypes<Singleton>((EntityQueryOptions)16)[0].Read<Singleton>();
			NetworkIdLookupMap networkIdLookupRW = ((Singleton)(ref val)).GetNetworkIdLookupRW();
			Entity result = default(Entity);
			((NetworkIdLookupMap)(ref networkIdLookupRW)).TryGetValue(networkid, ref result);
			return result;
		}
	}
	public static class Logger
	{
		public static Task<string> CreateDirectory(string folderName)
		{
			if (!Directory.Exists("CrimsonLogs/" + folderName))
			{
				Directory.CreateDirectory("CrimsonLogs/" + folderName);
			}
			return Task.FromResult("CrimsonLogs/" + folderName);
		}

		public static async void Record(string folderName, string recordName, string message)
		{
			string text = await CreateDirectory(folderName);
			string path = $"{text}/{recordName}_{DateTime.Now:yyyy-MM-dd}";
			if (!File.Exists(path))
			{
				File.Create(path).Dispose();
				DeleteOldLogs(text, recordName);
			}
			File.AppendAllText(path, Time() + " | " + message);
		}

		public static string Time()
		{
			return $"{DateTime.Now:HH:mm.ss}";
		}

		public static void DeleteOldLogs(string folderPath, string prefix)
		{
			int value = Settings.DaysToKeep.Value;
			if (value < 0)
			{
				return;
			}
			string[] files = Directory.GetFiles(folderPath, prefix + "*");
			foreach (string text in files)
			{
				FileInfo fileInfo = new FileInfo(text);
				if ((DateTime.Now - fileInfo.CreationTime).Days > value)
				{
					File.Delete(text);
				}
			}
		}
	}
}
namespace CrimsonLog.Structs
{
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public readonly struct Settings
	{
		public static ConfigEntry<bool> ToggleLog { get; private set; }

		public static ConfigEntry<int> DaysToKeep { get; private set; }

		public static ConfigEntry<bool> ChatSingleFile { get; private set; }

		public static ConfigEntry<bool> GlobalChat { get; private set; }

		public static ConfigEntry<bool> WhisperChat { get; private set; }

		public static ConfigEntry<bool> RegionChat { get; private set; }

		public static ConfigEntry<bool> LocalChat { get; private set; }

		public static ConfigEntry<bool> TeamChat { get; private set; }

		public static void InitConfig()
		{
			ToggleLog = InitConfigEntry("_Config", "ToggleLog", defaultValue: true, "Enable or disable the mod overall");
			DaysToKeep = InitConfigEntry("_Config", "DaysToKeep", 5, "How many days (server time) to keep logs before automated delete. -1 to set to manually delete only.");
			ChatSingleFile = InitConfigEntry("Chat", "SingleFile", defaultValue: true, "If this is true, all chats will go to a single file; otherwise they will have their own files");
			GlobalChat = InitConfigEntry("Chat", "Global", defaultValue: true, "Log the global chat");
			WhisperChat = InitConfigEntry("Chat", "Whisper", defaultValue: false, "Log player whispers");
			RegionChat = InitConfigEntry("Chat", "Region", defaultValue: false, "Log region chat");
			LocalChat = InitConfigEntry("Chat", "Local", defaultValue: false, "Log local chat");
			TeamChat = InitConfigEntry("Chat", "Team", defaultValue: false, "Log team chat");
		}

		private static ConfigEntry<T> InitConfigEntry<T>(string section, string key, T defaultValue, string description)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			ConfigEntry<T> val = ((BasePlugin)Plugin.Instance).Config.Bind<T>(section, key, defaultValue, description);
			string text = Path.Combine(Paths.ConfigPath, "CrimsonLog.cfg");
			ConfigEntry<T> val2 = default(ConfigEntry<T>);
			if (File.Exists(text) && new ConfigFile(text, true).TryGetEntry<T>(section, key, ref val2))
			{
				val.Value = val2.Value;
			}
			return val;
		}
	}
}
namespace CrimsonLog.Hooks
{
	[HarmonyPatch]
	public static class ChatMessageSystem_Patch
	{
		[HarmonyPatch(typeof(ChatMessageSystem), "OnUpdate")]
		[HarmonyPrefix]
		public static bool OnUpdate(ChatMessageSystem __instance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0039: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0078: 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)
			_ = __instance.__query_661171423_0;
			EntityQuery _query_661171423_ = __instance.__query_661171423_0;
			Enumerator<Entity> enumerator = ((EntityQuery)(ref _query_661171423_)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)).GetEnumerator();
			while (enumerator.MoveNext())
			{
				Entity current = enumerator.Current;
				EntityManager entityManager = ((ComponentSystemBase)__instance).EntityManager;
				FromCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<FromCharacter>(current);
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				User componentData2 = ((EntityManager)(ref entityManager)).GetComponentData<User>(componentData.User);
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				ChatMessageEvent componentData3 = ((EntityManager)(ref entityManager)).GetComponentData<ChatMessageEvent>(current);
				if (((NetworkId)(ref componentData3.ReceiverEntity)).IsValid)
				{
					Chat.Whisper(componentData3, componentData2);
				}
			}
			return true;
		}
	}
}