Beispiel #1
0
        private static FunctionRedirect AddVTableRedirect(IntPtr unrealClass, string dummyName, Delegate callback)
        {
            using (FStringUnsafe dummyNameUnsafe = new FStringUnsafe(dummyName))
            {
                Native_VTableHacks.Set_VTableCallback(ref dummyNameUnsafe.Array, Marshal.GetFunctionPointerForDelegate(callback));
            }
            FunctionRedirect redirect = new FunctionRedirect(unrealClass, dummyName, callback);

            vtableRedirects.Add(redirect);
            return(redirect);
        }
        public async void Http_trigger_redirect()
        {
            string urlfull  = "https://docs.microsoft.com/en-us/azure/azure-functions/";
            string urlshort = await GetShortUrlAsync(urlfull);

            Assert.True(!String.IsNullOrEmpty(urlshort));

            //try to inflate to original URL and compare
            var requestredirect  = TestFactory.CreateHttpRequest("UrlShort", urlshort);
            var responseredirect = (RedirectResult)await FunctionRedirect.Run(requestredirect, logger);

            Assert.Equal(urlfull, responseredirect.Url);
        }
Beispiel #3
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);
            }