Decompiled source of LoadoutLockdown v1.2.0
LoadoutLockdown.dll
Decompiled 3 weeks 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.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using HookDOTS.API; using HookDOTS.API.Attributes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using ProfuselyViolentProgression.Core.Config; using ProfuselyViolentProgression.Core.Utilities; using ProfuselyViolentProgression.LoadoutLockdown.Config; using ProfuselyViolentProgression.LoadoutLockdown.Rulings; using ProjectM; using ProjectM.CastleBuilding; using ProjectM.Gameplay.Scripting; using ProjectM.Network; using ProjectM.Scripting; using ProjectM.Shared; using Stunlock.Core; using Unity.Collections; using Unity.Entities; using Unity.Mathematics; using Unity.Transforms; using UnityEngine; 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("Nicholas Toby")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyCopyright("Copyright (c) Nicholas Toby 2025")] [assembly: AssemblyDescription("Restrict (or unrestrict) equipping gear, both in and out of combat. Fully customizable.")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyInformationalVersion("1.2.0+ec2c837921e090e0ee81b5c22b4363d4563ab992")] [assembly: AssemblyProduct("LoadoutLockdown")] [assembly: AssemblyTitle("LoadoutLockdown")] [assembly: AssemblyMetadata("Reloadable", "True")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ProfuselyViolentProgression.Core.Utilities { public class BuffUtil { public static void GiveBuffToPlayer(Entity character, PrefabGUID buffPrefabGUID) { //IL_0006: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; PlayerCharacter componentData = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(character); FromCharacter val = default(FromCharacter); val.User = componentData.UserEntity; val.Character = character; FromCharacter val2 = val; ApplyBuffDebugEvent val3 = default(ApplyBuffDebugEvent); val3.BuffPrefabGUID = buffPrefabGUID; ApplyBuffDebugEvent val4 = val3; DebugEventsSystem existingSystemManaged = WorldUtil.Server.GetExistingSystemManaged<DebugEventsSystem>(); existingSystemManaged.ApplyBuff(val2, val4); } public static bool TryRemoveBuffFromPlayer(Entity character, PrefabGUID buffPrefabGUID) { //IL_0006: 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_000d: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; Entity val = default(Entity); if (BuffUtility.TryGetBuff<EntityManager>(entityManager, character, PrefabIdentifier.op_Implicit(buffPrefabGUID), ref val)) { DestroyUtility.Destroy(entityManager, val, (DestroyDebugReason)13, (string)null, 0); return true; } return false; } public static void ToggleBuffableFlagState_On(Entity character, BuffModificationTypes flags) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //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_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_0026: Expected I8, but got Unknown //IL_0028: 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_0030: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; BuffableFlagState componentData = ((EntityManager)(ref entityManager)).GetComponentData<BuffableFlagState>(character); ref long value = ref componentData.Value._Value; value |= flags; ((EntityManager)(ref entityManager)).SetComponentData<BuffableFlagState>(character, componentData); DebugUtil.LogBuffableFlagState(character); } public static void ToggleBuffableFlagState_Off(Entity character, BuffModificationTypes flag) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //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_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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I8, but got Unknown //IL_0029: 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_0031: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; BuffableFlagState componentData = ((EntityManager)(ref entityManager)).GetComponentData<BuffableFlagState>(character); ref long value = ref componentData.Value._Value; value &= ~flag; ((EntityManager)(ref entityManager)).SetComponentData<BuffableFlagState>(character, componentData); DebugUtil.LogBuffableFlagState(character); } } public static class ChatUtil { public static void SendSystemMessageToClient(User user, string message) { //IL_0006: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(message.ToString()); ServerChatUtils.SendSystemMessageToClient(entityManager, user, ref val); } public static void SendSystemMessageToAllClients(string message) { //IL_0006: 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_0019: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(message.ToString()); ServerChatUtils.SendSystemMessageToAllClients(entityManager, ref val); } } public static class DebugUtil { public static void LogComponentTypesFromQueries(ComponentSystemBase systemBase) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) LogUtil.LogInfo("========================================"); int num = 0; foreach (EntityQuery item in (Il2CppArrayBase<EntityQuery>)(object)systemBase.EntityQueries) { EntityQuery current = item; LogUtil.LogInfo($"query#{num}--------------------------------"); NativeArray<Entity> val = ((EntityQuery)(ref current)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); for (int i = 0; i < val.Length; i++) { LogComponentTypes(val[i]); } num++; } } public static void LogComponentTypes(Entity entity) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) LogUtil.LogMessage("-------------------------------------------"); EntityManager entityManager = WorldUtil.Game.EntityManager; Enumerator<ComponentType> enumerator = ((EntityManager)(ref entityManager)).GetComponentTypes(entity, (Allocator)2).GetEnumerator(); while (enumerator.MoveNext()) { ComponentType current = enumerator.Current; LogUtil.LogMessage(((object)(ComponentType)(ref current)).ToString()); } LogUtil.LogMessage("-------------------------------------------"); } public static void LogPrefabGuid(Entity entity) { //IL_0006: 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_000e: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<PrefabGUID>(entity)) { PrefabGUID componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(entity); LogUtil.LogInfo(" PrefabGUID: " + LookupPrefabName(componentData)); } } public static void LogBuffableFlagState(Entity entity) { //IL_0006: 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_000e: 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_0029: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<BuffableFlagState>(entity)) { BuffableFlagState componentData = ((EntityManager)(ref entityManager)).GetComponentData<BuffableFlagState>(entity); LogUtil.LogInfo(" BuffableFlagState:"); LogUtil.LogInfo($" Value: {componentData.Value._Value}"); LogUtil.LogInfo($" BuffModificationTypes: {componentData.Value._Value}"); } } public static void LogBuffModificationFlagData(Entity entity) { //IL_0006: 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_000e: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_007e: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<BuffModificationFlagData>(entity)) { BuffModificationFlagData componentData = ((EntityManager)(ref entityManager)).GetComponentData<BuffModificationFlagData>(entity); LogUtil.LogInfo(" BuffModificationFlagData:"); LogUtil.LogInfo($" ModificationTypes: {componentData.ModificationTypes}"); LogUtil.LogInfo($" ModificationId: {componentData.ModificationId}"); } } public static void LogBuffCategory(Entity entity) { //IL_0006: 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_000e: 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_0029: 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_0080: 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_00b2: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<BuffCategory>(entity)) { BuffCategory componentData = ((EntityManager)(ref entityManager)).GetComponentData<BuffCategory>(entity); LogUtil.LogInfo(" BuffCategory:"); LogUtil.LogInfo($" Level: {componentData.Level}"); LogUtil.LogInfo($" Groups: {componentData.Groups}"); LogUtil.LogInfo($" KeepOldest: {componentData.KeepOldest}"); } } public static void LogBuffs(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<BuffBuffer>(entity)) { LogUtil.LogInfo(" buffs:"); Enumerator<BuffBuffer> enumerator = ((EntityManager)(ref entityManager)).GetBuffer<BuffBuffer>(entity, false).GetEnumerator(); while (enumerator.MoveNext()) { BuffBuffer current = enumerator.Current; LogUtil.LogInfo(" " + LookupPrefabName(current.PrefabGuid)); } } } public static void LogLifeTime(Entity entity) { //IL_0006: 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_000e: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_007e: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<LifeTime>(entity)) { LifeTime componentData = ((EntityManager)(ref entityManager)).GetComponentData<LifeTime>(entity); LogUtil.LogInfo(" LifeTime:"); LogUtil.LogInfo($" Duration: {componentData.Duration}"); LogUtil.LogInfo($" EndAction: {componentData.EndAction}"); } } public static void LogSpellModSet(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0074: 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_00b3: 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_00b9: 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_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_00f3: 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_0113: Unknown result type (might be due to invalid IL or missing references) //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_0133: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<SpellModSetComponent>(entity)) { LogUtil.LogInfo(" spell mods:"); SpellModSetComponent componentData = ((EntityManager)(ref entityManager)).GetComponentData<SpellModSetComponent>(entity); SpellModSet spellMods = componentData.SpellMods; LogUtil.LogInfo($" count:{spellMods.Count}"); LogUtil.LogInfo(" 0:" + LookupPrefabName(spellMods.Mod0.Id)); LogUtil.LogInfo(" 1:" + LookupPrefabName(spellMods.Mod1.Id)); LogUtil.LogInfo(" 2:" + LookupPrefabName(spellMods.Mod2.Id)); LogUtil.LogInfo(" 3:" + LookupPrefabName(spellMods.Mod3.Id)); LogUtil.LogInfo(" 4:" + LookupPrefabName(spellMods.Mod4.Id)); LogUtil.LogInfo(" 5:" + LookupPrefabName(spellMods.Mod5.Id)); LogUtil.LogInfo(" 6:" + LookupPrefabName(spellMods.Mod6.Id)); LogUtil.LogInfo(" 7:" + LookupPrefabName(spellMods.Mod7.Id)); LogUtil.LogInfo(" ----"); } } public static void LogApplyBuffOnGameplayEvent(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<ApplyBuffOnGameplayEvent>(entity)) { LogUtil.LogInfo(" Buffs to apply on gameplay events:"); Enumerator<ApplyBuffOnGameplayEvent> enumerator = ((EntityManager)(ref entityManager)).GetBuffer<ApplyBuffOnGameplayEvent>(entity, false).GetEnumerator(); while (enumerator.MoveNext()) { ApplyBuffOnGameplayEvent current = enumerator.Current; LogUtil.LogInfo($" stacks:{current.Stacks}"); LogUtil.LogInfo(" 0:" + LookupPrefabName(current.Buff0)); LogUtil.LogInfo(" 1:" + LookupPrefabName(current.Buff1)); LogUtil.LogInfo(" 2:" + LookupPrefabName(current.Buff2)); LogUtil.LogInfo(" 3:" + LookupPrefabName(current.Buff3)); LogUtil.LogInfo($" spellModSource:{current.CustomAbilitySpellModsSource}"); LogUtil.LogInfo(" ----"); } } } public static void LogProjectilDestroyData(Entity entity) { //IL_0006: 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_000e: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<ProjectileDestroyData>(entity)) { ProjectileDestroyData componentData = ((EntityManager)(ref entityManager)).GetComponentData<ProjectileDestroyData>(entity); LogUtil.LogInfo(" ProjectileDestroyData:"); LogUtil.LogInfo($" HasHitTarget: {componentData.HasHitTarget}"); } } public static void LogHitColliderCast(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<HitColliderCast>(entity)) { LogUtil.LogInfo(" HitColliderCast [Buffer]:"); DynamicBuffer<HitColliderCast> buffer = ((EntityManager)(ref entityManager)).GetBuffer<HitColliderCast>(entity, false); for (int i = 0; i < buffer.Length; i++) { HitColliderCast val = buffer[i]; LogUtil.LogInfo($" HitColliderCast [{i}]"); LogUtil.LogInfo(" Shape"); LogUtil.LogInfo($" Type: {val.Shape.Type}"); LogUtil.LogInfo($" RadiusOrWidth: {val.Shape.RadiusOrWidth}"); LogUtil.LogInfo($" InnerRadiusOrHeight: {val.Shape.InnerRadiusOrHeight}"); LogUtil.LogInfo($" Length: {val.Shape.Length}"); LogUtil.LogInfo($" Angle: {val.Shape.Angle}"); LogUtil.LogInfo($" AfterDuration: {val.AfterDuration}"); LogUtil.LogInfo($" TerrainColliderModifier: {val.TerrainColliderModifier}"); LogUtil.LogInfo(" PrioritySettings"); LogUtil.LogInfo($" Near_Origin_Factor: {val.PrioritySettings.Near_Origin_Factor}"); LogUtil.LogInfo($" Near_Origin_Distance: {val.PrioritySettings.Near_Origin_Distance}"); LogUtil.LogInfo($" Target_Priority_Factor: {val.PrioritySettings.Target_Priority_Factor}"); LogUtil.LogInfo($" UseMeleeCone: {val.PrioritySettings.UseMeleeCone}"); LogUtil.LogInfo($" Melee_Cone_Angle {val.PrioritySettings.Melee_Cone_Angle}"); LogUtil.LogInfo($" UseColliderCenterAsOriginPosition: {val.PrioritySettings.UseColliderCenterAsOriginPosition}"); LogUtil.LogInfo($" CollisionCheckType: {val.CollisionCheckType}"); LogUtil.LogInfo($" PrimaryFilterFlags: {val.PrimaryFilterFlags}"); LogUtil.LogInfo($" PrimaryTargets_Count: {val.PrimaryTargets_Count}"); LogUtil.LogInfo($" SecondaryTargets_Count: {val.SecondaryTargets_Count}"); LogUtil.LogInfo($" ContinuousCollision: {val.ContinuousCollision}"); LogUtil.LogInfo($" IncludeTerrain: {val.IncludeTerrain}"); LogUtil.LogInfo($" CanHitThroughBlockSpellCollision: {val.CanHitThroughBlockSpellCollision}"); LogUtil.LogInfo($" IgnoreImmaterial: {val.IgnoreImmaterial}"); LogUtil.LogInfo(" ----"); } } } public static void LogHitTriggers(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_0103: 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_0136: 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_0169: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<HitTrigger>(entity)) { LogUtil.LogInfo(" HitTrigger [Buffer]:"); DynamicBuffer<HitTrigger> buffer = ((EntityManager)(ref entityManager)).GetBuffer<HitTrigger>(entity, false); for (int i = 0; i < buffer.Length; i++) { HitTrigger val = buffer[i]; LogUtil.LogInfo($" HitTrigger [{i}]"); LogUtil.LogInfo($" HitTime: {val.HitTime}"); LogUtil.LogInfo($" Target: {val.Target}"); LogUtil.LogInfo($" OriginPosition: {val.OriginPosition}"); LogUtil.LogInfo($" CollisionPosition: {val.CollisionPosition}"); LogUtil.LogInfo($" CollisionRotation: {val.CollisionRotation}"); LogUtil.LogInfo($" Handled: {val.Handled}"); LogUtil.LogInfo($" Ignore: {val.Ignore}"); LogUtil.LogInfo($" HitGroup: {val.HitGroup}"); LogUtil.LogInfo($" CastIndex: {val.CastIndex}"); LogUtil.LogInfo(" ----"); } } } public static void LogTriggerHitConsume(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<TriggerHitConsume>(entity)) { LogUtil.LogInfo(" TriggerHitConsume [Buffer]:"); DynamicBuffer<TriggerHitConsume> buffer = ((EntityManager)(ref entityManager)).GetBuffer<TriggerHitConsume>(entity, false); for (int i = 0; i < buffer.Length; i++) { TriggerHitConsume val = buffer[i]; LogUtil.LogInfo($" TriggerHitConsume [{i}]"); LogUtil.LogInfo($" SpellCategory: {val.SpellCategory}"); LogUtil.LogInfo($" EventIdIndex: {val.EventIdIndex}"); LogUtil.LogInfo($" EventIdCount: {val.EventIdCount}"); LogUtil.LogInfo(" ----"); } } } public static void LogPlayImpactOnGameplayEvent(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_0152: 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_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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<PlayImpactOnGameplayEvent>(entity)) { LogUtil.LogInfo(" PlayImpactOnGameplayEvent [Buffer]:"); DynamicBuffer<PlayImpactOnGameplayEvent> buffer = ((EntityManager)(ref entityManager)).GetBuffer<PlayImpactOnGameplayEvent>(entity, false); for (int i = 0; i < buffer.Length; i++) { PlayImpactOnGameplayEvent val = buffer[i]; LogUtil.LogInfo($" PlayImpactOnGameplayEvent [{i}]"); LogUtil.LogInfo($" PrimarySequenceGuid: {val.PrimarySequenceGuid}"); LogUtil.LogInfo(" ImpactMappingGuid: " + LookupPrefabName(val.ImpactMappingGuid)); LogUtil.LogInfo($" SkipMaterialSequence: {val.SkipMaterialSequence}"); LogUtil.LogInfo($" RotationOffsetEulerMin: {val.RotationOffsetEulerMin}"); LogUtil.LogInfo($" RotationOffsetEulerMax: {val.RotationOffsetEulerMax}"); LogUtil.LogInfo($" Scale: {val.Scale}"); LogUtil.LogInfo($" SequenceRotationTarget: {val.SequenceRotationTarget}"); LogUtil.LogInfo(" ----"); } } } public static void LogDealDamageOnGameplayEvent(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01d2: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<DealDamageOnGameplayEvent>(entity)) { LogUtil.LogInfo(" DealDamageOnGameplayEvent [Buffer]:"); DynamicBuffer<DealDamageOnGameplayEvent> buffer = ((EntityManager)(ref entityManager)).GetBuffer<DealDamageOnGameplayEvent>(entity, false); for (int i = 0; i < buffer.Length; i++) { DealDamageOnGameplayEvent val = buffer[i]; LogUtil.LogInfo($" DealDamageOnGameplayEvent [{i}]"); LogUtil.LogInfo(" Parameters"); LogUtil.LogInfo($" MaterialModifiers: {val.Parameters.MaterialModifiers}"); LogUtil.LogInfo($" Human: {val.Parameters.MaterialModifiers.Human}"); LogUtil.LogInfo($" Undead: {val.Parameters.MaterialModifiers.Undead}"); LogUtil.LogInfo($" Demon: {val.Parameters.MaterialModifiers.Demon}"); LogUtil.LogInfo($" Mechanical: {val.Parameters.MaterialModifiers.Mechanical}"); LogUtil.LogInfo($" Beast: {val.Parameters.MaterialModifiers.Beast}"); LogUtil.LogInfo($" CastleObject: {val.Parameters.MaterialModifiers.CastleObject}"); LogUtil.LogInfo($" PlayerVampire: {val.Parameters.MaterialModifiers.PlayerVampire}"); LogUtil.LogInfo($" PvEVampire: {val.Parameters.MaterialModifiers.PvEVampire}"); LogUtil.LogInfo($" ShadowVBlood: {val.Parameters.MaterialModifiers.ShadowVBlood}"); LogUtil.LogInfo($" BasicStructure: {val.Parameters.MaterialModifiers.BasicStructure}"); LogUtil.LogInfo($" ReinforcedStructure: {val.Parameters.MaterialModifiers.ReinforcedStructure}"); LogUtil.LogInfo($" FortifiedStructure: {val.Parameters.MaterialModifiers.FortifiedStructure}"); LogUtil.LogInfo($" StoneStructure: {val.Parameters.MaterialModifiers.StoneStructure}"); LogUtil.LogInfo($" SiegeAltar: {val.Parameters.MaterialModifiers.SiegeAltar}"); LogUtil.LogInfo($" Wood: {val.Parameters.MaterialModifiers.Wood}"); LogUtil.LogInfo($" Minerals: {val.Parameters.MaterialModifiers.Minerals}"); LogUtil.LogInfo($" Vegetation: {val.Parameters.MaterialModifiers.Vegetation}"); LogUtil.LogInfo($" LightArmor: {val.Parameters.MaterialModifiers.LightArmor}"); LogUtil.LogInfo($" VBlood: {val.Parameters.MaterialModifiers.VBlood}"); LogUtil.LogInfo($" Magic: {val.Parameters.MaterialModifiers.Magic}"); LogUtil.LogInfo($" Explosives: {val.Parameters.MaterialModifiers.Explosives}"); LogUtil.LogInfo($" MassiveResource: {val.Parameters.MaterialModifiers.MassiveResource}"); LogUtil.LogInfo($" MonsterGate: {val.Parameters.MaterialModifiers.MonsterGate}"); LogUtil.LogInfo($" MainFactor: {val.Parameters.MainFactor}"); LogUtil.LogInfo($" ResourceModifier: {val.Parameters.ResourceModifier}"); LogUtil.LogInfo($" StaggerFactor: {val.Parameters.StaggerFactor}"); LogUtil.LogInfo($" RawDamageValue: {val.Parameters.RawDamageValue}"); LogUtil.LogInfo($" RawDamagePercent: {val.Parameters.RawDamagePercent}"); LogUtil.LogInfo($" DealDamageFlags: {val.Parameters.DealDamageFlags}"); LogUtil.LogInfo($" MainType: {val.Parameters.MainType}"); LogUtil.LogInfo($" DamageModifierPerHit: {val.DamageModifierPerHit}"); LogUtil.LogInfo($" MultiplyMainFactorWithStacks: {val.MultiplyMainFactorWithStacks}"); LogUtil.LogInfo(" ----"); } } } public static void LogGameplayEventListeners(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_00ce: 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_0103: 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_0136: 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_0169: 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_019f: 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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<GameplayEventListeners>(entity)) { LogUtil.LogInfo(" GameplayEventListeners [Buffer]:"); DynamicBuffer<GameplayEventListeners> buffer = ((EntityManager)(ref entityManager)).GetBuffer<GameplayEventListeners>(entity, false); for (int i = 0; i < buffer.Length; i++) { GameplayEventListeners val = buffer[i]; LogUtil.LogInfo($" GameplayEventListeners [{i}]"); LogUtil.LogInfo($" EventIdIndex: {val.EventIdIndex}"); LogUtil.LogInfo($" EventIndexOfType: {val.EventIndexOfType}"); LogUtil.LogInfo($" GameplayEventType: {val.GameplayEventType}"); LogUtil.LogInfo($" GameplayEventId: {val.GameplayEventId}"); LogUtil.LogInfo($" GameplayEventType: {val.GameplayEventId.GameplayEventType}"); LogUtil.LogInfo($" EventId: {val.GameplayEventId.EventId}"); LogUtil.LogInfo(" ----"); } } } public static void LogCreateGameplayEventsOnHit(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<CreateGameplayEventsOnHit>(entity)) { LogUtil.LogInfo(" CreateGameplayEventsOnHit [Buffer]:"); DynamicBuffer<CreateGameplayEventsOnHit> buffer = ((EntityManager)(ref entityManager)).GetBuffer<CreateGameplayEventsOnHit>(entity, false); for (int i = 0; i < buffer.Length; i++) { CreateGameplayEventsOnHit val = buffer[i]; LogUtil.LogInfo($" CreateGameplayEventsOnHit [{i}]"); LogUtil.LogInfo($" EventId: {val.EventId}"); LogUtil.LogInfo($" HitGroup: {val.HitGroup}"); LogUtil.LogInfo($" ColliderCastIndex: {val.ColliderCastIndex}"); LogUtil.LogInfo(" ----"); } } } public static void LogAbilityProjectileFanOnGameplayEvent_DataServer(Entity entity) { //IL_0006: 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_000e: 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_0029: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0379: 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) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<AbilityProjectileFanOnGameplayEvent_DataServer>(entity)) { AbilityProjectileFanOnGameplayEvent_DataServer componentData = ((EntityManager)(ref entityManager)).GetComponentData<AbilityProjectileFanOnGameplayEvent_DataServer>(entity); LogUtil.LogInfo(" AbilityProjectileFanOnGameplayEvent_DataServer:"); LogUtil.LogInfo($" Angle: {componentData.Angle}"); LogUtil.LogInfo($" OffsetAngle: {componentData.OffsetAngle}"); LogUtil.LogInfo($" RandomOffset: {componentData.RandomOffset}"); LogUtil.LogInfo($" IndividualRandom: {componentData.IndividualRandom}"); LogUtil.LogInfo(" NewProjectileEntity: " + LookupPrefabName(componentData.NewProjectileEntity)); LogUtil.LogInfo(" NewProjectileEntityAlternate: " + LookupPrefabName(componentData.NewProjectileEntityAlternate)); LogUtil.LogInfo($" TickCount: {componentData.TickCount}"); LogUtil.LogInfo($" UseOwnerAimDirection: {componentData.UseOwnerAimDirection}"); LogUtil.LogInfo($" SetSpellTargetToSelf: {componentData.SetSpellTargetToSelf}"); LogUtil.LogInfo($" SetSpellTargetToSelfSpellTarget: {componentData.SetSpellTargetToSelfSpellTarget}"); LogUtil.LogInfo($" SetSpellTargetToBuffTarget: {componentData.SetSpellTargetToBuffTarget}"); LogUtil.LogInfo($" SetRandomTargetInRadiusToSpellTarget: {componentData.SetRandomTargetInRadiusToSpellTarget}"); LogUtil.LogInfo($" RandomTargetMaxHeightDiff: {componentData.RandomTargetMaxHeightDiff}"); LogUtil.LogInfo($" RandomSpellTargetHitFilter: {componentData.RandomSpellTargetHitFilter}"); LogUtil.LogInfo($" BoostBuffType: {componentData.BoostBuffType}"); LogUtil.LogInfo($" BoostPerStackCount: {componentData.BoostPerStackCount}"); LogUtil.LogInfo($" BoostPerStackAngle: {componentData.BoostPerStackAngle}"); LogUtil.LogInfo(" BoostPerStackPrefab1: " + LookupPrefabName(componentData.BoostPerStackPrefab1)); LogUtil.LogInfo(" BoostPerStackPrefab2: " + LookupPrefabName(componentData.BoostPerStackPrefab2)); LogUtil.LogInfo(" BoostPerStackPrefab3: " + LookupPrefabName(componentData.BoostPerStackPrefab3)); LogUtil.LogInfo($" OverrideProjectileSpeedMin: {componentData.OverrideProjectileSpeedMin}"); LogUtil.LogInfo($" OverrideProjectileSpeedMax: {componentData.OverrideProjectileSpeedMax}"); } } public static void LogInteractAbilityBuffer(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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_0089: 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_00ea: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<InteractAbilityBuffer>(entity)) { LogUtil.LogInfo(" InteractAbilityBuffer [Buffer]:"); DynamicBuffer<InteractAbilityBuffer> buffer = ((EntityManager)(ref entityManager)).GetBuffer<InteractAbilityBuffer>(entity, false); for (int i = 0; i < buffer.Length; i++) { InteractAbilityBuffer val = buffer[i]; LogUtil.LogInfo($" InteractAbilityBuffer [{i}]"); LogUtil.LogInfo(" Ability: " + LookupPrefabName(val.Ability)); LogUtil.LogInfo($" Importance: {val.Importance}"); LogUtil.LogInfo($" HideInteractHUDWhileCasting: {val.HideInteractHUDWhileCasting}"); LogUtil.LogInfo(" ----"); } } } public static void LogAttachedBuffer(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<AttachedBuffer>(entity)) { LogUtil.LogInfo(" AttachedBuffer [Buffer]:"); DynamicBuffer<AttachedBuffer> buffer = ((EntityManager)(ref entityManager)).GetBuffer<AttachedBuffer>(entity, false); for (int i = 0; i < buffer.Length; i++) { AttachedBuffer val = buffer[i]; LogUtil.LogInfo($" AttachedBuffer [{i}]"); LogUtil.LogInfo(" PrefabGuid: " + LookupPrefabName(val.PrefabGuid)); LogUtil.LogInfo(" ----"); } } } public static void LogCastleTeleporterElement(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0046: 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) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasBuffer<CastleTeleporterElement>(entity)) { LogUtil.LogInfo(" CastleTeleporterElement [Buffer]:"); DynamicBuffer<CastleTeleporterElement> buffer = ((EntityManager)(ref entityManager)).GetBuffer<CastleTeleporterElement>(entity, false); for (int i = 0; i < buffer.Length; i++) { CastleTeleporterElement val = buffer[i]; LogUtil.LogInfo($" CastleTeleporterElement [{i}]"); LogUtil.LogInfo($" Group: {val.Group}"); LogUtil.LogInfo(" ----"); } } } public static void LogSpawnPrefabOnDestroy(Entity entity) { //IL_0006: 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_000e: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<SpawnPrefabOnDestroy>(entity)) { SpawnPrefabOnDestroy componentData = ((EntityManager)(ref entityManager)).GetComponentData<SpawnPrefabOnDestroy>(entity); LogUtil.LogInfo(" SpawnPrefabOnDestroy:"); LogUtil.LogInfo(" SpawnPrefab: " + LookupPrefabName(componentData.SpawnPrefab)); } } public static string LookupPrefabName(Entity entity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Game.EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent<PrefabGUID>(entity)) { return "Entity does not have PrefabGUID component"; } PrefabGUID componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(entity); return LookupPrefabName(componentData); } public static string LookupPrefabName(PrefabGUID prefabGuid) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_008e: 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) PrefabCollectionSystem existingSystemManaged = WorldUtil.Game.GetExistingSystemManaged<PrefabCollectionSystem>(); PrefabLookupMap prefabLookupMap = existingSystemManaged._PrefabLookupMap; NativeParallelHashMap<PrefabGUID, Entity> guidToEntityMap = prefabLookupMap.GuidToEntityMap; if (!guidToEntityMap.ContainsKey(prefabGuid)) { return $"GUID Not Found {prefabGuid._Value}"; } return $"{((PrefabLookupMap)(ref prefabLookupMap)).GetName(prefabGuid)} PrefabGUID({((PrefabGUID)(ref prefabGuid)).GuidHash})"; } } public static class LogUtil { public static ManualLogSource Logger; public static void Init(ManualLogSource logger) { Logger = logger; } public static void LogMessage(object data) { Logger.LogMessage(data); } public static void LogInfo(object data) { Logger.LogInfo(data); } public static void LogDebug(object data) { Logger.LogDebug(data); } public static void LogError(object data) { Logger.LogError(data); } public static void LogWarning(object data) { Logger.LogWarning(data); } } public static class UserUtil { public struct UserModel { public Entity Entity; public User User; } public static List<UserModel> FindAllUsers() { //IL_0006: 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_0011: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; ComponentType val = ComponentType.ReadOnly<User>(); EntityQuery val2 = ((EntityManager)(ref entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[1] { val }); NativeArray<Entity> val3 = ((EntityQuery)(ref val2)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); NativeArray<User> val4 = ((EntityQuery)(ref val2)).ToComponentDataArray<User>(AllocatorHandle.op_Implicit((Allocator)2)); List<UserModel> list = new List<UserModel>(); for (int i = 0; i < val3.Length; i++) { list.Add(new UserModel { Entity = val3[i], User = val4[i] }); } return list; } public static bool TryFindUserByName(string characterName, out UserModel userModel) { //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_0024: Unknown result type (might be due to invalid IL or missing references) foreach (UserModel item in FindAllUsers()) { FixedString64Bytes characterName2 = item.User.CharacterName; if (string.Equals(characterName, ((object)(FixedString64Bytes)(ref characterName2)).ToString(), StringComparison.OrdinalIgnoreCase)) { userModel = item; return true; } } userModel = default(UserModel); return false; } public static bool TryFindUserByPlatformId(ulong platformId, out UserModel userModel) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) foreach (UserModel item in FindAllUsers()) { if (platformId.Equals(item.User.PlatformId)) { userModel = item; return true; } } userModel = default(UserModel); return false; } public static void HaxSetIsAdminForPluginChatCommands(Entity userEntity, bool isAdmin) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; User val = default(User); if (((EntityManager)(ref entityManager)).TryGetComponentData<User>(userEntity, ref val)) { val.IsAdmin = isAdmin; ((EntityManager)(ref entityManager)).SetComponentData<User>(userEntity, val); } } public static bool IsAdminForPluginChatCommands(Entity userEntity) { //IL_0006: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = WorldUtil.Server.EntityManager; User val = default(User); if (((EntityManager)(ref entityManager)).TryGetComponentData<User>(userEntity, ref val)) { return val.IsAdmin; } return false; } } public static class WorldUtil { private static World _clientWorld; private static World _serverWorld; private static ServerBootstrapSystem _serverBootstrapSystem; public static World Server { get { if (_serverWorld != null && _serverWorld.IsCreated) { return _serverWorld; } _serverWorld = GetWorld("Server") ?? throw new Exception("There is no Server world (yet). Did you install a server mod on the client?"); return _serverWorld; } } public static World Client { get { if (_clientWorld != null && _clientWorld.IsCreated) { return _clientWorld; } _clientWorld = GetWorld("Client_0") ?? throw new Exception("There is no Client world (yet). Did you install a client mod on the server?"); return _clientWorld; } } public static World Default => World.DefaultGameObjectInjectionWorld; public static World Game => IsClient ? Client : Server; public static bool IsServer => Application.productName == "VRisingServer"; public static bool IsClient => Application.productName == "VRising"; public static bool IsServerInitialized { get { if (_serverBootstrapSystem == null) { World server = Server; _serverBootstrapSystem = ((server != null) ? server.GetExistingSystemManaged<ServerBootstrapSystem>() : null); } ServerBootstrapSystem serverBootstrapSystem = _serverBootstrapSystem; return serverBootstrapSystem != null && serverBootstrapSystem.ServerIsInitialized; } } public static bool IsGameWorldCreated() { if (_clientWorld != null) { return _clientWorld.IsCreated; } if (_serverWorld != null) { return _serverWorld.IsCreated; } if (IsClient) { return GetWorld("Client_0") != null; } if (IsServer) { return GetWorld("Server") != null; } return false; } private static World GetWorld(string name) { Enumerator<World> enumerator = World.s_AllWorlds.GetEnumerator(); while (enumerator.MoveNext()) { World current = enumerator.Current; if (current.Name == name) { _serverWorld = current; return current; } } return null; } } } namespace ProfuselyViolentProgression.Core.Config { public class BepInExConfigReloader { private ConfigFile _config; private string _filename; private string _absoluteFilePath; private string _absoluteFileDir; private FileSystemWatcher _fileWatcher; public BepInExConfigReloader(ConfigFile config) { _config = config; _absoluteFilePath = config.ConfigFilePath; _absoluteFileDir = Path.GetDirectoryName(_absoluteFilePath); _filename = Path.GetFileName(_absoluteFilePath); InitFileWatcher(); } private void InitFileWatcher() { _fileWatcher = new FileSystemWatcher(_absoluteFileDir); _fileWatcher.Filter = _filename; _fileWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime; _fileWatcher.Changed += HandleConfigFileChanged; _fileWatcher.EnableRaisingEvents = true; } private void HandleConfigFileChanged(object sender, FileSystemEventArgs e) { _config.Reload(); } public void Dispose() { _fileWatcher.Changed -= HandleConfigFileChanged; } } public abstract class ConfigManagerBase<TConfig> : IConfigManager<TConfig> { private string _filename; private string _absoluteFilePath; private string _absoluteFileDir; private FileSystemWatcher _fileWatcher; public string FileName => _filename; public string AbsoluteFilePath => _absoluteFilePath; public string AbsoluteFileDir => _absoluteFileDir; public event Action<TConfig> ConfigUpdated; public ConfigManagerBase(string pluginGUID, string filename) { _filename = filename; _absoluteFileDir = Path.Combine(Paths.ConfigPath, pluginGUID); Directory.CreateDirectory(_absoluteFileDir); _absoluteFilePath = Path.Combine(_absoluteFileDir, filename); InitFileWatcher(); } private void InitFileWatcher() { _fileWatcher = new FileSystemWatcher(AbsoluteFileDir); _fileWatcher.Filter = _filename; _fileWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime; _fileWatcher.Changed += HandleConfigFileChanged; _fileWatcher.EnableRaisingEvents = true; } private void HandleConfigFileChanged(object sender, FileSystemEventArgs e) { if (TryLoadConfig(out var config)) { this.ConfigUpdated?.Invoke(config); } } public void Dispose() { _fileWatcher.Changed -= HandleConfigFileChanged; } public void CreateMainFile_FromResource(string resourceName, bool overwrite = false) { CreateExampleFile_FromResource(resourceName, _filename, overwrite); } public void CreateExampleFile_FromResource(string resourceName, string toFilename, bool overwrite = false) { string path = Path.Combine(AbsoluteFileDir, toFilename); if (!overwrite && File.Exists(path)) { return; } Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream(resourceName); using FileStream destination = File.Create(path); stream.CopyTo(destination); } public abstract bool TryLoadConfig(out TConfig config); } public class ConfigManagerJSON<TConfig> : ConfigManagerBase<TConfig> { private ManualLogSource _log; private JsonSerializerOptions _jsonSerializerOptions = new JsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true, Converters = { (JsonConverter)new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } }; public ConfigManagerJSON(string pluginGUID, string filename, ManualLogSource log) : base(pluginGUID, filename) { _log = log; } public override bool TryLoadConfig([NotNullWhen(true)] out TConfig config) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown try { string json = File.ReadAllText(base.AbsoluteFilePath); config = JsonSerializer.Deserialize<TConfig>(json, _jsonSerializerOptions); return true; } catch (Exception ex) { config = default(TConfig); ManualLogSource log = _log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(16, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error parsing "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(base.AbsoluteFilePath); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } return false; } } public interface IConfigManager<TConfig> { string FileName { get; } string AbsoluteFilePath { get; } string AbsoluteFileDir { get; } event Action<TConfig> ConfigUpdated; bool TryLoadConfig(out TConfig config); void CreateMainFile_FromResource(string resourceName, bool overwrite = false); void CreateExampleFile_FromResource(string resourceName, string toFilename, bool overwrite = false); void Dispose(); } } namespace ProfuselyViolentProgression.LoadoutLockdown { [BepInPlugin("LoadoutLockdown", "LoadoutLockdown", "1.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { private Harmony _harmony; private HookDOTS _hookDOTS; private ConfigEntry<string> RulesetFilename; private ConfigEntry<bool> DebugLogRulings; private BepInExConfigReloader BepInExConfigReloader; private ConfigManagerJSON<LoadoutLockdownConfig> RulesetManager; private bool _initialized = false; private ServerGameSettingsSystem _serverGameSettingsSystem => WorldUtil.Server.GetExistingSystemManaged<ServerGameSettingsSystem>(); public Plugin() { LogUtil.Init(((BasePlugin)this).Log); RulesetFilename = ((BasePlugin)this).Config.Bind<string>("General", "RulesetFilename", "MyRuleset.jsonc", "Filename of the ruleset to apply. Relative to BepInEx/config/LoadoutLockdown/"); DebugLogRulings = ((BasePlugin)this).Config.Bind<bool>("Debug", "LogRulings", false, "Log all rulings made by LoadoutLockdown."); } public override void Load() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown RulingLogger.Enabled = DebugLogRulings.Value; BepInExConfigReloader = new BepInExConfigReloader(((BasePlugin)this).Config); _harmony = new Harmony("LoadoutLockdown"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); _hookDOTS = new HookDOTS("LoadoutLockdown", ((BasePlugin)this).Log); _hookDOTS.RegisterAnnotatedHooks(); ResetRulesetManager(); string text = "ProfuselyViolentProgression.LoadoutLockdown.resources.presets"; RulesetManager.CreateMainFile_FromResource(text + ".Default.jsonc"); RulesetManager.CreateExampleFile_FromResource(text + ".Default.jsonc", "Example_Default.jsonc", overwrite: true); RulesetManager.CreateExampleFile_FromResource(text + ".FishersFantasy.jsonc", "Example_FishersFantasy.jsonc", overwrite: true); RulesetManager.CreateExampleFile_FromResource(text + ".CrutchersCrucible.jsonc", "Example_CrutchersCrucible.jsonc", overwrite: true); RulesetManager.CreateExampleFile_FromResource(text + ".SweatlordsSwag.jsonc", "Example_SweatlordsSwag.jsonc", overwrite: true); Hooks.EarlyUpdateGroup_Updated += OnEarlyUpdate; RulesetFilename.SettingChanged += HandleRulesetFilenameChanged; DebugLogRulings.SettingChanged += HandleDebugLogRulingsChanged; CommandRegistry.RegisterAll(); ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("LoadoutLockdown"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.2.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!"); } log.LogInfo(val); } public override bool Unload() { CommandRegistry.UnregisterAssembly(); BepInExConfigReloader?.Dispose(); Hooks.EarlyUpdateGroup_Updated -= OnEarlyUpdate; RulesetFilename.SettingChanged -= HandleRulesetFilenameChanged; DebugLogRulings.SettingChanged -= HandleDebugLogRulingsChanged; _hookDOTS.Dispose(); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } if (RulesetManager != null) { RulesetManager.ConfigUpdated -= HandleRulesetChanged; RulesetManager.Dispose(); } return true; } public void OnEarlyUpdate() { if (!_initialized && WorldUtil.IsServerInitialized) { _initialized = true; ReloadRuleset(); } } public void HandleDebugLogRulingsChanged(object sender, EventArgs e) { RulingLogger.Enabled = DebugLogRulings.Value; if (RulingLogger.Enabled) { LogUtil.LogInfo("LogRulings is now enabled."); } else { LogUtil.LogInfo("LogRulings is now disabled."); } } public void HandleRulesetChanged(LoadoutLockdownConfig config) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (_initialized) { ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Reloading ruleset "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(RulesetFilename.Value); } log.LogMessage(val); ResetLoadoutService(config); } } private void HandleRulesetFilenameChanged(object sender, EventArgs e) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Switching ruleset to "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(RulesetFilename.Value); } log.LogMessage(val); ResetRulesetManager(); if (_initialized) { ReloadRuleset(); } } public void ResetRulesetManager() { if (RulesetManager != null) { RulesetManager.ConfigUpdated -= HandleRulesetChanged; RulesetManager.Dispose(); } RulesetManager = new ConfigManagerJSON<LoadoutLockdownConfig>("LoadoutLockdown", RulesetFilename.Value, ((BasePlugin)this).Log); RulesetManager.ConfigUpdated += HandleRulesetChanged; } private void ReloadRuleset() { if (!RulesetManager.TryLoadConfig(out var config)) { ((BasePlugin)this).Log.LogWarning((object)"Failed to load ruleset. Falling back to vanilla behaviour."); LoadoutLockdownService.Instance = null; } else { ResetLoadoutService(config); } } private void ResetLoadoutService(LoadoutLockdownConfig config) { LoadoutLockdownService.Instance = new LoadoutLockdownService(config); _serverGameSettingsSystem._Settings.WeaponSlots = (byte)config.WeaponSlots; } } [HarmonyPatch] public static class Hooks { public static event Action EarlyUpdateGroup_Updated; [EcsSystemUpdatePostfix(typeof(EarlyUpdateGroup), false)] public static void EarlyUpdateGroup_Postfix() { Hooks.EarlyUpdateGroup_Updated?.Invoke(); } } internal class LoadoutLockdownService { public static LoadoutLockdownService Instance; private LoadoutLockdownConfig _config; private HashSet<PrefabGUID> _forbiddenByPrefab = new HashSet<PrefabGUID>(); private HashSet<PrefabGUID> _notWaste = new HashSet<PrefabGUID>(); private HashSet<PrefabGUID> _alwaysAllowSwapIntoSlot = new HashSet<PrefabGUID>(); private Dictionary<string, PrefabGUID> _spawnablePrefabLookup; private static HashSet<EquipmentType> EquipmentTypesWithDesignatedSlot = new HashSet<EquipmentType> { (EquipmentType)10, (EquipmentType)8, (EquipmentType)0, (EquipmentType)3, (EquipmentType)1, (EquipmentType)5, (EquipmentType)9, (EquipmentType)4 }; public static AssetGuid SCTMessage_Nope = AssetGuid.FromString("7114de17-65b2-4e69-8723-79f8b33b2213"); public static AssetGuid SCTMessage_Disabled = AssetGuid.FromString("3bf7e066-4e49-4ae4-b7a3-6703b7a15dc1"); public static AssetGuid SCTMessage_CannotModifyActionBarWhilePVP = AssetGuid.FromString("1b032d4c-f114-429b-ad7c-43c2cd23262a"); public static AssetGuid SCTMessage_NoFreeActionBarSlots = AssetGuid.FromString("8e2de316-22d6-4088-b23f-9084af440171"); public static float3 ColorRed = new float3(255f, 0f, 0f); private static HashSet<EquipmentType> EquipmentTypesToUnequipIfForbidden = new HashSet<EquipmentType> { (EquipmentType)10, (EquipmentType)8, (EquipmentType)0, (EquipmentType)3, (EquipmentType)1, (EquipmentType)5, (EquipmentType)9, (EquipmentType)4, (EquipmentType)2 }; private static PrefabGUID Buff_InCombat = new PrefabGUID(581443919); private EntityManager EntityManager => WorldUtil.Server.EntityManager; private EndSimulationEntityCommandBufferSystem EndSimulationEntityCommandBufferSystem => WorldUtil.Server.GetExistingSystemManaged<EndSimulationEntityCommandBufferSystem>(); private static NativeParallelHashMap<PrefabGUID, ItemData> ItemHashLookupMap => WorldUtil.Server.GetExistingSystemManaged<GameDataSystem>().ItemHashLookupMap; private static ServerScriptMapper ServerScriptMapper => WorldUtil.Server.GetExistingSystemManaged<ServerScriptMapper>(); private static ServerRootPrefabCollection ServerRootPrefabCollection => ((ComponentSystemBase)ServerScriptMapper).GetSingleton<ServerRootPrefabCollection>(); private static NetworkIdLookupMap NetworkIdLookupMap => ((ComponentSystemBase)ServerScriptMapper).GetSingleton<Singleton>()._NetworkIdLookupMap; private int _maxWeaponSlotIndex => _config.WeaponSlots - 1; public int WeaponSlots => _config.WeaponSlots; private Dictionary<string, PrefabGUID> SpawnablePrefabLookup { get { if (_spawnablePrefabLookup == null) { PrefabCollectionSystem existingSystemManaged = WorldUtil.Server.GetExistingSystemManaged<PrefabCollectionSystem>(); _spawnablePrefabLookup = existingSystemManaged.SpawnableNameToPrefabGuidDictionary; } return _spawnablePrefabLookup; } } public LoadoutLockdownService(LoadoutLockdownConfig config) { _config = config; InitForbiddenByPrefab(); InitNotWaste(); InitAlwaysAllowSwapIntoSlot(); } private void InitForbiddenByPrefab() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) PrefabGUID item = default(PrefabGUID); foreach (string item2 in _config.ForbiddenByPrefab) { if (SpawnablePrefabLookup.TryGetValue(item2, ref item)) { _forbiddenByPrefab.Add(item); } else { LogUtil.LogWarning("Unrecognized prefab in ForbiddenByPrefab: " + item2); } } } private void InitNotWaste() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) PrefabGUID item = default(PrefabGUID); foreach (string item2 in _config.NotWaste) { if (SpawnablePrefabLookup.TryGetValue(item2, ref item)) { _notWaste.Add(item); } else { LogUtil.LogWarning("Unrecognized prefab in NotWaste: " + item2); } } } private void InitAlwaysAllowSwapIntoSlot() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) PrefabGUID item = default(PrefabGUID); foreach (string item2 in _config.AlwaysAllowSwapIntoSlot) { if (SpawnablePrefabLookup.TryGetValue(item2, ref item)) { if (_forbiddenByPrefab.Contains(item)) { LogUtil.LogWarning(item2 + " was removed from AlwaysAllowSwapIntoSlot, because it is ForbiddenByPrefab."); } else { _alwaysAllowSwapIntoSlot.Add(item); } } else { LogUtil.LogWarning("Unrecognized prefab in AlwaysAllowSwapIntoSlot: " + item2); } } } public bool IsEquipmentForbidden(Entity entity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_001f: 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_0028: 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_002e: 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_0053: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0088: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent<EquippableData>(entity)) { return false; } entityManager = EntityManager; EquippableData componentData = ((EntityManager)(ref entityManager)).GetComponentData<EquippableData>(entity); if (TryFindForbiddable(componentData, out var forbiddable) && forbiddable.Forbidden) { return true; } entityManager = EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent<PrefabGUID>(entity)) { return false; } entityManager = EntityManager; PrefabGUID componentData2 = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(entity); return _forbiddenByPrefab.Contains(componentData2); } public bool IsEquippableWithoutSlot(Entity entity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent<EquippableData>(entity)) { return false; } entityManager = EntityManager; EquippableData componentData = ((EntityManager)(ref entityManager)).GetComponentData<EquippableData>(entity); if (TryFindEquippableToHotBarRules(componentData, out var rules)) { return !rules.RequiresHotbarSlot; } return false; } public bool HasDesignatedSlot(Entity entity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent<EquippableData>(entity)) { return false; } entityManager = EntityManager; EquippableData componentData = ((EntityManager)(ref entityManager)).GetComponentData<EquippableData>(entity); return EquipmentTypesWithDesignatedSlo