Really strange crash upon trying to open the modded research tree

Started by donoya, December 24, 2016, 11:00:14 PM

Previous topic - Next topic

donoya

I finally figured out how to detour the research tree (with the help of a few people), but when we tried to open the research tab in the game, it crashed without any warning or error being shown. Here is the only bit of information we got from the output log:
RW_Revamped_Transcendence injected.
Verse.Log:Message(String)
RW_Revamped_Transcendence.DetourInjector:Inject()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__733()


I've attached the class files in this post.

[attachment deleted by admin due to age]

1000101

What is happening is infinite recursion which is causing a stack overflow.  You can't detour a method then call the base method because you've detoured the base method and therefore you are actually calling your detour.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

RawCode

injection code implemented by CCL designed to replace method with other method fully and completely.
"new" method expected to be completely independent from original method, you should not extend type, that host original method, you should not try to call original method or rely on it in any form.

if you need function of original method, you MUST reimplement it inside your own code.

DaemonDeathAngel

So what he is needing to do is rewrite the entirety of the research tab code and allow it to include only specified research?

RawCode

yes, you must provide complete replacement for method, you are not allowed (by current implementation) to replace part of method.

to call "base" ignoring type safety and other things, you may rely to __asm31 routine posted by me some time ago.

same routine can be used for many other "things", just perform some research or wait for others to do it for you.

DaemonDeathAngel

We would rather not have to wait for someone else to do it, as we are hoping to be able to release something within the next few weeks. I have found a workaround temporarily, but it's only that, temporary.

RawCode

i had posted code snippets that already allows to do anything, including method invocation ignoring type protection and access to fields ignoring any rules, sadly, it's all one big "workaround" and there are no ways to do it "correctly" without brewing custom mono.dll