Decompiled source of RevealForge v1.0.0
RevealForge.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using 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.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Gameplay.Systems; using ProjectM.Network; using RevealForge.Data; using RevealForge.Hooks; using RevealForge.Middlewares; using RevealForge.Utils; using Stunlock.Core; using Unity.Collections; using Unity.Entities; using VampireCommandFramework; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("RevealForge")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Announces all commands used in VCF and the console by admins.")] [assembly: AssemblyFileVersion("0.1.10.0")] [assembly: AssemblyInformationalVersion("0.1.10+1.Branch.main.Sha.c33d0879382e1a0da34861ec55914ba7e637a80e")] [assembly: AssemblyProduct("RevealForge")] [assembly: AssemblyTitle("RevealForge")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.10.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RevealForge { [BepInPlugin("RevealForge", "RevealForge Event Announcer", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { public static class MyPluginInfo { public const string PLUGIN_GUID = "RevealForge"; public const string PLUGIN_NAME = "RevealForge Event Announcer"; public const string PLUGIN_VERSION = "1.0.0"; } private Harmony _harmony; public override void Load() { VWorld.Initialize(); InitializeHooks(); RegisterVCFMiddleware(); ApplyHarmonyPatches(); } private void InitializeHooks() { try { GiveDebugEventHook.Initialize(); CreateJewelDebugEventV2Hook.Initialize(); CreateLegendaryWeaponEventHook.Initialize(); GenerateLegendaryWeaponEventHook.Initialize(); GenerateBloodPotionAdminEventHook.Initialize(); ConsumeBloodAdminEventHook.Initialize(); ChangeHealthOfClosestToPositionEventHook.Initialize(); CompleteCurrentAchievementEventHook.Initialize(); CombatPresetEventHook.Initialize(); InventoryCommandsHook.Initialize(); RenameEventHook.Initialize(); } catch (Exception) { } } private void RegisterVCFMiddleware() { try { AdminAnnounceMiddleware item = new AdminAnnounceMiddleware(); CommandRegistry.Middlewares.Add((CommandMiddleware)(object)item); } catch (Exception) { } } private void ApplyHarmonyPatches() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown try { _harmony = new Harmony("RevealForge"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); } catch (Exception) { } } public override bool Unload() { if (_harmony != null) { _harmony.UnpatchSelf(); } try { CommandRegistry.Middlewares.RemoveAll((CommandMiddleware m) => m is AdminAnnounceMiddleware); } catch (Exception) { } return true; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "RevealForge"; public const string PLUGIN_NAME = "RevealForge"; public const string PLUGIN_VERSION = "0.1.10"; } } namespace RevealForge.Utils { public static class ChatColors { public const string TextHex = "#FFFFFF"; public const string AdminNameHex = "#2ECC40"; public const string CommandHex = "#FFDC00"; private static string Format(string message, string colorHex) { if (string.IsNullOrEmpty(message)) { return string.Empty; } if (!string.IsNullOrEmpty(colorHex) && colorHex.StartsWith("#") && (colorHex.Length == 4 || colorHex.Length == 7 || colorHex.Length == 5 || colorHex.Length == 9)) { return $"<color={colorHex}>{message}</color>"; } return message; } public static string FormatText(string message) { return Format(message, "#FFFFFF"); } public static string FormatAdminName(string message) { return Format(message, "#2ECC40"); } public static string FormatCommand(string message) { return Format(message, "#FFDC00"); } } public static class VWorld { private static World _serverWorld; private static EntityManager _serverEntityManager; private static PrefabCollectionSystem _prefabCollectionSystem; public static World Server { get { if (_serverWorld == null || !_serverWorld.IsCreated) { TryGetServerWorldAndSystems(); } return _serverWorld; } } public static EntityManager ServerEntityManager { get { //IL_002e: 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_001d: 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_0024: 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) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) World server = Server; if (server == null || !server.IsCreated) { return default(EntityManager); } if (((EntityManager)(ref _serverEntityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _serverEntityManager)).World.IsCreated) { _serverEntityManager = server.EntityManager; } return _serverEntityManager; } } public static bool IsServer { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 World server = Server; return server != null && server.IsCreated && (server.Flags & 0x101) == 257; } } public static void Initialize() { TryGetServerWorldAndSystems(); } private static void TryGetServerWorldAndSystems() { //IL_0050: 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_007d: 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) if (_serverWorld == null || !_serverWorld.IsCreated) { _serverWorld = GetWorld("Server"); } if (_serverWorld == null || !_serverWorld.IsCreated) { return; } if (((EntityManager)(ref _serverEntityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _serverEntityManager)).World.IsCreated) { _serverEntityManager = _serverWorld.EntityManager; } if (_prefabCollectionSystem != null && ((ComponentSystemBase)_prefabCollectionSystem).World.IsCreated) { return; } try { if (_serverWorld.IsCreated) { _prefabCollectionSystem = _serverWorld.GetExistingSystemManaged<PrefabCollectionSystem>(); } } catch (Exception) { } } private static World GetWorld(string name) { if (World.All == null) { return null; } Enumerator<World> enumerator = World.All.GetEnumerator(); while (enumerator.MoveNext()) { World current = enumerator.Current; if (current.Name == name) { return current; } } return null; } private static bool IsValidNameString(string name) { if (string.IsNullOrWhiteSpace(name)) { return false; } for (int i = 0; i < name.Length; i++) { if (char.IsControl(name[i]) && !char.IsWhiteSpace(name[i])) { return false; } } return true; } public static string GetItemName(PrefabGUID prefabGuid, EntityManager entityManager) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) if (InternalPrefabs.NameByGuidHash != null && InternalPrefabs.NameByGuidHash.TryGetValue(((PrefabGUID)(ref prefabGuid)).GuidHash, out var value)) { return value; } if (_prefabCollectionSystem == null || !((ComponentSystemBase)_prefabCollectionSystem).World.IsCreated) { TryGetServerWorldAndSystems(); if (_prefabCollectionSystem == null || !((ComponentSystemBase)_prefabCollectionSystem).World.IsCreated) { return $"ItemGUID({((PrefabGUID)(ref prefabGuid)).GuidHash})"; } } if (((EntityManager)(ref entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref entityManager)).World.IsCreated) { entityManager = ServerEntityManager; if (((EntityManager)(ref entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref entityManager)).World.IsCreated) { return $"ItemGUID({((PrefabGUID)(ref prefabGuid)).GuidHash})"; } } try { if (((ComponentSystemBase)_prefabCollectionSystem).World != null && ((ComponentSystemBase)_prefabCollectionSystem).World.IsCreated) { PrefabLookupMap prefabLookupMap = ((PrefabCollectionSystem_Base)_prefabCollectionSystem).PrefabLookupMap; string text = default(string); if (((PrefabLookupMap)(ref prefabLookupMap)).TryGetName(prefabGuid, ref text) && IsValidNameString(text)) { return text; } FixedString128Bytes val = default(FixedString128Bytes); if (((PrefabLookupMap)(ref prefabLookupMap)).TryGetFixedName(prefabGuid, ref val)) { string text2 = ((object)(FixedString128Bytes)(ref val)).ToString(); if (IsValidNameString(text2)) { return text2; } } } } catch (Exception) { } return $"ItemGUID({((PrefabGUID)(ref prefabGuid)).GuidHash})"; } } } namespace RevealForge.Middlewares { public class AdminAnnounceMiddleware : CommandMiddleware { public override void AfterExecute(ICommandContext ctx, CommandAttribute commandAttr, MethodInfo method) { if (ctx == null || commandAttr == null || !ctx.IsAdmin || !commandAttr.AdminOnly) { return; } string name = ctx.Name; ChatCommandContext val = (ChatCommandContext)(object)((ctx is ChatCommandContext) ? ctx : null); string text; if (val != null && val.Event != null && !string.IsNullOrEmpty(val.Event.Message)) { text = val.Event.Message; } else { text = "." + commandAttr.Name; if (method != null && method.GetParameters().Length > ((ctx is ChatCommandContext) ? 1 : 0)) { text += " [with arguments]"; } } if (text.Length > 100) { text = text.Substring(0, 97) + "..."; } text = text.Replace("\n", " ").Replace("\r", " "); string message = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(name)} {ChatColors.FormatText("executed")} {ChatColors.FormatCommand(text)}"; BroadcastMessageToAllPlayers(message); } private void BroadcastMessageToAllPlayers(string message) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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) EntityManager entityManager; try { if (VWorld.Server == null || !VWorld.Server.IsCreated) { return; } entityManager = VWorld.Server.EntityManager; } catch (Exception) { return; } if (((EntityManager)(ref entityManager)).World == null || !((EntityManager)(ref entityManager)).World.IsCreated) { return; } try { FixedString512Bytes val = FixedString512Bytes.op_Implicit(message); ServerChatUtils.SendSystemMessageToAllClients(entityManager, ref val); } catch (Exception) { } } } } namespace RevealForge.Hooks { [HarmonyPatch(typeof(VariousMigratedDebugEventsSystem), "HandleChangeHealthOfClosestToPositionEvent")] public static class ChangeHealthOfClosestToPositionEventHook { public static void Initialize() { } private static void Prefix(VariousMigratedDebugEventsSystem __instance, [HarmonyArgument(0)] ref ChangeHealthOfClosestToPositionDebugEvent eventData, [HarmonyArgument(1)] ref FromCharacter fromCharacter, [HarmonyArgument(2)] double serverTime) { //IL_000f: 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_0035: 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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) if (__instance == null) { return; } EntityManager val = ((ComponentSystemBase)__instance).EntityManager; if (((EntityManager)(ref val)).World == null || !((EntityManager)(ref val)).World.IsCreated) { val = VWorld.ServerEntityManager; if (((EntityManager)(ref val)).World == null || !((EntityManager)(ref val)).World.IsCreated) { return; } } try { if (!(fromCharacter.User == Entity.Null) && ((EntityManager)(ref val)).HasComponent<User>(fromCharacter.User)) { User componentData = ((EntityManager)(ref val)).GetComponentData<User>(fromCharacter.User); string text = ((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User (ID: {componentData.PlatformId})"; } int amount = eventData.Amount; string text2 = ((amount >= 0) ? "increased" : "decreased"); string message = text2 + " health"; string text3 = $"by {Math.Abs(amount)} using a console command"; string text4 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text3 + ".")}"; FixedString512Bytes val2 = default(FixedString512Bytes); ((FixedString512Bytes)(ref val2))..ctor(text4); ServerChatUtils.SendSystemMessageToAllClients(val, ref val2); } } catch (Exception) { } } } [HarmonyPatch(typeof(GiveCombatPresetSystem), "OnUpdate")] public static class CombatPresetEventHook { private static EntityManager _entityManager; public static void Initialize() { } private static void EnsureEntityManager(SystemBase systemInstance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0075: Unknown result type (might be due to invalid IL or missing references) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { if (systemInstance != null && ((ComponentSystemBase)systemInstance).World != null && ((ComponentSystemBase)systemInstance).World.IsCreated) { _entityManager = ((ComponentSystemBase)systemInstance).EntityManager; } else { _entityManager = VWorld.ServerEntityManager; } if (!((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) && ((EntityManager)(ref _entityManager)).World.IsCreated) { } } } private static void Prefix(GiveCombatPresetSystem __instance) { //IL_000f: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_005d: 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_0067: 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) //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_008c: 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_0095: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) EnsureEntityManager((SystemBase)(object)__instance); if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } EntityQuery val = default(EntityQuery); try { val = ((EntityManager)(ref _entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[2] { ComponentType.ReadOnly<GiveCombatPresetEvent>(), ComponentType.ReadOnly<FromCharacter>() }); if (((EntityQuery)(ref val)).IsEmpty) { return; } NativeArray<Entity> val2 = ((EntityQuery)(ref val)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<Entity> enumerator = val2.GetEnumerator(); FixedString512Bytes val3 = default(FixedString512Bytes); while (enumerator.MoveNext()) { Entity current = enumerator.Current; if (!((EntityManager)(ref _entityManager)).HasComponent<FromCharacter>(current)) { continue; } FromCharacter componentData = ((EntityManager)(ref _entityManager)).GetComponentData<FromCharacter>(current); if (((EntityManager)(ref _entityManager)).HasComponent<User>(componentData.User)) { User componentData2 = ((EntityManager)(ref _entityManager)).GetComponentData<User>(componentData.User); string text = ((object)(FixedString64Bytes)(ref componentData2.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User_{componentData2.PlatformId}"; } string message = "spawned a Combat Preset"; string text2 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)}{ChatColors.FormatText(".")}"; ((FixedString512Bytes)(ref val3))..ctor(text2); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val3); } } val2.Dispose(); } catch (Exception) { } finally { if (!((EntityQuery)(ref val)).Equals(default(EntityQuery))) { ((EntityQuery)(ref val)).Dispose(); } } } } [HarmonyPatch(typeof(VariousMigratedDebugEventsSystem), "HandleCompleteCurrentAchievementEvent")] public static class CompleteCurrentAchievementEventHook { public static void Initialize() { } private static void Prefix(VariousMigratedDebugEventsSystem __instance, [HarmonyArgument(0)] ref CompleteCurrentAchievementAdminEvent eventData, [HarmonyArgument(1)] ref FromCharacter fromCharacter) { //IL_000f: 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_0035: 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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) if (__instance == null) { return; } EntityManager val = ((ComponentSystemBase)__instance).EntityManager; if (((EntityManager)(ref val)).World == null || !((EntityManager)(ref val)).World.IsCreated) { val = VWorld.ServerEntityManager; if (((EntityManager)(ref val)).World == null || !((EntityManager)(ref val)).World.IsCreated) { return; } } try { if (!(fromCharacter.User == Entity.Null) && ((EntityManager)(ref val)).HasComponent<User>(fromCharacter.User)) { User componentData = ((EntityManager)(ref val)).GetComponentData<User>(fromCharacter.User); string text = ((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"Admin (ID: {componentData.PlatformId})"; } string text2 = ((object)(FixedString64Bytes)(ref eventData.CharacterName)).ToString(); if (string.IsNullOrEmpty(text2)) { text2 = "player specified in command"; } int amount = eventData.Amount; string text3 = ((amount == 1) ? "current achievement" : $"{amount} current achievements"); string message = "completed " + text3; string text4 = "for " + text2; string text5 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text4 + ".")}"; FixedString512Bytes val2 = default(FixedString512Bytes); ((FixedString512Bytes)(ref val2))..ctor(text5); ServerChatUtils.SendSystemMessageToAllClients(val, ref val2); } } catch (Exception) { } } } [HarmonyPatch(typeof(VariousMigratedDebugEventsSystem), "HandleConsumeBloodEvent")] public static class ConsumeBloodAdminEventHook { public static void Initialize() { } private static void Prefix(VariousMigratedDebugEventsSystem __instance, [HarmonyArgument(0)] ConsumeBloodAdminEvent clientEvent, [HarmonyArgument(1)] FromCharacter fromCharacter) { //IL_000f: 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_0019: 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_003e: 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_004e: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) if (__instance == null) { return; } EntityManager val = ((ComponentSystemBase)__instance).EntityManager; if (((EntityManager)(ref val)).Equals(default(EntityManager)) || !((EntityManager)(ref val)).World.IsCreated) { val = VWorld.ServerEntityManager; if (((EntityManager)(ref val)).Equals(default(EntityManager)) || !((EntityManager)(ref val)).World.IsCreated) { return; } } try { if (((EntityManager)(ref val)).HasComponent<User>(fromCharacter.User)) { User componentData = ((EntityManager)(ref val)).GetComponentData<User>(fromCharacter.User); string text = ((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User ({componentData.PlatformId})"; } ConsumeBloodAdminEvent val2 = clientEvent; string text2 = VWorld.GetItemName(val2.PrimaryType, val); if (text2.StartsWith("ItemGUID(")) { text2 = $"Blood ({((PrefabGUID)(ref val2.PrimaryType)).GuidHash})"; } string message = "consumed " + text2; string text3 = $"(Quality: {val2.PrimaryQuality:F0}%, Amount: {val2.Amount})"; string text4 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text3 + ".")}"; FixedString512Bytes val3 = default(FixedString512Bytes); ((FixedString512Bytes)(ref val3))..ctor(text4); ServerChatUtils.SendSystemMessageToAllClients(val, ref val3); } } catch (Exception) { } } } [HarmonyPatch(typeof(DebugEventsSystem), "OnUpdate")] public static class CreateJewelDebugEventV2Hook { private static EntityManager _entityManager; private static EntityQuery _eventQuery; public static void Initialize() { } private static void EnsureInitialized(SystemBase systemInstance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_0075: Unknown result type (might be due to invalid IL or missing references) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { if (systemInstance != null && ((ComponentSystemBase)systemInstance).World != null && ((ComponentSystemBase)systemInstance).World.IsCreated) { _entityManager = ((ComponentSystemBase)systemInstance).EntityManager; } else { _entityManager = VWorld.ServerEntityManager; } if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } } if (((EntityQuery)(ref _eventQuery)).Equals(default(EntityQuery)) && !((EntityManager)(ref _entityManager)).Equals(default(EntityManager))) { try { EntityQueryDesc[] array = new EntityQueryDesc[1]; EntityQueryDesc val = new EntityQueryDesc(); val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[3] { ComponentType.ReadOnly<CreateJewelDebugEventV2>(), ComponentType.ReadOnly<FromCharacter>(), ComponentType.ReadOnly<HandleClientDebugEvent>() }); array[0] = val; _eventQuery = ((EntityManager)(ref _entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array); } catch (Exception) { } } } private static void Prefix(DebugEventsSystem __instance) { //IL_000f: 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_0042: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007d: 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_008b: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) EnsureInitialized((SystemBase)(object)__instance); if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated || ((EntityQuery)(ref _eventQuery)).Equals(default(EntityQuery)) || ((EntityQuery)(ref _eventQuery)).IsEmpty) { return; } try { NativeArray<Entity> val = ((EntityQuery)(ref _eventQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<Entity> enumerator = val.GetEnumerator(); FixedString512Bytes val2 = default(FixedString512Bytes); while (enumerator.MoveNext()) { Entity current = enumerator.Current; if (!((EntityManager)(ref _entityManager)).Exists(current) || !((EntityManager)(ref _entityManager)).HasComponent<FromCharacter>(current) || !((EntityManager)(ref _entityManager)).HasComponent<CreateJewelDebugEventV2>(current)) { continue; } FromCharacter componentData = ((EntityManager)(ref _entityManager)).GetComponentData<FromCharacter>(current); if (((EntityManager)(ref _entityManager)).HasComponent<User>(componentData.User)) { User componentData2 = ((EntityManager)(ref _entityManager)).GetComponentData<User>(componentData.User); string text = ((object)(FixedString64Bytes)(ref componentData2.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User ({componentData2.PlatformId})"; } CreateJewelDebugEventV2 componentData3 = ((EntityManager)(ref _entityManager)).GetComponentData<CreateJewelDebugEventV2>(current); PrefabGUID abilityPrefabGuid = componentData3.AbilityPrefabGuid; int tier = componentData3.Tier; float spellMod1Power = componentData3.SpellMod1Power; string text2 = VWorld.GetItemName(abilityPrefabGuid, _entityManager); if (text2.StartsWith("ItemGUID(")) { text2 = $"Ability ({((PrefabGUID)(ref abilityPrefabGuid)).GuidHash})"; } int value = tier + 1; string text3 = ((spellMod1Power >= 0.999f) ? "Max Stats" : "Not Max Stats"); string message = $"created a Tier {value} jewel: {text2}"; string text4 = "(Stats: " + text3 + ")"; string text5 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text4 + ".")}"; ((FixedString512Bytes)(ref val2))..ctor(text5); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val2); } } val.Dispose(); } catch (Exception) { } } } [HarmonyPatch(typeof(DebugEventsSystem), "OnUpdate")] public static class CreateLegendaryWeaponEventHook { private static EntityManager _entityManager; private static EntityQuery _eventQuery; private static bool _isQueryInitialized; public static void Initialize() { } private static void EnsureInitialized(SystemBase systemInstance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || (((EntityManager)(ref _entityManager)).World != null && !((EntityManager)(ref _entityManager)).World.IsCreated)) { if (systemInstance != null && ((ComponentSystemBase)systemInstance).World != null && ((ComponentSystemBase)systemInstance).World.IsCreated) { _entityManager = ((ComponentSystemBase)systemInstance).EntityManager; } else { _entityManager = VWorld.ServerEntityManager; } if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || ((EntityManager)(ref _entityManager)).World == null || !((EntityManager)(ref _entityManager)).World.IsCreated) { _isQueryInitialized = false; return; } } if (!_isQueryInitialized && !((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) && ((EntityManager)(ref _entityManager)).World != null && ((EntityManager)(ref _entityManager)).World.IsCreated) { try { EntityQueryDesc[] array = new EntityQueryDesc[1]; EntityQueryDesc val = new EntityQueryDesc(); val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[3] { ComponentType.ReadOnly<CreateLegendaryWeaponDebugEvent>(), ComponentType.ReadOnly<FromCharacter>(), ComponentType.ReadOnly<HandleClientDebugEvent>() }); array[0] = val; _eventQuery = ((EntityManager)(ref _entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array); _isQueryInitialized = true; } catch (Exception) { _isQueryInitialized = false; } } } private static void Prefix(DebugEventsSystem __instance) { //IL_0016: 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_0058: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a6: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) EnsureInitialized((SystemBase)(object)__instance); if (!_isQueryInitialized || ((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || ((EntityManager)(ref _entityManager)).World == null || !((EntityManager)(ref _entityManager)).World.IsCreated || ((EntityQuery)(ref _eventQuery)).Equals(default(EntityQuery)) || ((EntityQuery)(ref _eventQuery)).IsEmpty) { return; } try { NativeArray<Entity> val = ((EntityQuery)(ref _eventQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<Entity> enumerator = val.GetEnumerator(); FixedString512Bytes val2 = default(FixedString512Bytes); while (enumerator.MoveNext()) { Entity current = enumerator.Current; if (!((EntityManager)(ref _entityManager)).Exists(current) || !((EntityManager)(ref _entityManager)).HasComponent<FromCharacter>(current) || !((EntityManager)(ref _entityManager)).HasComponent<CreateLegendaryWeaponDebugEvent>(current)) { continue; } FromCharacter componentData = ((EntityManager)(ref _entityManager)).GetComponentData<FromCharacter>(current); if (!(componentData.User == Entity.Null) && ((EntityManager)(ref _entityManager)).HasComponent<User>(componentData.User)) { User componentData2 = ((EntityManager)(ref _entityManager)).GetComponentData<User>(componentData.User); string text = ((object)(FixedString64Bytes)(ref componentData2.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User ({componentData2.PlatformId})"; } CreateLegendaryWeaponDebugEvent componentData3 = ((EntityManager)(ref _entityManager)).GetComponentData<CreateLegendaryWeaponDebugEvent>(current); PrefabGUID weaponPrefabGuid = componentData3.WeaponPrefabGuid; int tier = componentData3.Tier; float statMod1Power = componentData3.StatMod1Power; string text2 = VWorld.GetItemName(weaponPrefabGuid, _entityManager); if (text2.StartsWith("ItemGUID(")) { text2 = $"Weapon ({((PrefabGUID)(ref weaponPrefabGuid)).GuidHash})"; } int value = tier + 1; string text3 = ((statMod1Power >= 0.999f) ? "Max Stats" : $"Power {statMod1Power:F2}"); string message = $"created legendary Tier {value} {text2}"; string text4 = "(Stats: " + text3 + ")"; string text5 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text4 + ".")}"; ((FixedString512Bytes)(ref val2))..ctor(text5); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val2); } } val.Dispose(); } catch (Exception) { } } } [HarmonyPatch(typeof(VariousMigratedDebugEventsSystem), "HandleGenerateBloodPotionEvent")] public static class GenerateBloodPotionAdminEventHook { public static void Initialize() { } private static void Prefix(VariousMigratedDebugEventsSystem __instance, [HarmonyArgument(0)] ref GenerateBloodPotionAdminEvent clientEvent, [HarmonyArgument(1)] FromCharacter fromCharacter) { //IL_000f: 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_0019: 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_003e: 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_004e: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) if (__instance == null) { return; } EntityManager val = ((ComponentSystemBase)__instance).EntityManager; if (((EntityManager)(ref val)).Equals(default(EntityManager)) || !((EntityManager)(ref val)).World.IsCreated) { val = VWorld.ServerEntityManager; if (((EntityManager)(ref val)).Equals(default(EntityManager)) || !((EntityManager)(ref val)).World.IsCreated) { return; } } try { if (((EntityManager)(ref val)).HasComponent<User>(fromCharacter.User)) { User componentData = ((EntityManager)(ref val)).GetComponentData<User>(fromCharacter.User); string text = ((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User ({componentData.PlatformId})"; } string text2 = VWorld.GetItemName(clientEvent.PrimaryBloodTypePrefab, val); if (text2.StartsWith("ItemGUID(")) { text2 = $"BloodType ({((PrefabGUID)(ref clientEvent.PrimaryBloodTypePrefab)).GuidHash})"; } string message = "generated a " + text2 + " Potion"; string text3 = $"(Quality: {clientEvent.PrimaryQuality:F0}%)"; string text4 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text3 + ".")}"; FixedString512Bytes val2 = default(FixedString512Bytes); ((FixedString512Bytes)(ref val2))..ctor(text4); ServerChatUtils.SendSystemMessageToAllClients(val, ref val2); } } catch (Exception) { } } } [HarmonyPatch(typeof(DebugEventsSystem), "OnUpdate")] public static class GenerateJewelEventHook { private static EntityManager _entityManager; private static EntityQuery _eventQuery; public static void Initialize() { } private static void EnsureInitialized(SystemBase systemInstance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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) //IL_011a: 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_0075: Unknown result type (might be due to invalid IL or missing references) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { if (systemInstance != null && ((ComponentSystemBase)systemInstance).World != null && ((ComponentSystemBase)systemInstance).World.IsCreated) { _entityManager = ((ComponentSystemBase)systemInstance).EntityManager; } else { _entityManager = VWorld.ServerEntityManager; } if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } } if (((EntityQuery)(ref _eventQuery)).Equals(default(EntityQuery)) && !((EntityManager)(ref _entityManager)).Equals(default(EntityManager))) { try { EntityQueryDesc[] array = new EntityQueryDesc[1]; EntityQueryDesc val = new EntityQueryDesc(); val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[2] { ComponentType.ReadOnly<GenerateJewelDebugEvent>(), ComponentType.ReadOnly<FromCharacter>() }); array[0] = val; _eventQuery = ((EntityManager)(ref _entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array); } catch (Exception) { } } } private static void Prefix(DebugEventsSystem __instance) { //IL_000f: 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_0042: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007d: 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_008b: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) EnsureInitialized((SystemBase)(object)__instance); if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated || ((EntityQuery)(ref _eventQuery)).Equals(default(EntityQuery)) || ((EntityQuery)(ref _eventQuery)).IsEmpty) { return; } try { NativeArray<Entity> val = ((EntityQuery)(ref _eventQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<Entity> enumerator = val.GetEnumerator(); FixedString512Bytes val2 = default(FixedString512Bytes); while (enumerator.MoveNext()) { Entity current = enumerator.Current; if (!((EntityManager)(ref _entityManager)).Exists(current) || !((EntityManager)(ref _entityManager)).HasComponent<FromCharacter>(current) || !((EntityManager)(ref _entityManager)).HasComponent<GenerateJewelDebugEvent>(current)) { continue; } FromCharacter componentData = ((EntityManager)(ref _entityManager)).GetComponentData<FromCharacter>(current); if (((EntityManager)(ref _entityManager)).HasComponent<User>(componentData.User)) { User componentData2 = ((EntityManager)(ref _entityManager)).GetComponentData<User>(componentData.User); string text = ((object)(FixedString64Bytes)(ref componentData2.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User ({componentData2.PlatformId})"; } GenerateJewelDebugEvent componentData3 = ((EntityManager)(ref _entityManager)).GetComponentData<GenerateJewelDebugEvent>(current); string text2 = VWorld.GetItemName(componentData3.AbilityPrefabGuid, _entityManager); if (text2.StartsWith("ItemGUID(")) { text2 = $"Ability ({((PrefabGUID)(ref componentData3.AbilityPrefabGuid)).GuidHash})"; } int value = componentData3.Tier + 1; string text3 = ((componentData3.Power >= 0.999f) ? "Max Stats" : "Not Max Stats"); string message = $"created a Tier {value} jewel: {text2}"; string text4 = "(Stats: " + text3 + ")"; string text5 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text4 + ".")}"; ((FixedString512Bytes)(ref val2))..ctor(text5); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val2); } } val.Dispose(); } catch (Exception) { } } } [HarmonyPatch(typeof(DebugEventsSystem), "OnUpdate")] public static class GenerateLegendaryWeaponEventHook { private static EntityManager _entityManager; private static EntityQuery _eventQuery; private static bool _isQueryInitialized; public static void Initialize() { } private static void EnsureInitialized(SystemBase systemInstance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || (((EntityManager)(ref _entityManager)).World != null && !((EntityManager)(ref _entityManager)).World.IsCreated)) { if (systemInstance != null && ((ComponentSystemBase)systemInstance).World != null && ((ComponentSystemBase)systemInstance).World.IsCreated) { _entityManager = ((ComponentSystemBase)systemInstance).EntityManager; } else { _entityManager = VWorld.ServerEntityManager; } if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || ((EntityManager)(ref _entityManager)).World == null || !((EntityManager)(ref _entityManager)).World.IsCreated) { _isQueryInitialized = false; return; } } if (!_isQueryInitialized && !((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) && ((EntityManager)(ref _entityManager)).World != null && ((EntityManager)(ref _entityManager)).World.IsCreated) { try { EntityQueryDesc[] array = new EntityQueryDesc[1]; EntityQueryDesc val = new EntityQueryDesc(); val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[3] { ComponentType.ReadOnly<GenerateLegendaryWeaponDebugEvent>(), ComponentType.ReadOnly<FromCharacter>(), ComponentType.ReadOnly<HandleClientDebugEvent>() }); array[0] = val; _eventQuery = ((EntityManager)(ref _entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array); _isQueryInitialized = true; } catch (Exception) { _isQueryInitialized = false; } } } private static void Prefix(DebugEventsSystem __instance) { //IL_0016: 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_0058: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00b1: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0106: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) EnsureInitialized((SystemBase)(object)__instance); if (!_isQueryInitialized || ((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || ((EntityManager)(ref _entityManager)).World == null || !((EntityManager)(ref _entityManager)).World.IsCreated || ((EntityQuery)(ref _eventQuery)).Equals(default(EntityQuery)) || ((EntityQuery)(ref _eventQuery)).IsEmpty) { return; } try { NativeArray<Entity> val = ((EntityQuery)(ref _eventQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); if (val.Length == 0) { val.Dispose(); return; } Enumerator<Entity> enumerator = val.GetEnumerator(); FixedString512Bytes val2 = default(FixedString512Bytes); while (enumerator.MoveNext()) { Entity current = enumerator.Current; if (!((EntityManager)(ref _entityManager)).Exists(current) || !((EntityManager)(ref _entityManager)).HasComponent<FromCharacter>(current) || !((EntityManager)(ref _entityManager)).HasComponent<GenerateLegendaryWeaponDebugEvent>(current)) { continue; } FromCharacter componentData = ((EntityManager)(ref _entityManager)).GetComponentData<FromCharacter>(current); if (!(componentData.User == Entity.Null) && ((EntityManager)(ref _entityManager)).HasComponent<User>(componentData.User)) { User componentData2 = ((EntityManager)(ref _entityManager)).GetComponentData<User>(componentData.User); string text = ((object)(FixedString64Bytes)(ref componentData2.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User (ID: {componentData2.PlatformId})"; } GenerateLegendaryWeaponDebugEvent componentData3 = ((EntityManager)(ref _entityManager)).GetComponentData<GenerateLegendaryWeaponDebugEvent>(current); PrefabGUID itemPrefabGuid = componentData3.ItemPrefabGuid; float power = componentData3.Power; string text2 = VWorld.GetItemName(itemPrefabGuid, _entityManager); if (text2.StartsWith("ItemGUID(")) { text2 = $"Weapon ({((PrefabGUID)(ref itemPrefabGuid)).GuidHash})"; } string text3 = $"Power {power:F2}"; string message = "generated " + text2; string text4 = "(" + text3 + ")"; string text5 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text4 + ".")}"; ((FixedString512Bytes)(ref val2))..ctor(text5); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val2); } } val.Dispose(); } catch (Exception) { } } } [HarmonyPatch(typeof(DebugEventsSystem), "OnUpdate")] public static class GiveDebugEventHook { private static EntityManager _entityManager; public static void Initialize() { } private static void Prefix(DebugEventsSystem __instance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { if (((ComponentSystemBase)__instance).World != null && ((ComponentSystemBase)__instance).World.IsCreated) { _entityManager = ((ComponentSystemBase)__instance).EntityManager; } else { _entityManager = VWorld.ServerEntityManager; if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } } } if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } EntityQuery val = default(EntityQuery); NativeArray<Entity> val2 = default(NativeArray<Entity>); try { val = ((EntityManager)(ref _entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[2] { ComponentType.ReadOnly<GiveDebugEvent>(), ComponentType.ReadOnly<FromCharacter>() }); if (((EntityQuery)(ref val)).IsEmpty) { return; } val2 = ((EntityQuery)(ref val)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<Entity> enumerator = val2.GetEnumerator(); FixedString512Bytes val3 = default(FixedString512Bytes); while (enumerator.MoveNext()) { Entity current = enumerator.Current; try { if (!((EntityManager)(ref _entityManager)).Exists(current)) { continue; } GiveDebugEvent componentData = ((EntityManager)(ref _entityManager)).GetComponentData<GiveDebugEvent>(current); FromCharacter componentData2 = ((EntityManager)(ref _entityManager)).GetComponentData<FromCharacter>(current); if (((EntityManager)(ref _entityManager)).Exists(componentData2.User) && ((EntityManager)(ref _entityManager)).HasComponent<User>(componentData2.User)) { User componentData3 = ((EntityManager)(ref _entityManager)).GetComponentData<User>(componentData2.User); string text = ((object)(FixedString64Bytes)(ref componentData3.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User_{componentData3.Index}"; } string text2 = VWorld.GetItemName(componentData.PrefabGuid, _entityManager); if (text2.StartsWith("GUID(") || string.IsNullOrEmpty(text2) || text2.StartsWith("ItemGUID(")) { text2 = $"an item (ID: {((PrefabGUID)(ref componentData.PrefabGuid)).GuidHash})"; } string message = "used 'give'"; string text3 = $"for {text2} (Amount: {componentData.Amount})"; string text4 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text3 + ".")}"; ((FixedString512Bytes)(ref val3))..ctor(text4); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val3); } } catch (Exception) { } } } catch (Exception) { } finally { if (val2.IsCreated) { val2.Dispose(); } if (!((EntityQuery)(ref val)).Equals(default(EntityQuery))) { ((EntityQuery)(ref val)).Dispose(); } } } } [HarmonyPatch] public static class InventoryCommandsHook { private static EntityManager _entityManager; public static void Initialize() { } private static void EnsureEntityManager() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //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_0041: 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) if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { _entityManager = VWorld.ServerEntityManager; if (!((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) && ((EntityManager)(ref _entityManager)).World.IsCreated) { } } } private static string GetAdminNameFromSystem(object systemInstance) { //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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) if (systemInstance == null) { return "Unknown Admin"; } EnsureEntityManager(); Entity val = Entity.Null; try { string[] array = new string[5] { "_LastCommandUserEntity", "LastExecutingUserEntity", "m_LastExecutingUserEntity", "m_ExecutingUser", "_currentUserEntity" }; FieldInfo fieldInfo = null; string[] array2 = array; foreach (string text in array2) { fieldInfo = AccessTools.Field(systemInstance.GetType(), text); if (fieldInfo != null) { break; } } if (fieldInfo != null && fieldInfo.GetValue(systemInstance) is Entity val2) { val = val2; } if (val != Entity.Null && ((EntityManager)(ref _entityManager)).Exists(val) && ((EntityManager)(ref _entityManager)).HasComponent<User>(val)) { User componentData = ((EntityManager)(ref _entityManager)).GetComponentData<User>(val); string text2 = ((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(); return string.IsNullOrEmpty(text2) ? $"User ({componentData.PlatformId})" : text2; } } catch (Exception) { } return "Server/Unknown"; } [HarmonyPatch(typeof(GiveInventoryItemCommandSystem), "Give")] [HarmonyPostfix] private static void GiveCommandPostfix(GiveInventoryItemCommandSystem __instance, string item, int giveAmount) { //IL_000f: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) try { EnsureEntityManager(); if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } string adminNameFromSystem = GetAdminNameFromSystem(__instance); string value = item; if (int.TryParse(item, out var result)) { string itemName = VWorld.GetItemName(new PrefabGUID(result), _entityManager); if (!itemName.StartsWith("ItemGUID(")) { value = itemName; } } string text = $"\"{value}\" (Amount: {giveAmount})"; string text2 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(adminNameFromSystem)} {ChatColors.FormatText("used command")} {ChatColors.FormatCommand("give")} {ChatColors.FormatText(text + ".")}"; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(text2); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val); } catch (Exception) { } } [HarmonyPatch(typeof(GiveInventoryItemCommandSystem), "GiveSet")] [HarmonyPostfix] private static void GiveSetCommandPostfix(GiveInventoryItemCommandSystem __instance, string itemSet) { //IL_000f: 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_00c4: Unknown result type (might be due to invalid IL or missing references) try { EnsureEntityManager(); if (!((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) && ((EntityManager)(ref _entityManager)).World.IsCreated) { string adminNameFromSystem = GetAdminNameFromSystem(__instance); string message = "spawned Combat Preset: " + itemSet; string text = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(adminNameFromSystem)} {ChatColors.FormatCommand(message)}{ChatColors.FormatText(".")}"; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(text); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val); } } catch (Exception) { } } [HarmonyPatch(typeof(GiveInventoryItemCommandSystem), "CreateJewel", new Type[] { typeof(string), typeof(int), typeof(string), typeof(float), typeof(string), typeof(float), typeof(string), typeof(float), typeof(string), typeof(float) })] [HarmonyPostfix] private static void CreateJewelCommandPostfix(GiveInventoryItemCommandSystem __instance, string abilityName, int tier, string spellMod1, float power1, string spellMod2, float power2, string spellMod3, float power3, string spellMod4, float power4) { //IL_000f: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) try { EnsureEntityManager(); if (((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) || !((EntityManager)(ref _entityManager)).World.IsCreated) { return; } string adminNameFromSystem = GetAdminNameFromSystem(__instance); string value = abilityName; if (int.TryParse(abilityName, out var result)) { string itemName = VWorld.GetItemName(new PrefabGUID(result), _entityManager); if (!itemName.StartsWith("ItemGUID(")) { value = itemName; } } int value2 = tier + 1; string text = ((power1 >= 0.999f) ? "Max Stats" : "Not Max Stats"); string message = $"created a Tier {value2} jewel: {value}"; string text2 = "(Stats: " + text + ")"; string text3 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(adminNameFromSystem)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text2 + ".")}"; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(text3); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val); } catch (Exception) { } } [HarmonyPatch(typeof(GiveInventoryItemCommandSystem), "CreateAndFullyEquipJewels", new Type[] { typeof(int) })] [HarmonyPostfix] private static void CreateAndFullyEquipJewelsPostfix(GiveInventoryItemCommandSystem __instance, int inputTier) { //IL_000f: 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_011f: Unknown result type (might be due to invalid IL or missing references) try { EnsureEntityManager(); if (!((EntityManager)(ref _entityManager)).Equals(default(EntityManager)) && ((EntityManager)(ref _entityManager)).World.IsCreated) { string adminNameFromSystem = GetAdminNameFromSystem(__instance); int value = inputTier + 1; string text = "Max Stats"; string message = $"created Tier {value} jewels for all slots"; string text2 = "(Stats: " + text + ")"; string text3 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(adminNameFromSystem)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text2 + ".")}"; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(text3); ServerChatUtils.SendSystemMessageToAllClients(_entityManager, ref val); } } catch (Exception) { } } } [HarmonyPatch(typeof(VariousMigratedDebugEventsSystem), "HandleRenamePlayerEvent")] public static class RenameEventHook { public static void Initialize() { } private static void Prefix(VariousMigratedDebugEventsSystem __instance, RenamePlayerEvent clientEvent, FromCharacter fromCharacter) { //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_000b: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_0064: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) try { EntityManager entityManager = ((ComponentSystemBase)__instance).EntityManager; string text; if (((EntityManager)(ref entityManager)).HasComponent<User>(fromCharacter.User)) { User componentData = ((EntityManager)(ref entityManager)).GetComponentData<User>(fromCharacter.User); text = ((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = $"User ({componentData.PlatformId})"; } } else { text = "UnknownAdmin"; } NetworkId targetNetworkId = clientEvent.TargetNetworkId; string text2 = ((object)(FixedString64Bytes)(ref clientEvent.NewName)).ToString(); string text3 = "UnknownPlayer"; bool flag = false; if ((int)targetNetworkId.Type == 1) { int normal_Index = targetNetworkId.Normal_Index; byte normal_Generation = targetNetworkId.Normal_Generation; EntityQuery val = ((EntityManager)(ref entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[1] { ComponentType.ReadOnly<User>() }); NativeArray<User> val2 = ((EntityQuery)(ref val)).ToComponentDataArray<User>(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<User> enumerator = val2.GetEnumerator(); while (enumerator.MoveNext()) { User current = enumerator.Current; if (current.Index == normal_Index && current.Generation == normal_Generation) { FixedString64Bytes characterName = current.CharacterName; text3 = ((object)(FixedString64Bytes)(ref characterName)).ToString(); if (string.IsNullOrEmpty(text3)) { text3 = $"User (ID: {current.PlatformId})"; } flag = true; break; } } val2.Dispose(); ((EntityQuery)(ref val)).Dispose(); } if (!flag && (int)targetNetworkId.Type == 1) { text3 = $"User (ID: {targetNetworkId.Normal_Index}-{targetNetworkId.Normal_Generation})"; } else if (!flag) { text3 = $"User (Type:{targetNetworkId.Type})"; } if (string.IsNullOrEmpty(text3)) { text3 = "UnknownPlayer"; } string message = "renamed"; string text4 = text3 + " to " + text2; string text5 = $"{ChatColors.FormatText("Admin")} {ChatColors.FormatAdminName(text)} {ChatColors.FormatCommand(message)} {ChatColors.FormatText(text4 + ".")}"; FixedString512Bytes val3 = default(FixedString512Bytes); ((FixedString512Bytes)(ref val3))..ctor(text5); ServerChatUtils.SendSystemMessageToAllClients(entityManager, ref val3); } catch (Exception) { } } } } namespace RevealForge.Data { public static class InternalPrefabs { public static readonly PrefabGUID _10x6RectangularTablesModularBuildMenuGroup; public static readonly PrefabGUID _3x3RoundTablesModularBuildMenuGroup; public static readonly PrefabGUID _3x6RectangularTablesBuildMenuGroup; public static readonly PrefabGUID _6x6RoundTablesModularBuildMenuGroup; public static readonly PrefabGUID AB_AmbientLightning_Light; public static readonly PrefabGUID AB_AmbientLightning_Light_GameplayStrike; public static readonly PrefabGUID AB_ApplyWeaponCoating_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Blood_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Blood_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Blood_Cast; public static readonly PrefabGUID AB_ApplyWeaponCoating_Cast; public static readonly PrefabGUID AB_ApplyWeaponCoating_Chaos_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Chaos_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Chaos_Cast; public static readonly PrefabGUID AB_ApplyWeaponCoating_Frost_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Frost_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Frost_Cast; public static readonly PrefabGUID AB_ApplyWeaponCoating_Illusion_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Illusion_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Illusion_Cast; public static readonly PrefabGUID AB_ApplyWeaponCoating_Storm_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Storm_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Storm_Cast; public static readonly PrefabGUID AB_ApplyWeaponCoating_Unholy_AbilityGroup; public static readonly PrefabGUID AB_ApplyWeaponCoating_Unholy_Activate; public static readonly PrefabGUID AB_ApplyWeaponCoating_Unholy_Cast; public static readonly PrefabGUID AB_Archer_Projectile_Cast; public static readonly PrefabGUID AB_Archer_Projectile_Group; public static readonly PrefabGUID AB_Archer_Projectile01; public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_Cast; public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_ImprisonBuff; public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_MoveBehaviourBuff; public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_RingArea; public static readonly PrefabGUID AB_ArchMage_CrystalLance_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_CrystalLance_AggroBuff; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Cast_01; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Cast_02; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Cast_03; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_Cast; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_HitBuff; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_Projectile; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_SplinterProjectile; public static readonly PrefabGUID AB_ArchMage_CrystalLance_Projectile; public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_Buff; public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_Buff_ALREADY_EXISTS_2; public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_Cast; public static readonly PrefabGUID AB_ArchMage_FireSpinner_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_FireSpinner_Cast; public static readonly PrefabGUID AB_ArchMage_FireSpinner_Projectile; public static readonly PrefabGUID AB_ArchMage_FireSpinner_Spinner; public static readonly PrefabGUID AB_ArchMage_FlameSphere_AggroBuff; public static readonly PrefabGUID AB_ArchMage_FlameSphere_AreaDamageBuff; public static readonly PrefabGUID AB_ArchMage_FlameSphere_AreaEffectBuff; public static readonly PrefabGUID AB_ArchMage_FlameSphere_AreaInitBuff; public static readonly PrefabGUID AB_ArchMage_FlameSphere_Dash_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_FlameSphere_Dash_Cast; public static readonly PrefabGUID AB_ArchMage_FlameSphere_Dash_Trigger; public static readonly PrefabGUID AB_ArchMage_FlameSphere_Projectile; public static readonly PrefabGUID AB_ArchMage_FlameSphere_ShouldDestroyBuff; public static readonly PrefabGUID AB_ArchMage_FlamingIce_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_FlamingIce_Area; public static readonly PrefabGUID AB_ArchMage_FlamingIce_Cast; public static readonly PrefabGUID AB_ArchMage_FlamingIce_Channel; public static readonly PrefabGUID AB_ArchMage_FlamingIce_FreezeBuff; public static readonly PrefabGUID AB_ArchMage_FlamingIce_Trigger; public static readonly PrefabGUID AB_ArchMage_LightningArc_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_LightningArc_Cast; public static readonly PrefabGUID AB_ArchMage_LightningArc_Projectile; public static readonly PrefabGUID AB_ArchMage_LightningCurse_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_LightningCurse_Cast; public static readonly PrefabGUID AB_ArchMage_LightningCurse_Projectile; public static readonly PrefabGUID AB_ArchMage_LightningCurse_ProjectileSpawnerBuff; public static readonly PrefabGUID AB_ArchMage_LightningCurse_ProjectileTrigger; public static readonly PrefabGUID AB_ArchMage_LightningCurse_Trigger; public static readonly PrefabGUID AB_ArchMage_MirrorImage_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_MirrorImage_Cast; public static readonly PrefabGUID AB_ArchMage_MirrorImage_EndPhase; public static readonly PrefabGUID AB_ArchMage_MirrorImage_MoveBehaviourBuff; public static readonly PrefabGUID AB_ArchMage_MirrorImage_Phase; public static readonly PrefabGUID AB_ArchMage_MirrorImage_Trigger; public static readonly PrefabGUID AB_ArchMage_Teleport_AbilityGroup; public static readonly PrefabGUID AB_ArchMage_Teleport_Cast; public static readonly PrefabGUID AB_ArchMage_Teleport_EndPhase; public static readonly PrefabGUID AB_ArchMage_Teleport_Phase; public static readonly PrefabGUID AB_Bandit_Ambush_Buff; public static readonly PrefabGUID AB_Bandit_Ambush_RevealBuff; public static readonly PrefabGUID AB_Bandit_Bomber_Elite_Roll; public static readonly PrefabGUID AB_Bandit_Bomber_Elite_Roll_Group; public static readonly PrefabGUID AB_Bandit_BombThrow_AbilityGroup; public static readonly PrefabGUID AB_Bandit_BombThrow_Cast; public static readonly PrefabGUID AB_Bandit_BombThrow_Throw; public static readonly PrefabGUID AB_Bandit_ClusterBombThrow_AbilityGroup; public static readonly PrefabGUID AB_Bandit_ClusterBombThrow_Cast; public static readonly PrefabGUID AB_Bandit_ClusterBombThrow_Throw_A; public static readonly PrefabGUID AB_Bandit_ClusterBombThrow_Throw_B; public static readonly PrefabGUID AB_Bandit_ClusterBombThrow_Throw_C; public static readonly PrefabGUID AB_Bandit_Deadeye_Camouflage_AbilityGroup; public static readonly PrefabGUID AB_Bandit_Deadeye_Camouflage_Buff; public static readonly PrefabGUID AB_Bandit_Deadeye_Camouflage_Cast; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_Area; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_Cast; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_Channel_Buff; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_Group; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_Hard_Area; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_Hard_Cast; public static readonly PrefabGUID AB_Bandit_Deadeye_Chaosbarrage_