Decompiled source of PalacePrivileges v1.0.0
PalacePrivileges.dll
Decompiled 2 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; 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.Collections.Generic; using Microsoft.CodeAnalysis; using ProfuselyViolentProgression.Core.Utilities; using ProfuselyViolentProgression.PalacePrivileges.Commands; using ProfuselyViolentProgression.PalacePrivileges.Models; using ProfuselyViolentProgression.PalacePrivileges.Services; using ProjectM; using ProjectM.CastleBuilding; using ProjectM.CastleBuilding.Placement; using ProjectM.CastleBuilding.Rebuilding; using ProjectM.Contest.Arena; using ProjectM.Gameplay; using ProjectM.Gameplay.Scripting; using ProjectM.Gameplay.Systems; using ProjectM.Network; using ProjectM.Scripting; using ProjectM.Shared; using ProjectM.Terrain; using ProjectM.Tiles; 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("Safely clan up for PvP! Restricts what clan members can do in your castle. Grant more privileges via chat commands.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+92f6944bf479b804adb236220b1349b4b95f6b85")] [assembly: AssemblyProduct("PalacePrivileges")] [assembly: AssemblyTitle("PalacePrivileges")] [assembly: AssemblyMetadata("Reloadable", "True")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.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.PalacePrivileges { [BepInPlugin("PalacePrivileges", "PalacePrivileges", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { private Harmony _harmony; private HookDOTS _hookDOTS; public override void Load() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown LogUtil.Init(((BasePlugin)this).Log); _harmony = new Harmony("PalacePrivileges"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); _hookDOTS = new HookDOTS("PalacePrivileges", ((BasePlugin)this).Log); _hookDOTS.RegisterAnnotatedHooks(); CommandRegistry.RegisterAll(); Hooks.EarlyUpdateGroup_Updated += OnEarlyUpdate; 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>("PalacePrivileges"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!"); } log.LogInfo(val); } public override bool Unload() { Hooks.EarlyUpdateGroup_Updated -= OnEarlyUpdate; CommandRegistry.UnregisterAssembly(); _hookDOTS.Dispose(); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } Core.Save(); Core.Dispose(); return true; } public void OnEarlyUpdate() { if (!Core.IsInitialized && WorldUtil.IsServerInitialized) { Core.Initialize(((BasePlugin)this).Log); } } } public static class Core { public static bool IsInitialized { get; private set; } public static ServerScriptMapper ServerScriptMapper { get; private set; } public static ServerGameManager ServerGameManager => ServerScriptMapper.GetServerGameManager(); public static SingletonService SingletonService { get; private set; } public static SCTService SCTService { get; private set; } public static UserService UserService { get; private set; } public static AntiCheatService AntiCheatService { get; private set; } public static CastleTerritoryService CastleTerritoryService { get; private set; } public static CastleService CastleService { get; private set; } public static CastleDoorService CastleDoorService { get; private set; } public static BuildingService BuildingService { get; private set; } public static GardenService GardenService { get; private set; } public static PrisonService PrisonService { get; private set; } public static PrivilegeParser PrivilegeParser { get; private set; } public static GlobalSettingsService GlobalSettingsService { get; private set; } public static CastlePrivilegesService CastlePrivilegesService { get; private set; } public static RestrictionService RestrictionService { get; private set; } public static RulingLoggerService RulingLoggerService { get; private set; } public static NotificationService NotificationService { get; private set; } public static void Initialize(ManualLogSource log) { IsInitialized = true; ServerScriptMapper = WorldUtil.Server.GetExistingSystemManaged<ServerScriptMapper>(); SingletonService = new SingletonService(); SCTService = new SCTService(); UserService = new UserService(); AntiCheatService = new AntiCheatService(log); CastleTerritoryService = new CastleTerritoryService(); CastleService = new CastleService(log, UserService); CastleDoorService = new CastleDoorService(CastleService); BuildingService = new BuildingService(); GardenService = new GardenService(); PrisonService = new PrisonService(); PrivilegeParser = new PrivilegeParser(); GlobalSettingsService = new GlobalSettingsService(log, new GlobalSettingsRepository(log, "PalacePrivileges", "GlobalSettings.json")); GlobalSettingsService.LoadSettings(); GlobalSettingsService.GlobalSettingsChanged += HandleGlobalSettingsChanged; CastlePrivilegesService = new CastlePrivilegesService(log, new PlayerSettingsRepository(log, "PalacePrivileges", "PlayerSettings")); CastlePrivilegesService.LoadSettings(); Hooks.BeforeWorldSave += CastlePrivilegesService.SaveSettings; RulingLoggerService = new RulingLoggerService(log); RulingLoggerService.Enabled = GlobalSettingsService.GetGlobalSettings().DebugLogRulings; RestrictionService = new RestrictionService(log, GlobalSettingsService, CastlePrivilegesService, UserService, AntiCheatService, RulingLoggerService, CastleService, CastleDoorService, GardenService, PrisonService); NotificationService = new NotificationService(SCTService); } public static void Dispose() { if (IsInitialized) { IsInitialized = false; GlobalSettingsService.GlobalSettingsChanged -= HandleGlobalSettingsChanged; Hooks.BeforeWorldSave -= CastlePrivilegesService.SaveSettings; } } public static void Save() { GlobalSettingsService?.SaveSettings(); CastlePrivilegesService?.SaveSettings(); } public static void HandleGlobalSettingsChanged(GlobalSettings newSettings) { RulingLoggerService.Enabled = newSettings.DebugLogRulings; } } [HarmonyPatch] public static class Hooks { public static event Action EarlyUpdateGroup_Updated; public static event Action BeforeWorldSave; [EcsSystemUpdatePostfix(typeof(EarlyUpdateGroup), false)] public static void EarlyUpdateGroup_Postfix() { Hooks.EarlyUpdateGroup_Updated?.Invoke(); } [HarmonyPatch(typeof(TriggerPersistenceSaveSystem), "TriggerSave")] [HarmonyPrefix] public static void TriggerSave_Prefix() { Hooks.BeforeWorldSave?.Invoke(); } } public static class PrefabGuids { public static PrefabGUID AB_Interact_OpenContainer_Cast = new PrefabGUID(-305054665); public static PrefabGUID TM_Stash_Chest_SafetyBox = new PrefabGUID(1842080060); public static PrefabGUID AB_Interact_UseMusicPlayerStation_Cast = new PrefabGUID(1522881987); public static PrefabGUID AB_Interact_UseWorkstation_Cast = new PrefabGUID(434360908); public static PrefabGUID AB_Interact_UseStables_Cast = new PrefabGUID(-587833951); public static PrefabGUID AB_Interact_UseInventoryRouteStation_Cast = new PrefabGUID(1081392595); public static PrefabGUID AB_Interact_ArenaStation_Cast = new PrefabGUID(1623165510); public static PrefabGUID AB_Interact_Throne_Cast = new PrefabGUID(1832821794); public static PrefabGUID TM_Castle_Wall_Door_Metal_Wide_Tier02_Standard = new PrefabGUID(-1378161357); public static PrefabGUID TM_Castle_Wall_Door_Metal_Wide_Tier02_ServantLock = new PrefabGUID(809177531); public static PrefabGUID TM_Castle_Wall_Door_Wood_Wide_Tier02_Standard = new PrefabGUID(1407457927); public static PrefabGUID TM_Castle_Wall_Door_Wood_Wide_Tier02_ServantLock = new PrefabGUID(1790947395); public static PrefabGUID TM_Castle_Fence_IronGate01 = new PrefabGUID(-448001608); public static PrefabGUID TM_Castle_Fence_IronGate02 = new PrefabGUID(-1921424515); public static PrefabGUID TM_Castle_Fence_IronGate03 = new PrefabGUID(-663581951); public static PrefabGUID TM_Castle_Fence_WoodGate01 = new PrefabGUID(2114550113); public static PrefabGUID TM_Castle_Fence_WoodGate02 = new PrefabGUID(-191378828); public static PrefabGUID TM_Castle_Fence_StableGate01 = new PrefabGUID(1997273288); public static PrefabGUID TM_Castle_Fence_ProjectK01_Gate = new PrefabGUID(155733373); public static PrefabGUID TM_Castle_Wall_Door_Palisade_Tier01 = new PrefabGUID(-1259825508); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard = new PrefabGUID(-1462717684); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_ServantLock = new PrefabGUID(1325579315); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard01_Standard = new PrefabGUID(-1720487003); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard01_ServantLock = new PrefabGUID(661164434); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard02 = new PrefabGUID(163814050); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard02_ServantLock = new PrefabGUID(-324390719); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard03_Standard = new PrefabGUID(-183045232); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_Standard03_ServantLock = new PrefabGUID(1671467399); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_DLC01Variant_Standard = new PrefabGUID(1690783957); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_DLC01Variant_ServantLock = new PrefabGUID(2063389605); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_DLC02Variant_Standard = new PrefabGUID(-1872077746); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_DLC02Variant_ServantLock = new PrefabGUID(214726352); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_ProjectK01Variant_Standard = new PrefabGUID(-1725918454); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_ProjectK01Variant_ServantLock = new PrefabGUID(423018316); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_ProjectK02Variant_Standard = new PrefabGUID(1362023808); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_ProjectK02Variant_ServantLock = new PrefabGUID(1523490679); public static PrefabGUID TM_Castle_Wall_Door_Tier02_PrisonStyle01_Standard = new PrefabGUID(-1615530056); public static PrefabGUID TM_Castle_Wall_Door_Tier02_PrisonStyle01_ServantLock = new PrefabGUID(-2120778385); public static PrefabGUID TM_Castle_Wall_Door_Tier02_PrisonStyle02_Standard = new PrefabGUID(-29749970); public static PrefabGUID TM_Castle_Wall_Door_Tier02_PrisonStyle02_ServantLock = new PrefabGUID(1031154600); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_StrongbladeDLC01Variant_Standard = new PrefabGUID(-1441209695); public static PrefabGUID TM_Castle_Wall_Door_Wood_Tier02_StrongbladeDLC01Variant_ServantLock = new PrefabGUID(1394627606); public static PrefabGUID BP_Castle_Chain_Plant_BloodRose = new PrefabGUID(-591319789); public static PrefabGUID BP_Castle_Chain_Plant_FireBlossom = new PrefabGUID(1141816596); public static PrefabGUID BP_Castle_Chain_Plant_SnowFlower = new PrefabGUID(-1475317620); public static PrefabGUID BP_Castle_Chain_Plant_HellsClarion = new PrefabGUID(-1946047422); public static PrefabGUID BP_Castle_Chain_Plant_MourningLily = new PrefabGUID(-1057579736); public static PrefabGUID BP_Castle_Chain_Plant_Sunflower = new PrefabGUID(1659865297); public static PrefabGUID BP_Castle_Chain_Plant_Lotus = new PrefabGUID(1230409568); public static PrefabGUID BP_Castle_Chain_Plant_Grapes = new PrefabGUID(-486047789); public static PrefabGUID BP_Castle_Chain_Plant_BleedingHeart = new PrefabGUID(-1473915226); public static PrefabGUID BP_Castle_Chain_Plant_CorruptedFlower = new PrefabGUID(1655131947); public static PrefabGUID BP_Castle_Chain_Plant_GhostShroom = new PrefabGUID(-947749857); public static PrefabGUID BP_Castle_Chain_Plant_Cotton = new PrefabGUID(1171326100); public static PrefabGUID BP_Castle_Chain_Plant_TrippyShroom = new PrefabGUID(1228922848); public static PrefabGUID BP_Castle_Chain_Plant_Thistle = new PrefabGUID(-437194426); public static PrefabGUID BP_Castle_Chain_Tree_Spruce_01 = new PrefabGUID(1218240817); public static PrefabGUID BP_Castle_Chain_Tree_Cypress_01 = new PrefabGUID(308236778); public static PrefabGUID BP_Castle_Chain_Tree_Aspen_01 = new PrefabGUID(-683262945); public static PrefabGUID BP_Castle_Chain_Tree_AspenAutum_01 = new PrefabGUID(1072528933); public static PrefabGUID BP_Castle_Chain_Tree_Birch_01 = new PrefabGUID(-355620152); public static PrefabGUID BP_Castle_Chain_Tree_BirchAutum_01 = new PrefabGUID(500254158); public static PrefabGUID BP_Castle_Chain_Tree_AppleTree_01 = new PrefabGUID(-1362642773); public static PrefabGUID BP_Castle_Chain_Tree_AppleCursed_01 = new PrefabGUID(-315187808); public static PrefabGUID BP_Castle_Chain_Tree_GloomTree_01 = new PrefabGUID(-1523660086); public static PrefabGUID BP_Castle_Chain_Tree_CherryBlossomWhite_01 = new PrefabGUID(148077443); public static PrefabGUID BP_Castle_Chain_Tree_CherryBlossom_01 = new PrefabGUID(1646702119); public static PrefabGUID BP_Castle_Chain_Tree_Oak_01 = new PrefabGUID(75711340); public static PrefabGUID TM_Workstation_Waypoint_Castle = new PrefabGUID(-1348294483); public static PrefabGUID AB_Interact_UseWaypoint_Castle_Cast = new PrefabGUID(-1252882299); public static PrefabGUID AB_Interact_LocalCastleTeleport_Red_Cast = new PrefabGUID(-1644954585); public static PrefabGUID AB_Interact_LocalCastleTeleport_Yellow_Cast = new PrefabGUID(-211215583); public static PrefabGUID AB_Interact_LocalCastleTeleport_Blue_Cast = new PrefabGUID(-155879739); public static PrefabGUID TM_Castle_LocalTeleporter_Red = new PrefabGUID(1326023321); public static PrefabGUID TM_Castle_LocalTeleporter_Yellow = new PrefabGUID(1579702125); public static PrefabGUID TM_Castle_LocalTeleporter_Purple = new PrefabGUID(2027471241); public static PrefabGUID TM_Castle_LocalTeleporter_Blue = new PrefabGUID(760696617); public static PrefabGUID AB_Interact_UseResearchstation_Cast = new PrefabGUID(-83188602); public static PrefabGUID TM_ResearchStation_T01 = new PrefabGUID(-495424062); public static PrefabGUID TM_ResearchStation_T02 = new PrefabGUID(-1292809886); public static PrefabGUID TM_ResearchStation_T03 = new PrefabGUID(-1262194203); public static PrefabGUID TM_StygianAltar_Passive_T01 = new PrefabGUID(-1938449679); public static PrefabGUID Recipe_Consumable_PrisonPotion = new PrefabGUID(1839006118); public static PrefabGUID Recipe_Consumable_PrisonPotion_Bloodwine = new PrefabGUID(1930190516); public static PrefabGUID Recipe_Misc_ExtractEssencePrisoner = new PrefabGUID(1716338316); public static PrefabGUID Recipe_Misc_FeedPrisoner_Rat = new PrefabGUID(1469101010); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_FatGoby = new PrefabGUID(-2047246570); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_RainbowTrout = new PrefabGUID(-1206171767); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_FierceStinger = new PrefabGUID(-37587809); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_TwilightSnapper = new PrefabGUID(-252411567); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_SageFish = new PrefabGUID(1800570390); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_BloodSnapper = new PrefabGUID(956953141); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_SwampDweller = new PrefabGUID(-460272822); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_GoldenRiverBass = new PrefabGUID(1816434122); public static PrefabGUID Recipe_Misc_FeedPrisoner_Fish_Corrupted = new PrefabGUID(493259323); public static PrefabGUID Recipe_Misc_FeedPrisoner_IrradiantGruel = new PrefabGUID(-279936313); } public static class MyPluginInfo { public const string PLUGIN_GUID = "PalacePrivileges"; public const string PLUGIN_NAME = "PalacePrivileges"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace ProfuselyViolentProgression.PalacePrivileges.Services { public class GlobalSettingsRepository { private readonly string _filePath; private readonly ManualLogSource _log; private GlobalSettings _globalSettings; private int _revision = 0; private int _revisionSaved = 0; public GlobalSettingsRepository(ManualLogSource log, string pluginGUID, string filename) { string fullPath = Path.GetFullPath(Path.Combine(Paths.ConfigPath, "..\\")); string text = Path.Combin