using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.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.BoneBanditBrandHit.Services;
using ProfuselyViolentProgression.BoneBanditBrandHits.Services;
using ProfuselyViolentProgression.Core.Utilities;
using ProjectM;
using ProjectM.CastleBuilding;
using ProjectM.Gameplay.Scripting;
using ProjectM.Network;
using ProjectM.Scripting;
using ProjectM.Shared;
using Stunlock.Core;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
[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("Prevent newly awakened (PvP protected) players from looting death containers which don't belong to their clan.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+4c45fffbb52c8f84e43cdaf23c99b93aec73cc33")]
[assembly: AssemblyProduct("BoneBanditBrandHit")]
[assembly: AssemblyTitle("BoneBanditBrandHit")]
[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.BoneBanditBrandHits.Services
{
public class NotificationService
{
private SCTService _SCTService;
private Dictionary<Entity, DateTime> _lastChatNotifications = new Dictionary<Entity, DateTime>();
private TimeSpan _chatNotificationCooldown = new TimeSpan(0, 0, 30);
private EntityManager _entityManager;
public NotificationService(ref EntityManager entityManager, SCTService SCTService)
{
//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)
_entityManager = entityManager;
_SCTService = SCTService;
}
public void NotifyDeathContainerAccessDenied(Entity character, Entity deathContainerEntity)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//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)
PlayerCharacter val = default(PlayerCharacter);
User user = default(User);
if (((EntityManager)(ref _entityManager)).TryGetComponentData<PlayerCharacter>(character, ref val) && ((EntityManager)(ref _entityManager)).TryGetComponentData<User>(val.UserEntity, ref user))
{
SendSCTMessage(character, deathContainerEntity);
SendChatNotification(character, user);
}
}
private void SendSCTMessage(Entity character, Entity deathContainerEntity)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
float3 value = ((EntityManager)(ref _entityManager)).GetComponentData<Translation>(deathContainerEntity).Value;
float3 worldPosition = value - new float3(0f, 1f, 0f);
_SCTService.CreateSCTMessage(worldPosition, character, SCTService.SCTMessage_MissingOwnership, SCTService.ColorDarkRed);
}
private void SendChatNotification(Entity character, User user)
{
//IL_0002: 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_0023: Unknown result type (might be due to invalid IL or missing references)
if (!IsChatNotificationOnCooldown(character))
{
string message = "While PvP protected, you cannot loot death containers which don't belong to your clan.";
ChatUtil.SendSystemMessageToClient(user, message);
_lastChatNotifications[character] = DateTime.Now;
}
}
private bool IsChatNotificationOnCooldown(Entity character)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
if (_lastChatNotifications.TryGetValue(character, out var value))
{
DateTime dateTime = value + _chatNotificationCooldown;
if (DateTime.Now <= dateTime)
{
return true;
}
}
return false;
}
}
}
namespace ProfuselyViolentProgression.BoneBanditBrandHit
{
[BepInPlugin("BoneBanditBrandHit", "BoneBanditBrandHit", "1.0.0")]
[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_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Expected O, but got Unknown
LogUtil.Init(((BasePlugin)this).Log);
_harmony = new Harmony("BoneBanditBrandHit");
_harmony.PatchAll(Assembly.GetExecutingAssembly());
_hookDOTS = new HookDOTS("BoneBanditBrandHit", ((BasePlugin)this).Log);
_hookDOTS.RegisterAnnotatedHooks();
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>("BoneBanditBrandHit");
((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;
_hookDOTS.Dispose();
Harmony harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
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 SCTService SCTService { get; private set; }
public static NotificationService NotificationService { get; private set; }
public static ServerGameManager FetchServerGameManager()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return ServerScriptMapper.GetServerGameManager();
}
public static void Initialize(ManualLogSource log)
{
//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)
IsInitialized = true;
EntityManager entityManager = WorldUtil.Server.EntityManager;
ServerScriptMapper = WorldUtil.Server.GetExistingSystemManaged<ServerScriptMapper>();
SCTService = new SCTService(ref entityManager);
NotificationService = new NotificationService(ref entityManager, SCTService);
}
public static void Dispose()
{
if (IsInitialized)
{
IsInitialized = false;
}
}
}
[HarmonyPatch]
public static class Hooks
{
public static event Action EarlyUpdateGroup_Updated;
[EcsSystemUpdatePostfix(typeof(EarlyUpdateGroup), false)]
public static void EarlyUpdateGroup_Postfix()
{
Hooks.EarlyUpdateGroup_Updated?.Invoke();
}
}
public static class PrefabGuids
{
public static PrefabGUID Buff_General_PvPProtected = new PrefabGUID(1111481396);
public static PrefabGUID Resource_PlayerDeathContainer_Drop = new PrefabGUID(-1167134977);
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "BoneBanditBrandHit";
public const string PLUGIN_NAME = "BoneBanditBrandHit";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace ProfuselyViolentProgression.BoneBanditBrandHit.Services
{
public class SCTService
{
private EntityManager _entityManager;
public static AssetGuid SCTMessage_Nope = AssetGuid.FromString("7114de17-65b2-4e69-8723-79f8b33b2213");
public static AssetGuid SCTMessage_Disabled = AssetGuid.FromString("3bf7e066-4e49-4ae4-b7a3-6703b7a15dc1");
public static AssetGuid SCTMessage_MissingOwnership = AssetGuid.FromString("3c901e55-974d-4aa2-862e-1f63da340dc7");
public static AssetGuid SCTMessage_MissingResources = AssetGuid.FromString("8cccca3d-97da-412e-a527-a6e9ebef54fb");
public static float3 ColorRed = new float3(1f, 0f, 0f);
public static float3 ColorDarkRed = new float3(0.9f, 0f, 0f);
public SCTService(ref EntityManager entityManager)
{
//IL_000a: 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)
_entityManager = entityManager;
}
public void CreateSCTMessage(Entity character, AssetGuid messageGuid, float3 color)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
Translation componentData = ((EntityManager)(ref _entityManager)).GetComponentData<Translation>(character);
CreateSCTMessage(componentData.Value, character, messageGuid, color);
}
public void CreateSCTMessage(float3 worldPosition, Entity character, AssetGuid messageGuid, float3 color)
{
//IL_0004: 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_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: 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_0027: 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_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
EntityCommandBuffer val = default(EntityCommandBuffer);
((EntityCommandBuffer)(ref val))..ctor(AllocatorHandle.op_Implicit((Allocator)2));
ScrollingCombatTextMessage.Create(_entityManager, val, messageGuid, worldPosition, color, character, 0f, default(PrefabGUID), default(Entity));
((EntityCommandBuffer)(ref val)).Playback(_entityManager);
}
public void SendMessageNope(Entity character)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
CreateSCTMessage(character, SCTMessage_Nope, ColorRed);
}
public void SendMessageMissingOwnership(Entity character)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
CreateSCTMessage(character, SCTMessage_MissingOwnership, ColorRed);
}
}
}
namespace ProfuselyViolentProgression.BoneBanditBrandHit.Patches
{
[HarmonyPatch]
public static class AbilityCastPatches
{
private static EntityManager _entityManager = WorldUtil.Server.EntityManager;
[HarmonyPatch(typeof(AbilityRunScriptsSystem), "OnUpdate")]
[HarmonyPrefix]
public static void AbilityRunScriptsSystem_Prefix(AbilityRunScriptsSystem __instance)
{
//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)
if (Core.IsInitialized)
{
ServerGameManager serverGameManager = Core.FetchServerGameManager();
ProcessQuery_OnCastStarted(__instance, ref serverGameManager);
}
}
private static void ProcessQuery_OnCastStarted(AbilityRunScriptsSystem __instance, ref ServerGameManager serverGameManager)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: 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_0035: Unknown result type (might be due to invalid IL or missing references)
EntityQuery onCastStartedQuery = __instance._OnCastStartedQuery;
NativeArray<Entity> val = ((EntityQuery)(ref onCastStartedQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
NativeArray<AbilityCastStartedEvent> val2 = ((EntityQuery)(ref onCastStartedQuery)).ToComponentDataArray<AbilityCastStartedEvent>(AllocatorHandle.op_Implicit((Allocator)2));
for (int i = 0; i < val2.Length; i++)
{
OnCastStarted(ref serverGameManager, val[i], val2[i]);
}
}
private static void OnCastStarted(ref ServerGameManager serverGameManager, Entity entity, AbilityCastStartedEvent ev)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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)
//IL_003e: Invalid comparison between Unknown and I4
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
AbilityTarget val = default(AbilityTarget);
if (((EntityManager)(ref _entityManager)).HasComponent<PlayerCharacter>(ev.Character) && ((EntityManager)(ref _entityManager)).TryGetComponentData<AbilityTarget>(ev.Ability, ref val) && (int)val.GetTargetType == 0 && ((EntityManager)(ref _entityManager)).HasComponent<PlayerDeathContainer>(val.Target._Entity))
{
Handle_StartOpeningDeathContainer(ref serverGameManager, ev.Character, val.Target._Entity);
}
}
private static void Handle_StartOpeningDeathContainer(ref ServerGameManager serverGameManager, Entity character, Entity container)
{
//IL_0006: 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_003e: Unknown result typ