Beispiel #1
0
        private static void OnActorComponentBeginPlay(IntPtr address)
        {
            UObject obj = GCHelper.Find(address);

            IntPtr original = actorComponentBeginPlay.GetOriginal(obj);

            Native_VTableHacks.CallOriginal_ActorComponentBeginPlay(original, address);

            obj.BeginPlayInternal();
        }
Beispiel #2
0
        private static void OnSetupPlayerInputComponent(IntPtr address, IntPtr inputComponentAddress)
        {
            UObject obj = GCHelper.Find(address);

            IntPtr original = setupPlayerInput.GetOriginal(obj);

            Native_VTableHacks.CallOriginal_SetupPlayerInputComponent(original, address, inputComponentAddress);

            obj.SetupPlayerInputComponent(inputComponentAddress);
        }
Beispiel #3
0
        private static void OnActorEndPlay(IntPtr address, byte endPlayReason)
        {
            UObject obj = GCHelper.Find(address);

            IntPtr original = actorEndPlay.GetOriginal(obj);

            Native_VTableHacks.CallOriginal_ActorEndPlay(original, address, endPlayReason);

            obj.EndPlayInternal(endPlayReason);
        }
Beispiel #4
0
        private static void OnActorBeginPlay(IntPtr address)
        {
            UObject obj = GCHelper.Find(address);

            ActorBeginPlayDel_ThisCall original = actorBeginPlay.GetOriginal <ActorBeginPlayDel_ThisCall>(obj);

            original(address);
            //Native_VTableHacks.CallOriginal_ActorBeginPlay(original, address);

            obj.BeginPlayInternal();
        }
Beispiel #5
0
        private static void OnActorComponentEndPlay(IntPtr address, byte endPlayReason)
        {
            UObject obj = GCHelper.Find(address);

            ActorComponentEndPlayDel_ThisCall original = actorComponentEndPlay.GetOriginal <ActorComponentEndPlayDel_ThisCall>(obj);

            original(address, endPlayReason);
            //Native_VTableHacks.CallOriginal_ActorComponentEndPlay(original,

            obj.EndPlayInternal(endPlayReason);
        }
Beispiel #6
0
        private static void OnGetLifetimeReplicatedProps(IntPtr address, IntPtr arrayAddress)
        {
            UObject obj = GCHelper.Find(address);

            IntPtr original = repProps.GetOriginal(obj);

            Native_VTableHacks.CallOriginal_GetLifetimeReplicatedProps(original, address, arrayAddress);

            using (TArrayUnsafeRef <FLifetimeProperty> lifetimePropsUnsafe = new TArrayUnsafeRef <FLifetimeProperty>(arrayAddress))
            {
                FLifetimePropertyCollection lifetimeProps = new FLifetimePropertyCollection(address, lifetimePropsUnsafe);
                obj.GetLifetimeReplicatedProps(lifetimeProps);
            }
        }
Beispiel #7
0
            public T Resolve(FunctionRedirect functionRedirect, UObject obj)
            {
                if (cachedFunc == null)
                {
                    cachedFunc = functionRedirect.GetOriginal <T>(obj);
                }

                if (cachedFunc == null)
                {
                    throw new Exception("FunctionRedirect did not result in a function pointer");
                }

                return(cachedFunc);
            }
Beispiel #8
0
        private static void OnActorBeginPlay(IntPtr address)
        {
            try
            {
                UObject obj = GCHelper.Find(address);

                ActorBeginPlayDel_ThisCall original = actorBeginPlay.GetOriginal <ActorBeginPlayDel_ThisCall>(obj);
                original(address);
                //Native_VTableHacks.CallOriginal_ActorBeginPlay(original, address);

                obj.BeginPlayInternal();
            }
            catch (Exception e)
            {
                LogCallbackException(nameof(OnActorBeginPlay), e);
            }
        }
Beispiel #9
0
        private static void OnSetupPlayerInputComponent(IntPtr address, IntPtr inputComponentAddress)
        {
            try
            {
                UObject obj = GCHelper.Find(address);

                SetupPlayerInputComponentDel_ThisCall original = setupPlayerInput.GetOriginal <SetupPlayerInputComponentDel_ThisCall>(obj);
                original(address, inputComponentAddress);
                //Native_VTableHacks.CallOriginal_SetupPlayerInputComponent(original, address, inputComponentAddress);

                obj.SetupPlayerInputComponent(inputComponentAddress);
            }
            catch (Exception e)
            {
                LogCallbackException(nameof(OnSetupPlayerInputComponent), e);
            }
        }
Beispiel #10
0
        private static void OnActorComponentEndPlay(IntPtr address, byte endPlayReason)
        {
            try
            {
                UObject obj = GCHelper.Find(address);

                ActorComponentEndPlayDel_ThisCall original = actorComponentEndPlay.GetOriginal <ActorComponentEndPlayDel_ThisCall>(obj);
                original(address, endPlayReason);
                //Native_VTableHacks.CallOriginal_ActorComponentEndPlay(original,

                obj.EndPlayInternal(endPlayReason);
            }
            catch (Exception e)
            {
                LogCallbackException(nameof(OnActorComponentEndPlay), e);
            }
        }
Beispiel #11
0
        private static void OnPlayerControllerSetupInputComponent(IntPtr address)
        {
            try
            {
                UObject obj = GCHelper.Find(address);

                PlayerControllerSetupInputComponentDel_ThisCall original = playerControllerSetupInputComponent.GetOriginal <PlayerControllerSetupInputComponentDel_ThisCall>(obj);
                original(address);
                //Native_VTableHacks.CallOriginal_PlayerControllerSetupInputComponent(original)

                obj.SetupInputComponentInternal();
            }
            catch (Exception e)
            {
                LogCallbackException(nameof(OnPlayerControllerSetupInputComponent), e);
            }
        }
Beispiel #12
0
        private static void OnGetLifetimeReplicatedProps(IntPtr address, IntPtr arrayAddress)
        {
            try
            {
                UObject obj = GCHelper.Find(address);

                GetLifetimeReplicatedPropsDel_ThisCall original = repProps.GetOriginal <GetLifetimeReplicatedPropsDel_ThisCall>(obj);
                original(address, arrayAddress);
                //Native_VTableHacks.CallOriginal_GetLifetimeReplicatedProps(original, address, arrayAddress);

                using (TArrayUnsafeRef <FLifetimeProperty> lifetimePropsUnsafe = new TArrayUnsafeRef <FLifetimeProperty>(arrayAddress))
                {
                    FLifetimePropertyCollection lifetimeProps = new FLifetimePropertyCollection(address, lifetimePropsUnsafe);
                    obj.GetLifetimeReplicatedProps(lifetimeProps);
                }
            }
            catch (Exception e)
            {
                LogCallbackException(nameof(OnGetLifetimeReplicatedProps), e);
            }
        }